[Svn-src-all:3652] [version-2_12-dev 22564] #2150 (改行コードの調整)
shutta
admin @ mail.ec-cube.net
2013年 2月 18日 (月) 17:58:21 JST
Subversion committed to /home/svn/open 22564
http://svn.ec-cube.net/open_trac/changeset/22564
┌────────────────────────────┐
│更新者 : shutta │
│更新日時: 2013-02-18 17:58:21 +0900 (月, 18 2月 2013)│
└────────────────────────────┘
Log:
--------------------------------------------------------
#2150 (改行コードの調整)
改行コードを調整(CRLF -> LF)
Changed: [U:修正,A:追加,D:削除]
--------------------------------------------------------
U branches/version-2_12-dev/data/Smarty/templates/admin/system/editdb.tpl
U branches/version-2_12-dev/data/class/helper/SC_Helper_Delivery.php
U branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php
U branches/version-2_12-dev/data/class_extends/helper_extends/SC_Helper_Delivery_Ex.php
U branches/version-2_12-dev/html/user_data/packages/sphone/js/btn.js
U branches/version-2_12-dev/html/user_data/packages/sphone/js/config.js
U branches/version-2_12-dev/html/user_data/packages/sphone/js/favorite.js
U branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.autoResizeTextAreaQ-0.1.js
U branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.facebox/facebox.css
変更: branches/version-2_12-dev/data/Smarty/templates/admin/system/editdb.tpl
===================================================================
--- branches/version-2_12-dev/data/Smarty/templates/admin/system/editdb.tpl 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/data/Smarty/templates/admin/system/editdb.tpl 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,63 +1,63 @@
-<!--{*
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
- *
- * http://www.lockon.co.jp/
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-*}-->
-
-<form name="index_form" method="post" action="?">
- <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
- <input type="hidden" name="mode" value="confirm" />
- <div class="btn">
- <a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('index_form', 'confirm', '', '');"><span class="btn-next">変更する</span></a>
- </div>
- <table class="list">
- <col width="5%" />
- <col width="5%" />
- <col width="25%" />
- <col width="25%" />
- <col width="40%" />
- <tr>
- <th colspan="2">インデックス</th>
- <th rowspan="2">テーブル名</th>
- <th rowspan="2">カラム名</th>
- <th rowspan="2">説明</th>
- </tr>
- <tr>
- <th>ON</th>
- <th>OFF</th>
- </tr>
-
- <!--{section name=cnt loop=$arrForm}-->
- <tr>
- <td class="center"><input type="radio" name="indexflag_new[<!--{$smarty.section.cnt.iteration}-->]" value="1" <!--{if $arrForm[cnt].indexflag == "1"}-->checked<!--{/if}--> /></td>
- <td class="center"><input type="radio" name="indexflag_new[<!--{$smarty.section.cnt.iteration}-->]" value="" <!--{if $arrForm[cnt].indexflag != "1"}-->checked<!--{/if}--> /></td>
- <th class="column"><!--{$arrForm[cnt].table_name}--></th>
- <th class="column"><!--{$arrForm[cnt].column_name}--></th>
- <td><!--{$arrForm[cnt].recommend_comment}--></td>
- </tr>
- <input type="hidden" name="table_name[<!--{$smarty.section.cnt.iteration}-->]" value="<!--{$arrForm[cnt].table_name}-->" />
- <input type="hidden" name="column_name[<!--{$smarty.section.cnt.iteration}-->]" value="<!--{$arrForm[cnt].column_name}-->" />
- <input type="hidden" name="indexflag[<!--{$smarty.section.cnt.iteration}-->]" value="<!--{$arrForm[cnt].indexflag}-->" />
- <!--{/section}-->
- </table>
-
- <a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('index_form', 'confirm', '', ''); return false;"><span class="btn-next">変更する</span></a>
-</form>
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+*}-->
+
+<form name="index_form" method="post" action="?">
+ <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
+ <input type="hidden" name="mode" value="confirm" />
+ <div class="btn">
+ <a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('index_form', 'confirm', '', '');"><span class="btn-next">変更する</span></a>
+ </div>
+ <table class="list">
+ <col width="5%" />
+ <col width="5%" />
+ <col width="25%" />
+ <col width="25%" />
+ <col width="40%" />
+ <tr>
+ <th colspan="2">インデックス</th>
+ <th rowspan="2">テーブル名</th>
+ <th rowspan="2">カラム名</th>
+ <th rowspan="2">説明</th>
+ </tr>
+ <tr>
+ <th>ON</th>
+ <th>OFF</th>
+ </tr>
+
+ <!--{section name=cnt loop=$arrForm}-->
+ <tr>
+ <td class="center"><input type="radio" name="indexflag_new[<!--{$smarty.section.cnt.iteration}-->]" value="1" <!--{if $arrForm[cnt].indexflag == "1"}-->checked<!--{/if}--> /></td>
+ <td class="center"><input type="radio" name="indexflag_new[<!--{$smarty.section.cnt.iteration}-->]" value="" <!--{if $arrForm[cnt].indexflag != "1"}-->checked<!--{/if}--> /></td>
+ <th class="column"><!--{$arrForm[cnt].table_name}--></th>
+ <th class="column"><!--{$arrForm[cnt].column_name}--></th>
+ <td><!--{$arrForm[cnt].recommend_comment}--></td>
+ </tr>
+ <input type="hidden" name="table_name[<!--{$smarty.section.cnt.iteration}-->]" value="<!--{$arrForm[cnt].table_name}-->" />
+ <input type="hidden" name="column_name[<!--{$smarty.section.cnt.iteration}-->]" value="<!--{$arrForm[cnt].column_name}-->" />
+ <input type="hidden" name="indexflag[<!--{$smarty.section.cnt.iteration}-->]" value="<!--{$arrForm[cnt].indexflag}-->" />
+ <!--{/section}-->
+ </table>
+
+ <a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('index_form', 'confirm', '', ''); return false;"><span class="btn-next">変更する</span></a>
+</form>
変更: branches/version-2_12-dev/data/class/helper/SC_Helper_Delivery.php
===================================================================
--- branches/version-2_12-dev/data/class/helper/SC_Helper_Delivery.php 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/data/class/helper/SC_Helper_Delivery.php 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,336 +1,336 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
- *
- * http://www.lockon.co.jp/
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/**
- * 配送方法を管理するヘルパークラス.
- *
- * @package Helper
- * @author pineray
- * @version $Id:$
- */
-class SC_Helper_Delivery
-{
- /**
- * 配送方法の情報を取得.
- *
- * @param integer $deliv_id 配送方法ID
- * @param boolean $has_deleted 削除された支払方法も含む場合 true; 初期値 false
- * @return array
- */
- public function get($deliv_id, $has_deleted = false) {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
-
- // 配送業者一覧の取得
- $col = 'deliv_id, name, service_name, remark, confirm_url, product_type_id';
- $where = 'deliv_id = ?';
- if (!$has_deleted) {
- $where .= ' AND del_flg = 0';
- }
- $table = 'dtb_deliv';
- $arrRet = $objQuery->select($col, $table, $where, array($deliv_id));
- $arrDeliv = $arrRet[0];
- if (!$arrDeliv) {
- return $arrDeliv;
- }
-
- // お届け時間の取得
- $arrDeliv['deliv_time'] = $this->getDelivTime($deliv_id);
-
- // 配送料金の取得
- $arrDeliv['fee'] = $this->getDelivFeeList($deliv_id);
-
- // 支払方法
- $arrDeliv['payment_ids'] = $this->getPayments($deliv_id);
-
- return $arrDeliv;
- }
-
- /**
- * 配送方法一覧の取得.
- *
- * @param integer $product_type_id 商品種別ID
- * @param boolean $has_deleted 削除された支払方法も含む場合 true; 初期値 false
- * @return array
- */
- public function getList($product_type_id = null, $has_deleted = false) {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- $col = '*';
- $where = '';
- $arrVal = array();
- if (!$has_deleted) {
- $where .= 'del_flg = 0';
- }
- if (!is_null($product_type_id)) {
- if (!$has_deleted) {
- $where .= ' AND ';
- }
- $where .= 'product_type_id = ?';
- $arrVal[] = $product_type_id;
- }
- $table = 'dtb_deliv';
- $objQuery->setOrder('rank DESC');
- $arrRet = $objQuery->select($col, $table, $where, $arrVal);
- return $arrRet;
- }
-
- /**
- * 配送方法の登録.
- *
- * @param array $sqlval
- * @return integer $deliv_id
- */
- public function save($sqlval) {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- $objQuery->begin();
-
- // お届け時間
- $sqlval_deliv_time = $sqlval['deliv_time'];
- unset($sqlval['deliv_time']);
- // 配送料
- if (INPUT_DELIV_FEE) {
- $sqlval_deliv_fee = $sqlval['deliv_fee'];
- }
- unset($sqlval['deliv_fee']);
- // 支払い方法
- $sqlval_payment_ids = $sqlval['payment_ids'];
- unset($sqlval['payment_ids']);
-
- // deliv_id が決まっていた場合
- if ($sqlval['deliv_id'] != '') {
- $deliv_id = $sqlval['deliv_id'];
- $where = 'deliv_id = ?';
- $objQuery->update('dtb_deliv', $sqlval, $where, array($deliv_id));
-
- // お届け時間の登録
- $table = 'dtb_delivtime';
- $where = 'deliv_id = ? AND time_id = ?';
- for ($cnt = 1; $cnt <= DELIVTIME_MAX; $cnt++) {
- $keyname = 'deliv_time'.$cnt;
- $arrWhereVal = array($deliv_id, $cnt);
- // 既存データの有無を確認
- $curData = $objQuery->select('*', $table, $where, $arrWhereVal);
-
- if (isset($sqlval_deliv_time[$cnt])) {
- $deliv_time = $sqlval_deliv_time[$cnt];
-
- // 入力が空ではなく、DBに情報があれば更新
- if (count($curData)) {
- $objQuery->update($table, $deliv_time, $where, $arrWhereVal);
- }
- // DBに情報がなければ登録
- else {
- $deliv_time['deliv_id'] = $deliv_id;
- $deliv_time['time_id'] = $cnt;
- $objQuery->insert($table, $deliv_time);
- }
- }
- // 入力が空で、DBに情報がある場合は削除
- else if (count($curData)) {
- $objQuery->delete($table, $where, $arrWhereVal);
- }
- }
-
- // 配送料の登録
- if (INPUT_DELIV_FEE) {
- foreach ($sqlval_deliv_fee as $cnt => $deliv_fee) {
- $objQuery->update('dtb_delivfee', array('fee' => $deliv_fee['fee']), 'deliv_id = ? AND fee_id = ?', array($deliv_id, $cnt));
- }
- }
- } else {
- // 登録する配送業者IDの取得
- $deliv_id = $objQuery->nextVal('dtb_deliv_deliv_id');
- $sqlval['deliv_id'] = $deliv_id;
- $sqlval['rank'] = $objQuery->max('rank', 'dtb_deliv') + 1;
- $sqlval['create_date'] = 'CURRENT_TIMESTAMP';
- // INSERTの実行
- $objQuery->insert('dtb_deliv', $sqlval);
-
- // お届け時間の設定
- foreach ($sqlval_deliv_time as $cnt => $deliv_time) {
- $deliv_time['deliv_id'] = $deliv_id;
- $deliv_time['time_id'] = $cnt;
- // INSERTの実行
- $objQuery->insert('dtb_delivtime', $deliv_time);
- }
-
- if (INPUT_DELIV_FEE) {
- // 配送料金の設定
- foreach ($sqlval_deliv_fee as $cnt => $deliv_fee) {
- $deliv_fee['deliv_id'] = $deliv_id;
- $deliv_fee['fee_id'] = $cnt;
- // INSERTの実行
- $objQuery->insert('dtb_delivfee', $deliv_fee);
- }
- }
- }
-
- // 支払い方法
- $objQuery->delete('dtb_payment_options', 'deliv_id = ?', array($deliv_id));
- foreach ($sqlval_payment_ids as $payment_ids) {
- $payment_ids['deliv_id'] = $deliv_id;
- $objQuery->insert('dtb_payment_options', $payment_ids);
- }
-
- $objQuery->commit();
-
- return $deliv_id;
- }
-
- /**
- * 配送方法の削除.
- *
- * @param integer $deliv_id 配送方法ID
- * @return void
- */
- public function delete($deliv_id) {
- $objDb = new SC_Helper_DB_Ex();
- // ランク付きレコードの削除
- $objDb->sfDeleteRankRecord('dtb_deliv', 'deliv_id', $deliv_id);
- }
-
- /**
- * 配送方法の表示順をひとつ上げる.
- *
- * @param integer $deliv_id 配送方法ID
- * @return void
- */
- public function rankUp($deliv_id) {
- $objDb = new SC_Helper_DB_Ex();
- $objDb->sfRankUp('dtb_deliv', 'deliv_id', $deliv_id);
- }
-
- /**
- * 配送方法の表示順をひとつ下げる.
- *
- * @param integer $deliv_id 配送方法ID
- * @return void
- */
- public function rankDown($deliv_id) {
- $objDb = new SC_Helper_DB_Ex();
- $objDb->sfRankDown('dtb_deliv', 'deliv_id', $deliv_id);
- }
-
- /**
- * 同じ内容の配送方法が存在するか確認.
- *
- * @param array $arrDeliv
- * @return boolean
- */
- public function checkExist($arrDeliv) {
- $objDb = new SC_Helper_DB_Ex();
- if ($arrDeliv['deliv_id'] == '') {
- $ret = $objDb->sfIsRecord('dtb_deliv', 'service_name', array($arrDeliv['service_name']));
- } else {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- $ret = (($objQuery->count('dtb_deliv', 'deliv_id != ? AND service_name = ? ', array($arrDeliv['deliv_id'], $arrDeliv['service_name'])) > 0)? true : false);
- }
- return $ret;
- }
-
- /**
- * 配送方法IDをキー, 名前を値とする配列を取得.
- *
- * @param string $type 値のタイプ
- * @return array
- */
- public static function getIDValueList($type = 'name') {
- return SC_Helper_DB_Ex::sfGetIDValueList('dtb_deliv', 'deliv_id', $type);
- }
-
- /**
- * 配送業者IDからお届け時間の配列を取得する.
- *
- * @param integer $deliv_id 配送業者ID
- * @return array お届け時間の配列
- */
- public static function getDelivTime($deliv_id) {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- $objQuery->setOrder('time_id');
- $results = $objQuery->select('time_id, deliv_time',
- 'dtb_delivtime',
- 'deliv_id = ?', array($deliv_id));
- $arrDelivTime = array();
- foreach ($results as $val) {
- $arrDelivTime[$val['time_id']] = $val['deliv_time'];
- }
- return $arrDelivTime;
- }
-
- /**
- * 配送業者ID から, 有効な支払方法IDを取得する.
- *
- * @param integer $deliv_id 配送業者ID
- * @return array 有効な支払方法IDの配列
- */
- public static function getPayments($deliv_id) {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- $objQuery->setOrder('rank');
- return $objQuery->getCol('payment_id', 'dtb_payment_options',
- 'deliv_id = ?',
- array($deliv_id), MDB2_FETCHMODE_ORDERED);
- }
-
- /**
- * 都道府県から配送料金を取得する.
- *
- * @param integer|array $pref_id 都道府県ID 又は都道府県IDの配列
- * @param integer $deliv_id 配送業者ID
- * @return string 指定の都道府県, 配送業者の配送料金
- */
- public static function getDelivFee($pref_id, $deliv_id = 0) {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- if (!is_array($pref_id)) {
- $pref_id = array($pref_id);
- }
- $sql = <<< __EOS__
- SELECT T1.fee AS fee
- FROM dtb_delivfee T1
- JOIN dtb_deliv T2
- ON T1.deliv_id = T2.deliv_id
- WHERE T1.pref = ?
- AND T1.deliv_id = ?
- AND T2.del_flg = 0
-__EOS__;
- $result = 0;
- foreach ($pref_id as $pref) {
- $result += $objQuery->getOne($sql, array($pref, $deliv_id));
- }
- return $result;
- }
-
- /**
- * 配送業者ID から, 配送料金の一覧を取得する.
- *
- * @param integer $deliv_id 配送業者ID
- * @return array 配送料金の配列
- */
- public static function getDelivFeeList($deliv_id) {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- $objQuery->setOrder('pref');
- $col = 'fee';
- $where = 'deliv_id = ?';
- $table = 'dtb_delivfee';
- return $objQuery->getCol($col, $table, $where, array($deliv_id),
- MDB2_FETCHMODE_ORDERED);
- }
-}
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * 配送方法を管理するヘルパークラス.
+ *
+ * @package Helper
+ * @author pineray
+ * @version $Id:$
+ */
+class SC_Helper_Delivery
+{
+ /**
+ * 配送方法の情報を取得.
+ *
+ * @param integer $deliv_id 配送方法ID
+ * @param boolean $has_deleted 削除された支払方法も含む場合 true; 初期値 false
+ * @return array
+ */
+ public function get($deliv_id, $has_deleted = false) {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+
+ // 配送業者一覧の取得
+ $col = 'deliv_id, name, service_name, remark, confirm_url, product_type_id';
+ $where = 'deliv_id = ?';
+ if (!$has_deleted) {
+ $where .= ' AND del_flg = 0';
+ }
+ $table = 'dtb_deliv';
+ $arrRet = $objQuery->select($col, $table, $where, array($deliv_id));
+ $arrDeliv = $arrRet[0];
+ if (!$arrDeliv) {
+ return $arrDeliv;
+ }
+
+ // お届け時間の取得
+ $arrDeliv['deliv_time'] = $this->getDelivTime($deliv_id);
+
+ // 配送料金の取得
+ $arrDeliv['fee'] = $this->getDelivFeeList($deliv_id);
+
+ // 支払方法
+ $arrDeliv['payment_ids'] = $this->getPayments($deliv_id);
+
+ return $arrDeliv;
+ }
+
+ /**
+ * 配送方法一覧の取得.
+ *
+ * @param integer $product_type_id 商品種別ID
+ * @param boolean $has_deleted 削除された支払方法も含む場合 true; 初期値 false
+ * @return array
+ */
+ public function getList($product_type_id = null, $has_deleted = false) {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ $col = '*';
+ $where = '';
+ $arrVal = array();
+ if (!$has_deleted) {
+ $where .= 'del_flg = 0';
+ }
+ if (!is_null($product_type_id)) {
+ if (!$has_deleted) {
+ $where .= ' AND ';
+ }
+ $where .= 'product_type_id = ?';
+ $arrVal[] = $product_type_id;
+ }
+ $table = 'dtb_deliv';
+ $objQuery->setOrder('rank DESC');
+ $arrRet = $objQuery->select($col, $table, $where, $arrVal);
+ return $arrRet;
+ }
+
+ /**
+ * 配送方法の登録.
+ *
+ * @param array $sqlval
+ * @return integer $deliv_id
+ */
+ public function save($sqlval) {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ $objQuery->begin();
+
+ // お届け時間
+ $sqlval_deliv_time = $sqlval['deliv_time'];
+ unset($sqlval['deliv_time']);
+ // 配送料
+ if (INPUT_DELIV_FEE) {
+ $sqlval_deliv_fee = $sqlval['deliv_fee'];
+ }
+ unset($sqlval['deliv_fee']);
+ // 支払い方法
+ $sqlval_payment_ids = $sqlval['payment_ids'];
+ unset($sqlval['payment_ids']);
+
+ // deliv_id が決まっていた場合
+ if ($sqlval['deliv_id'] != '') {
+ $deliv_id = $sqlval['deliv_id'];
+ $where = 'deliv_id = ?';
+ $objQuery->update('dtb_deliv', $sqlval, $where, array($deliv_id));
+
+ // お届け時間の登録
+ $table = 'dtb_delivtime';
+ $where = 'deliv_id = ? AND time_id = ?';
+ for ($cnt = 1; $cnt <= DELIVTIME_MAX; $cnt++) {
+ $keyname = 'deliv_time'.$cnt;
+ $arrWhereVal = array($deliv_id, $cnt);
+ // 既存データの有無を確認
+ $curData = $objQuery->select('*', $table, $where, $arrWhereVal);
+
+ if (isset($sqlval_deliv_time[$cnt])) {
+ $deliv_time = $sqlval_deliv_time[$cnt];
+
+ // 入力が空ではなく、DBに情報があれば更新
+ if (count($curData)) {
+ $objQuery->update($table, $deliv_time, $where, $arrWhereVal);
+ }
+ // DBに情報がなければ登録
+ else {
+ $deliv_time['deliv_id'] = $deliv_id;
+ $deliv_time['time_id'] = $cnt;
+ $objQuery->insert($table, $deliv_time);
+ }
+ }
+ // 入力が空で、DBに情報がある場合は削除
+ else if (count($curData)) {
+ $objQuery->delete($table, $where, $arrWhereVal);
+ }
+ }
+
+ // 配送料の登録
+ if (INPUT_DELIV_FEE) {
+ foreach ($sqlval_deliv_fee as $cnt => $deliv_fee) {
+ $objQuery->update('dtb_delivfee', array('fee' => $deliv_fee['fee']), 'deliv_id = ? AND fee_id = ?', array($deliv_id, $cnt));
+ }
+ }
+ } else {
+ // 登録する配送業者IDの取得
+ $deliv_id = $objQuery->nextVal('dtb_deliv_deliv_id');
+ $sqlval['deliv_id'] = $deliv_id;
+ $sqlval['rank'] = $objQuery->max('rank', 'dtb_deliv') + 1;
+ $sqlval['create_date'] = 'CURRENT_TIMESTAMP';
+ // INSERTの実行
+ $objQuery->insert('dtb_deliv', $sqlval);
+
+ // お届け時間の設定
+ foreach ($sqlval_deliv_time as $cnt => $deliv_time) {
+ $deliv_time['deliv_id'] = $deliv_id;
+ $deliv_time['time_id'] = $cnt;
+ // INSERTの実行
+ $objQuery->insert('dtb_delivtime', $deliv_time);
+ }
+
+ if (INPUT_DELIV_FEE) {
+ // 配送料金の設定
+ foreach ($sqlval_deliv_fee as $cnt => $deliv_fee) {
+ $deliv_fee['deliv_id'] = $deliv_id;
+ $deliv_fee['fee_id'] = $cnt;
+ // INSERTの実行
+ $objQuery->insert('dtb_delivfee', $deliv_fee);
+ }
+ }
+ }
+
+ // 支払い方法
+ $objQuery->delete('dtb_payment_options', 'deliv_id = ?', array($deliv_id));
+ foreach ($sqlval_payment_ids as $payment_ids) {
+ $payment_ids['deliv_id'] = $deliv_id;
+ $objQuery->insert('dtb_payment_options', $payment_ids);
+ }
+
+ $objQuery->commit();
+
+ return $deliv_id;
+ }
+
+ /**
+ * 配送方法の削除.
+ *
+ * @param integer $deliv_id 配送方法ID
+ * @return void
+ */
+ public function delete($deliv_id) {
+ $objDb = new SC_Helper_DB_Ex();
+ // ランク付きレコードの削除
+ $objDb->sfDeleteRankRecord('dtb_deliv', 'deliv_id', $deliv_id);
+ }
+
+ /**
+ * 配送方法の表示順をひとつ上げる.
+ *
+ * @param integer $deliv_id 配送方法ID
+ * @return void
+ */
+ public function rankUp($deliv_id) {
+ $objDb = new SC_Helper_DB_Ex();
+ $objDb->sfRankUp('dtb_deliv', 'deliv_id', $deliv_id);
+ }
+
+ /**
+ * 配送方法の表示順をひとつ下げる.
+ *
+ * @param integer $deliv_id 配送方法ID
+ * @return void
+ */
+ public function rankDown($deliv_id) {
+ $objDb = new SC_Helper_DB_Ex();
+ $objDb->sfRankDown('dtb_deliv', 'deliv_id', $deliv_id);
+ }
+
+ /**
+ * 同じ内容の配送方法が存在するか確認.
+ *
+ * @param array $arrDeliv
+ * @return boolean
+ */
+ public function checkExist($arrDeliv) {
+ $objDb = new SC_Helper_DB_Ex();
+ if ($arrDeliv['deliv_id'] == '') {
+ $ret = $objDb->sfIsRecord('dtb_deliv', 'service_name', array($arrDeliv['service_name']));
+ } else {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ $ret = (($objQuery->count('dtb_deliv', 'deliv_id != ? AND service_name = ? ', array($arrDeliv['deliv_id'], $arrDeliv['service_name'])) > 0)? true : false);
+ }
+ return $ret;
+ }
+
+ /**
+ * 配送方法IDをキー, 名前を値とする配列を取得.
+ *
+ * @param string $type 値のタイプ
+ * @return array
+ */
+ public static function getIDValueList($type = 'name') {
+ return SC_Helper_DB_Ex::sfGetIDValueList('dtb_deliv', 'deliv_id', $type);
+ }
+
+ /**
+ * 配送業者IDからお届け時間の配列を取得する.
+ *
+ * @param integer $deliv_id 配送業者ID
+ * @return array お届け時間の配列
+ */
+ public static function getDelivTime($deliv_id) {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ $objQuery->setOrder('time_id');
+ $results = $objQuery->select('time_id, deliv_time',
+ 'dtb_delivtime',
+ 'deliv_id = ?', array($deliv_id));
+ $arrDelivTime = array();
+ foreach ($results as $val) {
+ $arrDelivTime[$val['time_id']] = $val['deliv_time'];
+ }
+ return $arrDelivTime;
+ }
+
+ /**
+ * 配送業者ID から, 有効な支払方法IDを取得する.
+ *
+ * @param integer $deliv_id 配送業者ID
+ * @return array 有効な支払方法IDの配列
+ */
+ public static function getPayments($deliv_id) {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ $objQuery->setOrder('rank');
+ return $objQuery->getCol('payment_id', 'dtb_payment_options',
+ 'deliv_id = ?',
+ array($deliv_id), MDB2_FETCHMODE_ORDERED);
+ }
+
+ /**
+ * 都道府県から配送料金を取得する.
+ *
+ * @param integer|array $pref_id 都道府県ID 又は都道府県IDの配列
+ * @param integer $deliv_id 配送業者ID
+ * @return string 指定の都道府県, 配送業者の配送料金
+ */
+ public static function getDelivFee($pref_id, $deliv_id = 0) {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ if (!is_array($pref_id)) {
+ $pref_id = array($pref_id);
+ }
+ $sql = <<< __EOS__
+ SELECT T1.fee AS fee
+ FROM dtb_delivfee T1
+ JOIN dtb_deliv T2
+ ON T1.deliv_id = T2.deliv_id
+ WHERE T1.pref = ?
+ AND T1.deliv_id = ?
+ AND T2.del_flg = 0
+__EOS__;
+ $result = 0;
+ foreach ($pref_id as $pref) {
+ $result += $objQuery->getOne($sql, array($pref, $deliv_id));
+ }
+ return $result;
+ }
+
+ /**
+ * 配送業者ID から, 配送料金の一覧を取得する.
+ *
+ * @param integer $deliv_id 配送業者ID
+ * @return array 配送料金の配列
+ */
+ public static function getDelivFeeList($deliv_id) {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ $objQuery->setOrder('pref');
+ $col = 'fee';
+ $where = 'deliv_id = ?';
+ $table = 'dtb_delivfee';
+ return $objQuery->getCol($col, $table, $where, array($deliv_id),
+ MDB2_FETCHMODE_ORDERED);
+ }
+}
変更: branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,128 +1,128 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
- *
- * http://www.lockon.co.jp/
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-// {{{ requires
-require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Ex.php';
-
-/**
- * Recommend のページクラス.
- *
- * @package Page
- * @author LOCKON CO.,LTD.
- * @version $Id: LC_Page_FrontParts_Bloc_Best5 - Copy.php -1 $
- */
-class LC_Page_FrontParts_Bloc_Recommend extends LC_Page_FrontParts_Bloc_Ex {
-
- // }}}
- // {{{ functions
-
- /**
- * Page を初期化する.
- *
- * @return void
- */
- function init() {
- parent::init();
- }
-
- /**
- * Page のプロセス.
- *
- * @return void
- */
- function process() {
- $this->action();
- $this->sendResponse();
- }
-
- /**
- * Page のアクション.
- *
- * @return void
- */
- function action() {
-
- // 基本情報を渡す
- $objSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
- $this->arrInfo = $objSiteInfo->data;
-
- //おすすめ商品表示
- $this->arrBestProducts = $this->lfGetRanking();
-
-
- }
-
- /**
- * デストラクタ.
- *
- * @return void
- */
- function destroy() {
- parent::destroy();
- }
-
- /**
- * おすすめ商品検索.
- *
- * @return array $arrBestProducts 検索結果配列
- */
- function lfGetRanking() {
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- $objProduct = new SC_Product_Ex();
-
- // おすすめ商品取得
- $col = 'T1.best_id, T1.category_id, T1.rank, T1.product_id, T1.title, T1.comment, T1.create_date, T1.update_date';
- $table = 'dtb_best_products as T1 INNER JOIN dtb_products as T2 ON T1.product_id = T2.product_id';
- $where = 'T1.del_flg = 0 and T2.status = 1';
- if (NOSTOCK_HIDDEN) {
- $where .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = T1.product_id AND dtb_products_class.del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))';
- }
- $objQuery->setOrder('T1.rank');
- $objQuery->setLimit(RECOMMEND_NUM);
- $arrBestProducts = $objQuery->select($col, $table, $where);
-
- $objQuery =& SC_Query_Ex::getSingletonInstance();
- if (count($arrBestProducts) > 0) {
- // 商品一覧を取得
- // where条件生成&セット
- $arrProductId = array();
- $where = 'product_id IN (';
- foreach ($arrBestProducts as $key => $val) {
- $arrProductId[] = $val['product_id'];
- }
- // 取得
- $arrProductList = $objProduct->getListByProductIds($objQuery, $arrProductId);
- // おすすめ商品情報にマージ
- foreach ($arrBestProducts as $key => $value) {
- $arrRow =& $arrBestProducts[$key];
- if (isset($arrProductList[$arrRow['product_id']])) {
- $arrRow = array_merge($arrRow, $arrProductList[$arrRow['product_id']]);
- } else {
- // 削除済み商品は除外
- unset($arrBestProducts[$key]);
- }
- }
- }
- return $arrBestProducts;
- }
-}
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+// {{{ requires
+require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Ex.php';
+
+/**
+ * Recommend のページクラス.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id: LC_Page_FrontParts_Bloc_Best5 - Copy.php -1 $
+ */
+class LC_Page_FrontParts_Bloc_Recommend extends LC_Page_FrontParts_Bloc_Ex {
+
+ // }}}
+ // {{{ functions
+
+ /**
+ * Page を初期化する.
+ *
+ * @return void
+ */
+ function init() {
+ parent::init();
+ }
+
+ /**
+ * Page のプロセス.
+ *
+ * @return void
+ */
+ function process() {
+ $this->action();
+ $this->sendResponse();
+ }
+
+ /**
+ * Page のアクション.
+ *
+ * @return void
+ */
+ function action() {
+
+ // 基本情報を渡す
+ $objSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
+ $this->arrInfo = $objSiteInfo->data;
+
+ //おすすめ商品表示
+ $this->arrBestProducts = $this->lfGetRanking();
+
+
+ }
+
+ /**
+ * デストラクタ.
+ *
+ * @return void
+ */
+ function destroy() {
+ parent::destroy();
+ }
+
+ /**
+ * おすすめ商品検索.
+ *
+ * @return array $arrBestProducts 検索結果配列
+ */
+ function lfGetRanking() {
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ $objProduct = new SC_Product_Ex();
+
+ // おすすめ商品取得
+ $col = 'T1.best_id, T1.category_id, T1.rank, T1.product_id, T1.title, T1.comment, T1.create_date, T1.update_date';
+ $table = 'dtb_best_products as T1 INNER JOIN dtb_products as T2 ON T1.product_id = T2.product_id';
+ $where = 'T1.del_flg = 0 and T2.status = 1';
+ if (NOSTOCK_HIDDEN) {
+ $where .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = T1.product_id AND dtb_products_class.del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))';
+ }
+ $objQuery->setOrder('T1.rank');
+ $objQuery->setLimit(RECOMMEND_NUM);
+ $arrBestProducts = $objQuery->select($col, $table, $where);
+
+ $objQuery =& SC_Query_Ex::getSingletonInstance();
+ if (count($arrBestProducts) > 0) {
+ // 商品一覧を取得
+ // where条件生成&セット
+ $arrProductId = array();
+ $where = 'product_id IN (';
+ foreach ($arrBestProducts as $key => $val) {
+ $arrProductId[] = $val['product_id'];
+ }
+ // 取得
+ $arrProductList = $objProduct->getListByProductIds($objQuery, $arrProductId);
+ // おすすめ商品情報にマージ
+ foreach ($arrBestProducts as $key => $value) {
+ $arrRow =& $arrBestProducts[$key];
+ if (isset($arrProductList[$arrRow['product_id']])) {
+ $arrRow = array_merge($arrRow, $arrProductList[$arrRow['product_id']]);
+ } else {
+ // 削除済み商品は除外
+ unset($arrBestProducts[$key]);
+ }
+ }
+ }
+ return $arrBestProducts;
+ }
+}
変更: branches/version-2_12-dev/data/class_extends/helper_extends/SC_Helper_Delivery_Ex.php
===================================================================
--- branches/version-2_12-dev/data/class_extends/helper_extends/SC_Helper_Delivery_Ex.php 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/data/class_extends/helper_extends/SC_Helper_Delivery_Ex.php 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,39 +1,39 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
- *
- * http://www.lockon.co.jp/
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-// {{{ requires
-require_once CLASS_REALDIR . 'helper/SC_Helper_Delivery.php';
-
-/**
- * 配送方法を管理するヘルパークラス(拡張).
- *
- * LC_Helper_Delivery をカスタマイズする場合はこのクラスを編集する.
- *
- * @package Helper
- * @author pineray
- * @version $Id:$
- */
-class SC_Helper_Delivery_Ex extends SC_Helper_Delivery
-{
- //put your code here
-}
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+// {{{ requires
+require_once CLASS_REALDIR . 'helper/SC_Helper_Delivery.php';
+
+/**
+ * 配送方法を管理するヘルパークラス(拡張).
+ *
+ * LC_Helper_Delivery をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Helper
+ * @author pineray
+ * @version $Id:$
+ */
+class SC_Helper_Delivery_Ex extends SC_Helper_Delivery
+{
+ //put your code here
+}
変更: branches/version-2_12-dev/html/user_data/packages/sphone/js/btn.js
===================================================================
--- branches/version-2_12-dev/html/user_data/packages/sphone/js/btn.js 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/html/user_data/packages/sphone/js/btn.js 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,27 +1,27 @@
-
-
- function smartRollover() {
- if(document.getElementsByTagName) {
- var images = document.getElementsByTagName("img");
-
- for(var i=0; i < images.length; i++) {
- if(images[i].getAttribute("src").match("_off."))
- {
- images[i].onmouseover = function() {
- this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
- }
- images[i].onmouseout = function() {
- this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
- }
- }
- }
- }
-}
-
-if(window.addEventListener) {
- window.addEventListener("load", smartRollover, false);
-}
-else if(window.attachEvent) {
- window.attachEvent("onload", smartRollover);
-}
-
+
+
+ function smartRollover() {
+ if(document.getElementsByTagName) {
+ var images = document.getElementsByTagName("img");
+
+ for(var i=0; i < images.length; i++) {
+ if(images[i].getAttribute("src").match("_off."))
+ {
+ images[i].onmouseover = function() {
+ this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
+ }
+ images[i].onmouseout = function() {
+ this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
+ }
+ }
+ }
+ }
+}
+
+if(window.addEventListener) {
+ window.addEventListener("load", smartRollover, false);
+}
+else if(window.attachEvent) {
+ window.attachEvent("onload", smartRollover);
+}
+
変更: branches/version-2_12-dev/html/user_data/packages/sphone/js/config.js
===================================================================
--- branches/version-2_12-dev/html/user_data/packages/sphone/js/config.js 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/html/user_data/packages/sphone/js/config.js 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,5 +1,5 @@
-$(document).bind("mobileinit", function(){
- $.mobile.ajaxEnabled = false;
- $.mobile.pushStateEnabled = false;
- $.mobile.page.prototype.options.keepNative = "select, input, textarea.bar";
-});
+$(document).bind("mobileinit", function(){
+ $.mobile.ajaxEnabled = false;
+ $.mobile.pushStateEnabled = false;
+ $.mobile.page.prototype.options.keepNative = "select, input, textarea.bar";
+});
変更: branches/version-2_12-dev/html/user_data/packages/sphone/js/favorite.js
===================================================================
--- branches/version-2_12-dev/html/user_data/packages/sphone/js/favorite.js 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/html/user_data/packages/sphone/js/favorite.js 2013-02-18 08:58:21 UTC (rev 22564)
@@ -5,8 +5,8 @@
$.mobile.showPageLoadingMsg();
//送信データを準備
var postData = {};
- $("#form1").find(':input').each(function(){
- postData[$(this).attr('name')] = $(this).val();
+ $("#form1").find(':input').each(function(){
+ postData[$(this).attr('name')] = $(this).val();
});
postData["mode"] = "add_favorite_sphone";
postData["favorite_product_id"] = favoriteProductId;
変更: branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.autoResizeTextAreaQ-0.1.js
===================================================================
--- branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.autoResizeTextAreaQ-0.1.js 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.autoResizeTextAreaQ-0.1.js 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,118 +1 @@
-/*
- * jQuery autoResizeTextAreaQ plugin
- * @requires jQuery v1.4.2 or later
- *
- * Copyright (c) 2010 M. Brown (mbrowniebytes A gmail.com)
- * Licensed under the Revised BSD license:
- * http://www.opensource.org/licenses/bsd-license.php
- * http://en.wikipedia.org/wiki/BSD_licenses
- *
- * Versions:
- * 0.1 - 2010-07-21
- * initial
- *
- * usage:
- * $(document).ready( function() {
- * $('textarea').autoResizeTextAreaQ({"max_rows":8});
- * });
- *
- */
-
-(function($) {
-
-$.fn.autoResizeTextAreaQ = function(options) {
- var opts = $.extend({
- // ya prob want to use
- max_rows: 10, // # - max rows to resize too
-
- // ya may want to use, but defaults should be ok
- extra_rows: 1, // # - nbr extra rows after last line ie padding; 0|1 optimal
-
- // ya should really specify in html
- rows: null, // null|# - null infer from html; # override html
- cols: null, // null|# - null infer from html; # override html
-
- debug: false // true|false - turn on|off console.log()
- }, options);
-
- // extra padding based on browser
- if ($.browser.msie) {
- opts.extra_rows += 1;
- } else if ($.browser.webkit) {
- opts.extra_rows += 1;
- } // else $.browser.mozilla
-
- // iterate over passed in selector, only process actual textareas
- return $(this).filter('textarea').each(function(index) {
-
- var ta = $(this);
- var orig = {};
-
- // textarea rows cols current state
- if (opts.cols != null && opts.cols > 0) {
- ta.attr('cols', opts.cols);
- }
- orig.cols = ta.attr('cols');
-
- if (opts.rows != null && opts.rows > 0) {
- ta.attr('rows', opts.rows);
- }
- orig.rows = ta.attr('rows');
-
- // validate max extra_rows
- if (opts.max_rows == null || opts.max_rows < orig.rows) {
- opts.max_rows = orig.rows;
- }
- if (opts.extra_rows == null || opts.extra_rows < 0) {
- opts.extra_rows = 0;
- }
-
- if (opts.debug) {
- console.log('opts: ', opts, ' orig: ', orig);
- }
-
- // resize textares on load
- resize(ta, orig);
-
- // check resize on key input
- ta.bind('keyup', function(e) {
- resize(ta, orig);
- });
- }); // end each()
-
- function resize(ta, orig) {
-
- // nbr explicit rows
- var nl_rows = ta.val().split('\n');
-
- // nbr inferred rows
- var nbr_ta_rows = 0;
- for (index in nl_rows) {
- // overly simple check to account for text being auto wrapped and thus a new line
- nbr_ta_rows += Math.floor((nl_rows[index].length / orig.cols)) + 1;
- }
-
- // get final nbr ta rows
- var final_nbr_ta_rows = nbr_ta_rows - 1; // deduct for current line
- final_nbr_ta_rows += opts.extra_rows; // add on extra rows
-
- // resize textarea
- // note: $.animate() doesnt work well here since only inc/dec row by one
- if (final_nbr_ta_rows >= opts.max_rows) {
- ta.attr('rows', opts.max_rows);
-
- } else if (final_nbr_ta_rows >= orig.rows) {
- ta.attr('rows', final_nbr_ta_rows);
-
- } else {
- ta.attr('rows', orig.rows);
- }
-
- if (opts.debug) {
- console.log('rows: ', ta.attr('rows'), ' nbr nl_rows: ', nl_rows.length, ' nbr_ta_rows: ', nbr_ta_rows, ' final_nbr_ta_rows: ', final_nbr_ta_rows);
- }
- } // end resize()
-
-}; // end autoResizeTextAreaQ()
-
-})(jQuery);
+/* * jQuery autoResizeTextAreaQ plugin * @requires jQuery v1.4.2 or later * * Copyright (c) 2010 M. Brown (mbrowniebytes A gmail.com) * Licensed under the Revised BSD license: * http://www.opensource.org/licenses/bsd-license.php * http://en.wikipedia.org/wiki/BSD_licenses * * Versions: * 0.1 - 2010-07-21 * initial * * usage: * $(document).ready( function() { * $('textarea').autoResizeTextAreaQ({"max_rows":8}); * }); * */(function($) { $.fn.autoResizeTextAreaQ = function(options) { var opts = $.extend({ // ya prob want to use max_rows: 10, // # - max rows to resize too // ya may want to use, but defaults should be ok extra_rows: 1, // # - nbr extra rows after last line ie padding; 0|1 optimal // ya should really specify in html rows: null, // null|# - null infer from html; # override html cols: null, // null|# - null infer from html; # override html debug: false // true|false - turn on|off console.log() }, options); // extra padding based on browser if ($.browser.msie) { opts.extra_rows += 1; } else if ($.browser.webkit) { opts.extra_rows += 1; } // else $.browser.mozilla // iterate over passed in selector, only process actual textareas return $(this).filter('textarea').each(function(index) { var ta = $(this); var orig = {}; // textarea rows cols current state if (opts.cols != null && opts.cols > 0) { ta.attr('cols', opts.cols); } orig.cols = ta.attr('cols'); if (opts.rows != null && opts.rows > 0) { ta.attr('rows', opts.rows); } orig.rows = ta.attr('rows'); // validate max extra_rows if (opts.max_rows == null || opts.max_rows < orig.rows) { opts.max_rows = orig.rows; } if (opts.extra_rows == null || opts.extra_rows < 0) { opts.extra_rows = 0; } if (opts.debug) { console.log('opts: ', opts, ' orig: ', orig); } // resize textares on load resize(ta, orig); // check resize on key input ta.bind('keyup', function(e) { resize(ta, orig); }); }); // end each() function resize(ta, orig) { // nbr explicit rows var nl_rows = ta.val().split('\n'); // nbr inferred rows var nbr_ta_rows = 0; for (index in nl_rows) { // overly simple check to account for text being auto wrapped and thus a new line nbr_ta_rows += Math.floor((nl_rows[index].length / orig.cols)) + 1; } // get final nbr ta rows var final_nbr_ta_rows = nbr_ta_rows - 1; // deduct for current line final_nbr_ta_rows += opts.extra_rows; // add on extra rows // resize textarea // note: $.animate() doesnt work well here since only inc/dec row by one if (final_nbr_ta_rows >= opts.max_rows) { ta.attr('rows', opts.max_rows); } else if (final_nbr_ta_rows >= orig.rows) { ta.attr('rows', final_nbr_ta_rows); } else { ta.attr('rows', orig.rows); } if (opts.debug) { console.log('rows: ', ta.attr('rows'), ' nbr nl_rows: ', nl_rows.length, ' nbr_ta_rows: ', nbr_ta_rows, ' final_nbr_ta_rows: ', final_nbr_ta_rows); } } // end resize()}; // end autoResizeTextAreaQ()})(jQuery);
変更: branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.facebox/facebox.css
===================================================================
--- branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.facebox/facebox.css 2013-02-18 06:30:08 UTC (rev 22563)
+++ branches/version-2_12-dev/html/user_data/packages/sphone/js/jquery.facebox/facebox.css 2013-02-18 08:58:21 UTC (rev 22564)
@@ -1,86 +1,86 @@
-#facebox {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 100;
- text-align: left;
-}
-
-
-#facebox .popup{
- position:relative;
- border:3px solid rgba(0,0,0,0);
- -webkit-border-radius:5px;
- -moz-border-radius:5px;
- border-radius:5px;
- -webkit-box-shadow:0 0 18px rgba(0,0,0,0.4);
- -moz-box-shadow:0 0 18px rgba(0,0,0,0.4);
- box-shadow:0 0 18px rgba(0,0,0,0.4);
-}
-
-#facebox .content {
- display:table;
- width: 370px;
- padding: 10px;
- background: #fff;
- -webkit-border-radius:4px;
- -moz-border-radius:4px;
- border-radius:4px;
-}
-
-#facebox .content > p:first-child{
- margin-top:0;
-}
-#facebox .content > p:last-child{
- margin-bottom:0;
-}
-
-#facebox .close{
- position:absolute;
- top:5%;
- right:5%;
- padding:3px;
- background:#fff;
- border:#FFF solid 1px;
- border-radius: 16px;
--moz-border-radius: 16px;
--webkit-border-radius: 16px;
-}
-#facebox .close img{
- width:21px;
- height:20px;
- opacity:1.0;
-}
-#facebox .close:hover img{
- opacity:0.7;
-}
-
-#facebox .loading {
- text-align: center;
-}
-
-#facebox .image {
- text-align: center;
-}
-
-#facebox img {
- border: 0;
- margin: 0;
-}
-
-#facebox_overlay {
- position: fixed;
- top: 0px;
- left: 0px;
- height:100%;
- width:100%;
-}
-
-.facebox_hide {
- z-index:-100;
-}
-
-.facebox_overlayBG {
- background-color: #000;
- z-index: 99;
-}
+#facebox {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 100;
+ text-align: left;
+}
+
+
+#facebox .popup{
+ position:relative;
+ border:3px solid rgba(0,0,0,0);
+ -webkit-border-radius:5px;
+ -moz-border-radius:5px;
+ border-radius:5px;
+ -webkit-box-shadow:0 0 18px rgba(0,0,0,0.4);
+ -moz-box-shadow:0 0 18px rgba(0,0,0,0.4);
+ box-shadow:0 0 18px rgba(0,0,0,0.4);
+}
+
+#facebox .content {
+ display:table;
+ width: 370px;
+ padding: 10px;
+ background: #fff;
+ -webkit-border-radius:4px;
+ -moz-border-radius:4px;
+ border-radius:4px;
+}
+
+#facebox .content > p:first-child{
+ margin-top:0;
+}
+#facebox .content > p:last-child{
+ margin-bottom:0;
+}
+
+#facebox .close{
+ position:absolute;
+ top:5%;
+ right:5%;
+ padding:3px;
+ background:#fff;
+ border:#FFF solid 1px;
+ border-radius: 16px;
+-moz-border-radius: 16px;
+-webkit-border-radius: 16px;
+}
+#facebox .close img{
+ width:21px;
+ height:20px;
+ opacity:1.0;
+}
+#facebox .close:hover img{
+ opacity:0.7;
+}
+
+#facebox .loading {
+ text-align: center;
+}
+
+#facebox .image {
+ text-align: center;
+}
+
+#facebox img {
+ border: 0;
+ margin: 0;
+}
+
+#facebox_overlay {
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ height:100%;
+ width:100%;
+}
+
+.facebox_hide {
+ z-index:-100;
+}
+
+.facebox_overlayBG {
+ background-color: #000;
+ z-index: 99;
+}
Svn-src-all メーリングリストの案内