/**
  * プット先コミュニティ設定処理
  */
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     // 対象となるフォルダIDを取得
     $target_folder_id = $request->ACSgetParameter('folder_id');
     // ACSUserFolder インスタンス生成
     $user_folder_obj = new ACSUserFolder($user_community_id, $acs_user_info_row, $target_folder_id);
     $target_folder_obj = $user_folder_obj->get_folder_obj();
     // 選択された community_id, folder_id を取得
     $selected_put_folder_row_array = $request->getParameter('selected_put_folder_id');
     // ----------------------------
     // 更新用にデータ加工
     // プット先コミュニティ更新用に、row_array 作成
     $put_community_row_array = array();
     foreach ($selected_put_folder_row_array as $community_id => $folder_id) {
         array_push($put_community_row_array, array('put_community_id' => $community_id, 'put_community_folder_id' => $folder_id));
     }
     // ----------------------------
     // 更新処理
     $ret = $target_folder_obj->update_put_community($target_folder_id, $put_community_row_array);
     if (!$ret) {
         print "ERROR: Update put-community failed.<br>\n";
         exit;
     }
     // ML通知チェックがあればMLにメール送信する
     // コミュニティ情報の取得
     $send_announce_mail = $request->getParameter('send_announce_mail');
     if ($send_announce_mail == "t") {
         foreach ($selected_put_folder_row_array as $community_id => $folder_id) {
             $folder_info = ACSFolderModel::select_folder_row($folder_id);
             ACSCommunityMail::send_putfolder_mail($acs_user_info_row, $folder_info, $community_id);
         }
     }
     // 処理が終わったら、ウィンドウを閉じる
     $controller->forward('Common', 'CloseChildWindow');
 }
 /**
  * フォルダオブジェクトセット
  *
  * @param $folder_id
  */
 function set_folder_obj($community_id, $acs_user_info_row, $folder_id, $target_folder_id_array)
 {
     static $cache_rows;
     if (is_array($cache_rows[$folder_id])) {
         $folder_row = $cache_rows[$folder_id];
     } else {
         /* フォルダ情報取得 */
         $folder_row = ACSFolderModel::select_folder_row($folder_id);
         $cache_rows[$folder_id] = $folder_row;
     }
     /* フォルダインスタンスセット */
     $this->folder_obj = new ACSFolder($folder_row, $target_folder_id_array, $acs_user_info_row);
 }