diff --git a/.gitignore b/.gitignore
index 71a9b13..36b49f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,17 @@
/.settings
/.buildpath
/.project
+
+# MacOSXシステムファイル無視設定
+.DS_Store
+__MACOSX
+thumbs.db
+._*
+.Spotlight-V100
+.Trashes
+
+# Windowsシステムファイル無視設定
+Thumbs.db
+ehthumbs.db
+Desktop.ini
+$RECYCLE.BIN/
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
old mode 100644
new mode 100755
index f8888ac..0f85e08
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -1,6 +1,68 @@
- NetComomns2 Changelog
+ NetCommons2 Changelog
===============================
+2015/03/19: Version 2.4.2.1
+- PHP5.6対応
+- 脆弱性に関する修正
+- IE11対応
+- IE10以上の場合は互換表示にする修正
+- IE7のとき、プルダウンメニューテンプレートのものを使用しているとJSエラーが発生する問題への対応
+- SQLエラー時のメッセージ変更
+- インポート・エクスポート・ダウンロード時に環境依存文字が文字化けする問題への対応
+- 日本語ファイルのダウンロード時に文字化けする問題の対応
+- action_nameの形式によってはNoticeが発生する問題への対応
+- PHP5.2.7以上の環境だとエラーログが表示されない問題への対応
+- トップページでページスタイルダイアログの設定ができない問題への対応
+- mysqli使用時でも正常に動作するように修正
+- smarty_cacheが溜まらない不具合の修正
+- リクエストパラメータのlangでNoticeが発生する不具合の修正
+- ファイルを削除する処理でwarningが発生する場合がある不具合の修正(XAMPPの場合のみ発生)
+- WYSIWYGの箇条書きで全角入力すると、先頭の文字が2行目に表示される不具合の修正
+- WYSIWYGで、一般権限でyoutubeを貼り付けても消える問題の修正
+- バックアップのリストア時、メモリを節約するように修正
+- クリーンアップで削除するまでの期間を正しく計算していない不具合の修正
+- ルーム管理の設定をすることで、当該ルームに配置してあるグループ枠中の配置が全て消される不具合の対応
+- ルーム管理で公開中⇔準備中の切り替えがサブルームに反映されない不具合の修正
+- システム管理とページスタイル設定のページ/サイトの説明とキーワードの表示順を統一するように修正
+- キャビネットでファイル・フォルダがないときにソートするとjavascriptエラーとなる不具合の修正
+- カレンダーで時間順⇔会員順を切り替えるとエラーとなることがある不具合の修正
+- カレンダーで12/31の年単位の繰り返しが正常に登録されない不具合の修正
+- 回覧板でログインしていないと検索モジュールの検索でエラーが発生するため修正
+- 回覧板のtextのデータ型のDefault指定を削除
+- 日誌のトラックバックの不具合の修正
+- 日誌のラベルの「by:」を「by 」に修正
+- 汎用DBで、状態項目を数値化するように修正
+- 汎用DBの、重複している条件式を削除
+- 汎用DBの検索で、ハンドルに「?」を入力するとエラーになる不具合の修正
+- 汎用DBの検索で、ソート順判定処理の条件分岐の修正
+- プライベートメッセージの不要なコメントの削除
+- アンケートで質問の編集リンクが効かないことがある不具合の修正
+- 登録フォームで英語の一部言語が未定義だったため修正
+- 登録フォームでメールアドレス欄が複数ある場合の不具合の修正
+- 施設予約の変数名を一部修正
+- RSSでPHP5.3以上の環境でwarningが出る問題への対応
+- 新着情報でタイトルが入らない場合がある不具合の修正
+
+
+
+2013/08/29: Version 2.4.2.0
+- メニューでプルダウンテンプレートを追加
+- メニューでパンくずリストテンプレートを追加
+- ルーム管理で参加会員エクスポート、インポート機能を追加
+- 施設予約で時間枠機能を追加
+- アンケートでキーフレーズ機能を追加
+- アンケートで回答非表示機能を追加
+- Todoにブロックコピー機能を追加
+- PHP5.4暫定対応
+- GitHub無視ファイルの定義を追加
+- Thumbs.dbファイルを削除
+- ソースコードのインデントを一部修正
+- 会員登録で択一選択の必須入力エラーメッセージが正しく表示されるように修正
+- カレンダーでセンターカラム以外に配置した時のデフォルトルームを表示しているルームになるように修正
+- フォトアルバムがIE10で動作しない不具合を修正
+
+
+
2013/05/20: Version 2.4.1.0
===============================
- 会員の新規申込みで複数選択項目があった場合、その項目を条件とした会員検索にヒットしないバグを修正
diff --git a/html/htdocs/index.php b/html/htdocs/index.php
index 047f140..bc87e65 100644
--- a/html/htdocs/index.php
+++ b/html/htdocs/index.php
@@ -15,7 +15,7 @@
* @access public
*/
if (version_compare(phpversion(), '5.3.0', '>=')) {
- error_reporting(E_ALL ^ E_DEPRECATED);
+ error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
} else {
error_reporting(E_ALL);
}
diff --git a/html/index.php b/html/index.php
index 907e236..23b2e18 100644
--- a/html/index.php
+++ b/html/index.php
@@ -15,7 +15,7 @@
* @access public
*/
if (version_compare(phpversion(), '5.3.0', '>=')) {
- error_reporting(E_ALL ^ E_DEPRECATED);
+ error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
} else {
error_reporting(E_ALL);
}
diff --git a/html/maple/core/FilterChain.class.php b/html/maple/core/FilterChain.class.php
index 7f44f14..e32ed17 100644
--- a/html/maple/core/FilterChain.class.php
+++ b/html/maple/core/FilterChain.class.php
@@ -114,7 +114,7 @@ function add($name, $alias = '')
//
// ファイルが存在していなければエラー
//
- if (!(@include_once $filename) or !class_exists($className)) {
+ if (!(include_once $filename) or !class_exists($className)) {
$log->error("存在していないFilterが指定されています(${name}[alias:${alias}])", "FilterChain#add");
return false;
}
diff --git a/html/maple/filter/Filter_AllowIdList.class.php b/html/maple/filter/Filter_AllowIdList.class.php
index 483fe6d..c59abf4 100644
--- a/html/maple/filter/Filter_AllowIdList.class.php
+++ b/html/maple/filter/Filter_AllowIdList.class.php
@@ -285,7 +285,7 @@ function setShowPagesList() {
$params = array();
if($where_params) {
- $where_str = $this->_db->getWhereSQL(&$params, &$where_params, false);
+ $where_str = $this->_db->getWhereSQL($params, $where_params, false);
$sql .= $where_str;
if(!empty($sql2))
$sql2 .= $where_str;
diff --git a/html/maple/filter/Filter_RequestCheck.class.php b/html/maple/filter/Filter_RequestCheck.class.php
index e1491ed..2e97ac3 100644
--- a/html/maple/filter/Filter_RequestCheck.class.php
+++ b/html/maple/filter/Filter_RequestCheck.class.php
@@ -18,130 +18,130 @@
* @access public
*/
class Filter_RequestCheck extends Filter {
-
+
var $_container;
var $_log;
var $_filterChain;
-
+
var $_actionChain;
-
+
var $_request;
-
+
var $_className;
-
- /**
- * コンストラクター
- *
- * @access public
- */
- function Filter_RequestCheck() {
- parent::Filter();
- }
-
- /**
- * Viewの処理を実行
- *
- * @access public
- **/
- function execute() {
- $this->_container =& DIContainerFactory::getContainer();
+
+ /**
+ * コンストラクター
+ *
+ * @access public
+ */
+ function Filter_RequestCheck() {
+ parent::Filter();
+ }
+
+ /**
+ * Viewの処理を実行
+ *
+ * @access public
+ **/
+ function execute() {
+ $this->_container =& DIContainerFactory::getContainer();
$this->_log =& LogFactory::getLog();
$this->_filterChain =& $this->_container->getComponent("FilterChain");
$this->_actionChain =& $this->_container->getComponent("ActionChain");
$this->_request =& $this->_container->getComponent("Request");
-
+
$this->_className = get_class($this);
-
- $this->_prefilter();
-
+
+ $this->_prefilter();
+
$this->_log->trace("{$this->_className}の前処理が実行されました", "{$this->_className}#execute");
-
+
$this->_filterChain->execute();
$this->_postfilter();
$this->_log->trace("{$this->_className}の後処理が実行されました", "{$this->_className}#execute");
- }
-
- /**
+ }
+
+ /**
* プレフィルタ
* 初期処理を行う
* @access private
*/
function _prefilter()
{
- $errorList =& $this->_actionChain->getCurErrorList();
- if ($errorList->isExists()) {
- //既にエラーがあればそのまま返却
- return;
- }
- //アクション名取得
- $action_name = $this->_actionChain->getCurActionName();
- $pathList = explode("_", $action_name);
- $attributes = $this->getAttributes();
- if (isset($attributes["request"])) {
- if ($attributes["request"] == "BOTH" || $this->_request->getMethod() == $attributes["request"]) {
- //登録処理の場合、リファラチェック
- if ($this->_request->getMethod() == "POST" && $this->_refcheck()) {
- return;
- } else if($this->_request->getMethod() == "GET"){
- return;
- }
- }
- } else if ($this->_request->getMethod() == "POST" && isset($_FILES) && (0 < count($_FILES))) {
- //ファイルアップロード処理の場合、リファラチェック
- if ($this->_refcheck()) {
- return;
- }
- } else {
- //Default
- //system_view(action)_XXXX
- $i = 1;
- //if($pathList[1] == "system" && isset($pathList[2])) {
- // $i = 2;
- //}
- if($pathList[$i] != "action" && $pathList[$i] != "view") {
- //module名_action or module名_viewのどちらでもない場合、チェックしない
- return;
- }else if ($this->_request->getMethod() == "POST" && $pathList[$i] == "action") {
- //登録処理の場合、リファラチェック
- if (isset($attributes["refcheck"]) && $attributes["refcheck"] == "none") {
- return;
- }
- if ($this->_refcheck()) {
- return;
- }
- } else if($this->_request->getMethod() == "GET" && $pathList[$i] == "view"){
- return;
- }
- }
- //エラー
- $errorList->add("RquestCheck_Error", sprintf(_REQUESTCHECK_FAILURE,CURRENT_URL));
- $errorList->setType(VALIDATE_ERROR_TYPE); //VALIDATE_ERRORとする
- return;
-
+ $errorList =& $this->_actionChain->getCurErrorList();
+ if ($errorList->isExists()) {
+ //既にエラーがあればそのまま返却
+ return;
+ }
+ //アクション名取得
+ $action_name = $this->_actionChain->getCurActionName();
+ $pathList = explode("_", $action_name);
+ $attributes = $this->getAttributes();
+ if (isset($attributes["request"])) {
+ if ($attributes["request"] == "BOTH" || $this->_request->getMethod() == $attributes["request"]) {
+ //登録処理の場合、リファラチェック
+ if ($this->_request->getMethod() == "POST" && $this->_refcheck()) {
+ return;
+ } else if($this->_request->getMethod() == "GET"){
+ return;
+ }
+ }
+ } else if ($this->_request->getMethod() == "POST" && isset($_FILES) && (0 < count($_FILES))) {
+ //ファイルアップロード処理の場合、リファラチェック
+ if ($this->_refcheck()) {
+ return;
+ }
+ } else {
+ //Default
+ //system_view(action)_XXXX
+ $i = 1;
+ //if($pathList[1] == "system" && isset($pathList[2])) {
+ // $i = 2;
+ //}
+ if($pathList[$i] != "action" && $pathList[$i] != "view") {
+ //module名_action or module名_viewのどちらでもない場合、チェックしない
+ return;
+ }else if ($this->_request->getMethod() == "POST" && $pathList[$i] == "action") {
+ //登録処理の場合、リファラチェック
+ if (isset($attributes["refcheck"]) && $attributes["refcheck"] == "none") {
+ return;
+ }
+ if ($this->_refcheck()) {
+ return;
+ }
+ } else if($this->_request->getMethod() == "GET" && $pathList[$i] == "view"){
+ return;
+ }
+ }
+ //エラー
+ $errorList->add("RquestCheck_Error", sprintf(_REQUESTCHECK_FAILURE,CURRENT_URL));
+ $errorList->setType(VALIDATE_ERROR_TYPE); //VALIDATE_ERRORとする
+ return;
+
}
-
+
/**
* リファラチェック
* @access private
*/
function _refcheck()
{
- $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
- if ($ref != '' && strpos($ref, BASE_URL) === 0) {
- return true;
- }
- // httpsの場合
- $ssl_base_url = preg_replace("/^http:\/\//i","https://", BASE_URL);
- if ($ref != '' && strpos($ref, $ssl_base_url) === 0) {
- return true;
- }
- return false;
+ $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
+ if ($ref != '' && strpos($ref, BASE_URL) === 0) {
+ return true;
+ }
+ // httpsの場合
+ $ssl_base_url = preg_replace("/^http:\/\//i","https://", BASE_URL);
+ if ($ref != '' && strpos($ref, $ssl_base_url) === 0) {
+ return true;
+ }
+ return false;
}
-
+
/**
* ポストフィルタ
* @access private
diff --git a/html/maple/filter/Filter_SetConfig.class.php b/html/maple/filter/Filter_SetConfig.class.php
index efa0554..eb017b0 100644
--- a/html/maple/filter/Filter_SetConfig.class.php
+++ b/html/maple/filter/Filter_SetConfig.class.php
@@ -243,7 +243,7 @@ function _prefilter()
}
// 言語セット
- $_lang = $this->_request->getParameter('lang');
+ $_lang = trim($this->_request->getParameter('lang'));
if(!empty($_lang)) {
$languages = $this->_languagesView->getLanguages(array("lang_dirname"=>$_lang));
if (!isset($languages[0])) {
@@ -387,7 +387,7 @@ function _prefilter()
$this->_session->setParameter("_php_debug",$php_debug);
if ($php_debug
&& version_compare(phpversion(), '5.3.0', '>=')) {
- error_reporting(E_ALL ^ E_DEPRECATED);
+ error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
} elseif ($php_debug) {
error_reporting(E_ALL);
} else {
diff --git a/html/maple/generate/script/generate.php b/html/maple/generate/script/generate.php
index 6c74f17..943c7ad 100644
--- a/html/maple/generate/script/generate.php
+++ b/html/maple/generate/script/generate.php
@@ -23,7 +23,7 @@
define('BASE_DIR', dirname(dirname(dirname(dirname(__FILE__)))));
-error_reporting(E_ALL ^ E_DEPRECATED);
+error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
//error_reporting(0);
define('DEBUG_MODE', 0);
diff --git a/html/maple/logger/Logger_ViewDisplayManage.class.php b/html/maple/logger/Logger_ViewDisplayManage.class.php
index 3898f57..6214939 100644
--- a/html/maple/logger/Logger_ViewDisplayManage.class.php
+++ b/html/maple/logger/Logger_ViewDisplayManage.class.php
@@ -147,7 +147,9 @@ function setLoggerHandle($errNo, $errStr, $errFile, $errLine=NULL)
$write_flag = false;
if($errNo != LEVEL_SQL) {
- if (defined("PHP_DEBUG")) {
+ if ((version_compare(phpversion(), '5.2.7', '>=') && PHP_DEBUG==true)
+ ||
+ (version_compare(phpversion(), '5.2.7', '<') && defined("PHP_DEBUG"))) {
if(PHP_DEBUG)
$php_debug = 1;
else
diff --git a/html/maple/nccore/RequestExtra.class.php b/html/maple/nccore/RequestExtra.class.php
index a639fe2..4467165 100644
--- a/html/maple/nccore/RequestExtra.class.php
+++ b/html/maple/nccore/RequestExtra.class.php
@@ -102,7 +102,7 @@ function _rawurlDecode(&$params, $security_chk_flag = false) {
}
if(is_array($value)) {
- $this->_rawurlDecode($params[$key]);
+ $this->_rawurlDecode($params[$key], $security_chk_flag);
} else {
if($security_chk_flag) {
// ヌル文字列をスペースに変更する
diff --git a/html/maple/nccore/SecurityManager.class.php b/html/maple/nccore/SecurityManager.class.php
index 03fcff9..600a01d 100644
--- a/html/maple/nccore/SecurityManager.class.php
+++ b/html/maple/nccore/SecurityManager.class.php
@@ -126,7 +126,7 @@ function chkContamiAction($key)
{
// Variables contamination
if( $this->_config[_SECURITY_CONF_CATID]['contami_action']['conf_value'] &&
- in_array($key, $this->bad_globals) ) {
+ in_array($key, $this->bad_globals, true) ) {
$this->message = sprintf(_SECURITY_CONTAMI_ACTION_ERROR, $key);
$user_id = $this->_session->getParameter("_user_id");
$this->outputLog( 'CONTAMI', $user_id) ;
diff --git a/html/maple/nccore/SessionExtra.class.php b/html/maple/nccore/SessionExtra.class.php
index 9955b86..679fdc5 100644
--- a/html/maple/nccore/SessionExtra.class.php
+++ b/html/maple/nccore/SessionExtra.class.php
@@ -230,7 +230,16 @@ function start($regenerate_flag = _ON)
// smarty_cacheのセッションIDも同時に更新
// Cacheフィルターがうまく動作しなくなるため
$adodb =& $this->_db->getAdoDbObject();
- if(is_object($adodb)) {
+ $container =& DIContainerFactory::getContainer();
+ $actionChain =& $container->getComponent("ActionChain");
+ if($actionChain->getCurActionName() == "login_action_main_init") {
+ $params = array(
+ "base_sess_id" => $_base_sess_id,
+ "sess_id" => $this->new_session_id,
+ );
+ $result = $this->_db->execute("DELETE FROM {session} " .
+ " WHERE base_sess_id = ? AND sess_id != ? ",$params);
+ } else if(is_object($adodb)) {
$this->_db->updateExecute("smarty_cache", array("session_id" => $this->new_session_id), array("session_id" => $this->old_session_id));
if(rand(0, $this->regenerate_session_num) == 0) {
// regenerate_session_num分の1の確立で、regenerate前のセッションデータ削除
diff --git a/html/maple/nccore/SmartyTemplate.class.php b/html/maple/nccore/SmartyTemplate.class.php
index 79d4ee5..c77153c 100644
--- a/html/maple/nccore/SmartyTemplate.class.php
+++ b/html/maple/nccore/SmartyTemplate.class.php
@@ -767,7 +767,7 @@ function smartyTemplateCacheHandler($action, &$smarty_obj, &$cache_content, $tpl
$time = date("YmdHis",timezone_date(null, true, "U") - $renderer->cache_lifetime);
$result = $db->execute("DELETE FROM {smarty_cache} " .
- $where_str." OR update_time <'".$time."' ",$params);
+ $where_str." OR expire_time <'".$time."' ",$params);
} else {
$result = $db->execute("DELETE FROM {smarty_cache} " .
$where_str,$params);
diff --git a/html/maple/nccore/TokenExtra.class.php b/html/maple/nccore/TokenExtra.class.php
index 19693a0..d15a3da 100644
--- a/html/maple/nccore/TokenExtra.class.php
+++ b/html/maple/nccore/TokenExtra.class.php
@@ -74,11 +74,17 @@ function build()
//_nameを付与することにより複雑にした
//多次元配列化
$token_value = $this->getName();
+
+ $tokenString = $this->_name;
+ if (is_array($tokenString)) {
+ $tokenString = '_token';
+ }
+
if(is_array($token_value)) {
$token_value = array_merge(array("_token"), $token_value);
- $this->_session->setParameter($token_value, md5($this->_name.uniqid(rand(),1)));
+ $this->_session->setParameter($token_value, md5($tokenString . uniqid(rand(),1)));
} else {
- $this->_session->setParameter(array("_token",$this->getName()), md5($this->_name.uniqid(rand(),1)));
+ $this->_session->setParameter(array("_token",$this->getName()), md5($tokenString . uniqid(rand(),1)));
}
}
diff --git a/html/maple/nccore/db/DbObjectAdodb.class.php b/html/maple/nccore/db/DbObjectAdodb.class.php
index ac84a6d..8258c9e 100644
--- a/html/maple/nccore/db/DbObjectAdodb.class.php
+++ b/html/maple/nccore/db/DbObjectAdodb.class.php
@@ -55,7 +55,7 @@ class DbObjectAdodb
/**
* DSNをセットする
- *
+ *
* @param string $dsn DSN $driver://$username:$password@hostname/$database
* @access public
*/
@@ -65,7 +65,7 @@ function setDsn($dsn) {
/**
* DSNをゲットする
- *
+ *
* @return string $dsn DSN $driver://$username:$password@hostname/$database
* @access public
*/
@@ -75,7 +75,7 @@ function getDsn() {
/**
* Prefixをセットする
- *
+ *
* @param string $prefix
* @access public
*/
@@ -85,7 +85,7 @@ function setPrefix($prefix) {
/**
* Prefixをゲットする
- *
+ *
* @return string $prefix
* @access public
*/
@@ -106,7 +106,7 @@ function setOption($key, $value) {
/**
* 接続時のoptionをゲットする
- *
+ *
* @return array $option
* @access public
*/
@@ -130,7 +130,7 @@ function setDebugMode($debugMode=true) {
/**
* デバッグモードをゲットする
- *
+ *
* @return bool $debugMode デバッグモードをセットする
* @access public
*/
@@ -186,7 +186,11 @@ function connect() {
// http://php.net/manual/ja/function.mysql-set-charset.php
if (version_compare(phpversion(), '5.2.3', '>=')
&& $server_info['version'] >= '5.0.7') {
- mysql_set_charset(DATABASE_CHARSET);
+ if (strpos($this->_dsn, 'mysqli') === 0) {
+ $this->_conn->SetCharSet(DATABASE_CHARSET);
+ } else {
+ mysql_set_charset(DATABASE_CHARSET);
+ }
}
}
@@ -236,7 +240,7 @@ function setSql($sql) {
/**
* デバッグモードをゲットする
- *
+ *
* @return string $sql 実行するSQL文
* @access public
*/
@@ -295,6 +299,15 @@ function execute($sql, $params = array(), $limit = 0, $offset = 0, $key_flag = t
else
$this->_conn->SetFetchMode(ADODB_FETCH_NUM);
+ // paramsのvalueに配列の入力パラメータがはいった場合、adodb内で複数のSQLを実行しようとするため、ここで対処。
+ if (is_array($params)) {
+ foreach($params as $param) {
+ if (is_array($param)) {
+ return false;
+ }
+ }
+ }
+
if ($limit || $offset) {
$result =& $this->_conn->SelectLimit($sql, $limit, $offset, $params);
} else {
@@ -552,7 +565,7 @@ function &getSelectSQL($tableName, &$params, &$where_params, &$order_params)
* パラメータよりwhere文を生成し返す
* @param array $params WHERE句のデータ配列
* @param array $where_params キー名称配列、whereデータ配列
- * @param array $where_prefix_flag 接頭語句をANDでなくwhereにして返す場合、true defaut:true
+ * @param array $where_prefix_flag 接頭語句をANDでなくwhereにして返す場合、true default:true
* @return string where文
* @access public
*/
@@ -579,15 +592,19 @@ function &getWhereSQL(&$params, &$where_params, $where_prefix_flag = true)
/**
* パラメータよりorder文を生成し返す
* @param array $order_params キー名称配列、orderデータ配列
+ * @param array $allow_keys キー名称で設定できるカラムの配列
* @return string order文
* @access public
*/
- function &getOrderSQL(&$order_params)
+ function &getOrderSQL(&$order_params, $allow_keys = array())
{
$sql_order = "";
if (!empty($order_params)) {
foreach ($order_params as $key=>$item) {
- $sql_order .= ",".$key." ".(empty($item) ? "ASC" : $item);
+ if (!empty($allow_keys) && !in_array($key, $allow_keys)) {
+ $key = $allow_keys[0];
+ }
+ $sql_order .= ",".$key." ".((empty($item) || ($item != 'DESC' && $item != 'desc')) ? "ASC" : $item);
}
}
$sql_order = ($sql_order ? " ORDER BY ".substr($sql_order,1) : "");
@@ -620,7 +637,7 @@ function &selectExecute($tableName, $where_params=null, $order_params=null, $lim
/**
* テーブルInsert
- *
+ *
* @param string $tableName 対象テーブル名称
* @param array $params キー名称配列、パラメータ配列
* @param boolean true or false insert_time-update_user_nameを自動的に付与する
@@ -647,7 +664,7 @@ function insertExecute($tableName, $params=array(), $footer_flag=false, $create_
/**
* テーブルUpdate
- *
+ *
* @param string $tableName 対象テーブル名称
* @param array $params キー名称配列、更新カラム配列
* @param array $where_params キー名称配列、whereデータ配列
@@ -667,7 +684,7 @@ function updateExecute($tableName, $params=array(), $where_params=array(), $foot
/**
* テーブルDelete
- *
+ *
* @param string $tableName 対象テーブル名称
* @param array $where_params キー名称配列、whereデータ配列
* @return boolean true or false
@@ -899,8 +916,10 @@ function addError($error_no=null, $error_mes=null)
$session =& $container->getComponent("Session");
if(isset($session) && $session->getParameter("_php_debug") == _ON) {
$errorList->add($this->ErrorNo(), $this->ErrorMsg(). ":\n". $this->_bck_sql);
+ } else if (defined('_INVALID_INPUT')) {
+ $errorList->add($this->ErrorNo(), _INVALID_INPUT);
} else {
- $errorList->add($this->ErrorNo(), "SQL Error!");
+ $errorList->add($this->ErrorNo(), "Security Error! Unauthorized input.");
}
} else {
$errorList->add($error_no, $error_mes);
@@ -909,7 +928,7 @@ function addError($error_no=null, $error_mes=null)
/**
* MATCH AGAINST用の文字列に変換する
- *
+ *
* @return bool $debugMode デバッグモードをセットする
* @access public
*/
diff --git a/html/maple/nccore/db/adodb/cute_icons_for_site/Thumbs.db b/html/maple/nccore/db/adodb/cute_icons_for_site/Thumbs.db
deleted file mode 100644
index 0ae45f3..0000000
Binary files a/html/maple/nccore/db/adodb/cute_icons_for_site/Thumbs.db and /dev/null differ
diff --git a/html/webapp/components/authcheck/Main.class.php b/html/webapp/components/authcheck/Main.class.php
index 6f6643c..ced6aea 100644
--- a/html/webapp/components/authcheck/Main.class.php
+++ b/html/webapp/components/authcheck/Main.class.php
@@ -349,7 +349,7 @@ function AuthCheck($action_name, $page_id, $block_id) {
$isMobileAction = ($pathList[0] == 'common'
&& $pathList[1] == 'mobile');
$isMobileAction = ($isMobileAction
- || $pathList[2] == 'mobile');
+ || isset($pathList[2]) && $pathList[2] == 'mobile');
if ($isMobileAction
&& empty($mobile_flag)) {
return false;
diff --git a/html/webapp/components/calendar/Action.class.php b/html/webapp/components/calendar/Action.class.php
old mode 100644
new mode 100755
index a96a882..84a9a46
--- a/html/webapp/components/calendar/Action.class.php
+++ b/html/webapp/components/calendar/Action.class.php
@@ -713,6 +713,7 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0)
$bymonthday = intval(substr($start_date,6,2));
}
+ $result = true;
$current_month = intval(substr($start_date,4,2));
foreach ($rrule["BYMONTH"] as $i=>$month) {
if ($first && $current_month > $month) { continue; }
@@ -724,7 +725,8 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0)
} else {
$params["start_date"] = substr($start_date,0,4).sprintf("%02d",$month)."01";
$params["start_time"] = $start_time;
- $params["end_date"] = substr($end_date,0,4).sprintf("%02d",$month).sprintf("%02d", 1 + $diff_num);
+ // end_dateにはstart_date + $diff_numの日付をセット(12/31の場合に翌年がセットされるため)
+ $params["end_date"] = substr($start_date,0,4) . sprintf("%02d", $month) . sprintf("%02d", 1 + $diff_num);
$params["end_time"] = $end_time;
}
if (!empty($rrule["BYDAY"]) && count($rrule["BYDAY"]) > 0) {
@@ -736,10 +738,16 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0)
return false;
}
}
- $params["start_date"] = timezone_date($start_date.$start_time, true, "Ymd");
- $params["start_time"] = timezone_date($start_date.$start_time, true, "His");
- $params["end_date"] = timezone_date($end_date.$end_time, true, "Ymd");
- $params["end_time"] = timezone_date($end_date.$end_time, true, "His");
+ $startDate = $start_date.$start_time;
+ $endDate = $end_date.$end_time;
+ if (is_array($result)) {
+ list($startDate, $endDate) = $result;
+ }
+
+ $params["start_date"] = timezone_date($startDate, true, "Ymd");
+ $params["start_time"] = timezone_date($startDate, true, "His");
+ $params["end_date"] = timezone_date($endDate, true, "Ymd");
+ $params["end_time"] = timezone_date($endDate, true, "His");
if (!empty($rrule["BYDAY"]) && count($rrule["BYDAY"]) > 0) {
return $this->_insertYearly($params, $rrule);
@@ -749,8 +757,10 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0)
}
/**
- * 登録処理
+ * 登録処理(年単位-開始日と同日)
*
+ * @return mixed boolean true:登録せず終了 false:失敗
+ * array 登録成功: array(登録した開始年月日時分秒, 登録した終了年月日時分秒)
* @access private
*/
function __insertYearlyByMonthday($params, &$rrule, $bymonthday, $first)
@@ -798,13 +808,15 @@ function __insertYearlyByMonthday($params, &$rrule, $bymonthday, $first)
if ($calendar_id === false) {
return false;
} else {
- return true;
+ return array($start_date.$start_time, $end_date.$end_time);
}
}
/**
- * 登録処理
+ * 登録処理(年単位-第○週○曜日)
*
+ * @return mixed boolean true:登録せず終了 false:失敗
+ * array 登録成功: array(登録した開始年月日時分秒, 登録した終了年月日時分秒)
* @access private
*/
function __insertYearlyByday($params, &$rrule, $first=false)
@@ -862,7 +874,7 @@ function __insertYearlyByday($params, &$rrule, $first=false)
if ($calendar_id === false) {
return false;
} else {
- return true;
+ return array($start_date.$start_time, $end_date.$end_time);
}
}
diff --git a/html/webapp/components/common/Main.class.php b/html/webapp/components/common/Main.class.php
old mode 100644
new mode 100755
index febd5c0..460b2c0
--- a/html/webapp/components/common/Main.class.php
+++ b/html/webapp/components/common/Main.class.php
@@ -187,7 +187,7 @@ function viewAssign(&$renderer) {
$renderer->assign('module_id',$modules[$pathList[0]]['module_id']);
} else {
$module_id = 0;
- $renderer->assign('module_obj',"");
+ $renderer->assign('module_obj', array());
$renderer->assign('module_id',0);
}
@@ -465,13 +465,11 @@ function redirectHeader($url="", $time = 2, $message = "")
if($url == "") {
$url = BASE_URL.INDEX_FILE_NAME."?".ACTION_KEY."=".DEFAULT_ACTION;
}
- //$url = htmlspecialchars(str_replace("?action=","?_sub_action=",str_replace("&","@",BASE_URL.INDEX_FILE_NAME.$this->_request->getStrParameters(false))), ENT_QUOTES);
$renderer =& SmartyTemplate::getInstance();
$renderer->assign('header_field',$meta);
$renderer->assign('time', $time);
- $renderer->assign('url',$url);
- $renderer->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD,$url));
+ $renderer->assign('redirect_url', $url);
if($message != "") {
$renderer->assign('redirect_message', $message);
} else {
diff --git a/html/webapp/components/csv/Main.class.php b/html/webapp/components/csv/Main.class.php
index 90c8b4c..4b6c544 100644
--- a/html/webapp/components/csv/Main.class.php
+++ b/html/webapp/components/csv/Main.class.php
@@ -60,7 +60,7 @@ class Csv_Main
*/
function Csv_Main() {
$this->_LE = "\n";
- $this->charSet = "SJIS";
+ $this->charSet = _CLIENT_OS_CHARSET;
$this->mimeType = "document/unknown";
$this->division = ",";
$this->extension = ".csv";
diff --git a/html/webapp/components/escape/Text.class.php b/html/webapp/components/escape/Text.class.php
index 85f158e..7572899 100644
--- a/html/webapp/components/escape/Text.class.php
+++ b/html/webapp/components/escape/Text.class.php
@@ -234,9 +234,9 @@ function escapeWysiwyg(&$string) {
continue;
}
} else {
- // ./ と ../ の許可
- if($attribute_split[2] != "#" && !preg_match("/^\.\//", $attribute_split[2]) && !preg_match("/^\.\.\//", $attribute_split[2])) {
- $attribute_split[2] = "./".$attribute_split[2];
+ // ./ と ../ とvideo の許可
+ if($attribute_split[2] != "#" && !preg_match("/^\.\//", $attribute_split[2]) && !preg_match("/^\.\.\//", $attribute_split[2]) && !$this->_checkVideoURL($attribute_split[2], $allowable_video)) {
+ $attribute_split[2] = "./".$attribute_split[2];
}
}
}
@@ -445,6 +445,11 @@ function _escapeWysiwygAllowHtmltag($string) {
$script_flag = false;
foreach ($parts as $part) {
// script-/scriptまではそのまま連結
+ if(preg_match("/<\/script>$/u", $part)) {
+ $script_flag = false;
+ $string .= $part;
+ continue;
+ }
if(preg_match("/^');
+ } else if (collapsed) {
t.editorDoc.execCommand('insertImage', false, 'nc_wysiwygurl');
- else
+ } else if (browser.isEdge) {
+ t.editorDoc.execCommand('createLink', false, 'nc_wysiwygurl');
+ } else {
t.editorDoc.execCommand('fontName', false, 'nc_wysiwygfont');
+ }
r_el = replaceFonts();
if(t._keyhandler) {
Event.stopObserving(this.editorDoc,"keyup",t._keyhandler);
diff --git a/html/webapp/modules/dialog/files/js/default/pagestyle.js b/html/webapp/modules/dialog/files/js/default/pagestyle.js
index d47fcd3..41edb87 100644
--- a/html/webapp/modules/dialog/files/js/default/pagestyle.js
+++ b/html/webapp/modules/dialog/files/js/default/pagestyle.js
@@ -1,533 +1,533 @@
-var clsPagestyle = Class.create();
-
-clsPagestyle.prototype = {
- initialize: function() {
- this.id = null;
- this.top_el = null;
-
- this.lang_down_arrow = null;
- this.lang_right_arrow = null;
-
- this.lang_cancel_confirm = null;
-
- this.themefields = null;
- this.theme_name = null;
- this.header_flag = null;
- this.leftcolumn_flag = null;
- this.rightcolumn_flag = null;
-
- this.header_el = null;
- this.header_id_el = null;
- this.leftcolumn_el = null;
- this.centercolumn_el = null;
- this.rightcolumn_el = null;
- this.footer_el = null;
-
- this.colorclick_flag = false;
-
- this.chg_flag = false;
- this.initColorFlag = false;
- this.initStr = "";
- this.tabset = null;
- },
- init: function(id, page_id, theme_name, header_flag, leftcolumn_flag, rightcolumn_flag, active_tab, change_flag, lang_cancel_confirm, lang_style, lang_theme, lang_layout, lang_coloration, lang_down_arrow, lang_right_arrow, pages_action, permalink_prohibition, permalink_prohibition_replace) {
- this.id = id;
- this.page_id = page_id;
- this.theme_name = theme_name;
- this.header_flag = header_flag;
- this.leftcolumn_flag = leftcolumn_flag;
- this.rightcolumn_flag = rightcolumn_flag;
-
- this.pages_action = pages_action;
- this.permalink_prohibition = permalink_prohibition;
- this.permalink_prohibition_replace = permalink_prohibition_replace;
-
- var top_el = $(id);
- this.top_el = top_el;
- this.header_id_el = $("__headercolumn");
- this.header_el = $("_headercolumn");
- if(this.header_el) {
- this.header_add_module_el = Element.getChildElementByClassName(this.header_el, "headercolumn_addmodule");
- }
- this.leftcolumn_el = $("_leftcolumn");
- this.centercolumn_el = $("_centercolumn");
- this.rightcolumn_el =$("_rightcolumn");
- this.footer_el = $("_footercolumn");
-
- /* タブ */
- tabset = new compTabset(top_el);
- tabset.addTabset(lang_theme, null);
- tabset.addTabset(lang_style,pagestyleCls.clkStyle.bind($(id)));
- tabset.addTabset(lang_layout);
- tabset.addTabset(lang_coloration, null, pagestyleCls.clkColor.bind(this));
-
- tabset.setActiveIndex(valueParseInt(active_tab));
-
- tabset.render();
- if(change_flag != "") {
- this.chg_flag = true;
- } else {
- this.chg_flag = false;
- }
- this.tabset = tabset;
- this.lang_cancel_confirm = lang_cancel_confirm;
- this.lang_down_arrow = lang_down_arrow;
- this.lang_right_arrow = lang_right_arrow;
-
- //Initに時間がかかる処理は後回し
- //setTimeout(pagestyleCls.InitTimer.bind(this), 0);
- },
- clkStyle: function() {
- var top_el = this;
- var form = top_el.getElementsByTagName("form")[0];
- commonCls.focus(form.page_name);
- },
- clkColor: function() {
- this.initColorFlag = true;
- this.initStr = "";
- var coloration_el =$("_pagestyle_color");
- if(coloration_el != null) {
- //配色取得
- this.setHighlightColor(document.body, "_pagestyle_body","backgroundColor");
- this.setHighlightColor(this.header_el, "_pagestyle_headercolumn","backgroundColor");
- this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn","backgroundColor");
- this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn","backgroundColor");
- this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn","backgroundColor");
- this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn","backgroundColor");
-
- this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_top_color","borderTopColor");
- this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_right_color","borderRightColor");
- this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_bottom_color","borderBottomColor");
- this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_left_color","borderLeftColor");
-
- this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_top_color","borderTopColor");
- this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_right_color","borderRightColor");
- this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_bottom_color","borderBottomColor");
- this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_left_color","borderLeftColor");
-
- this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_top_color","borderTopColor");
- this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_right_color","borderRightColor");
- this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_bottom_color","borderBottomColor");
- this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_left_color","borderLeftColor");
-
- this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_top_color","borderTopColor");
- this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_right_color","borderRightColor");
- this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_bottom_color","borderBottomColor");
- this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_left_color","borderLeftColor");
-
- this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_top_color","borderTopColor");
- this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_right_color","borderRightColor");
- this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_bottom_color","borderBottomColor");
- this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_left_color","borderLeftColor");
- }
- this.initColorFlag = false;
- if(this.initStr != "") {
- var color_params = new Object();
- color_params["method"] = "post";
- color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1"+this.initStr;
- commonCls.send(color_params);
- }
- },
- setHighlightColor: function(el, child_class_name, property_name) {
- if(el) {
- //background-image対応
- var bgImageStyle = "none";
- if(property_name == "backgroundColor" || property_name == "background-color") {
- bgImageStyle = Element.getStyle(el, "backgroundImage");
- }
-
- var color = commonCls.getColorCode(el,property_name);
- var column_el = $(child_class_name);
- ////var highlight_flag = false;
- var count = 0;
- for (var i = 0,column_len = column_el.childNodes.length; i < column_len; i++) {
- var child_el = column_el.childNodes[i];
- if(child_el.nodeType == 1) {
- if(child_el.tagName.toLowerCase() == "a" && child_el.title == color && bgImageStyle == "none") {
- Element.addClassName(child_el, "highlight");
- //if(count != 0) {
- child_el.onclick();
- //}
- break;
- } else if(child_el.tagName.toLowerCase() == "select") {
- //background-image
- if(bgImageStyle != "none") {
- var selected_flag = false;
- var select_el = child_el;
- // urlの中身だけ残す
- if(bgImageStyle.match("^url[(]{1}\"")) {
- var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(\"", "").replace("\")", "");
- } else {
- var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(", "").replace(")", "");
- }
- for (var j = 0, option_len = select_el.childNodes.length; j < option_len; j++) {
- var option_el = select_el.childNodes[j];
- if(option_el.value.match(repBgImageStyle)) {
- option_el.selected = "selected";
- selected_flag = true;
- select_el.onchange();
- break;
- }
- }
- }
- } else if(child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") {
- if(color != "transparent") {
- child_el.value = color;
- child_el.onchange();
- }
- //break;
- }
- count++;
- }
- }
-
- } else {
- //レイアウトで表示していないカラム
- commonCls.displayNone($(child_class_name));
- var sub_el = $(child_class_name + "_border");
- if(sub_el) {
- commonCls.displayNone(sub_el);
- }
- }
- },
- displayChange: function(this_el, el) {
- var img_el = Element.getChildElement(this_el);
- if(img_el.src.match("down_arrow.gif")) {
- img_el.src = img_el.src.replace("down_arrow.gif","right_arrow.gif");
- img_el.alt = this.lang_right_arrow;
- this_el.title = this.lang_right_arrow;
- } else {
- img_el.src = img_el.src.replace("right_arrow.gif","down_arrow.gif");
- img_el.alt = this.lang_down_arrow;
- this_el.title = this.lang_down_arrow;
- }
- if(el == null || el == undefined) {
- var next_el = this_el.nextSibling;
- if(Element.hasClassName(next_el,"_blockstyle_custom_sample")) {
- next_el = next_el.nextSibling;
- }
- commonCls.displayChange(next_el);
- } else {
- commonCls.displayChange($(el));
- }
- },
- themeClick: function(this_el, theme_name) {
- if(!this.themefields) {
- var pagestyle_top = $("_pagestyle_top");
- this.themefields = Element.getElementsByClassName(pagestyle_top, "_pagestyle");
- }
- var return_flag = false;
- this.themefields.each(function(field) {
- if(Element.hasClassName(field,"highlight")) {
- if(field == this_el) {
- /* 変更なし */
- return_flag = true;
- return;
- } else {
- Element.removeClassName(field,"highlight");
- }
- }
- }.bind(this));
- if(return_flag) {
- return;
- }
- Element.addClassName(this_el,"highlight");
-
- /* send */
- var all_apply = 0;
- var defultcolor_params = new Object();
-
- defultcolor_params["method"] = "post";
- defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply,"sesson_only":1};
- defultcolor_params["callbackfunc"] = function(){
- var theme_params = new Object();
- theme_params["method"] = "post";
- theme_params["param"] = {"action":"dialog_pagestyle_action_edit_change","page_id":this.page_id,"_pagestyle_flag":1,"theme_name": theme_name};
- theme_params["callbackfunc"] = function(){
- this.refresh(0);
- }.bind(this);
- commonCls.send(theme_params);
- }.bind(this);
- commonCls.send(defultcolor_params);
- },
- /* 配色クリック */
- colorClick: function(class_name, property_name, color, this_el) {
- if(this_el.tagName.toLowerCase() != "select" && (color == "" || color =="1px solid " || this.colorclick_flag == true || (color.length == 7 && color.indexOf('#') != 0))) {
- return;
- }
- if(property_name == "backgroundColor" && color == null) color = this_el.title;
- else if(color == null && this_el.title == "transparent") color = "0px none";
- else if(color == null) color = "1px solid " + this_el.title;
- if(typeof class_name == "string") {
- var el = Element.getChildElementByClassName(document.body, class_name);
- var send_name = class_name+"_"+property_name;
- } else {
- var el = class_name;
- var send_name = "body"+"_"+property_name;
- }
- if(!this.initColorFlag) {
- this.colorclick_flag = true;
- if(property_name == "backgroundColor") {
- // backgroundクリア
- el.style.background = "none" ;
- }
- if(property_name == "background" && color == "") {
- color = "none";
- }
- eval("el.style."+property_name + "=\"" + color+"\";");
- if(!(browser.isIE) && property_name.match("border")) {
- //firefoxのborderの場合、すぐに反映されないため
- $("_container").style.display = "none";
- }
- var color_params = new Object();
- color_params["method"] = "post";
- color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1&"+send_name+"="+encodeURIComponent(color);
- color_params["callbackfunc"] = function(){
- this.colorclick_flag = false;
- if(!(browser.isIE) && property_name.match("border") ) {
- $("_container").style.display = "table";
- }
- }.bind(this);
- commonCls.send(color_params);
- this.setHighlight(this_el);
- this.chg_flag = true;
- } else {
- //pagestyle_list初期化文字列作成
- this.initStr += "&"+send_name+"="+encodeURIComponent(color);
- }
- },
- setHighlight: function(this_el) {
- for (var i = 0; i < this_el.parentNode.childNodes.length; i++) {
- var child_el = this_el.parentNode.childNodes[i];
- if(child_el.nodeType != 1) continue;
- if(Element.hasClassName(child_el,"highlight")) {
- Element.removeClassName(child_el,"highlight");
- } else if(this_el.tagName.toLowerCase() != "select" && child_el.tagName.toLowerCase() == "select") {
- child_el.selectedIndex = 0;
- } else if(this_el.tagName.toLowerCase() != "input" && child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") {
- child_el.value = "";
- }
- }
- if(this_el.tagName.toLowerCase() != "input" && this_el.tagName.toLowerCase() != "select") {
- Element.addClassName(this_el,"highlight");
- }
- },
- /* 規定値に戻す */
- defaultColorClick: function() {
- var top_el = $(this.id);
- var form = top_el.getElementsByTagName("form")[0];
- if(form.pagestyle_all_apply) {
- if(form.pagestyle_all_apply.checked) {
- var all_apply = 1;
- } else {
- var all_apply = 0;
- }
- } else {
- var all_apply = 0;
- }
- /* send */
- var defultcolor_params = new Object();
-
- defultcolor_params["method"] = "post";
- defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply};
- defultcolor_params["callbackfunc"] = function(){
- this.refresh(3);
- }.bind(this);
- commonCls.send(defultcolor_params);
- },
- /* レイアウトクリック */
- layoutClick: function(el , header_flag, leftcolum_flag, rightcolumn_flag) {
- if(Element.hasClassName(el,"highlight")) {
- //変更なし
- return;
- }
- this.chg_flag = true;
- var pagestyle_layout_el = Element.getParentElementByClassName(el, "_pagestyle_layout");
- var highlight_el = Element.getChildElementByClassName(pagestyle_layout_el, "highlight");
- Element.removeClassName(highlight_el,"highlight");
- Element.addClassName(el,"highlight");
- var refresh_flag = false;
- if(header_flag) {
- if(this.header_id_el) {
- if(this.header_add_module_el) commonCls.displayVisible(this.header_add_module_el);
- commonCls.displayVisible(this.header_id_el);
- } else {
- refresh_flag = true;
- }
- this.header_flag = 1;
- } else {
- if(this.header_add_module_el) commonCls.displayNone(this.header_add_module_el);
- if(this.header_id_el) commonCls.displayNone(this.header_id_el);
- this.header_flag = 0;
- }
- var colspan = 1;
- if(leftcolum_flag) {
- colspan++;
- if(this.leftcolumn_el) {
- commonCls.displayVisible(this.leftcolumn_el);
- } else {
- refresh_flag = true;
- }
- this.leftcolumn_flag = 1;
- } else {
- if(this.leftcolumn_el) commonCls.displayNone(this.leftcolumn_el);
- this.leftcolumn_flag = 0;
- }
- if(rightcolumn_flag) {
- colspan++;
- if(this.rightcolumn_el) {
- commonCls.displayVisible(this.rightcolumn_el);
- } else {
- refresh_flag = true;
- }
- this.rightcolumn_flag = 1;
- } else {
- if(this.rightcolumn_el) commonCls.displayNone(this.rightcolumn_el);
- this.rightcolumn_flag = 0;
- }
- if(this.header_id_el) {
- this.header_id_el.colspan = colspan;
- }
- if(this.footer_el) {
- this.footer_el.colspan = colspan;
- }
- var layout_params = new Object();
- layout_params["method"] = "post";
- layout_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id,"header_flag": this.header_flag,"leftcolumn_flag": this.leftcolumn_flag,"rightcolumn_flag": this.rightcolumn_flag};
- layout_params["callbackfunc"] = function(){
- if(refresh_flag != "" || !(browser.isIE)) {
- this.refresh(2);
- }
- }.bind(this);
- commonCls.send(layout_params);
- },
- refresh: function(active_tab, append_str) {
- var top_el = $(this.id);
- append_str = (append_str == undefined || append_str == null) ? "" : append_str;
- var str = "&_layoutmode=off";
- if(active_tab != undefined && active_tab != null) {
- str += "&active_tab="+active_tab;
- }
- location.href = _nc_base_url + _nc_index_file_name + "?action="+ this.pages_action+"&page_id="+this.page_id+
- "&_pagestyle_flag=1&pagestyle_x="+top_el.parentNode.style.left+"&pagestyle_y="+top_el.parentNode.style.top+
- str + append_str;
- },
- //行揃え変更
- chgGeneral: function(el) {
- var top_el = $(this.id);
- var form = top_el.getElementsByTagName("form")[0];
- var name = el.name;
- var hidden_el = el.nextSibling;
- if(hidden_el.value == el.value) {
- // 変更なし
- return;
- }
- this.chg_flag = true;
- var container_el = $("_container");
- if(name == "align") {
- if(el.value == "center") {
- form.leftmargin.value = "0";
- form.rightmargin.value = "0";
- container_el.style.marginRight = "";
- container_el.style.marginLeft = "";
- var buf_hidden_el = form.leftmargin.nextSibling;
- buf_hidden_el.value = "0";
- var buf_hidden_el = form.rightmargin.nextSibling;
- buf_hidden_el.value = "0";
- }
- container_el.align = el.value;
- container_el.style.textAlign = el.value;
- } else if(name == "topmargin") {
- container_el.style.marginTop = el.value + "px";
- } else if(name == "rightmargin") {
- container_el.style.marginRight = el.value + "px";
- } else if(name == "bottommargin") {
- container_el.style.marginBottom = el.value + "px";
- } else if(name == "leftmargin") {
- container_el.style.marginLeft = el.value + "px";
- }
- if((name == "leftmargin" || name == "rightmargin") && el.value != "0" && form.align.value == "center") {
- form.align.value = "left";
- container_el.align = "left";
- container_el.style.textAlign = "left";
- var buf_hidden_el = form.align.nextSibling;
- buf_hidden_el.value = "left";
- }
- if(name == "page_name") {
- var robj = new RegExp(this.permalink_prohibition, "ig");
- if(hidden_el.value.replace(robj, this.permalink_prohibition_replace) == form.permalink.value.replace(robj, this.permalink_prohibition_replace)) {
- form.permalink.value = el.value.replace(robj, this.permalink_prohibition_replace);
- }
- }
- hidden_el.value = el.value;
- //session情報に追記
- var general_params = new Object();
- general_params["method"] = "post";
- general_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id};
- general_params["param"][name] = el.value;
- commonCls.send(general_params);
- },
- /*OK*/
- okClick: function(id) {
- var top_el = $(this.id);
- var form = top_el.getElementsByTagName("form")[0];
- if(form.pagestyle_all_apply) {
- if(form.pagestyle_all_apply.checked) {
- var all_apply = 1;
- } else {
- var all_apply = 0;
- }
- } else {
- var all_apply = 0;
- }
- if(this.chg_flag) {
- setTimeout(function() {
- var top_el = $(this.id);
- var theme_params = new Object();
- if(typeof form.titletag != "undefined") {
- var titletag = form.titletag.value;
- } else {
- var titletag = null;
- }
- if(typeof form.permalink != "undefined") {
- var permalink = form.permalink.value;
- } else {
- var permalink = null;
- }
-
- theme_params["method"] = "post";
- theme_params["top_el"] = $(this.id);
- theme_params["param"] = {"action":"dialog_pagestyle_action_edit_init","page_id":this.page_id,"page_name":form.page_name.value,"permalink":permalink,"titletag":titletag,"meta_description":form.meta_description.value,"meta_keywords":form.meta_keywords.value,"_pagestyle_flag":1,"all_apply":all_apply,"prefix_id_name":"dialog_pagestyle"};
- theme_params["callbackfunc"] = function(res){
- if(form.permalink_url && form.permalink.value != undefined && form.permalink.value != '') {
- location.href = form.permalink_url.value + form.permalink.value + '/';
- } else {
- location.href = _nc_base_url + _nc_index_file_name + "?action=" + this.pages_action + "&page_id="+this.page_id;
- }
- }.bind(this);
- theme_params["callbackfunc_error"] = function(res){
- commonCls.alert(res);
- this.tabset.setActiveIndex(1);
- this.tabset.refresh();
- }.bind(this);
- commonCls.send(theme_params);
- }.bind(this),300);
- } else {
- //変更なし
- commonCls.removeBlock(id);
- }
- },
- /*キャンセル*/
- cancelClick: function(id) {
- if(this.chg_flag) {
- if(!commonCls.confirm(this.lang_cancel_confirm))return false;
- location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id;
- } else {
- //変更なし
- commonCls.removeBlock(id);
- }
- //location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id;
- }
-}
-
+var clsPagestyle = Class.create();
+
+clsPagestyle.prototype = {
+ initialize: function() {
+ this.id = null;
+ this.top_el = null;
+
+ this.lang_down_arrow = null;
+ this.lang_right_arrow = null;
+
+ this.lang_cancel_confirm = null;
+
+ this.themefields = null;
+ this.theme_name = null;
+ this.header_flag = null;
+ this.leftcolumn_flag = null;
+ this.rightcolumn_flag = null;
+
+ this.header_el = null;
+ this.header_id_el = null;
+ this.leftcolumn_el = null;
+ this.centercolumn_el = null;
+ this.rightcolumn_el = null;
+ this.footer_el = null;
+
+ this.colorclick_flag = false;
+
+ this.chg_flag = false;
+ this.initColorFlag = false;
+ this.initStr = "";
+ this.tabset = null;
+ },
+ init: function(id, page_id, theme_name, header_flag, leftcolumn_flag, rightcolumn_flag, active_tab, change_flag, lang_cancel_confirm, lang_style, lang_theme, lang_layout, lang_coloration, lang_down_arrow, lang_right_arrow, pages_action, permalink_prohibition, permalink_prohibition_replace) {
+ this.id = id;
+ this.page_id = page_id;
+ this.theme_name = theme_name;
+ this.header_flag = header_flag;
+ this.leftcolumn_flag = leftcolumn_flag;
+ this.rightcolumn_flag = rightcolumn_flag;
+
+ this.pages_action = pages_action;
+ this.permalink_prohibition = permalink_prohibition;
+ this.permalink_prohibition_replace = permalink_prohibition_replace;
+
+ var top_el = $(id);
+ this.top_el = top_el;
+ this.header_id_el = $("__headercolumn");
+ this.header_el = $("_headercolumn");
+ if(this.header_el) {
+ this.header_add_module_el = Element.getChildElementByClassName(this.header_el, "headercolumn_addmodule");
+ }
+ this.leftcolumn_el = $("_leftcolumn");
+ this.centercolumn_el = $("_centercolumn");
+ this.rightcolumn_el =$("_rightcolumn");
+ this.footer_el = $("_footercolumn");
+
+ /* タブ */
+ tabset = new compTabset(top_el);
+ tabset.addTabset(lang_theme, null);
+ tabset.addTabset(lang_style,pagestyleCls.clkStyle.bind($(id)));
+ tabset.addTabset(lang_layout);
+ tabset.addTabset(lang_coloration, null, pagestyleCls.clkColor.bind(this));
+
+ tabset.setActiveIndex(valueParseInt(active_tab));
+
+ tabset.render();
+ if(change_flag != "") {
+ this.chg_flag = true;
+ } else {
+ this.chg_flag = false;
+ }
+ this.tabset = tabset;
+ this.lang_cancel_confirm = lang_cancel_confirm;
+ this.lang_down_arrow = lang_down_arrow;
+ this.lang_right_arrow = lang_right_arrow;
+
+ //Initに時間がかかる処理は後回し
+ //setTimeout(pagestyleCls.InitTimer.bind(this), 0);
+ },
+ clkStyle: function() {
+ var top_el = this;
+ var form = top_el.getElementsByTagName("form")[0];
+ commonCls.focus(form.page_name);
+ },
+ clkColor: function() {
+ this.initColorFlag = true;
+ this.initStr = "";
+ var coloration_el =$("_pagestyle_color");
+ if(coloration_el != null) {
+ //配色取得
+ this.setHighlightColor(document.body, "_pagestyle_body","backgroundColor");
+ this.setHighlightColor(this.header_el, "_pagestyle_headercolumn","backgroundColor");
+ this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn","backgroundColor");
+ this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn","backgroundColor");
+ this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn","backgroundColor");
+ this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn","backgroundColor");
+
+ this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_top_color","borderTopColor");
+ this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_right_color","borderRightColor");
+ this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_bottom_color","borderBottomColor");
+ this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_left_color","borderLeftColor");
+
+ this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_top_color","borderTopColor");
+ this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_right_color","borderRightColor");
+ this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_bottom_color","borderBottomColor");
+ this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_left_color","borderLeftColor");
+
+ this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_top_color","borderTopColor");
+ this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_right_color","borderRightColor");
+ this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_bottom_color","borderBottomColor");
+ this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_left_color","borderLeftColor");
+
+ this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_top_color","borderTopColor");
+ this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_right_color","borderRightColor");
+ this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_bottom_color","borderBottomColor");
+ this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_left_color","borderLeftColor");
+
+ this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_top_color","borderTopColor");
+ this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_right_color","borderRightColor");
+ this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_bottom_color","borderBottomColor");
+ this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_left_color","borderLeftColor");
+ }
+ this.initColorFlag = false;
+ if(this.initStr != "") {
+ var color_params = new Object();
+ color_params["method"] = "post";
+ color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1"+this.initStr;
+ commonCls.send(color_params);
+ }
+ },
+ setHighlightColor: function(el, child_class_name, property_name) {
+ if(el) {
+ //background-image対応
+ var bgImageStyle = "none";
+ if(property_name == "backgroundColor" || property_name == "background-color") {
+ bgImageStyle = Element.getStyle(el, "backgroundImage");
+ }
+
+ var color = commonCls.getColorCode(el,property_name);
+ var column_el = $(child_class_name);
+ ////var highlight_flag = false;
+ var count = 0;
+ for (var i = 0,column_len = column_el.childNodes.length; i < column_len; i++) {
+ var child_el = column_el.childNodes[i];
+ if(child_el.nodeType == 1) {
+ if(child_el.tagName.toLowerCase() == "a" && child_el.title == color && bgImageStyle == "none") {
+ Element.addClassName(child_el, "highlight");
+ //if(count != 0) {
+ child_el.onclick();
+ //}
+ break;
+ } else if(child_el.tagName.toLowerCase() == "select") {
+ //background-image
+ if(bgImageStyle != "none") {
+ var selected_flag = false;
+ var select_el = child_el;
+ // urlの中身だけ残す
+ if(bgImageStyle.match("^url[(]{1}\"")) {
+ var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(\"", "").replace("\")", "");
+ } else {
+ var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(", "").replace(")", "");
+ }
+ for (var j = 0, option_len = select_el.childNodes.length; j < option_len; j++) {
+ var option_el = select_el.childNodes[j];
+ if(option_el.value.match(repBgImageStyle)) {
+ option_el.selected = "selected";
+ selected_flag = true;
+ select_el.onchange();
+ break;
+ }
+ }
+ }
+ } else if(child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") {
+ if(color != "transparent") {
+ child_el.value = color;
+ child_el.onchange();
+ }
+ //break;
+ }
+ count++;
+ }
+ }
+
+ } else {
+ //レイアウトで表示していないカラム
+ commonCls.displayNone($(child_class_name));
+ var sub_el = $(child_class_name + "_border");
+ if(sub_el) {
+ commonCls.displayNone(sub_el);
+ }
+ }
+ },
+ displayChange: function(this_el, el) {
+ var img_el = Element.getChildElement(this_el);
+ if(img_el.src.match("down_arrow.gif")) {
+ img_el.src = img_el.src.replace("down_arrow.gif","right_arrow.gif");
+ img_el.alt = this.lang_right_arrow;
+ this_el.title = this.lang_right_arrow;
+ } else {
+ img_el.src = img_el.src.replace("right_arrow.gif","down_arrow.gif");
+ img_el.alt = this.lang_down_arrow;
+ this_el.title = this.lang_down_arrow;
+ }
+ if(el == null || el == undefined) {
+ var next_el = this_el.nextSibling;
+ if(Element.hasClassName(next_el,"_blockstyle_custom_sample")) {
+ next_el = next_el.nextSibling;
+ }
+ commonCls.displayChange(next_el);
+ } else {
+ commonCls.displayChange($(el));
+ }
+ },
+ themeClick: function(this_el, theme_name) {
+ if(!this.themefields) {
+ var pagestyle_top = $("_pagestyle_top");
+ this.themefields = Element.getElementsByClassName(pagestyle_top, "_pagestyle");
+ }
+ var return_flag = false;
+ this.themefields.each(function(field) {
+ if(Element.hasClassName(field,"highlight")) {
+ if(field == this_el) {
+ /* 変更なし */
+ return_flag = true;
+ return;
+ } else {
+ Element.removeClassName(field,"highlight");
+ }
+ }
+ }.bind(this));
+ if(return_flag) {
+ return;
+ }
+ Element.addClassName(this_el,"highlight");
+
+ /* send */
+ var all_apply = 0;
+ var defultcolor_params = new Object();
+
+ defultcolor_params["method"] = "post";
+ defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply,"sesson_only":1};
+ defultcolor_params["callbackfunc"] = function(){
+ var theme_params = new Object();
+ theme_params["method"] = "post";
+ theme_params["param"] = {"action":"dialog_pagestyle_action_edit_change","page_id":this.page_id,"_pagestyle_flag":1,"theme_name": theme_name};
+ theme_params["callbackfunc"] = function(){
+ this.refresh(0);
+ }.bind(this);
+ commonCls.send(theme_params);
+ }.bind(this);
+ commonCls.send(defultcolor_params);
+ },
+ /* 配色クリック */
+ colorClick: function(class_name, property_name, color, this_el) {
+ if(this_el.tagName.toLowerCase() != "select" && (color == "" || color =="1px solid " || this.colorclick_flag == true || (color.length == 7 && color.indexOf('#') != 0))) {
+ return;
+ }
+ if(property_name == "backgroundColor" && color == null) color = this_el.title;
+ else if(color == null && this_el.title == "transparent") color = "0px none";
+ else if(color == null) color = "1px solid " + this_el.title;
+ if(typeof class_name == "string") {
+ var el = Element.getChildElementByClassName(document.body, class_name);
+ var send_name = class_name+"_"+property_name;
+ } else {
+ var el = class_name;
+ var send_name = "body"+"_"+property_name;
+ }
+ if(!this.initColorFlag) {
+ this.colorclick_flag = true;
+ if(property_name == "backgroundColor") {
+ // backgroundクリア
+ el.style.background = "none" ;
+ }
+ if(property_name == "background" && color == "") {
+ color = "none";
+ }
+ eval("el.style."+property_name + "=\"" + color+"\";");
+ if(!(browser.isIE) && property_name.match("border")) {
+ //firefoxのborderの場合、すぐに反映されないため
+ $("_container").style.display = "none";
+ }
+ var color_params = new Object();
+ color_params["method"] = "post";
+ color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1&"+send_name+"="+encodeURIComponent(color);
+ color_params["callbackfunc"] = function(){
+ this.colorclick_flag = false;
+ if(!(browser.isIE) && property_name.match("border") ) {
+ $("_container").style.display = "table";
+ }
+ }.bind(this);
+ commonCls.send(color_params);
+ this.setHighlight(this_el);
+ this.chg_flag = true;
+ } else {
+ //pagestyle_list初期化文字列作成
+ this.initStr += "&"+send_name+"="+encodeURIComponent(color);
+ }
+ },
+ setHighlight: function(this_el) {
+ for (var i = 0; i < this_el.parentNode.childNodes.length; i++) {
+ var child_el = this_el.parentNode.childNodes[i];
+ if(child_el.nodeType != 1) continue;
+ if(Element.hasClassName(child_el,"highlight")) {
+ Element.removeClassName(child_el,"highlight");
+ } else if(this_el.tagName.toLowerCase() != "select" && child_el.tagName.toLowerCase() == "select") {
+ child_el.selectedIndex = 0;
+ } else if(this_el.tagName.toLowerCase() != "input" && child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") {
+ child_el.value = "";
+ }
+ }
+ if(this_el.tagName.toLowerCase() != "input" && this_el.tagName.toLowerCase() != "select") {
+ Element.addClassName(this_el,"highlight");
+ }
+ },
+ /* 規定値に戻す */
+ defaultColorClick: function() {
+ var top_el = $(this.id);
+ var form = top_el.getElementsByTagName("form")[0];
+ if(form.pagestyle_all_apply) {
+ if(form.pagestyle_all_apply.checked) {
+ var all_apply = 1;
+ } else {
+ var all_apply = 0;
+ }
+ } else {
+ var all_apply = 0;
+ }
+ /* send */
+ var defultcolor_params = new Object();
+
+ defultcolor_params["method"] = "post";
+ defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply};
+ defultcolor_params["callbackfunc"] = function(){
+ this.refresh(3);
+ }.bind(this);
+ commonCls.send(defultcolor_params);
+ },
+ /* レイアウトクリック */
+ layoutClick: function(el , header_flag, leftcolum_flag, rightcolumn_flag) {
+ if(Element.hasClassName(el,"highlight")) {
+ //変更なし
+ return;
+ }
+ this.chg_flag = true;
+ var pagestyle_layout_el = Element.getParentElementByClassName(el, "_pagestyle_layout");
+ var highlight_el = Element.getChildElementByClassName(pagestyle_layout_el, "highlight");
+ Element.removeClassName(highlight_el,"highlight");
+ Element.addClassName(el,"highlight");
+ var refresh_flag = false;
+ if(header_flag) {
+ if(this.header_id_el) {
+ if(this.header_add_module_el) commonCls.displayVisible(this.header_add_module_el);
+ commonCls.displayVisible(this.header_id_el);
+ } else {
+ refresh_flag = true;
+ }
+ this.header_flag = 1;
+ } else {
+ if(this.header_add_module_el) commonCls.displayNone(this.header_add_module_el);
+ if(this.header_id_el) commonCls.displayNone(this.header_id_el);
+ this.header_flag = 0;
+ }
+ var colspan = 1;
+ if(leftcolum_flag) {
+ colspan++;
+ if(this.leftcolumn_el) {
+ commonCls.displayVisible(this.leftcolumn_el);
+ } else {
+ refresh_flag = true;
+ }
+ this.leftcolumn_flag = 1;
+ } else {
+ if(this.leftcolumn_el) commonCls.displayNone(this.leftcolumn_el);
+ this.leftcolumn_flag = 0;
+ }
+ if(rightcolumn_flag) {
+ colspan++;
+ if(this.rightcolumn_el) {
+ commonCls.displayVisible(this.rightcolumn_el);
+ } else {
+ refresh_flag = true;
+ }
+ this.rightcolumn_flag = 1;
+ } else {
+ if(this.rightcolumn_el) commonCls.displayNone(this.rightcolumn_el);
+ this.rightcolumn_flag = 0;
+ }
+ if(this.header_id_el) {
+ this.header_id_el.colspan = colspan;
+ }
+ if(this.footer_el) {
+ this.footer_el.colspan = colspan;
+ }
+ var layout_params = new Object();
+ layout_params["method"] = "post";
+ layout_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id,"header_flag": this.header_flag,"leftcolumn_flag": this.leftcolumn_flag,"rightcolumn_flag": this.rightcolumn_flag};
+ layout_params["callbackfunc"] = function(){
+ if(refresh_flag != "" || !(browser.isIE)) {
+ this.refresh(2);
+ }
+ }.bind(this);
+ commonCls.send(layout_params);
+ },
+ refresh: function(active_tab, append_str) {
+ var top_el = $(this.id);
+ append_str = (append_str == undefined || append_str == null) ? "" : append_str;
+ var str = "&_layoutmode=off";
+ if(active_tab != undefined && active_tab != null) {
+ str += "&active_tab="+active_tab;
+ }
+ location.href = _nc_base_url + _nc_index_file_name + "?action="+ this.pages_action+"&page_id="+this.page_id+
+ "&_pagestyle_flag=1&pagestyle_x="+top_el.parentNode.style.left+"&pagestyle_y="+top_el.parentNode.style.top+
+ str + append_str;
+ },
+ //行揃え変更
+ chgGeneral: function(el) {
+ var top_el = $(this.id);
+ var form = top_el.getElementsByTagName("form")[0];
+ var name = el.name;
+ var hidden_el = el.nextSibling;
+ if(hidden_el.value == el.value) {
+ // 変更なし
+ return;
+ }
+ this.chg_flag = true;
+ var container_el = $("_container");
+ if(name == "align") {
+ if(el.value == "center") {
+ form.leftmargin.value = "0";
+ form.rightmargin.value = "0";
+ container_el.style.marginRight = "";
+ container_el.style.marginLeft = "";
+ var buf_hidden_el = form.leftmargin.nextSibling;
+ buf_hidden_el.value = "0";
+ var buf_hidden_el = form.rightmargin.nextSibling;
+ buf_hidden_el.value = "0";
+ }
+ container_el.align = el.value;
+ container_el.style.textAlign = el.value;
+ } else if(name == "topmargin") {
+ container_el.style.marginTop = el.value + "px";
+ } else if(name == "rightmargin") {
+ container_el.style.marginRight = el.value + "px";
+ } else if(name == "bottommargin") {
+ container_el.style.marginBottom = el.value + "px";
+ } else if(name == "leftmargin") {
+ container_el.style.marginLeft = el.value + "px";
+ }
+ if((name == "leftmargin" || name == "rightmargin") && el.value != "0" && form.align.value == "center") {
+ form.align.value = "left";
+ container_el.align = "left";
+ container_el.style.textAlign = "left";
+ var buf_hidden_el = form.align.nextSibling;
+ buf_hidden_el.value = "left";
+ }
+ if(name == "page_name") {
+ var robj = new RegExp(this.permalink_prohibition, "ig");
+ if(hidden_el.value.replace(robj, this.permalink_prohibition_replace) == form.permalink.value.replace(robj, this.permalink_prohibition_replace)) {
+ form.permalink.value = el.value.replace(robj, this.permalink_prohibition_replace);
+ }
+ }
+ hidden_el.value = el.value;
+ //session情報に追記
+ var general_params = new Object();
+ general_params["method"] = "post";
+ general_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id};
+ general_params["param"][name] = el.value;
+ commonCls.send(general_params);
+ },
+ /*OK*/
+ okClick: function(id) {
+ var top_el = $(this.id);
+ var form = top_el.getElementsByTagName("form")[0];
+ if(form.pagestyle_all_apply) {
+ if(form.pagestyle_all_apply.checked) {
+ var all_apply = 1;
+ } else {
+ var all_apply = 0;
+ }
+ } else {
+ var all_apply = 0;
+ }
+ if(this.chg_flag) {
+ setTimeout(function() {
+ var top_el = $(this.id);
+ var theme_params = new Object();
+ if(typeof form.titletag != "undefined") {
+ var titletag = form.titletag.value;
+ } else {
+ var titletag = null;
+ }
+ if(typeof form.permalink != "undefined") {
+ var permalink = form.permalink.value;
+ } else {
+ var permalink = null;
+ }
+
+ theme_params["method"] = "post";
+ theme_params["top_el"] = $(this.id);
+ theme_params["param"] = {"action":"dialog_pagestyle_action_edit_init","page_id":this.page_id,"page_name":form.page_name.value,"permalink":permalink,"titletag":titletag,"meta_description":form.meta_description.value,"meta_keywords":form.meta_keywords.value,"_pagestyle_flag":1,"all_apply":all_apply,"prefix_id_name":"dialog_pagestyle"};
+ theme_params["callbackfunc"] = function(res){
+ if(form.permalink_url && form.permalink.type != "hidden" && form.permalink.value != '') {
+ location.href = form.permalink_url.value + form.permalink.value + '/';
+ } else {
+ location.href = _nc_base_url + _nc_index_file_name + "?action=" + this.pages_action + "&page_id="+this.page_id;
+ }
+ }.bind(this);
+ theme_params["callbackfunc_error"] = function(res){
+ commonCls.alert(res);
+ this.tabset.setActiveIndex(1);
+ this.tabset.refresh();
+ }.bind(this);
+ commonCls.send(theme_params);
+ }.bind(this),300);
+ } else {
+ //変更なし
+ commonCls.removeBlock(id);
+ }
+ },
+ /*キャンセル*/
+ cancelClick: function(id) {
+ if(this.chg_flag) {
+ if(!commonCls.confirm(this.lang_cancel_confirm))return false;
+ location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id;
+ } else {
+ //変更なし
+ commonCls.removeBlock(id);
+ }
+ //location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id;
+ }
+}
+
pagestyleCls = new clsPagestyle();
\ No newline at end of file
diff --git a/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php b/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php
old mode 100644
new mode 100755
index e96e140..54925aa
--- a/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php
+++ b/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php
@@ -213,23 +213,23 @@ function execute()
} else {
$this->background_color[$key] = "";
}
-
- foreach($border_array as $border => $border_value) {
- if(isset($theme_list[$key][$border])) {
- if($key == "general") {
- $this->headercolumn[$border_value] = explode(",",$theme_list[$key][$border]);
- $this->leftcolumn[$border_value] = explode(",",$theme_list[$key][$border]);
- $this->rightcolumn[$border_value] = explode(",",$theme_list[$key][$border]);
- $this->centercolumn[$border_value] = explode(",",$theme_list[$key][$border]);
- $this->footercolumn[$border_value] = explode(",",$theme_list[$key][$border]);
- } else {
- $this->$key[$border_value] = explode(",",$theme_list[$key][$border]);
- }
+
+ foreach ($border_array as $border => $border_value) {
+ if (!isset($theme_list[$key][$border])) {
+ // 未定義の場合はセットせず、generalの値を使用する
+ continue;
+ }
+ if ($key == "general") {
+ $this->headercolumn[$border_value] = explode(",", $theme_list[$key][$border]);
+ $this->leftcolumn[$border_value] = explode(",", $theme_list[$key][$border]);
+ $this->rightcolumn[$border_value] = explode(",", $theme_list[$key][$border]);
+ $this->centercolumn[$border_value] = explode(",", $theme_list[$key][$border]);
+ $this->footercolumn[$border_value] = explode(",", $theme_list[$key][$border]);
} else {
- $this->$key[$border_value] = "";
+ // 定義されている場合は定義内容をセットする
+ $this->{$key}[$border_value] = explode(",", $theme_list[$key][$border]);
}
}
-
}
}
}
diff --git a/html/webapp/modules/dialog/templates/pagestyle.html b/html/webapp/modules/dialog/templates/pagestyle.html
index 4417dde..aad9d92 100644
--- a/html/webapp/modules/dialog/templates/pagestyle.html
+++ b/html/webapp/modules/dialog/templates/pagestyle.html
@@ -1,401 +1,405 @@
-<{strip}>
-<{* TODO:style属性、後にクラス化 *}>
-
diff --git a/html/webapp/templates/main/mobile_smart.html b/html/webapp/templates/main/mobile_smart.html index 4329aed..f1ef9ec 100644 --- a/html/webapp/templates/main/mobile_smart.html +++ b/html/webapp/templates/main/mobile_smart.html @@ -7,6 +7,11 @@ <{$smarty.const.INDEX_FILE_NAME}>?action=common_download_css&dir_name=/comp/extension/jquery.mobile-1.0.1.min.css&header=0&vs=<{$smarty.const._CSS_VERSION}>" /> <{$smarty.const.INDEX_FILE_NAME}>?action=common_download_css&dir_name=/comp/extension/jquery.mobile_addition.css&header=0&vs=<{$smarty.const._CSS_VERSION}>" /> + diff --git a/html/webapp/templates/main/redirect.html b/html/webapp/templates/main/redirect.html old mode 100644 new mode 100755 index 0869964..79650e8 --- a/html/webapp/templates/main/redirect.html +++ b/html/webapp/templates/main/redirect.html @@ -2,8 +2,22 @@
+<{if isset($action.redirect_url|smarty:nodefaults)}> + <{assign var="redirect_url" value=$action.redirect_url|smarty:nodefaults}> +<{elseif empty($redirect_url|smarty:nodefaults)}> + <{assign var="redirect_url" value=$smarty.const.BASE_URL|cat:$smarty.const.INDEX_FILE_NAME}> +<{/if}> -<{else}><{$url|replace:"&":"&"}><{/if}>" /> +
{$smarty.const.INDEX_FILE_NAME}>?<{$smarty.const.ACTION_KEY}>=common_download_css" /> <{$header_field.script_header|smarty:nodefaults}> @@ -26,22 +40,14 @@
setTimeout( function(){ - var location_str = '<{if isset($redirect_url|smarty:nodefaults)}><{$redirect_url}><{else}><{$url}><{/if}>'; + var location_str = '<{$redirect_url|smarty:nodefaults|escape:"javascript"}>'; <{if $smarty.post.action == "login_action_main_init"}> top.location.href=location_str.replace(/&/ig,"&"); <{else}>