Index: branches/version-2_12-dev/data/class/SC_Batch.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_Batch.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/SC_Batch.php	(revision 21490)
@@ -0,0 +1,43 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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 Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class SC_Batch {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * バッチ処理を実行する
+     *
+     * @param mixed $argv コマンドライン引数
+     * @return mixed バッチの実行結果
+     */
+    function execute($argv = "") {}
+}
Index: branches/version-2_12-dev/data/class/SC_UploadFile.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_UploadFile.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/SC_UploadFile.php	(revision 21490)
@@ -21,7 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-$ownDir = realpath(dirname(__FILE__)) . '/';
-require_once $ownDir . '../module/gdthumb.php';
 
 /* アップロードファイル管理クラス */
Index: branches/version-2_12-dev/data/class/SC_SendMail.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_SendMail.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/SC_SendMail.php	(revision 21490)
@@ -21,6 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-require_once 'Mail.php';
 
 //--- テキスト/HTML　メール送信
Index: branches/version-2_12-dev/data/class/helper/SC_Helper_Mobile.php
===================================================================
--- branches/version-2_12-dev/data/class/helper/SC_Helper_Mobile.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/helper/SC_Helper_Mobile.php	(revision 21490)
@@ -21,8 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-// {{{ requires
-require_once CLASS_REALDIR . '../module/Net/URL.php';
-require_once CLASS_REALDIR . 'SC_Query.php';
 
 /**
Index: branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php
===================================================================
--- branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php	(revision 21490)
@@ -21,7 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-// {{{ requires
-require_once dirname(__FILE__) . '/../../module/Tar.php';
 
 /**
Index: branches/version-2_12-dev/data/class/SC_Query.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_Query.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/SC_Query.php	(revision 21490)
@@ -22,6 +22,4 @@
  */
 
-require_once realpath(dirname(__FILE__)) . '/../module/MDB2.php';
-
 /**
  * SQLの構築・実行を行う
Index: branches/version-2_12-dev/data/class/batch/SC_Batch_Update.php
===================================================================
--- branches/version-2_12-dev/data/class/batch/SC_Batch_Update.php	(revision 21479)
+++ branches/version-2_12-dev/data/class/batch/SC_Batch_Update.php	(revision 21490)
@@ -21,7 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-// {{{ requires
-require_once CLASS_REALDIR . 'batch/SC_Batch.php';
 
 /**
Index: branches/version-2_12-dev/data/class/batch/SC_Batch.php
===================================================================
--- branches/version-2_12-dev/data/class/batch/SC_Batch.php	(revision 21420)
+++ 	(revision )
@@ -1,43 +1,0 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2011 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 Page
- * @author LOCKON CO.,LTD.
- * @version $Id$
- */
-class SC_Batch {
-
-    // }}}
-    // {{{ functions
-
-    /**
-     * バッチ処理を実行する
-     *
-     * @param mixed $argv コマンドライン引数
-     * @return mixed バッチの実行結果
-     */
-    function execute($argv = "") {}
-}
Index: branches/version-2_12-dev/data/class/SC_SessionFactory.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_SessionFactory.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/SC_SessionFactory.php	(revision 21490)
@@ -0,0 +1,103 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+
+/**
+ * セッションの初期化処理を抽象化するファクトリークラス.
+ *
+ * このクラスはセッションの維持方法を管理するクラスです.
+ * 他のセッション管理クラスとは若干異なります.
+ *
+ * EC-CUBE2.1.1ベータ版から、
+ * 管理画面＞基本情報＞パラメーター管理で、セッションの維持方法を
+ * ・Cookieを使用する場合
+ * ・リクエストパラメーターを使用する場合
+ * の2種類が選択できますが、どちらの設定であっても下記のように呼び出すことで
+ * 適切にセッションを開始することができます.
+ *
+ * $sessionFactory = SC_SessionFactory::getInstance()
+ * $sessionFactory->initSession();
+ *
+ * @package SC_Session
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class SC_SessionFactory {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * パラメーター管理で設定したセッション維持設定に従って適切なオブジェクトを返す.
+     *
+     * @return SC_SessionFactory
+     */
+    function getInstance() {
+
+        $type = defined('SESSION_KEEP_METHOD')
+            ? SESSION_KEEP_METHOD
+            : '';
+
+        switch ($type) {
+        // セッションの維持にリクエストパラメーターを使用する
+        case 'useRequest':
+            $session = new SC_SessionFactory_UseRequest;
+            SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE
+                ? $session->setState('mobile')
+                : $session->setState('pc');
+            break;
+
+        // クッキーを使用する
+        case 'useCookie':
+            // モバイルの場合はSC_SessionFactory_UseRequestを使用する
+            if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
+                $session = new SC_SessionFactory_UseRequest;
+                $session->setState('mobile');
+                break;
+            }
+        default:
+            $session = new SC_SessionFactory_UseCookie;
+            break;
+        }
+
+        return $session;
+    }
+
+    /**
+     * セッションの初期化を行う.
+     *
+     */
+    function initSession() {}
+
+    /**
+     * Cookieを使用するかどうかを返す.
+     *
+     * @return boolean
+     */
+    function useCookie() {}
+
+}
+/*
+ * Local variables:
+ * coding: utf-8
+ * End:
+ */
Index: branches/version-2_12-dev/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php	(revision 21490)
@@ -1,4 +1,3 @@
 <?php
-require_once CLASS_REALDIR . '../module/Services/JSON.php';
 /**
  * Enter description here...
Index: branches/version-2_12-dev/data/class/pages/upgrade/LC_Page_Upgrade_Base.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/upgrade/LC_Page_Upgrade_Base.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/upgrade/LC_Page_Upgrade_Base.php	(revision 21490)
@@ -4,5 +4,4 @@
 require_once CLASS_REALDIR . 'pages/upgrade/helper/LC_Upgrade_Helper_Log.php';
 require_once CLASS_REALDIR . 'pages/upgrade/helper/LC_Upgrade_Helper_Json.php';
-require_once DATA_REALDIR . 'module/HTTP/Request.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/upgrade/LC_Page_Upgrade_Download.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/upgrade/LC_Page_Upgrade_Download.php	(revision 21441)
+++ branches/version-2_12-dev/data/class/pages/upgrade/LC_Page_Upgrade_Download.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_REALDIR . 'pages/upgrade/LC_Page_Upgrade_Base.php';
-require_once DATA_REALDIR . 'module/Tar.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_MainEdit.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_MainEdit.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_MainEdit.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php	(revision 21490)
@@ -24,6 +24,4 @@
   // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once DATA_REALDIR . 'module/Tar.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_UpDown.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_UpDown.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/design/LC_Page_Admin_Design_UpDown.php	(revision 21490)
@@ -24,6 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once DATA_REALDIR. 'module/Tar.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order.php	(revision 21490)
@@ -416,5 +416,4 @@
      */
     function doOutputCSV($where, $arrVal, $order) {
-        require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
         if ($where != "") {
             $where = " WHERE $where ";
Index: branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Pdf.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Pdf.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Pdf.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_REALDIR . 'SC_Fpdf.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php	(revision 21480)
+++ branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_CSV.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_CSV.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_CSV.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php	(revision 21490)
@@ -359,5 +359,4 @@
             }
         }
-        require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
         $objCSV = new SC_Helper_CSV_Ex();
         $objCSV->sfDownloadCsvFromSql($sql, array(), 'contents', $arrHeader, true);
Index: branches/version-2_12-dev/data/class/pages/admin/LC_Page_Admin_Home.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/LC_Page_Admin_Home.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/LC_Page_Admin_Home.php	(revision 21490)
@@ -25,5 +25,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once DATA_REALDIR . 'module/HTTP/Request.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once DATA_REALDIR . 'module/HTTP/Request.php';
 
 /** CSV ファイルの最大行数 */
@@ -346,5 +345,5 @@
    function lfDownloadZipFileFromJp() {
         // Proxy経由を可能とする。
-        // TODO Proxyの設定は「DATA_REALDIR . 'module/HTTP/Request.php'」内の「function HTTP_Request」へ記述する。いずれは、外部設定としたい。
+        // TODO Proxyの設定は「data/module/HTTP/Request.php」内の「function HTTP_Request」へ記述する。いずれは、外部設定としたい。
         $req = new HTTP_Request();
 
Index: branches/version-2_12-dev/data/class/pages/admin/customer/LC_Page_Admin_Customer.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/customer/LC_Page_Admin_Customer.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/customer/LC_Page_Admin_Customer.php	(revision 21490)
@@ -226,5 +226,4 @@
         $order = "update_date DESC, customer_id DESC";
 
-        require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
         $objCSV = new SC_Helper_CSV_Ex();
         list($where, $arrVal) = $objSelect->getWhere();
Index: branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products.php	(revision 21490)
@@ -136,6 +136,4 @@
                     // CSVを送信する。
                     case 'csv':
-                        require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
-
                         $objCSV = new SC_Helper_CSV_Ex();
                         // CSVを送信する。正常終了の場合、終了。
Index: branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Review.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Review.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Review.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php	(revision 21490)
@@ -23,7 +23,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_REALDIR . 'graph/SC_GraphPie.php';
-require_once CLASS_REALDIR . 'graph/SC_GraphLine.php';
-require_once CLASS_REALDIR . 'graph/SC_GraphBar.php';
 
 /**
@@ -317,5 +314,5 @@
                 $interval = 1;
             }
-            $objGraphLine = new SC_GraphLine();
+            $objGraphLine = new SC_Graph_Line();
 
             // 値のセット
@@ -369,5 +366,5 @@
             $path = GRAPH_REALDIR . $pngname;
 
-            $objGraphPie = new SC_GraphPie();
+            $objGraphPie = new SC_Graph_Pie();
 
             // データをセットする
@@ -411,5 +408,5 @@
             $path = GRAPH_REALDIR . $pngname;
 
-            $objGraphBar = new SC_GraphBar();
+            $objGraphBar = new SC_Graph_Bar();
 
             foreach (array_keys($arrList) as $val) {
Index: branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_FileManager_Ex.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Bkup.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Bkup.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Bkup.php	(revision 21490)
@@ -24,6 +24,5 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
-require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
-require_once DATA_REALDIR. 'module/Tar.php';
+
 /**
  * バックアップ のページクラス.
Index: branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php	(revision 21479)
+++ branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php	(revision 21490)
@@ -23,7 +23,5 @@
 
 // {{{ requires
-$current_dir = realpath(dirname(__FILE__));
 define('CALENDAR_ROOT', DATA_REALDIR.'module/Calendar'.DIRECTORY_SEPARATOR);
-require_once $current_dir . '/../../../../module/Calendar/Month/Weekdays.php';
 require_once CLASS_REALDIR . 'pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php';
 
Index: branches/version-2_12-dev/data/class/pages/LC_Page_ResizeImage.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/LC_Page_ResizeImage.php	(revision 21456)
+++ branches/version-2_12-dev/data/class/pages/LC_Page_ResizeImage.php	(revision 21490)
@@ -24,5 +24,4 @@
 // {{{ requires
 require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
-require_once DATA_REALDIR . 'module/gdthumb.php';
 
 /**
Index: branches/version-2_12-dev/data/class/pages/LC_Page.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/LC_Page.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/pages/LC_Page.php	(revision 21490)
@@ -21,7 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-// {{{ requires
-require_once DATA_REALDIR . 'module/Net/URL.php';
 
 /**
Index: branches/version-2_12-dev/data/class/SC_MobileUserAgent.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_MobileUserAgent.php	(revision 21438)
+++ branches/version-2_12-dev/data/class/SC_MobileUserAgent.php	(revision 21490)
@@ -21,5 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-require_once dirname(__FILE__) . '/../module/Net/UserAgent/Mobile.php';
 
 /**
Index: branches/version-2_12-dev/data/class/graph/SC_Graph_Line.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_Graph_Line.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/graph/SC_Graph_Line.php	(revision 21490)
@@ -0,0 +1,305 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+
+// 折れ線グラフ生成クラス
+class SC_Graph_Line extends SC_Graph_Base{
+    var $area_width;
+    var $area_height;
+    var $ygrid_on;
+    var $graph_max;     // グラフのエリア最大値(Y軸頂点の値)
+    var $arrXLabel;
+    var $XLabelAngle;   // X軸ラベル角度
+    var $XTitle;        // X軸タイトル
+    var $YTitle;        // Y軸タイトル
+    var $arrDataList;   // グラフデータを格納
+    var $arrPointList;  // 折れ線座標を格納
+    var $line_max;      // 複数の描画の場合に加算していく
+
+    var $x_margin;
+    var $y_margin;
+
+    // コンストラクタ
+    function SC_Graph_Line(
+        $bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP,
+        $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
+        parent::SC_Graph_Base($bgw, $bgh, $left, $top);
+        $this->area_width = $area_width;
+        $this->area_height = $area_height;
+        $this->ygrid_on = true;
+        $this->line_max = 0;
+        $this->graph_max = 0;
+        $this->XLabelAngle = 0;
+        $this->x_margin = 0;
+        $this->y_margin = 0;
+    }
+
+    // X軸ラベルの角度セット
+    function setXLabelAngle($Angle) {
+        $this->XLabelAngle = $Angle;
+    }
+
+    // Y軸タイトル
+    function drawYTitle() {
+        // Y軸にタイトルを入れる
+        if ($this->YTitle != "") {
+            $text_width = $this->getTextWidth($this->YTitle, FONT_SIZE);
+            $x_pos = $this->left - ($text_width / 2);
+            $y_pos = $this->top - FONT_SIZE - LINE_YTITLE_PAD;
+            $this->setText(FONT_SIZE, $x_pos, $y_pos, $this->YTitle);
+        }
+    }
+
+    // X軸タイトル
+    function drawXTitle() {
+        // Y軸にタイトルを入れる
+        if ($this->XTitle != "") {
+            $text_width = $this->getTextWidth($this->XTitle, FONT_SIZE);
+            $x_pos = $this->left + $this->area_width - ($text_width / 2) + 30;
+            $y_pos = $this->top + $this->area_height + LINE_XTITLE_PAD;
+            $this->setText(FONT_SIZE, $x_pos, $y_pos, $this->XTitle);
+        }
+    }
+
+    // Y軸の描画
+    function drawYLine() {
+        imageline($this->image, $this->left, $this->top, $this->left, $this->top + $this->area_height, $this->flame_color);
+        // 目盛り幅を求める(中間点は自動)
+        $size = $this->area_height / (LINE_Y_SCALE * 2);
+        // 上から目盛りを入れていく
+        $pos = 0;
+        for ($i = 0; $i < (LINE_Y_SCALE * 2); $i++) {
+            // 目盛り幅
+            if (($i % 2) == 0) {
+                $sw = LINE_SCALE_SIZE;
+                if ($this->ygrid_on) {
+                    imageline($this->image, $this->left, $this->top + $pos, $this->left + $this->area_width, $this->top + $pos, $this->grid_color);
+                }
+            } else {
+                $sw = LINE_SCALE_SIZE / 2;
+            }
+            imageline($this->image, $this->left, $this->top + $pos, $this->left + $sw, $this->top + $pos, $this->flame_color);
+            $pos += $size;
+        }
+        // Y軸に目盛り値を入れる
+        $this->setYScale();
+        $this->drawYTitle();
+    }
+
+    // X軸の描画
+    function drawXLine($bar = false) {
+        imageline($this->image, $this->left, $this->top + $this->area_height, $this->left + $this->area_width, $this->top + $this->area_height, $this->flame_color);
+        $arrPointList = $this->arrPointList[0];
+        $count = count($arrPointList);
+
+        // 棒グラフの場合は半目盛りずらす
+        if ($bar) {
+            $half_scale = intval($this->area_width / ($count + 1) / 2);
+        } else {
+            $half_scale = 0;
+        }
+
+        // ラベルの表示インターバルを算出
+        $interval = ceil($count / LINE_XLABEL_MAX); // 切り上げ
+        for ($i = 0; $i < $count; $i++) {
+            // X軸に目盛りを入れる
+            $x = $arrPointList[$i][0];
+            $pos = $this->top + $this->area_height;
+            imageline($this->image, $x - $half_scale, $pos, $x - $half_scale, $pos - LINE_SCALE_SIZE,  $this->flame_color);
+            // ラベルを入れる
+            if (($i % $interval) == 0) {
+                $text_width = $this->getTextWidth($this->arrXLabel[$i], FONT_SIZE);
+                $x_pos = $x;
+
+                if ($bar) {
+                    $bar_margin = -15;
+                } else {
+                    $bar_margin = 0;
+                }
+
+                $this->setText(FONT_SIZE, $x_pos + $this->x_margin + $bar_margin, $pos + FONT_SIZE + $this->y_margin, $this->arrXLabel[$i], NULL, $this->XLabelAngle);
+            }
+        }
+
+        // 棒グラフの場合は最後の目盛りを一つ追加する
+        if ($bar) {
+            imageline($this->image, $x + $half_scale, $pos, $x + $half_scale, $pos - LINE_SCALE_SIZE,  $this->flame_color);
+        }
+
+        $this->drawXTitle();
+    }
+
+    // グリッド表示
+    function setYGridOn($ygrid_on) {
+        $this->ygrid_on = $ygrid_on;
+    }
+
+    // ポイントの描画
+    function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) {
+        // 偶数に変換しておく
+        $size += $size % 2;
+        $array = array(
+            $left, $top - ($size / 2),
+            $left + ($size / 2), $top,
+            $left, $top + ($size / 2),
+            $left - ($size / 2), $top,
+        );
+        imagefilledpolygon($this->image, $array, 4, $this->arrColor[$line_no]);
+        imagepolygon($this->image, $array, 4, $this->flame_color);
+        imagesetpixel ($this->image, $left, $top + ($size / 2), $this->flame_color);
+    }
+
+    // Y軸目盛りに値を入れる
+    function setYScale() {
+        // 1目盛りの値
+        $number = intval($this->graph_max / LINE_Y_SCALE);
+        // 目盛り幅を求める
+        $size = $this->area_height / LINE_Y_SCALE;
+        $pos = 0;
+        for ($i = 0; $i <= LINE_Y_SCALE; $i++) {
+            $snumber = $number * (LINE_Y_SCALE - $i);
+            $disp_number = number_format($snumber);
+            $num_width = $this->getTextWidth($disp_number, FONT_SIZE);
+            $this->setText(FONT_SIZE, $this->left - $num_width - 2, $this->top + $pos - (FONT_SIZE / 2), $disp_number);
+            $pos += $size;
+        }
+    }
+
+    //
+    function setMax($arrData) {
+        // データの最大値を取得する。
+        $data_max = max($arrData);
+        // 10の何倍かを取得
+        $figure = strlen($data_max) - 1;
+        // 次の桁を計算する
+        $tenval = pow(10, $figure);
+        // グラフ上での最大値を求める
+        $this->graph_max = $tenval * (intval($data_max / $tenval) + 1);
+        // 最大値が10未満の場合の対応
+        if ($this->graph_max < 10) {
+            $this->graph_max = 10;
+        }
+    }
+
+    // グラフの描画
+    function drawGraph() {
+        // グラフ背景を描画
+        $this->drawYLine();
+        $this->drawXLine();
+
+        // 折れ線グラフ描画
+        for ($i = 0; $i < $this->line_max; $i++) {
+            $this->drawLine($i);
+        }
+
+        // マークを描画
+        for ($i = 0; $i < $this->line_max; $i++) {
+            $this->drawMark($i);
+        }
+
+        // ラベルを描画
+        for ($i = 0; $i < $this->line_max; $i++) {
+            $this->drawLabel($i);
+        }
+
+        // 凡例の描画
+        $this->drawLegend();
+    }
+
+    // ラインを描画する
+    function drawLine($line_no) {
+        $arrPointList = $this->arrPointList[$line_no];
+
+        $count = count($arrPointList);
+        for ($i = 0; $i < $count; $i++) {
+            $x = $arrPointList[$i][0];
+            $y = $arrPointList[$i][1];
+            if (isset($arrPointList[$i + 1])) {
+                $next_x = $arrPointList[$i + 1][0];
+                $next_y = $arrPointList[$i + 1][1];
+                imageline($this->image, $x, $y, $next_x, $next_y, $this->arrColor[$line_no]);
+            }
+        }
+    }
+
+    // マークを描画する
+    function drawMark($line_no) {
+        $arrPointList = $this->arrPointList[$line_no];
+        $count = count($arrPointList);
+        for ($i = 0; $i < $count; $i++) {
+            $x = $arrPointList[$i][0];
+            $y = $arrPointList[$i][1];
+            $this->setMark($line_no, $x, $y);
+        }
+    }
+
+    // ラベルを描画する
+    function drawLabel($line_no) {
+        $arrData = $this->arrDataList[$line_no];
+        $arrPointList = $this->arrPointList[$line_no];
+        $count = count($arrPointList);
+        for ($i = 0; $i < $count; $i++) {
+            $x = $arrPointList[$i][0];
+            $y = $arrPointList[$i][1];
+            $text_width = $this->getTextWidth(number_format($arrData[$i]), FONT_SIZE);
+            $y_pos = $y - FONT_SIZE - 5;
+            $x_pos = $x - $text_width / 2;
+            $this->setText(FONT_SIZE, $x_pos, $y_pos, number_format($arrData[$i]));
+        }
+    }
+
+    // データをセットする
+    function setData($arrData) {
+        $this->arrDataList[$this->line_max] = array_values((array)$arrData);
+        $this->setMax($this->arrDataList[$this->line_max]);
+        // 値の描画変換率
+        $rate = $this->area_height / $this->graph_max;
+        // 描画率を計算
+        $count = count($this->arrDataList[$this->line_max]);
+        $scale_width = $this->area_width / ($count + 1);
+        $this->arrPointList[$this->line_max] = array();
+        for ($i = 0; $i < $count; $i++) {
+            // X座標を求める
+            $x = intval($this->left + ($scale_width * ($i + 1)));
+            // Y座標を求める
+            $y = intval($this->top + $this->area_height - ($this->arrDataList[$this->line_max][$i] * $rate));
+            // XY座標を保存する
+            $this->arrPointList[$this->line_max][] = array($x, $y);
+        }
+        $this->line_max++;
+    }
+
+    // X軸ラベルをセットする
+    function setXLabel($arrXLabel) {
+        $this->arrXLabel = array_values((array)$arrXLabel);
+    }
+
+    // X軸タイトルをセットする
+    function setXTitle($title) {
+        $this->XTitle = $title;
+    }
+
+    // Y軸タイトルをセットする
+    function setYTitle($title) {
+        $this->YTitle = $title;
+    }
+}
Index: branches/version-2_12-dev/data/class/graph/SC_Graph_Base.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_Graph_Base.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/graph/SC_Graph_Base.php	(revision 21490)
@@ -0,0 +1,484 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+
+/** TTFフォントファイル */
+define('FONT_REALFILE', DATA_REALDIR . "fonts/wlmaru20044.ttf");
+
+/** フォントサイズ */
+define('FONT_SIZE', 8);
+
+/** タイトルフォントサイズ */
+define('TITLE_FONT_SIZE', 11);
+
+/** 背景幅 */
+define('BG_WIDTH', 720);
+
+/** 背景高さ */
+define('BG_HEIGHT', 400);
+
+/** 行間 */
+define('LINE_PAD', 5);
+
+/** フォント補正値(実際の描画幅/フォントサイズ) */
+define('TEXT_RATE', 0.75);
+
+// -----------------------------------------------------------------------------
+// 円グラフ
+// -----------------------------------------------------------------------------
+/** 円グラフ位置 */
+define('PIE_LEFT', 200);
+
+/** 円グラフ位置 */
+define('PIE_TOP', 150);
+
+/** 円グラフ幅 */
+define('PIE_WIDTH', 230);
+
+/** 円グラフ高さ */
+define('PIE_HEIGHT', 100);
+
+/** 円グラフ太さ */
+define('PIE_THICK', 30);
+
+/** 円グラフのラベル位置を上にあげる */
+define('PIE_LABEL_UP', 20);
+
+/** 値が大きいほど影が長くなる */
+define('PIE_SHADE_IMPACT', 0.1);
+
+// -----------------------------------------------------------------------------
+// 折れ線グラフ
+// -----------------------------------------------------------------------------
+/** Y軸の目盛り数 */
+define('LINE_Y_SCALE', 10);
+
+/** X軸の目盛り数 */
+define('LINE_X_SCALE', 10);
+
+/** 線グラフ位置 */
+define('LINE_LEFT', 60);
+
+/** 線グラフ位置 */
+define('LINE_TOP', 50);
+
+/** 線グラフ背景のサイズ */
+define('LINE_AREA_WIDTH', 600);
+
+/** 線グラフ背景のサイズ */
+define('LINE_AREA_HEIGHT', 300);
+
+/** 線グラフマークのサイズ */
+define('LINE_MARK_SIZE', 6);
+
+/** 目盛り幅 */
+define('LINE_SCALE_SIZE', 6);
+
+/** X軸のラベルの表示制限数 */
+define('LINE_XLABEL_MAX', 30);
+
+/** X軸のタイトルと軸の間隔 */
+define('LINE_XTITLE_PAD', -5);
+
+/** Y軸のタイトルと軸の間隔 */
+define('LINE_YTITLE_PAD', 15);
+
+// -----------------------------------------------------------------------------
+//  棒グラフ
+// -----------------------------------------------------------------------------
+/** グラフと目盛りの間隔 */
+define('BAR_PAD', 6);
+
+// -----------------------------------------------------------------------------
+//  タイトルラベル
+// -----------------------------------------------------------------------------
+/** 背景枠との上幅 */
+define('TITLE_TOP', 10);
+
+// -----------------------------------------------------------------------------
+//  凡例
+// -----------------------------------------------------------------------------
+/** 背景枠との上幅 */
+define('LEGEND_TOP', 10);
+
+/** 背景枠との右幅 */
+define('LEGEND_RIGHT', 10);
+
+/**
+ * SC_Graph 共通クラス.
+ *
+ * @package Graph
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class SC_Graph_Base {
+
+    // {{{ properties
+
+    var $arrRGB;
+    var $arrColor;
+    var $arrDarkColor;
+    var $image;
+    var $left;
+    var $top;
+    var $shade_color;
+    var $flame_color;
+    var $shade_on;
+    var $text_color;
+    var $labelbg_color;
+    var $bgw;
+    var $bgh;
+    var $clabelbg_color;
+    var $title_color;
+    var $text_top;
+    var $mark_color;
+    var $arrLegend;
+
+    /** グラフ背景 */
+    var $ARR_GRAPH_RGB;
+
+    /** 背景色 */
+    var $ARR_BG_COLOR;
+
+    /** 影の色 */
+    var $ARR_SHADE_COLOR;
+
+    /** 縁の色 */
+    var $ARR_FLAME_COLOR;
+
+    /** 文字色 */
+    var $ARR_TEXT_COLOR;
+
+    /** ラベル背景 */
+    var $ARR_LABELBG_COLOR;
+
+    /** 凡例背景 */
+    var $ARR_LEGENDBG_COLOR;
+
+    /** タイトル文字色 */
+    var $ARR_TITLE_COLOR;
+
+    /** グリッド線色 */
+    var $ARR_GRID_COLOR;
+
+    // コンストラクタ
+    function SC_Graph_Base($bgw, $bgh, $left, $top) {
+        $this->init();
+        // 画像作成
+        $this->bgw = $bgw;
+        $this->bgh = $bgh;
+        $this->image = imagecreatetruecolor($bgw, $bgh);
+        // アンチエイリアス有効
+        if (function_exists('imageantialias')) imageantialias($this->image, true);
+        // 背景色をセット
+        imagefill($this->image, 0, 0, $this->lfGetImageColor($this->image, $this->ARR_BG_COLOR));
+
+        // 使用色の生成
+        $this->setColorList($this->ARR_GRAPH_RGB);
+        // グラフ描画位置の設定
+        $this->left = $left;
+        $this->top = $top;
+        $this->shade_color = $this->lfGetImageColor($this->image, $this->ARR_SHADE_COLOR);
+        $this->flame_color = $this->lfGetImageColor($this->image, $this->ARR_FLAME_COLOR);
+        $this->text_color = $this->lfGetImageColor($this->image, $this->ARR_TEXT_COLOR);
+        $this->labelbg_color = $this->lfGetImageColor($this->image, $this->ARR_LABELBG_COLOR);
+        $this->clabelbg_color = $this->lfGetImageColor($this->image, $this->ARR_LEGENDBG_COLOR);
+        $this->title_color = $this->lfGetImageColor($this->image, $this->ARR_TITLE_COLOR);
+        $this->grid_color = $this->lfGetImageColor($this->image, $this->ARR_GRID_COLOR);
+
+        // 影あり
+        $this->shade_on = true;
+    }
+
+    // リサンプル(画像を滑らかに縮小する)
+    function resampled() {
+        $new_width = $this->bgw * 0.8;
+        $new_height = $this->bgh * 0.8;
+        $tmp_image = imagecreatetruecolor($new_width, $new_height);
+        if (imagecopyresampled($tmp_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->bgw, $this->bgh)) {
+            $this->image = $tmp_image;
+        }
+    }
+
+    // オブジェクトカラーの設定
+    function setColorList($arrRGB) {
+        $this->arrRGB = $arrRGB;
+        $count = count($this->arrRGB);
+        // 通常色の設定
+        for ($i = 0; $i < $count; $i++) {
+            $this->arrColor[$i] = $this->lfGetImageColor($this->image, $this->arrRGB[$i]);
+        }
+        // 暗色の設定
+        for ($i = 0; $i < $count; $i++) {
+            $this->arrDarkColor[$i] = $this->lfGetImageDarkColor($this->image, $this->arrRGB[$i]);
+        }
+    }
+
+    // 影のありなし
+    function setShadeOn($shade_on) {
+        $this->shade_on = $shade_on;
+    }
+
+    // 画像を出力する
+    function outputGraph($header = true, $filename = "") {
+        if ($header) {
+            header('Content-type: image/png');
+        }
+
+        if ($filename != "") {
+            imagepng($this->image, $filename);
+        } else {
+            imagepng($this->image);
+        }
+
+        imagedestroy($this->image);
+    }
+
+    // 描画時のテキスト幅を求める
+    function getTextWidth($text, $font_size) {
+        $text_len = strlen($text);
+        $ret = $font_size * $text_len * TEXT_RATE;
+        /*
+            ※正確な値が取得できなかったので廃止
+            // テキスト幅の取得
+            $arrPos = imagettfbbox($font_size, 0, FONT_REALFILE, $text);
+            $ret = $arrPos[2] - $arrPos[0];
+        */
+        return $ret;
+    }
+
+    // テキストを出力する
+    function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) {
+        // 時計回りに角度を変更
+        $angle = -$angle;
+        // ラベル背景
+        if ($labelbg) {
+            $text_width = $this->getTextWidth($text, $font_size);
+            imagefilledrectangle($this->image, $left - 2, $top - 2, $left + $text_width + 2, $top + $font_size + 2, $this->labelbg_color);
+        }
+        /*
+         * XXX EUC-JP にしないと Warning がでる.
+         *     --enable-gd-jis-conv も関係していそうだが, このオプションを
+         *     つけなくても出る.
+         *
+         *     Warning: imagettftext() [function.imagettftext]:
+         *     any2eucjp(): something happen in
+         *
+         *     PHP Bugs: #42218
+         *
+         *     http://www.php.net/imagettftext を見ると, UTF-8 にしろと
+         *     書いてあるのに...
+         *
+         */
+        $text = mb_convert_encoding($text, "EUC-JP", CHAR_CODE);
+        //$text = mb_convert_encoding($text, CHAR_CODE);
+        if ($color != NULL) {
+            ImageTTFText($this->image, $font_size, $angle, $left, $top + $font_size, $color, FONT_REALFILE, $text);
+        } else {
+            ImageTTFText($this->image, $font_size, $angle, $left, $top + $font_size, $this->text_color, FONT_REALFILE, $text);
+        }
+    }
+
+    // タイトルを出力する
+    function drawTitle($text, $font_size = TITLE_FONT_SIZE) {
+        // 出力位置の算出
+        $text_width = $this->getTextWidth($text, $font_size);
+        $left = ($this->bgw - $text_width) / 2;
+        $top = TITLE_TOP;
+        $this->setText($font_size, $left, $top, $text, $this->title_color);
+    }
+
+    // ログを出力する
+    function debugPrint($text) {
+        $text = mb_convert_encoding($text, "UTF-8", CHAR_CODE);
+        if (!isset($this->text_top)) {
+            $this->text_top = FONT_SIZE + LINE_PAD;
+        }
+        // テキスト描画
+        ImageTTFText($this->image, FONT_SIZE, 0, LINE_PAD, $this->text_top, $this->text_color, FONT_REALFILE, $text);
+        $this->text_top += FONT_SIZE + LINE_PAD;
+    }
+
+    // カラーラベルを描画
+    function drawLegend($legend_max = "", $clabelbg = true) {
+        // 凡例が登録されていなければ中止
+        if (count($this->arrLegend) <= 0) {
+            return;
+        }
+
+        if ($legend_max != "") {
+            $label_max = $legend_max;
+        } else {
+            $label_max = count($this->arrLegend);
+        }
+
+        $height_max = 0;
+        $text_max = 0;
+        $width_max = 0;
+
+        // 一番文字数が多いものを取得
+        for ($i = 0; $i < $label_max; $i++) {
+            $text_len = strlen($this->arrLegend[$i]);
+            if ($text_max < $text_len) {
+                $text_max = $text_len;
+            }
+            $height_max += FONT_SIZE + LINE_PAD;
+        }
+        $width_max = FONT_SIZE * $text_max * TEXT_RATE;
+
+        //  カラーアイコンと文字間を含めた幅
+        $width_max += FONT_SIZE + (LINE_PAD * 2);
+        $left = $this->bgw - $width_max - LEGEND_RIGHT;
+        $top = LEGEND_TOP;
+        // カラーラベル背景の描画
+        if ($clabelbg) {
+            $this->drawClabelBG($left - LINE_PAD, $top, $left + $width_max, $top + $height_max + LINE_PAD);
+        }
+        $top += LINE_PAD;
+
+        // 色数の取得
+        $c_max = count($this->arrColor);
+        for ($i = 0; $i < $label_max; $i++) {
+            // カラーアイコンの表示
+            imagerectangle($this->image, $left, $top, $left + FONT_SIZE, $top + FONT_SIZE, $this->flame_color);
+            imagefilledrectangle($this->image, $left + 1, $top + 1, $left + FONT_SIZE - 1, $top + FONT_SIZE - 1, $this->arrColor[($i % $c_max)]);
+            // ラベルの表示
+            $this->setText(FONT_SIZE, $left + FONT_SIZE + LINE_PAD, $top, $this->arrLegend[$i]);
+            $top += FONT_SIZE + LINE_PAD;
+        }
+    }
+
+    // カラーラベル背景の描画
+    function drawClabelBG($left, $top, $right, $bottom) {
+        // 影の描画
+        if ($this->shade_on) {
+            imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom + 2, $this->shade_color);
+        }
+        // カラーラベル背景の描画
+        imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->clabelbg_color);
+        imagerectangle($this->image, $left, $top, $right, $bottom, $this->flame_color);
+    }
+
+    // 凡例をセットする
+    function setLegend($arrLegend) {
+        $this->arrLegend = array_values((array)$arrLegend);
+    }
+
+    // }}}
+    // {{{ protected functions
+
+    /**
+     * クラスの初期化を行う.
+     *
+     * 表示色をメンバ変数にセットする.
+     *
+     * @access protected
+     * @return void
+     */
+    function init() {
+        // 凡例背景
+        $this->ARR_LEGENDBG_COLOR = array(245,245,245);
+        // ラベル背景
+        $this->ARR_LABELBG_COLOR = array(255,255,255);
+        // グラフカラー
+        $this->ARR_GRAPH_RGB = array(
+                               array(200,50,50),
+                               array(50,50,200),
+                               array(50,200,50),
+                               array(255,255,255),
+                               array(244,200,200),
+                               array(200,200,255),
+                               array(50,200,50),
+                               array(255,255,255),
+                               array(244,244,244),
+                               );
+        // 影の色
+        $this->ARR_SHADE_COLOR = array(100,100,100);
+        // 縁の色
+        $this->ARR_FLAME_COLOR = array(0, 0, 0);
+        // 文字色
+        $this->ARR_TEXT_COLOR = array(0, 0, 0);
+        // 背景カラー
+        $this->ARR_BG_COLOR = array(255,255,255);
+        // タイトル文字色
+        $this->ARR_TITLE_COLOR = array(0, 0, 0);
+        // グリッド線色
+        $this->ARR_GRID_COLOR = array(200, 200, 200);
+        // マークの色
+        $this->ARR_MARK_COLOR = array(130, 130, 255);
+    }
+
+    /**
+     * 円の中心点と直径から弧の終端座標を算出する.
+     *
+     * @param integer $cx 中心点X座標
+     * @param integer $cy 中心点Y座標
+     * @param integer $r 半径
+     * @param integer $e 角度
+     * @return array 円の中心点と直径から弧の終端座標の配列
+     */
+    function lfGetArcPos($cx, $cy, $cw, $ch, $e) {
+        // 三角関数用の角度を求める
+        $s = 90 - $e;
+        $r = $cw / 2;
+        // 位置を求める
+        $x = $cx + ($r * cos(deg2rad($s)));
+        $y = $cy - (($r * sin(deg2rad($s))) * ($ch / $cw));
+        return array(round($x), round($y));
+    }
+
+    /** 画像にテキストを描画する */
+    function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) {
+        $color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]);
+        $text = mb_convert_encoding($text, "UTF-8", CHAR_CODE);
+        // 表示角度
+        $angle = 0;
+        // テキスト描画
+        ImageTTFText($dst_image, $font_size, $angle, $left, $top, $color, $font, $text);
+    }
+
+    /** 表示色の取得 */
+    function lfGetImageColor($image, $array) {
+        if (count($array) != 3) {
+            return NULL;
+        }
+        $ret = imagecolorallocate($image, $array[0], $array[1], $array[2]);
+        return $ret;
+    }
+
+    /** 影用表示色の取得 */
+    function lfGetImageDarkColor($image, $array) {
+        if (count($array) != 3) {
+            return NULL;
+        }
+        $i = 0;
+        foreach ($array as $val) {
+            $dark[$i] = $val - 45;
+            if ($dark[$i] < 0) {
+                $dark[$i] = 0;
+            }
+            $i++;
+        }
+        $ret = imagecolorallocate($image, $dark[0], $dark[1], $dark[2]);
+        return $ret;
+    }
+}
Index: branches/version-2_12-dev/data/class/graph/SC_Graph_Pie.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_Graph_Pie.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/graph/SC_Graph_Pie.php	(revision 21490)
@@ -0,0 +1,214 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+
+// 円グラフ生成クラス
+class SC_Graph_Pie extends SC_Graph_Base{
+    var $cw;
+    var $ch;
+    var $cz;
+    var $cx;
+    var $cy;
+    var $arrLabel;
+    var $arrData;
+
+    // コンストラクタ
+    function SC_Graph_Pie($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, $top = PIE_TOP) {
+        parent::SC_Graph_Base($bgw, $bgh, $left, $top);
+        // サイズ設定
+        $this->setSize(PIE_WIDTH, PIE_HEIGHT, PIE_THICK);
+        // 位置設定
+        $this->setPosition($this->left + ($this->cw / 2), $this->top + ($this->ch / 2));
+    }
+
+    // データを360°値に変換する
+    function getCircleData($array) {
+        $total = "";
+        $new_total = "";
+        if (!is_array($array)) {
+            return;
+        }
+        $arrRet = array();
+        foreach ($array as $val) {
+            $total += $val;
+        }
+        if ($total <= 0) {
+            return;
+        }
+        $rate = 360 / $total;
+        // ラベル表示用
+        $p_rate = 100 / $total;
+        $cnt = 0;
+        foreach ($array as $val) {
+            $ret = round($val * $rate);
+            $new_total+= $ret;
+            $arrRet[] = $ret;
+            // パーセント表示用
+            $this->arrLabel[] = round($val * $p_rate) . " %";
+            $cnt++;
+        }
+        // 合計が360になるように補正しておく
+        $arrRet[0] -= $new_total - 360;
+        return $arrRet;
+    }
+
+    // 円の位置設定を行う
+    function setPosition($cx, $cy) {
+        $this->cx = $cx;
+        $this->cy = $cy;
+    }
+
+    // 円のサイズ設定を行う
+    function setSize($cw, $ch, $cz = 0) {
+        $this->cw = $cw;
+        $this->ch = $ch;
+        $this->cz = $cz;
+    }
+
+    // 影の描画
+    function drawShade() {
+        $move = 1;
+        for ($i = ($this->cy + $this->cz); $i <= ($this->cy + $this->cz + ($this->cz * PIE_SHADE_IMPACT)); $i++) {
+            imagefilledarc($this->image, $this->cx + $move, $i, $this->cw, $this->ch, 0, 360, $this->shade_color, IMG_ARC_PIE);
+            $move += 0.5;
+        }
+    }
+
+    // データをセットする
+    function setData($arrData) {
+        $this->arrData = array_values($arrData);
+    }
+
+    // 円グラフを描画する
+    function drawGraph() {
+        $x = $this->cx;
+        $y = $this->cy;
+        $z = $this->cz;
+        $h = $this->ch;
+        $w = $this->cw;
+
+        // データの角度を取得する
+        $arrRad = $this->getCircleData($this->arrData);
+        $rd_max = count($arrRad);
+
+        // データが存在しない場合
+        if ($rd_max <= 0) {
+            return;
+        }
+
+        // 影の描画
+        if ($this->shade_on) {
+            $this->drawShade();
+        }
+
+        // 色数の取得
+        $c_max = count($this->arrColor);
+        $dc_max = count($this->arrDarkColor);
+
+        // 側面の描画
+        for ($i = ($y + $z - 1); $i >= $y; $i--) {
+            $start = 0;
+            for ($j = 0; $j < $rd_max; $j++) {
+                // 角度が0度以上の場合のみ側面を描画する。
+                if ($arrRad[$j] > 0) {
+                    $end = $start + $arrRad[$j];
+                    if ($start == 0 && $end == 360) {
+                        // -90~270で指定すると円が描画できないので0~360に指定
+                        imagearc($this->image, $x, $i, $w, $h, 0, 360, $this->arrDarkColor[($j % $dc_max)]);
+                    } else {
+                        // -90°は12時の位置から開始するように補正している
+                        imagearc($this->image, $x, $i, $w, $h, $start - 90, $end - 90, $this->arrDarkColor[($j % $dc_max)]);
+                    }
+                    $start = $end;
+                }
+            }
+        }
+        // 底面の描画
+        imagearc($this->image, $x, $y + $z, $w, $h, 0, 180 , $this->flame_color);
+
+        // 上面の描画
+        $start = 0;
+        for ($i = 0; $i < $rd_max; $i++) {
+            $end = $start + $arrRad[$i];
+            if ($start == 0 && $end == 360) {
+                // -90~270で指定すると円が描画できないので0~360に指定
+                imagefilledarc($this->image, $x, $y, $w, $h, 0, 360, $this->arrColor[($i % $c_max)], IMG_ARC_PIE);
+            } else {
+                // -90°は12時の位置から開始するように補正している。
+                imagefilledarc($this->image, $x, $y, $w, $h, $start - 90, $end - 90, $this->arrColor[($i % $c_max)], IMG_ARC_PIE);
+            }
+            $start = $end;
+        }
+
+        // 上面の縁取り
+        $start = 0;
+        for ($i = 0; $i < $rd_max; $i++) {
+            $end = $start + $arrRad[$i];
+            if ($start == 0 && $end == 360) {
+                // -90~270で指定すると円が描画できないので0~360に指定
+                imagearc($this->image, $x, $y, $w, $h, 0, 360 , $this->flame_color);
+            }
+            // -90°は12時の位置から開始するように補正している。
+            imagefilledarc($this->image, $x, $y, $w, $h, $start - 90, $end - 90, $this->flame_color, IMG_ARC_EDGED|IMG_ARC_NOFILL);
+            $start = $end;
+        }
+
+        // 側面の縁取り
+        imageline($this->image, $x + ($w / 2), $y, $x + ($w / 2), $y + $z, $this->flame_color);
+        imageline($this->image, $x - ($w / 2), $y, $x - ($w / 2), $y + $z, $this->flame_color);
+        $start = 0;
+        for ($i = 0; $i < $rd_max; $i++) {
+            $end = $start + $arrRad[$i];
+            // 前面のみ
+            if ($end > 90 && $end < 270) {
+                list($ax, $ay) = $this->lfGetArcPos($x, $y, $w, $h, $end);
+                // ラインのずれを補正する
+                if ($end > 180) {
+                    $ax = $ax + 1;
+                }
+                imageline($this->image, $ax, $ay, $ax, $ay + $z, $this->flame_color);
+            }
+            $start = $end;
+        }
+
+        // ラベルの描画
+        $this->drawLabel($arrRad);
+        // 凡例の描画
+        $this->drawLegend(count($this->arrData));
+    }
+
+    // 円グラフのラベルを描画する
+    function drawLabel($arrRad) {
+        $rd_max = count($arrRad);
+        $start = 0;
+        for ($i = 0; $i < $rd_max; $i++) {
+            $center = $start + ($arrRad[$i] / 2);
+            $end = $start + $arrRad[$i];
+            list($sx, $sy) = $this->lfGetArcPos($this->cx, $this->cy, ($this->cw / 1.5), ($this->ch / 1.5), $center);
+            list($ex, $ey) = $this->lfGetArcPos($this->cx, $this->cy, ($this->cw * 1.5), ($this->ch * 1.5), $center);
+            // 指示線の描画
+            imageline($this->image, $sx, $sy, $ex + 2, $ey - PIE_LABEL_UP, $this->flame_color);
+            $this->setText(FONT_SIZE, $ex - 10, $ey - PIE_LABEL_UP - FONT_SIZE, $this->arrLabel[$i], NULL, 0, true);
+            $start = $end;
+        }
+    }
+}
Index: branches/version-2_12-dev/data/class/graph/SC_Graph_Bar.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_Graph_Bar.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/graph/SC_Graph_Bar.php	(revision 21490)
@@ -0,0 +1,96 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+
+// 棒グラフ生成クラス
+class SC_Graph_Bar extends SC_Graph_Line{
+    // コンストラクタ
+    function SC_Graph_Line(
+        $bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP,
+        $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
+        parent::SC_Graph_Line($bgw, $bgh, $left, $top, $area_width, $area_height);
+    }
+
+    // グラフの描画
+    function drawGraph() {
+        $this->drawYLine();
+        $this->drawXLine(true);
+
+        // 棒グラフの描画
+        for ($i = 0; $i < $this->line_max; $i++) {
+            $this->drawBar($i);
+        }
+
+        // ラベルの描画
+        for ($i = 0; $i < $this->line_max; $i++) {
+            $this->drawLabel($i);
+        }
+
+        // 凡例の描画
+        $this->drawLegend();
+    }
+
+    // 棒グラフの描画
+    function drawBar($line_no) {
+        $arrPointList = $this->arrPointList[$line_no];
+        // データ数を数える
+        $count = count($arrPointList);
+        // 半目盛りの幅を求める
+        $half_scale = intval($this->area_width / ($count + 1) / 2);
+        // 目盛りの幅を求める
+        $scale_width = intval($this->area_width / ($count + 1));
+        // 棒グラフのサイズを求める
+        $bar_width = intval(($scale_width - (BAR_PAD * 2)) / $this->line_max);
+        // 色数の取得
+        $c_max = count($this->arrColor);
+        for ($i = 0; $i < $count; $i++) {
+            $left = $arrPointList[$i][0] - $half_scale + BAR_PAD + ($bar_width * $line_no);
+            $top = $arrPointList[$i][1];
+            $right = $left + $bar_width;
+            $bottom = $this->top + $this->area_height;
+
+            // 影の描画
+            if ($this->shade_on) {
+                imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom, $this->shade_color);
+            }
+            //imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->arrColor[($i % $c_max)]);
+            imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->arrColor[$line_no]);
+            imagerectangle($this->image, $left, $top, $right, $bottom, $this->flame_color);
+        }
+    }
+
+    // ラベルを描画する
+    function drawLabel($line_no) {
+        $arrData = $this->arrDataList[$line_no];
+        $arrPointList = $this->arrPointList[$line_no];
+        $count = count($arrPointList);
+        for ($i = 0; $i < $count; $i++) {
+            $x = $arrPointList[$i][0];
+            $y = $arrPointList[$i][1];
+            $text_width = $this->getTextWidth(number_format($arrData[$i]), FONT_SIZE);
+            $y_pos = $y - FONT_SIZE - 5;
+            $x_pos = $x - $text_width / 2;
+            $this->setText(FONT_SIZE, $x_pos, $y_pos, number_format($arrData[$i]));
+        }
+    }
+
+}
Index: branches/version-2_12-dev/data/class/graph/SC_GraphBar.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_GraphBar.php	(revision 21441)
+++ 	(revision )
@@ -1,99 +1,0 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2011 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.
- */
-
-$ownDir = realpath(dirname(__FILE__)) . '/';
-require_once $ownDir . 'SC_GraphLine.php';
-
-// 棒グラフ生成クラス
-class SC_GraphBar extends SC_GraphLine{
-    // コンストラクタ
-    function SC_GraphLine(
-        $bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP,
-        $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
-        parent::SC_GraphLine($bgw, $bgh, $left, $top, $area_width, $area_height);
-    }
-
-    // グラフの描画
-    function drawGraph() {
-        $this->drawYLine();
-        $this->drawXLine(true);
-
-        // 棒グラフの描画
-        for ($i = 0; $i < $this->line_max; $i++) {
-            $this->drawBar($i);
-        }
-
-        // ラベルの描画
-        for ($i = 0; $i < $this->line_max; $i++) {
-            $this->drawLabel($i);
-        }
-
-        // 凡例の描画
-        $this->drawLegend();
-    }
-
-    // 棒グラフの描画
-    function drawBar($line_no) {
-        $arrPointList = $this->arrPointList[$line_no];
-        // データ数を数える
-        $count = count($arrPointList);
-        // 半目盛りの幅を求める
-        $half_scale = intval($this->area_width / ($count + 1) / 2);
-        // 目盛りの幅を求める
-        $scale_width = intval($this->area_width / ($count + 1));
-        // 棒グラフのサイズを求める
-        $bar_width = intval(($scale_width - (BAR_PAD * 2)) / $this->line_max);
-        // 色数の取得
-        $c_max = count($this->arrColor);
-        for ($i = 0; $i < $count; $i++) {
-            $left = $arrPointList[$i][0] - $half_scale + BAR_PAD + ($bar_width * $line_no);
-            $top = $arrPointList[$i][1];
-            $right = $left + $bar_width;
-            $bottom = $this->top + $this->area_height;
-
-            // 影の描画
-            if ($this->shade_on) {
-                imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom, $this->shade_color);
-            }
-            //imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->arrColor[($i % $c_max)]);
-            imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->arrColor[$line_no]);
-            imagerectangle($this->image, $left, $top, $right, $bottom, $this->flame_color);
-        }
-    }
-
-    // ラベルを描画する
-    function drawLabel($line_no) {
-        $arrData = $this->arrDataList[$line_no];
-        $arrPointList = $this->arrPointList[$line_no];
-        $count = count($arrPointList);
-        for ($i = 0; $i < $count; $i++) {
-            $x = $arrPointList[$i][0];
-            $y = $arrPointList[$i][1];
-            $text_width = $this->getTextWidth(number_format($arrData[$i]), FONT_SIZE);
-            $y_pos = $y - FONT_SIZE - 5;
-            $x_pos = $x - $text_width / 2;
-            $this->setText(FONT_SIZE, $x_pos, $y_pos, number_format($arrData[$i]));
-        }
-    }
-
-}
Index: branches/version-2_12-dev/data/class/graph/SC_GraphLine.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_GraphLine.php	(revision 21441)
+++ 	(revision )
@@ -1,308 +1,0 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2011 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.
- */
-
-$ownDir = realpath(dirname(__FILE__)) . '/';
-require_once $ownDir . 'SC_GraphBase.php';
-
-// 折れ線グラフ生成クラス
-class SC_GraphLine extends SC_GraphBase{
-    var $area_width;
-    var $area_height;
-    var $ygrid_on;
-    var $graph_max;     // グラフのエリア最大値(Y軸頂点の値)
-    var $arrXLabel;
-    var $XLabelAngle;   // X軸ラベル角度
-    var $XTitle;        // X軸タイトル
-    var $YTitle;        // Y軸タイトル
-    var $arrDataList;   // グラフデータを格納
-    var $arrPointList;  // 折れ線座標を格納
-    var $line_max;      // 複数の描画の場合に加算していく
-
-    var $x_margin;
-    var $y_margin;
-
-    // コンストラクタ
-    function SC_GraphLine(
-        $bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP,
-        $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
-        parent::SC_GraphBase($bgw, $bgh, $left, $top);
-        $this->area_width = $area_width;
-        $this->area_height = $area_height;
-        $this->ygrid_on = true;
-        $this->line_max = 0;
-        $this->graph_max = 0;
-        $this->XLabelAngle = 0;
-        $this->x_margin = 0;
-        $this->y_margin = 0;
-    }
-
-    // X軸ラベルの角度セット
-    function setXLabelAngle($Angle) {
-        $this->XLabelAngle = $Angle;
-    }
-
-    // Y軸タイトル
-    function drawYTitle() {
-        // Y軸にタイトルを入れる
-        if ($this->YTitle != "") {
-            $text_width = $this->getTextWidth($this->YTitle, FONT_SIZE);
-            $x_pos = $this->left - ($text_width / 2);
-            $y_pos = $this->top - FONT_SIZE - LINE_YTITLE_PAD;
-            $this->setText(FONT_SIZE, $x_pos, $y_pos, $this->YTitle);
-        }
-    }
-
-    // X軸タイトル
-    function drawXTitle() {
-        // Y軸にタイトルを入れる
-        if ($this->XTitle != "") {
-            $text_width = $this->getTextWidth($this->XTitle, FONT_SIZE);
-            $x_pos = $this->left + $this->area_width - ($text_width / 2) + 30;
-            $y_pos = $this->top + $this->area_height + LINE_XTITLE_PAD;
-            $this->setText(FONT_SIZE, $x_pos, $y_pos, $this->XTitle);
-        }
-    }
-
-    // Y軸の描画
-    function drawYLine() {
-        imageline($this->image, $this->left, $this->top, $this->left, $this->top + $this->area_height, $this->flame_color);
-        // 目盛り幅を求める(中間点は自動)
-        $size = $this->area_height / (LINE_Y_SCALE * 2);
-        // 上から目盛りを入れていく
-        $pos = 0;
-        for ($i = 0; $i < (LINE_Y_SCALE * 2); $i++) {
-            // 目盛り幅
-            if (($i % 2) == 0) {
-                $sw = LINE_SCALE_SIZE;
-                if ($this->ygrid_on) {
-                    imageline($this->image, $this->left, $this->top + $pos, $this->left + $this->area_width, $this->top + $pos, $this->grid_color);
-                }
-            } else {
-                $sw = LINE_SCALE_SIZE / 2;
-            }
-            imageline($this->image, $this->left, $this->top + $pos, $this->left + $sw, $this->top + $pos, $this->flame_color);
-            $pos += $size;
-        }
-        // Y軸に目盛り値を入れる
-        $this->setYScale();
-        $this->drawYTitle();
-    }
-
-    // X軸の描画
-    function drawXLine($bar = false) {
-        imageline($this->image, $this->left, $this->top + $this->area_height, $this->left + $this->area_width, $this->top + $this->area_height, $this->flame_color);
-        $arrPointList = $this->arrPointList[0];
-        $count = count($arrPointList);
-
-        // 棒グラフの場合は半目盛りずらす
-        if ($bar) {
-            $half_scale = intval($this->area_width / ($count + 1) / 2);
-        } else {
-            $half_scale = 0;
-        }
-
-        // ラベルの表示インターバルを算出
-        $interval = ceil($count / LINE_XLABEL_MAX); // 切り上げ
-        for ($i = 0; $i < $count; $i++) {
-            // X軸に目盛りを入れる
-            $x = $arrPointList[$i][0];
-            $pos = $this->top + $this->area_height;
-            imageline($this->image, $x - $half_scale, $pos, $x - $half_scale, $pos - LINE_SCALE_SIZE,  $this->flame_color);
-            // ラベルを入れる
-            if (($i % $interval) == 0) {
-                $text_width = $this->getTextWidth($this->arrXLabel[$i], FONT_SIZE);
-                $x_pos = $x;
-
-                if ($bar) {
-                    $bar_margin = -15;
-                } else {
-                    $bar_margin = 0;
-                }
-
-                $this->setText(FONT_SIZE, $x_pos + $this->x_margin + $bar_margin, $pos + FONT_SIZE + $this->y_margin, $this->arrXLabel[$i], NULL, $this->XLabelAngle);
-            }
-        }
-
-        // 棒グラフの場合は最後の目盛りを一つ追加する
-        if ($bar) {
-            imageline($this->image, $x + $half_scale, $pos, $x + $half_scale, $pos - LINE_SCALE_SIZE,  $this->flame_color);
-        }
-
-        $this->drawXTitle();
-    }
-
-    // グリッド表示
-    function setYGridOn($ygrid_on) {
-        $this->ygrid_on = $ygrid_on;
-    }
-
-    // ポイントの描画
-    function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) {
-        // 偶数に変換しておく
-        $size += $size % 2;
-        $array = array(
-            $left, $top - ($size / 2),
-            $left + ($size / 2), $top,
-            $left, $top + ($size / 2),
-            $left - ($size / 2), $top,
-        );
-        imagefilledpolygon($this->image, $array, 4, $this->arrColor[$line_no]);
-        imagepolygon($this->image, $array, 4, $this->flame_color);
-        imagesetpixel ($this->image, $left, $top + ($size / 2), $this->flame_color);
-    }
-
-    // Y軸目盛りに値を入れる
-    function setYScale() {
-        // 1目盛りの値
-        $number = intval($this->graph_max / LINE_Y_SCALE);
-        // 目盛り幅を求める
-        $size = $this->area_height / LINE_Y_SCALE;
-        $pos = 0;
-        for ($i = 0; $i <= LINE_Y_SCALE; $i++) {
-            $snumber = $number * (LINE_Y_SCALE - $i);
-            $disp_number = number_format($snumber);
-            $num_width = $this->getTextWidth($disp_number, FONT_SIZE);
-            $this->setText(FONT_SIZE, $this->left - $num_width - 2, $this->top + $pos - (FONT_SIZE / 2), $disp_number);
-            $pos += $size;
-        }
-    }
-
-    //
-    function setMax($arrData) {
-        // データの最大値を取得する。
-        $data_max = max($arrData);
-        // 10の何倍かを取得
-        $figure = strlen($data_max) - 1;
-        // 次の桁を計算する
-        $tenval = pow(10, $figure);
-        // グラフ上での最大値を求める
-        $this->graph_max = $tenval * (intval($data_max / $tenval) + 1);
-        // 最大値が10未満の場合の対応
-        if ($this->graph_max < 10) {
-            $this->graph_max = 10;
-        }
-    }
-
-    // グラフの描画
-    function drawGraph() {
-        // グラフ背景を描画
-        $this->drawYLine();
-        $this->drawXLine();
-
-        // 折れ線グラフ描画
-        for ($i = 0; $i < $this->line_max; $i++) {
-            $this->drawLine($i);
-        }
-
-        // マークを描画
-        for ($i = 0; $i < $this->line_max; $i++) {
-            $this->drawMark($i);
-        }
-
-        // ラベルを描画
-        for ($i = 0; $i < $this->line_max; $i++) {
-            $this->drawLabel($i);
-        }
-
-        // 凡例の描画
-        $this->drawLegend();
-    }
-
-    // ラインを描画する
-    function drawLine($line_no) {
-        $arrPointList = $this->arrPointList[$line_no];
-
-        $count = count($arrPointList);
-        for ($i = 0; $i < $count; $i++) {
-            $x = $arrPointList[$i][0];
-            $y = $arrPointList[$i][1];
-            if (isset($arrPointList[$i + 1])) {
-                $next_x = $arrPointList[$i + 1][0];
-                $next_y = $arrPointList[$i + 1][1];
-                imageline($this->image, $x, $y, $next_x, $next_y, $this->arrColor[$line_no]);
-            }
-        }
-    }
-
-    // マークを描画する
-    function drawMark($line_no) {
-        $arrPointList = $this->arrPointList[$line_no];
-        $count = count($arrPointList);
-        for ($i = 0; $i < $count; $i++) {
-            $x = $arrPointList[$i][0];
-            $y = $arrPointList[$i][1];
-            $this->setMark($line_no, $x, $y);
-        }
-    }
-
-    // ラベルを描画する
-    function drawLabel($line_no) {
-        $arrData = $this->arrDataList[$line_no];
-        $arrPointList = $this->arrPointList[$line_no];
-        $count = count($arrPointList);
-        for ($i = 0; $i < $count; $i++) {
-            $x = $arrPointList[$i][0];
-            $y = $arrPointList[$i][1];
-            $text_width = $this->getTextWidth(number_format($arrData[$i]), FONT_SIZE);
-            $y_pos = $y - FONT_SIZE - 5;
-            $x_pos = $x - $text_width / 2;
-            $this->setText(FONT_SIZE, $x_pos, $y_pos, number_format($arrData[$i]));
-        }
-    }
-
-    // データをセットする
-    function setData($arrData) {
-        $this->arrDataList[$this->line_max] = array_values((array)$arrData);
-        $this->setMax($this->arrDataList[$this->line_max]);
-        // 値の描画変換率
-        $rate = $this->area_height / $this->graph_max;
-        // 描画率を計算
-        $count = count($this->arrDataList[$this->line_max]);
-        $scale_width = $this->area_width / ($count + 1);
-        $this->arrPointList[$this->line_max] = array();
-        for ($i = 0; $i < $count; $i++) {
-            // X座標を求める
-            $x = intval($this->left + ($scale_width * ($i + 1)));
-            // Y座標を求める
-            $y = intval($this->top + $this->area_height - ($this->arrDataList[$this->line_max][$i] * $rate));
-            // XY座標を保存する
-            $this->arrPointList[$this->line_max][] = array($x, $y);
-        }
-        $this->line_max++;
-    }
-
-    // X軸ラベルをセットする
-    function setXLabel($arrXLabel) {
-        $this->arrXLabel = array_values((array)$arrXLabel);
-    }
-
-    // X軸タイトルをセットする
-    function setXTitle($title) {
-        $this->XTitle = $title;
-    }
-
-    // Y軸タイトルをセットする
-    function setYTitle($title) {
-        $this->YTitle = $title;
-    }
-}
Index: branches/version-2_12-dev/data/class/graph/SC_GraphBase.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_GraphBase.php	(revision 21480)
+++ 	(revision )
@@ -1,484 +1,0 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2011 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.
- */
-
-/** TTFフォントファイル */
-define('FONT_REALFILE', DATA_REALDIR . "fonts/wlmaru20044.ttf");
-
-/** フォントサイズ */
-define('FONT_SIZE', 8);
-
-/** タイトルフォントサイズ */
-define('TITLE_FONT_SIZE', 11);
-
-/** 背景幅 */
-define('BG_WIDTH', 720);
-
-/** 背景高さ */
-define('BG_HEIGHT', 400);
-
-/** 行間 */
-define('LINE_PAD', 5);
-
-/** フォント補正値(実際の描画幅/フォントサイズ) */
-define('TEXT_RATE', 0.75);
-
-// -----------------------------------------------------------------------------
-// 円グラフ
-// -----------------------------------------------------------------------------
-/** 円グラフ位置 */
-define('PIE_LEFT', 200);
-
-/** 円グラフ位置 */
-define('PIE_TOP', 150);
-
-/** 円グラフ幅 */
-define('PIE_WIDTH', 230);
-
-/** 円グラフ高さ */
-define('PIE_HEIGHT', 100);
-
-/** 円グラフ太さ */
-define('PIE_THICK', 30);
-
-/** 円グラフのラベル位置を上にあげる */
-define('PIE_LABEL_UP', 20);
-
-/** 値が大きいほど影が長くなる */
-define('PIE_SHADE_IMPACT', 0.1);
-
-// -----------------------------------------------------------------------------
-// 折れ線グラフ
-// -----------------------------------------------------------------------------
-/** Y軸の目盛り数 */
-define('LINE_Y_SCALE', 10);
-
-/** X軸の目盛り数 */
-define('LINE_X_SCALE', 10);
-
-/** 線グラフ位置 */
-define('LINE_LEFT', 60);
-
-/** 線グラフ位置 */
-define('LINE_TOP', 50);
-
-/** 線グラフ背景のサイズ */
-define('LINE_AREA_WIDTH', 600);
-
-/** 線グラフ背景のサイズ */
-define('LINE_AREA_HEIGHT', 300);
-
-/** 線グラフマークのサイズ */
-define('LINE_MARK_SIZE', 6);
-
-/** 目盛り幅 */
-define('LINE_SCALE_SIZE', 6);
-
-/** X軸のラベルの表示制限数 */
-define('LINE_XLABEL_MAX', 30);
-
-/** X軸のタイトルと軸の間隔 */
-define('LINE_XTITLE_PAD', -5);
-
-/** Y軸のタイトルと軸の間隔 */
-define('LINE_YTITLE_PAD', 15);
-
-// -----------------------------------------------------------------------------
-//  棒グラフ
-// -----------------------------------------------------------------------------
-/** グラフと目盛りの間隔 */
-define('BAR_PAD', 6);
-
-// -----------------------------------------------------------------------------
-//  タイトルラベル
-// -----------------------------------------------------------------------------
-/** 背景枠との上幅 */
-define('TITLE_TOP', 10);
-
-// -----------------------------------------------------------------------------
-//  凡例
-// -----------------------------------------------------------------------------
-/** 背景枠との上幅 */
-define('LEGEND_TOP', 10);
-
-/** 背景枠との右幅 */
-define('LEGEND_RIGHT', 10);
-
-/**
- * SC_Graph共通クラス.
- *
- * @package Graph
- * @author LOCKON CO.,LTD.
- * @version $Id$
- */
-class SC_GraphBase {
-
-    // {{{ properties
-
-    var $arrRGB;
-    var $arrColor;
-    var $arrDarkColor;
-    var $image;
-    var $left;
-    var $top;
-    var $shade_color;
-    var $flame_color;
-    var $shade_on;
-    var $text_color;
-    var $labelbg_color;
-    var $bgw;
-    var $bgh;
-    var $clabelbg_color;
-    var $title_color;
-    var $text_top;
-    var $mark_color;
-    var $arrLegend;
-
-    /** グラフ背景 */
-    var $ARR_GRAPH_RGB;
-
-    /** 背景色 */
-    var $ARR_BG_COLOR;
-
-    /** 影の色 */
-    var $ARR_SHADE_COLOR;
-
-    /** 縁の色 */
-    var $ARR_FLAME_COLOR;
-
-    /** 文字色 */
-    var $ARR_TEXT_COLOR;
-
-    /** ラベル背景 */
-    var $ARR_LABELBG_COLOR;
-
-    /** 凡例背景 */
-    var $ARR_LEGENDBG_COLOR;
-
-    /** タイトル文字色 */
-    var $ARR_TITLE_COLOR;
-
-    /** グリッド線色 */
-    var $ARR_GRID_COLOR;
-
-    // コンストラクタ
-    function SC_GraphBase($bgw, $bgh, $left, $top) {
-        $this->init();
-        // 画像作成
-        $this->bgw = $bgw;
-        $this->bgh = $bgh;
-        $this->image = imagecreatetruecolor($bgw, $bgh);
-        // アンチエイリアス有効
-        if (function_exists('imageantialias')) imageantialias($this->image, true);
-        // 背景色をセット
-        imagefill($this->image, 0, 0, $this->lfGetImageColor($this->image, $this->ARR_BG_COLOR));
-
-        // 使用色の生成
-        $this->setColorList($this->ARR_GRAPH_RGB);
-        // グラフ描画位置の設定
-        $this->left = $left;
-        $this->top = $top;
-        $this->shade_color = $this->lfGetImageColor($this->image, $this->ARR_SHADE_COLOR);
-        $this->flame_color = $this->lfGetImageColor($this->image, $this->ARR_FLAME_COLOR);
-        $this->text_color = $this->lfGetImageColor($this->image, $this->ARR_TEXT_COLOR);
-        $this->labelbg_color = $this->lfGetImageColor($this->image, $this->ARR_LABELBG_COLOR);
-        $this->clabelbg_color = $this->lfGetImageColor($this->image, $this->ARR_LEGENDBG_COLOR);
-        $this->title_color = $this->lfGetImageColor($this->image, $this->ARR_TITLE_COLOR);
-        $this->grid_color = $this->lfGetImageColor($this->image, $this->ARR_GRID_COLOR);
-
-        // 影あり
-        $this->shade_on = true;
-    }
-
-    // リサンプル(画像を滑らかに縮小する)
-    function resampled() {
-        $new_width = $this->bgw * 0.8;
-        $new_height = $this->bgh * 0.8;
-        $tmp_image = imagecreatetruecolor($new_width, $new_height);
-        if (imagecopyresampled($tmp_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->bgw, $this->bgh)) {
-            $this->image = $tmp_image;
-        }
-    }
-
-    // オブジェクトカラーの設定
-    function setColorList($arrRGB) {
-        $this->arrRGB = $arrRGB;
-        $count = count($this->arrRGB);
-        // 通常色の設定
-        for ($i = 0; $i < $count; $i++) {
-            $this->arrColor[$i] = $this->lfGetImageColor($this->image, $this->arrRGB[$i]);
-        }
-        // 暗色の設定
-        for ($i = 0; $i < $count; $i++) {
-            $this->arrDarkColor[$i] = $this->lfGetImageDarkColor($this->image, $this->arrRGB[$i]);
-        }
-    }
-
-    // 影のありなし
-    function setShadeOn($shade_on) {
-        $this->shade_on = $shade_on;
-    }
-
-    // 画像を出力する
-    function outputGraph($header = true, $filename = "") {
-        if ($header) {
-            header('Content-type: image/png');
-        }
-
-        if ($filename != "") {
-            imagepng($this->image, $filename);
-        } else {
-            imagepng($this->image);
-        }
-
-        imagedestroy($this->image);
-    }
-
-    // 描画時のテキスト幅を求める
-    function getTextWidth($text, $font_size) {
-        $text_len = strlen($text);
-        $ret = $font_size * $text_len * TEXT_RATE;
-        /*
-            ※正確な値が取得できなかったので廃止
-            // テキスト幅の取得
-            $arrPos = imagettfbbox($font_size, 0, FONT_REALFILE, $text);
-            $ret = $arrPos[2] - $arrPos[0];
-        */
-        return $ret;
-    }
-
-    // テキストを出力する
-    function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) {
-        // 時計回りに角度を変更
-        $angle = -$angle;
-        // ラベル背景
-        if ($labelbg) {
-            $text_width = $this->getTextWidth($text, $font_size);
-            imagefilledrectangle($this->image, $left - 2, $top - 2, $left + $text_width + 2, $top + $font_size + 2, $this->labelbg_color);
-        }
-        /*
-         * XXX EUC-JP にしないと Warning がでる.
-         *     --enable-gd-jis-conv も関係していそうだが, このオプションを
-         *     つけなくても出る.
-         *
-         *     Warning: imagettftext() [function.imagettftext]:
-         *     any2eucjp(): something happen in
-         *
-         *     PHP Bugs: #42218
-         *
-         *     http://www.php.net/imagettftext を見ると, UTF-8 にしろと
-         *     書いてあるのに...
-         *
-         */
-        $text = mb_convert_encoding($text, "EUC-JP", CHAR_CODE);
-        //$text = mb_convert_encoding($text, CHAR_CODE);
-        if ($color != NULL) {
-            ImageTTFText($this->image, $font_size, $angle, $left, $top + $font_size, $color, FONT_REALFILE, $text);
-        } else {
-            ImageTTFText($this->image, $font_size, $angle, $left, $top + $font_size, $this->text_color, FONT_REALFILE, $text);
-        }
-    }
-
-    // タイトルを出力する
-    function drawTitle($text, $font_size = TITLE_FONT_SIZE) {
-        // 出力位置の算出
-        $text_width = $this->getTextWidth($text, $font_size);
-        $left = ($this->bgw - $text_width) / 2;
-        $top = TITLE_TOP;
-        $this->setText($font_size, $left, $top, $text, $this->title_color);
-    }
-
-    // ログを出力する
-    function debugPrint($text) {
-        $text = mb_convert_encoding($text, "UTF-8", CHAR_CODE);
-        if (!isset($this->text_top)) {
-            $this->text_top = FONT_SIZE + LINE_PAD;
-        }
-        // テキスト描画
-        ImageTTFText($this->image, FONT_SIZE, 0, LINE_PAD, $this->text_top, $this->text_color, FONT_REALFILE, $text);
-        $this->text_top += FONT_SIZE + LINE_PAD;
-    }
-
-    // カラーラベルを描画
-    function drawLegend($legend_max = "", $clabelbg = true) {
-        // 凡例が登録されていなければ中止
-        if (count($this->arrLegend) <= 0) {
-            return;
-        }
-
-        if ($legend_max != "") {
-            $label_max = $legend_max;
-        } else {
-            $label_max = count($this->arrLegend);
-        }
-
-        $height_max = 0;
-        $text_max = 0;
-        $width_max = 0;
-
-        // 一番文字数が多いものを取得
-        for ($i = 0; $i < $label_max; $i++) {
-            $text_len = strlen($this->arrLegend[$i]);
-            if ($text_max < $text_len) {
-                $text_max = $text_len;
-            }
-            $height_max += FONT_SIZE + LINE_PAD;
-        }
-        $width_max = FONT_SIZE * $text_max * TEXT_RATE;
-
-        //  カラーアイコンと文字間を含めた幅
-        $width_max += FONT_SIZE + (LINE_PAD * 2);
-        $left = $this->bgw - $width_max - LEGEND_RIGHT;
-        $top = LEGEND_TOP;
-        // カラーラベル背景の描画
-        if ($clabelbg) {
-            $this->drawClabelBG($left - LINE_PAD, $top, $left + $width_max, $top + $height_max + LINE_PAD);
-        }
-        $top += LINE_PAD;
-
-        // 色数の取得
-        $c_max = count($this->arrColor);
-        for ($i = 0; $i < $label_max; $i++) {
-            // カラーアイコンの表示
-            imagerectangle($this->image, $left, $top, $left + FONT_SIZE, $top + FONT_SIZE, $this->flame_color);
-            imagefilledrectangle($this->image, $left + 1, $top + 1, $left + FONT_SIZE - 1, $top + FONT_SIZE - 1, $this->arrColor[($i % $c_max)]);
-            // ラベルの表示
-            $this->setText(FONT_SIZE, $left + FONT_SIZE + LINE_PAD, $top, $this->arrLegend[$i]);
-            $top += FONT_SIZE + LINE_PAD;
-        }
-    }
-
-    // カラーラベル背景の描画
-    function drawClabelBG($left, $top, $right, $bottom) {
-        // 影の描画
-        if ($this->shade_on) {
-            imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom + 2, $this->shade_color);
-        }
-        // カラーラベル背景の描画
-        imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->clabelbg_color);
-        imagerectangle($this->image, $left, $top, $right, $bottom, $this->flame_color);
-    }
-
-    // 凡例をセットする
-    function setLegend($arrLegend) {
-        $this->arrLegend = array_values((array)$arrLegend);
-    }
-
-    // }}}
-    // {{{ protected functions
-
-    /**
-     * クラスの初期化を行う.
-     *
-     * 表示色をメンバ変数にセットする.
-     *
-     * @access protected
-     * @return void
-     */
-    function init() {
-        // 凡例背景
-        $this->ARR_LEGENDBG_COLOR = array(245,245,245);
-        // ラベル背景
-        $this->ARR_LABELBG_COLOR = array(255,255,255);
-        // グラフカラー
-        $this->ARR_GRAPH_RGB = array(
-                               array(200,50,50),
-                               array(50,50,200),
-                               array(50,200,50),
-                               array(255,255,255),
-                               array(244,200,200),
-                               array(200,200,255),
-                               array(50,200,50),
-                               array(255,255,255),
-                               array(244,244,244),
-                               );
-        // 影の色
-        $this->ARR_SHADE_COLOR = array(100,100,100);
-        // 縁の色
-        $this->ARR_FLAME_COLOR = array(0, 0, 0);
-        // 文字色
-        $this->ARR_TEXT_COLOR = array(0, 0, 0);
-        // 背景カラー
-        $this->ARR_BG_COLOR = array(255,255,255);
-        // タイトル文字色
-        $this->ARR_TITLE_COLOR = array(0, 0, 0);
-        // グリッド線色
-        $this->ARR_GRID_COLOR = array(200, 200, 200);
-        // マークの色
-        $this->ARR_MARK_COLOR = array(130, 130, 255);
-    }
-
-    /**
-     * 円の中心点と直径から弧の終端座標を算出する.
-     *
-     * @param integer $cx 中心点X座標
-     * @param integer $cy 中心点Y座標
-     * @param integer $r 半径
-     * @param integer $e 角度
-     * @return array 円の中心点と直径から弧の終端座標の配列
-     */
-    function lfGetArcPos($cx, $cy, $cw, $ch, $e) {
-        // 三角関数用の角度を求める
-        $s = 90 - $e;
-        $r = $cw / 2;
-        // 位置を求める
-        $x = $cx + ($r * cos(deg2rad($s)));
-        $y = $cy - (($r * sin(deg2rad($s))) * ($ch / $cw));
-        return array(round($x), round($y));
-    }
-
-    /** 画像にテキストを描画する */
-    function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) {
-        $color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]);
-        $text = mb_convert_encoding($text, "UTF-8", CHAR_CODE);
-        // 表示角度
-        $angle = 0;
-        // テキスト描画
-        ImageTTFText($dst_image, $font_size, $angle, $left, $top, $color, $font, $text);
-    }
-
-    /** 表示色の取得 */
-    function lfGetImageColor($image, $array) {
-        if (count($array) != 3) {
-            return NULL;
-        }
-        $ret = imagecolorallocate($image, $array[0], $array[1], $array[2]);
-        return $ret;
-    }
-
-    /** 影用表示色の取得 */
-    function lfGetImageDarkColor($image, $array) {
-        if (count($array) != 3) {
-            return NULL;
-        }
-        $i = 0;
-        foreach ($array as $val) {
-            $dark[$i] = $val - 45;
-            if ($dark[$i] < 0) {
-                $dark[$i] = 0;
-            }
-            $i++;
-        }
-        $ret = imagecolorallocate($image, $dark[0], $dark[1], $dark[2]);
-        return $ret;
-    }
-}
Index: branches/version-2_12-dev/data/class/graph/SC_GraphPie.php
===================================================================
--- branches/version-2_12-dev/data/class/graph/SC_GraphPie.php	(revision 21441)
+++ 	(revision )
@@ -1,217 +1,0 @@
-<?php
-/*
- * This file is part of EC-CUBE
- *
- * Copyright(c) 2000-2011 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.
- */
-
-$ownDir = realpath(dirname(__FILE__)) . '/';
-require_once $ownDir . 'SC_GraphBase.php';
-
-// 円グラフ生成クラス
-class SC_GraphPie extends SC_GraphBase{
-    var $cw;
-    var $ch;
-    var $cz;
-    var $cx;
-    var $cy;
-    var $arrLabel;
-    var $arrData;
-
-    // コンストラクタ
-    function SC_GraphPie($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, $top = PIE_TOP) {
-        parent::SC_GraphBase($bgw, $bgh, $left, $top);
-        // サイズ設定
-        $this->setSize(PIE_WIDTH, PIE_HEIGHT, PIE_THICK);
-        // 位置設定
-        $this->setPosition($this->left + ($this->cw / 2), $this->top + ($this->ch / 2));
-    }
-
-    // データを360°値に変換する
-    function getCircleData($array) {
-        $total = "";
-        $new_total = "";
-        if (!is_array($array)) {
-            return;
-        }
-        $arrRet = array();
-        foreach ($array as $val) {
-            $total += $val;
-        }
-        if ($total <= 0) {
-            return;
-        }
-        $rate = 360 / $total;
-        // ラベル表示用
-        $p_rate = 100 / $total;
-        $cnt = 0;
-        foreach ($array as $val) {
-            $ret = round($val * $rate);
-            $new_total+= $ret;
-            $arrRet[] = $ret;
-            // パーセント表示用
-            $this->arrLabel[] = round($val * $p_rate) . " %";
-            $cnt++;
-        }
-        // 合計が360になるように補正しておく
-        $arrRet[0] -= $new_total - 360;
-        return $arrRet;
-    }
-
-    // 円の位置設定を行う
-    function setPosition($cx, $cy) {
-        $this->cx = $cx;
-        $this->cy = $cy;
-    }
-
-    // 円のサイズ設定を行う
-    function setSize($cw, $ch, $cz = 0) {
-        $this->cw = $cw;
-        $this->ch = $ch;
-        $this->cz = $cz;
-    }
-
-    // 影の描画
-    function drawShade() {
-        $move = 1;
-        for ($i = ($this->cy + $this->cz); $i <= ($this->cy + $this->cz + ($this->cz * PIE_SHADE_IMPACT)); $i++) {
-            imagefilledarc($this->image, $this->cx + $move, $i, $this->cw, $this->ch, 0, 360, $this->shade_color, IMG_ARC_PIE);
-            $move += 0.5;
-        }
-    }
-
-    // データをセットする
-    function setData($arrData) {
-        $this->arrData = array_values($arrData);
-    }
-
-    // 円グラフを描画する
-    function drawGraph() {
-        $x = $this->cx;
-        $y = $this->cy;
-        $z = $this->cz;
-        $h = $this->ch;
-        $w = $this->cw;
-
-        // データの角度を取得する
-        $arrRad = $this->getCircleData($this->arrData);
-        $rd_max = count($arrRad);
-
-        // データが存在しない場合
-        if ($rd_max <= 0) {
-            return;
-        }
-
-        // 影の描画
-        if ($this->shade_on) {
-            $this->drawShade();
-        }
-
-        // 色数の取得
-        $c_max = count($this->arrColor);
-        $dc_max = count($this->arrDarkColor);
-
-        // 側面の描画
-        for ($i = ($y + $z - 1); $i >= $y; $i--) {
-            $start = 0;
-            for ($j = 0; $j < $rd_max; $j++) {
-                // 角度が0度以上の場合のみ側面を描画する。
-                if ($arrRad[$j] > 0) {
-                    $end = $start + $arrRad[$j];
-                    if ($start == 0 && $end == 360) {
-                        // -90~270で指定すると円が描画できないので0~360に指定
-                        imagearc($this->image, $x, $i, $w, $h, 0, 360, $this->arrDarkColor[($j % $dc_max)]);
-                    } else {
-                        // -90°は12時の位置から開始するように補正している
-                        imagearc($this->image, $x, $i, $w, $h, $start - 90, $end - 90, $this->arrDarkColor[($j % $dc_max)]);
-                    }
-                    $start = $end;
-                }
-            }
-        }
-        // 底面の描画
-        imagearc($this->image, $x, $y + $z, $w, $h, 0, 180 , $this->flame_color);
-
-        // 上面の描画
-        $start = 0;
-        for ($i = 0; $i < $rd_max; $i++) {
-            $end = $start + $arrRad[$i];
-            if ($start == 0 && $end == 360) {
-                // -90~270で指定すると円が描画できないので0~360に指定
-                imagefilledarc($this->image, $x, $y, $w, $h, 0, 360, $this->arrColor[($i % $c_max)], IMG_ARC_PIE);
-            } else {
-                // -90°は12時の位置から開始するように補正している。
-                imagefilledarc($this->image, $x, $y, $w, $h, $start - 90, $end - 90, $this->arrColor[($i % $c_max)], IMG_ARC_PIE);
-            }
-            $start = $end;
-        }
-
-        // 上面の縁取り
-        $start = 0;
-        for ($i = 0; $i < $rd_max; $i++) {
-            $end = $start + $arrRad[$i];
-            if ($start == 0 && $end == 360) {
-                // -90~270で指定すると円が描画できないので0~360に指定
-                imagearc($this->image, $x, $y, $w, $h, 0, 360 , $this->flame_color);
-            }
-            // -90°は12時の位置から開始するように補正している。
-            imagefilledarc($this->image, $x, $y, $w, $h, $start - 90, $end - 90, $this->flame_color, IMG_ARC_EDGED|IMG_ARC_NOFILL);
-            $start = $end;
-        }
-
-        // 側面の縁取り
-        imageline($this->image, $x + ($w / 2), $y, $x + ($w / 2), $y + $z, $this->flame_color);
-        imageline($this->image, $x - ($w / 2), $y, $x - ($w / 2), $y + $z, $this->flame_color);
-        $start = 0;
-        for ($i = 0; $i < $rd_max; $i++) {
-            $end = $start + $arrRad[$i];
-            // 前面のみ
-            if ($end > 90 && $end < 270) {
-                list($ax, $ay) = $this->lfGetArcPos($x, $y, $w, $h, $end);
-                // ラインのずれを補正する
-                if ($end > 180) {
-                    $ax = $ax + 1;
-                }
-                imageline($this->image, $ax, $ay, $ax, $ay + $z, $this->flame_color);
-            }
-            $start = $end;
-        }
-
-        // ラベルの描画
-        $this->drawLabel($arrRad);
-        // 凡例の描画
-        $this->drawLegend(count($this->arrData));
-    }
-
-    // 円グラフのラベルを描画する
-    function drawLabel($arrRad) {
-        $rd_max = count($arrRad);
-        $start = 0;
-        for ($i = 0; $i < $rd_max; $i++) {
-            $center = $start + ($arrRad[$i] / 2);
-            $end = $start + $arrRad[$i];
-            list($sx, $sy) = $this->lfGetArcPos($this->cx, $this->cy, ($this->cw / 1.5), ($this->ch / 1.5), $center);
-            list($ex, $ey) = $this->lfGetArcPos($this->cx, $this->cy, ($this->cw * 1.5), ($this->ch * 1.5), $center);
-            // 指示線の描画
-            imageline($this->image, $sx, $sy, $ex + 2, $ey - PIE_LABEL_UP, $this->flame_color);
-            $this->setText(FONT_SIZE, $ex - 10, $ey - PIE_LABEL_UP - FONT_SIZE, $this->arrLabel[$i], NULL, 0, true);
-            $start = $end;
-        }
-    }
-}
Index: branches/version-2_12-dev/data/class/SC_SmartphoneUserAgent.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_SmartphoneUserAgent.php	(revision 21420)
+++ branches/version-2_12-dev/data/class/SC_SmartphoneUserAgent.php	(revision 21490)
@@ -21,5 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-require_once dirname(__FILE__) . '/../module/Net/UserAgent/Mobile.php';
 
 /**
Index: branches/version-2_12-dev/data/class/sessionfactory/SC_SessionFactory_UseRequest.php
===================================================================
--- branches/version-2_12-dev/data/class/sessionfactory/SC_SessionFactory_UseRequest.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/sessionfactory/SC_SessionFactory_UseRequest.php	(revision 21490)
@@ -0,0 +1,540 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+
+/**
+ * Cookieを使用せず、リクエストパラメーターによりセッションを継続する設定を行うクラス.
+ *
+ * このクラスを直接インスタンス化しないこと.
+ * 必ず SC_SessionFactory クラスを経由してインスタンス化する.
+ * また, SC_SessionFactory クラスの関数を必ずオーバーライドしている必要がある.
+ *
+ * @package SC_SessionFactory
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class SC_SessionFactory_UseRequest extends SC_SessionFactory {
+
+    var $state = null;
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * PC/モバイルのセッション管理オブジェクトを切り替える
+     *
+     * @param string $state
+     */
+    function setState($state = 'pc') {
+        switch ($state) {
+        case 'mobile':
+            $this->state = new LC_UseRequest_State_Mobile;
+            break;
+
+        case 'pc':
+        default:
+            $this->state = new LC_UseRequest_State_PC;
+            break;
+        }
+    }
+
+    /**
+     * Cookieを使用するかどうか
+     *
+     * @return boolean 常にfalseを返す
+     */
+    function useCookie() {
+        return false;
+    }
+
+    /**
+     * dtb_mobile_ext_session_id テーブルを検索してセッションIDを取得する。
+     * PCサイトでもモバイルサイトでもこのテーブルを利用する.
+     *
+     * @return string|null 取得したセッションIDを返す。
+     *                     取得できなかった場合は null を返す。
+     */
+    function getExtSessionId() {
+        if (!preg_match('|^' . ROOT_URLPATH . '(.*)$|', $_SERVER['SCRIPT_NAME'], $matches)) {
+            return null;
+        }
+
+        $url = $matches[1];
+        $lifetime = $this->state->getLifeTime();
+        $time = date('Y-m-d H:i:s', time() - $lifetime);
+        $objQuery = new SC_Query_Ex();
+
+        foreach ($_REQUEST as $key => $value) {
+            $session_id = $objQuery->get('session_id', 'dtb_mobile_ext_session_id',
+                                         'param_key = ? AND param_value = ? AND url = ? AND create_date >= ?',
+                                         array($key, $value, $url, $time));
+            if (isset($session_id)) {
+                return $session_id;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 外部サイト連携用にセッションIDとパラメーターの組み合わせを保存する。
+     *
+     * @param string $param_key パラメーター名
+     * @param string $param_value パラメーター値
+     * @param string $url URL
+     * @return void
+     */
+    function setExtSessionId($param_key, $param_value, $url) {
+        $objQuery = new SC_Query_Ex();
+
+        // GC
+        $lifetime = $this->state->getLifeTime();
+        $time = date('Y-m-d H:i:s', time() - $lifetime);
+        $objQuery->delete('dtb_mobile_ext_session_id', 'create_date < ?', array($time));
+
+        $arrValues = array('session_id'  => session_id(),
+                           'param_key'   => $param_key,
+                           'param_value' => $param_value,
+                           'url'         => $url);
+
+        $objQuery->insert('dtb_mobile_ext_session_id', $arrValues);
+    }
+
+    /**
+     * セッションデータが有効かどうかをチェックする。
+     *
+     * @return boolean セッションデータが有効な場合は true、無効な場合は false を返す。
+     */
+    function validateSession() {
+        /**
+         * PCサイトでは
+         *  ・セッションデータが適切に設定されているか
+         *  ・UserAgent
+         *  ・IPアドレス
+         *  ・有効期限
+         * モバイルサイトでは
+         *  ・セッションデータが適切に設定されているか
+         *  ・機種名
+         *  ・IPアドレス
+         *  ・有効期限
+         *  ・phone_id
+         * がチェックされる
+         */
+        return $this->state->validateSessionData();
+    }
+
+    /**
+     * パラメーターから有効なセッションIDを取得する。
+     *
+     * @return string|false 取得した有効なセッションIDを返す。
+     *                      取得できなかった場合は false を返す。
+     */
+    function getSessionId() {
+        // パラメーターからセッションIDを取得する。
+        $sessionId = @$_POST[session_name()];
+        if (!isset($sessionId)) {
+            $sessionId = @$_GET[session_name()];
+            // AU動画音声ファイルダウンロード対策
+            // キャリアがAUで、動画、音声ファイルをダウンロードする際に
+            // SESSIONIDの後に余計なパラメータが付与され、セッションが無効になるケースがある
+            if (SC_MobileUserAgent::getCarrier() == 'ezweb') {
+                $idArray = split("\?", $sessionId);
+                $sessionId = $idArray[0];
+            }
+        }
+        if (!isset($sessionId)) {
+            $sessionId = $this->getExtSessionId();
+        }
+        if (!isset($sessionId)) {
+            return false;
+        }
+
+        // セッションIDの存在をチェックする。
+        $objSession = new SC_Helper_Session_Ex();
+        if ($objSession->sfSessRead($sessionId) === null) {
+            GC_Utils_Ex::gfPrintLog("Non-existent session id : sid=$sessionId");
+            return false;
+        }
+        return session_id($sessionId);
+    }
+
+    /**
+     * セッション初期処理を行う。
+     *
+     * @return void
+     */
+    function initSession() {
+        // セッションIDの受け渡しにクッキーを使用しない。
+        ini_set('session.use_cookies', '0');
+        ini_set('session.use_trans_sid', '1');
+        ini_set('session.use_only_cookies', '0');
+
+        // パラメーターから有効なセッションIDを取得する。
+        $sessionId = $this->getSessionId();
+
+        if (!$sessionId) {
+            session_start();
+        }
+
+        /*
+         * PHP4 では session.use_trans_sid が PHP_INI_PREDIR なので
+         * ini_set() で設定できない
+         */
+        if (!ini_get('session.use_trans_sid')) {
+            output_add_rewrite_var(session_name(), session_id());
+        }
+
+        // セッションIDまたはセッションデータが無効な場合は、セッションIDを再生成
+        // し、セッションデータを初期化する。
+        if ($sessionId === false || !$this->validateSession()) {
+            session_regenerate_id(true);
+            // セッションデータの初期化
+            $this->state->inisializeSessionData();
+
+            // 新しいセッションIDを付加してリダイレクトする。
+            if ($_SERVER['REQUEST_METHOD'] == 'GET') {
+                // GET の場合は同じページにリダイレクトする。
+                $objMobile = new SC_Helper_Mobile_Ex;
+                header('Location: ' . $objMobile->gfAddSessionId());
+            } else {
+                // GET 以外の場合はトップページへリダイレクトする。
+                header('Location: ' . TOP_URLPATH . '?' . SID);
+            }
+            exit;
+        }
+
+        // 有効期限を更新する.
+        $this->state->updateExpire();
+    }
+}
+/**
+ * セッションデータ管理クラスの基底クラス
+ *
+ */
+class LC_UseRequest_State {
+    /** 名前空間(pc/mobile) */
+    var $namespace = '';
+    /** 有効期間 */
+    var $lifetime  = 0;
+    /** エラーチェック関数名の配列 */
+    var $validate  = array();
+
+    /**
+     * 名前空間を取得する
+     *
+     * @return string
+     */
+    function getNameSpace() { return $this->namespace; }
+
+    /**
+     * 有効期間を取得する
+     *
+     * @return integer
+     */
+    function getLifeTime() { return $this->lifetime; }
+
+    /**
+     * セッションデータが設定されているかを判定する.
+     * $_SESSION[$namespace]の値が配列の場合に
+     * trueを返す.
+     *
+     * @return boolean
+     */
+    function validateNameSpace() {
+        $namespace = $this->getNameSpace();
+        if (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) {
+            return true;
+        }
+        GC_Utils_Ex::gfPrintLog("NameSpace $namespace not found in session data : sid=" . session_id());
+        return false;
+    }
+
+    /**
+     * セッションのデータを取得する
+     * 取得するデータは$_SESSION[$namespace][$key]となる.
+     *
+     * @param string $key
+     * @return mixed|null
+     */
+    function getValue($key) {
+        $namespace = $this->getNameSpace();
+        return isset($_SESSION[$namespace][$key])
+            ? $_SESSION[$namespace][$key]
+            : null;
+    }
+
+    /**
+     * セッションにデータを登録する.
+     * $_SESSION[$namespace][$key] = $valueの形で登録される.
+     *
+     * @param string $key
+     * @param mixed $value
+     */
+    function setValue($key, $value) {
+        $namespace = $this->getNameSpace();
+        $_SESSION[$namespace][$key] = $value;
+    }
+
+    /**
+     * 有効期限を取得する.
+     *
+     * @return integer
+     */
+    function getExpire() {
+        return $this->getValue('expires');
+    }
+
+    /**
+     * 有効期限を設定する.
+     *
+     */
+    function updateExpire() {
+        $lifetime = $this->getLifeTime();
+        $this->setValue('expires', time() + $lifetime);
+    }
+
+    /**
+     * 有効期限内かどうかを判定する.
+     *
+     * @return boolean
+     */
+    function validateExpire() {
+        $expire = $this->getExpire();
+        if (intval($expire) > time()) {
+            return true;
+        }
+        $date = date('Y/m/d H:i:s', $expire);
+        GC_Utils_Ex::gfPrintLog("Session expired at $date : sid=" . session_id());
+        return false;
+    }
+
+    /**
+     * IPアドレスを取得する.
+     *
+     * @return string
+     */
+    function getIp() {
+        return $this->getValue('ip');
+    }
+
+    /**
+     * IPアドレスを設定する.
+     *
+     */
+    function updateIp() {
+        $this->setValue('ip', $_SERVER['REMOTE_ADDR']);
+    }
+
+    /**
+     * REMOTE_ADDRとセッション中のIPが同じかどうかを判定する.
+     * 同じ場合にtrueが返る
+     *
+     * @return boolean
+     */
+    function validateIp() {
+        $ip = $this->getIp();
+        if (!empty($_SERVER['REMOTE_ADDR'])
+         && $ip === $_SERVER['REMOTE_ADDR']) {
+
+            return true;
+        }
+
+        $msg = sprintf('Ip Addr mismatch : %s != %s(expected) : sid=%s',
+                       $_SERVER['REMOTE_ADDR'], $ip, session_id());
+        GC_Utils_Ex::gfPrintLog($msg);
+        return false;
+    }
+
+    /**
+     * UserAgentもしくは携帯の機種名を取得する.
+     *
+     * @return string
+     */
+    function getModel() {
+        return $this->getValue('model');
+    }
+
+    /**
+     * セッション中のデータ検証する
+     *
+     * @return boolean
+     */
+    function validateSessionData() {
+        foreach ($this->validate as $method) {
+            $method = 'validate' . $method;
+            if (!$this->$method()) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * セッションデータを初期化する.
+     *
+     */
+    function inisializeSessionData() {}
+}
+
+/**
+ * PCサイト用のセッションデータ管理クラス
+ *
+ */
+class LC_UseRequest_State_PC extends LC_UseRequest_State {
+
+    /**
+     * コンストラクタ
+     * セッションのデータ構造は下のようになる.
+     * $_SESSION['pc']=> array(
+     *     ['model']   => "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"
+     *     ['ip']      => "127.0.0.1"
+     *     ['expires'] => 1204699031
+     * )
+     *
+     * @return LC_UseRequest_State_PC
+     */
+    function LC_UseRequest_State_PC() {
+        $this->namespace = 'pc';
+        $this->lifetime  = SESSION_LIFETIME;
+        $this->validate  = array('NameSpace', 'Model', 'Ip', 'Expire');
+    }
+
+    /**
+     * セッションにUserAgentを設定する.
+     *
+     */
+    function updateModel() {
+        $this->setValue('model', $_SERVER['HTTP_USER_AGENT']);
+    }
+
+    /**
+     * UserAgentを検証する.
+     *
+     * @return boolean
+     */
+    function validateModel() {
+        $ua = $this->getModel();
+        if (!empty($_SERVER['HTTP_USER_AGENT'])
+         && $_SERVER['HTTP_USER_AGENT'] === $ua) {
+
+            return true;
+        }
+        $msg = sprintf("User agent model mismatch : %s != %s(expected), sid=%s",
+                       $_SERVER['HTTP_USER_AGENT'], $ua, session_id());
+        GC_Utils_Ex::gfPrintLog($msg);
+        return false;
+    }
+
+    /**
+     * セッションデータを初期化する.
+     *
+     */
+    function inisializeSessionData() {
+        $_SESSION = array();
+        $this->updateModel();
+        $this->updateIp();
+        $this->updateExpire();
+    }
+}
+
+/**
+ * モバイルサイト用のセッションデータ管理クラス
+ *
+ */
+class LC_UseRequest_State_Mobile extends LC_UseRequest_State {
+
+    /**
+     * コンストラクタ
+     * セッションのデータ構造は下のようになる.
+     * $_SESSION['mobile']=> array(
+     *     ['model']   => 901sh
+     *     ['ip']      => 127.0.0.1
+     *     ['expires'] => 1204699031
+     *     ['phone_id']=> ****
+     * )
+     *
+     * @return LC_UseRequest_State_Mobile
+     */
+    function LC_UseRequest_State_Mobile() {
+        $this->namespace = 'mobile';
+        $this->lifetime  = MOBILE_SESSION_LIFETIME;
+        $this->validate  = array('NameSpace', 'Model', 'Expire');
+    }
+
+    /**
+     * 携帯の機種名を設定する
+     *
+     */
+    function updateModel() {
+        $this->setValue('model', SC_MobileUserAgent_Ex::getModel());
+    }
+
+    /**
+     * セッション中の携帯機種名と、アクセスしてきたブラウザの機種名が同じかどうかを判定する
+     *
+     * @return boolean
+     */
+    function validateModel() {
+        $modelInSession = $this->getModel();
+        $model = SC_MobileUserAgent_Ex::getModel();
+        if (!empty($model)
+         && $model === $modelInSession) {
+
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 携帯のIDを取得する
+     *
+     * @return string
+     */
+    function getPhoneId() {
+        return $this->getValue('phone_id');
+    }
+
+    /**
+     * 携帯のIDを登録する.
+     *
+     */
+    function updatePhoneId() {
+        $this->setValue('phone_id', SC_MobileUserAgent_Ex::getId());
+    }
+
+    /**
+     * セッションデータを初期化する.
+     *
+     */
+    function inisializeSessionData() {
+        $_SESSION = array();
+        $this->updateModel();
+        $this->updateIp();
+        $this->updateExpire();
+        $this->updatePhoneId();
+    }
+}
+/*
+ * Local variables:
+ * coding: utf-8
+ * End:
+ */
Index: branches/version-2_12-dev/data/class/sessionfactory/SC_SessionFactory_UseCookie.php
===================================================================
--- branches/version-2_12-dev/data/class/sessionfactory/SC_SessionFactory_UseCookie.php	(revision 21490)
+++ branches/version-2_12-dev/data/class/sessionfactory/SC_SessionFactory_UseCookie.php	(revision 21490)
@@ -0,0 +1,71 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 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.
+ */
+
+/**
+ * セッション維持の方法にCookieを使用するクラス.
+ *
+ * このクラスを直接インスタンス化しないこと.
+ * 必ず SC_SessionFactory クラスを経由してインスタンス化する.
+ * また, SC_SessionFactory クラスの関数を必ずオーバーライドしている必要がある.
+ *
+ * @package SC_SessionFactory
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class SC_SessionFactory_UseCookie extends SC_SessionFactory {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * セッションパラメーターの指定
+     * ・ブラウザを閉じるまで有効
+     * ・すべてのパスで有効
+     *   FIXME 多分、同一ホスト名に複数の EC-CUBE をインストールした場合に望ましくない状態である。特段の事由がなければ、アプリケーションルートを指定すべきだし、あればコメントに残すべき。
+     * ・同じドメイン間で共有
+     **/
+    function initSession() {
+        ini_set('session.cache_limiter', 'none');
+        if (session_id() === "") {
+            session_set_cookie_params(0, "/", DOMAIN_NAME);
+            if (!ini_get("session.auto_start")) {
+                // セッション開始
+                session_start();
+            }
+        }
+    }
+
+    /**
+     * Cookieを使用するかどうか
+     *
+     * @return boolean 常に true を返す
+     */
+    function useCookie() {
+        return true;
+    }
+}
+/*
+ * Local variables:
+ * coding: utf-8
+ * End:
+ */
Index: branches/version-2_12-dev/data/class/util/SC_Utils.php
===================================================================
--- branches/version-2_12-dev/data/class/util/SC_Utils.php	(revision 21481)
+++ branches/version-2_12-dev/data/class/util/SC_Utils.php	(revision 21490)
@@ -1672,5 +1672,4 @@
      */
     function sfGetRandomString($length = 1) {
-        require_once dirname(__FILE__) . '/../../module/Text/Password.php';
         return Text_Password::create($length);
     }
@@ -2039,5 +2038,4 @@
             return json_encode($value);
         } else {
-            require_once dirname(__FILE__) . '/../../module/Services/JSON.php';
             GC_Utils_Ex::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!');
             $objJson = new Services_JSON();
@@ -2062,5 +2060,4 @@
             return json_decode($json);
         } else {
-            require_once dirname(__FILE__) . '/../../module/Services/JSON.php';
             GC_Utils_Ex::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!');
             $objJson = new Services_JSON();
Index: branches/version-2_12-dev/data/class/db/SC_DB_DBFactory.php
===================================================================
--- branches/version-2_12-dev/data/class/db/SC_DB_DBFactory.php	(revision 21441)
+++ branches/version-2_12-dev/data/class/db/SC_DB_DBFactory.php	(revision 21490)
@@ -21,8 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-// {{{ requires
-require_once CLASS_REALDIR . 'db/dbfactory/SC_DB_DBFactory_MYSQL.php';
-require_once CLASS_REALDIR . 'db/dbfactory/SC_DB_DBFactory_PGSQL.php';
 
 /**
Index: branches/version-2_12-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php
===================================================================
--- branches/version-2_12-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php	(revision 21479)
+++ branches/version-2_12-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php	(revision 21490)
@@ -21,7 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-// {{{ requires
-require_once CLASS_REALDIR . 'db/SC_DB_DBFactory.php';
 
 /**
Index: branches/version-2_12-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php
===================================================================
--- branches/version-2_12-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php	(revision 21479)
+++ branches/version-2_12-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php	(revision 21490)
@@ -21,7 +21,4 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-// {{{ requires
-require_once CLASS_REALDIR . 'db/SC_DB_DBFactory.php';
 
 /**
Index: branches/version-2_12-dev/data/app_initial.php
===================================================================
--- branches/version-2_12-dev/data/app_initial.php	(revision 21483)
+++ branches/version-2_12-dev/data/app_initial.php	(revision 21490)
@@ -48,4 +48,6 @@
 /**
  * クラスのオートローディングを定義する
+ *
+ * LC_* には対応していない。
  */
 function setClassAutoloader() {
@@ -60,5 +62,11 @@
         }
         elseif ($arrClassNamePart[0] === 'SC' && $is_ex === true && $count >= 4) {
-            $classpath .= strtolower($arrClassNamePart[1]) . '_extends/';
+            $arrClassNamePartTemp = $arrClassNamePart;
+            // FIXME クラスファイルのディレクトリ命名が変。変な現状に合わせて強引な処理をしてる。
+            $arrClassNamePartTemp[1] = $arrClassNamePartTemp[1] . '_extends';
+            $classpath .= strtolower(implode('/', array_slice($arrClassNamePartTemp, 1, -2))) . '/';
+        }
+        elseif ($arrClassNamePart[0] === 'SC' && $is_ex === false && $count >= 3) {
+            $classpath .= strtolower(implode('/', array_slice($arrClassNamePart, 1, -1))) . '/';
         }
         elseif ($arrClassNamePart[0] === 'SC') {
Index: branches/version-2_12-dev/data/require_base.php
===================================================================
--- branches/version-2_12-dev/data/require_base.php	(revision 21483)
+++ branches/version-2_12-dev/data/require_base.php	(revision 21490)
@@ -39,9 +39,7 @@
 
         // セッションハンドラ開始
-        require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_Session_Ex.php';
         $objSession = new SC_Helper_Session_Ex();
 
         // セッション初期化・開始
-        require_once CLASS_REALDIR . 'session/SC_SessionFactory.php';
         $sessionFactory = SC_SessionFactory::getInstance();
         $sessionFactory->initSession();
