OSDN Git Service

システム初期化ウィザードの「コンテンツ」ページ修正。
authornaoki hirata <naoki@magic3.org>
Fri, 31 Jan 2014 13:25:10 +0000 (22:25 +0900)
committernaoki hirata <naoki@magic3.org>
Fri, 31 Jan 2014 13:25:10 +0000 (22:25 +0900)
widgets/admin_main/include/container/admin_mainInitwizard_contentWidgetContainer.php
widgets/admin_main/include/db/admin_mainDb.php

index 189e345..50edf48 100644 (file)
@@ -93,8 +93,8 @@ class admin_mainInitwizard_contentWidgetContainer extends admin_mainInitwizardBa
                                                                // コンテンツ属性からページサブIDを取得
                                                                $pageSubId = $this->gPage->getPageSubIdByContentType($contentType, $pageId);
                                                        
-                                                               // コンテンツに対するメインウィジェットを取得
-                                                               $ret = $this->_mainDb->getWidgetListByDeviceType($contentType, $j/*デバイスタイプ*/, $rows);
+                                                               // コンテンツに対する表示ウィジェットを取得
+                                                               $ret = $this->_mainDb->getViewWidgetListByDeviceType($contentType, $j/*デバイスタイプ*/, $rows);
                                                                if ($ret){
                                                                        $widgetId = $rows[0]['wd_id'];
                                                                        
@@ -107,27 +107,29 @@ class admin_mainInitwizard_contentWidgetContainer extends admin_mainInitwizardBa
                                                        }
                                                }
                                        } else {
+                                               // 変更状況に関わらず処理を行う
                                                // 非選択のコンテンツタイプのウィジェットはページから削除
-                                               if (in_array($contentType, $oldContentType)){
-                                                       for ($j = 0; $j < count($widgetInfoRows); $j++){
-                                                               // 指定のコンテンツタイプに対応するウィジェットを取得
-                                                               $widgetId = $widgetInfoRows[$j]['wd_id'];
-                                                               if ($contentType == $widgetInfoRows[$j]['wd_type']){
-                                                                       $ret = $this->_mainDb->delPageDefByWidgetId($widgetId);
-                                                                       
-                                                                       // アクセスポイントごとの処理
-                                                                       for ($k = 0; $k < count($this->pageIdArray); $k++){
-                                                                               $pageId = $this->pageIdArray[$k];
-                                                                               
-                                                                               // コンテンツ属性からページサブIDを取得
-                                                                               $pageSubId = $this->gPage->getPageSubIdByContentType($contentType, $pageId);
-                                                               
-                                                                               // ページの使用状況を更新
-                                                                               $this->updatePageAvailable($pageSubId, false);  // メニューから選択不可
-                                                                       }
-                                                               }
+//                                             if (in_array($contentType, $oldContentType)){
+                                               for ($j = 0; $j < count($widgetInfoRows); $j++){
+                                                       // 指定のコンテンツタイプに対応するウィジェットを取得
+                                                       $widgetId = $widgetInfoRows[$j]['wd_id'];
+                                                       if ($contentType == $widgetInfoRows[$j]['wd_type']){
+                                                               // ウィジェットをページから削除
+                                                               $ret = $this->_mainDb->delPageDefByWidgetId($widgetId);
                                                        }
                                                }
+                                                       
+                                               // アクセスポイントごとの処理
+                                               for ($j = 0; $j < count($this->pageIdArray); $j++){
+                                                       $pageId = $this->pageIdArray[$j];
+                                                       
+                                                       // コンテンツ属性からページサブIDを取得
+                                                       $pageSubId = $this->gPage->getPageSubIdByContentType($contentType, $pageId);
+                                       
+                                                       // ページの使用状況を更新
+                                                       $this->updatePageAvailable($pageSubId, false);  // メニューから選択不可
+                                               }
+//                                             }
                                        }
                                }
                                if (true){
index 4baf770..8c8b08a 100644 (file)
@@ -212,11 +212,12 @@ class admin_mainDb extends BaseDb
         * @param array  $rows                  レコード
         * @return bool                                 1行以上取得 = true, 取得なし= false
         */
-       function getWidgetListByDeviceType($widgetType, $deviceType, &$rows)
+       function getViewWidgetListByDeviceType($widgetType, $deviceType, &$rows)
        {
                $queryStr  = 'SELECT * FROM _widgets ';
                $queryStr .=   'WHERE wd_deleted = false ';     // 削除されていない
-               $queryStr .=     'AND wd_type = ? ';            // ウィジェットタイプ
+       //      $queryStr .=     'AND wd_type = ? ';            // ウィジェットタイプ
+               $queryStr .=     'AND wd_content_type = ? ';            // 表示コンテンツタイプ
                $queryStr .=     'AND wd_device_type = ? ';             // デバイスタイプ
                $queryStr .=   'ORDER BY wd_priority';
                $retValue = $this->selectRecords($queryStr, array($widgetType, $deviceType), $rows);