Skip to content

Commit

Permalink
Merge pull request #104 from s-nakajima/master
Browse files Browse the repository at this point in the history
Boxの切り替え機能の再修正
  • Loading branch information
s-nakajima committed Nov 22, 2016
2 parents ce27120 + b30b8c1 commit 03b38b8
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions Config/Migration/001_plugin_records.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

App::uses('NetCommonsMigration', 'NetCommons.Config/Migration');
App::uses('Space', 'Rooms.Model');

/**
* Add plugin migration
Expand Down Expand Up @@ -72,14 +73,7 @@ class PluginRecords extends NetCommonsMigration {
'plugin_key' => 'bbses'
),
),
'PluginsRoom' => array(
//パブリックスペース
array('room_id' => '2', 'plugin_key' => 'bbses', ),
//プライベートスペース
array('room_id' => '3', 'plugin_key' => 'bbses', ),
//グループスペース
array('room_id' => '4', 'plugin_key' => 'bbses', ),
),
//PluginsRoomは、beforeでセットする
);

/**
Expand All @@ -89,6 +83,29 @@ class PluginRecords extends NetCommonsMigration {
* @return bool Should process continue
*/
public function before($direction) {
$pluginName = $this->records['Plugin'][0]['key'];
$this->records['PluginsRoom'] = array(
//サイト全体
array(
'room_id' => Space::getRoomIdRoot(Space::WHOLE_SITE_ID, 'Room'),
'plugin_key' => $pluginName
),
//パブリックスペース
array(
'room_id' => Space::getRoomIdRoot(Space::PUBLIC_SPACE_ID, 'Room'),
'plugin_key' => $pluginName
),
//プライベートスペース
array(
'room_id' => Space::getRoomIdRoot(Space::PRIVATE_SPACE_ID, 'Room'),
'plugin_key' => $pluginName
),
//グループスペース
array(
'room_id' => Space::getRoomIdRoot(Space::COMMUNITY_SPACE_ID, 'Room'),
'plugin_key' => $pluginName
),
);
return true;
}

Expand Down

0 comments on commit 03b38b8

Please sign in to comment.