コード例 #1
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $diary_row_array = $request->getAttribute('diary_row_array');
     $term = $request->getAttribute('term');
     // ユーザ情報
     $target_user_info_row['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $target_user_info_row['user_community_id'];
     $target_user_info_row['image_url'] = ACSUser::get_image_url($target_user_info_row['user_community_id']);
     if ($target_user_info_row['file_id'] != '') {
         $user_file_info_row = ACSFileInfoModel::select_file_info_row($target_user_info_row['file_id']);
         $target_user_info_row['image_title'] = $user_file_info_row['display_file_name'];
     } else {
         // 写真はありません
         $target_user_info_row['image_title'] = ACSMsg::get_msg('User', 'DiaryRSSSuccessView.class.php', 'M001');
     }
     // 信頼済みコミュニティ情報
     foreach ($diary_row_array as $index => $diary_row) {
         // 友人に公開
         if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
             $diary_row_array[$index]['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($diary_row['diary_id']);
         }
         // ダイアリーコメントURL
         $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath('User', 'DiaryComment') . '&id=' . $target_user_info_row['community_id'] . '&diary_id=' . $diary_row['diary_id'];
         // ファイルの画像URL
         if ($diary_row['file_id'] != '') {
             $diary_row_array[$index]['file_url'] = ACSDiaryFile::get_image_url($diary_row['file_id']);
         }
     }
     // ACSDiary::print_diary_rss()で使用するパラメータをセットする
     $params = array();
     // ベースURL
     if ($acs_user_info_row['is_acs_user']) {
         $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL');
     } else {
         $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     }
     // 自身のURL
     $params['rss_syndication_url'] = $params['base_url'] . $this->getControllerPath('User', 'DiaryRSS') . '&id=' . $target_user_info_row['user_community_id'] . '&term=' . $term;
     // <description>
     if ($acs_user_info_row['is_acs_user']) {
         if (ACSUser::is_friends($acs_user_info_row['user_community_id'], $target_user_info_row['user_community_id'])) {
             // 友人向け
             $params['description'] = $target_user_info_row['contents_row_array']['community_profile_friend']['contents_value'];
         } else {
             // ログインユーザ向け
             $params['description'] = $target_user_info_row['contents_row_array']['community_profile_login']['contents_value'];
         }
     } else {
         // 一般向け
         $params['description'] = $target_user_info_row['contents_row_array']['community_profile']['contents_value'];
     }
     //---- アクセス制御 ----//
     $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
     $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array);
     //----------------------//
     // RSS出力部
     ACSDiary::print_diary_rss($target_user_info_row, $diary_row_array, $params);
     // 終了
     exit;
 }
コード例 #2
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $diary_row_array = $request->getAttribute('diary_row_array_result');
     $open_level_master_row_array = $request->getAttribute('open_level_master_row_array');
     $friends_group_row_array = $request->getAttribute('friends_group_row_array');
     $err_str = $request->getAttribute('err_str');
     $form_pre = $request->getAttribute('form_pre');
     // トップページURL
     $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id'];
     //他人の日記を閲覧している場合のトップページURL
     $link_page_url['else_user_top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id'];
     //他人の日記を閲覧している場合の日記ページURL
     $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $target_user_info_row['community_id'];
     //検索画面url
     $link_page_url['search_diary_url'] = SCRIPT_PATH;
     // get でサブミットするための、遷移先情報
     $module = 'User';
     $action = 'SearchResultDiary';
     $id = $target_user_info_row['community_id'];
     $move_id = '2';
     // 加工
     if ($diary_row_array) {
         foreach ($diary_row_array as $index => $diary_row) {
             // ユーザ画像URL
             $diary_row_array[$index]['image_url'] = ACSUser::get_image_url($diary_row['community_id'], 'thumb');
             //ユーザページ
             $user_row = ACSUser::get_user_profile_row($diary_row['community_id']);
             $diary_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $diary_row['community_id'];
             $diary_row_array[$index]['community_name'] = $user_row['community_name'];
             // 投稿日時
             $diary_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($diary_row['post_date']);
             // コメントページURL
             $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath('User', 'DiaryComment') . '&id=' . $diary_row['community_id'] . '&diary_id=' . $diary_row['diary_id'];
             // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか
             if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
                 if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) {
                     $diary_row_array[$index]['trusted_community_flag'] = 0;
                 } else {
                     $diary_row_array[$index]['trusted_community_flag'] = 1;
                 }
             }
         }
         //---- アクセス制御 ----//
         $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
         $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array);
         //特別::全件検索の場合 ターゲットが自分のままになってしまうことを回避
         $diary_row_array_result = array();
         foreach ($diary_row_array as $index => $diary_row) {
             $diary_target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($diary_row['community_id']);
             $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $diary_target_user_info_row);
             $is_valid_user = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $diary_row);
             if ($is_valid_user) {
                 //アクセス権がある
                 array_push($diary_row_array_result, $diary_row);
             }
         }
         //----------------------//
     }
     // 本人のページかどうか
     if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) {
         $is_self_page = 1;
     } else {
         $is_self_page = 0;
     }
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('diary_row_array_result', $diary_row_array_result);
     $this->setAttribute('is_self_page', $is_self_page);
     $this->setAttribute('link_page_url', $link_page_url);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('err_str', $err_str);
     $this->setAttribute('form_pre', $form_pre);
     $this->setAttribute('module', $module);
     $this->setAttribute('action', $action);
     $this->setAttribute('id', $id);
     $this->setAttribute('move_id', $move_id);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('SearchResultDiary.tpl.php');
     return parent::execute();
 }
コード例 #3
0
 function execute()
 {
     $context =& $this->getContext();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     if ($user_community_id == null || $user_community_id == '') {
         $user_community_id = $request->getAttribute("id");
     }
     // ユーザ情報
     $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
     $top_page_url = $this->getControllerPath("User", 'Diary') . '&id=' . $user_community_id;
     $year = $request->ACSgetParameter('year');
     // 年
     $month = $request->ACSgetParameter('month');
     // 月
     if (!checkdate($month, 1, $year)) {
         $date_array = getdate();
         // 現在の日付情報
         $year = $date_array["year"];
         $month = $date_array["mon"];
     }
     //表示月($year/$month)に該当するデータを検索に行く
     $diary_row_array = ACSDiary::get_diary_row_array_by_year_month($user_community_id, $year, $month);
     // 信頼済みコミュニティ情報の追加
     foreach ($diary_row_array as $index => $diary_row) {
         if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
             $diary_row_array[$index]['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($diary_row['diary_id']);
         }
     }
     //---- アクセス制御 ----//
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     foreach ($diary_row_array as $index => $diary_row) {
         // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか
         if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
             if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) {
                 $diary_row_array[$index]['trusted_community_flag'] = 0;
             } else {
                 $diary_row_array[$index]['trusted_community_flag'] = 1;
             }
         }
     }
     $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
     $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array);
     //----------------------//
     // クラスを初期化
     // calendar(開始曜日, 当月以外の日付を表示するかどうか) の形で指定します。
     // ※開始曜日(0-日曜 から 6-土曜)、当月以外の日付を表示(0-No, 1-Yes)
     $calendar_obj = new calendar(0, 0);
     // 表示月以外の日付を表示しないことで共通させる
     // リンクを設定
     $calendar_obj->clear_link();
     if ($diary_row_array) {
         // リンクのある間、繰り返し
         foreach ($diary_row_array as $index => $diary_row) {
             if ($diary_row) {
                 $link_date = substr($diary_row['post_date'], 8, 2);
                 if (substr($link_date, 0, 1) == '0') {
                     $link_date = substr($link_date, 1, 1);
                 }
                 $calendar_obj->set_link($link_date, $top_page_url . "&year={$year}&month={$month}&day={$link_date}", ACSMsg::get_msg('User', 'DiaryCalendarAction.class.php', 'M001'));
             }
         }
     }
     // 指定月のカレンダー描画
     // show_calendar(年, 月, 日) の形で指定します。
     // ※日は省略可能です。指定するとその日が太字で表示されます。
     $calendar_obj->set_str_url($top_page_url);
     $new_calendar_html = $calendar_obj->show_calendar($year, $month);
     // 年と月を指定してカレンダーを表示
     $request->setAttribute('new_calendar_html', $new_calendar_html);
     return View::INPUT;
 }
コード例 #4
0
 function execute()
 {
     $context =& $this->getContext();
     $user = $context->getUser();
     $request = $context->getRequest();
     $controller = $context->getController();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $diary_row_array = $request->getAttribute('diary_row_array');
     $diary_comment_row_array = $request->getAttribute('diary_comment_row_array');
     $open_level_master_row_array = $request->getAttribute('open_level_master_row_array');
     $friends_group_row_array = $request->getAttribute('friends_group_row_array');
     $last_open_level_code = $request->getAttribute('last_open_level_code');
     // トップページURL
     $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id'];
     // 他人の日記を閲覧している場合のトップページURL
     $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id'];
     // 検索画面URL
     $link_page_url['search_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'SearchDiary') . '&id=' . $target_user_info_row['community_id'];
     // ダイアリーRSS URL
     $term = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'DIARY_RSS_TERM');
     $link_page_url['diary_rss_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryRSS') . '&id=' . $target_user_info_row['community_id'] . "&term={$term}";
     // 加工
     foreach ($diary_row_array as $index => $diary_row) {
         // 画像URL
         $diary_row_array[$index]['image_url'] = ACSUser::get_image_url($diary_row['community_id'], 'thumb');
         // 投稿日時
         $diary_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($diary_row['post_date']);
         // 投稿日時 (省略系: M/D)
         $diary_row_array[$index]['short_post_date'] = gmdate("n/j", strtotime($diary_row['post_date']) + 9 * 60 * 60);
         // コメントページURL
         $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryComment') . '&id=' . $target_user_info_row['community_id'] . '&diary_id=' . $diary_row['diary_id'];
         // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか
         if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
             if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) {
                 $diary_row_array[$index]['trusted_community_flag'] = 0;
             } else {
                 $diary_row_array[$index]['trusted_community_flag'] = 1;
             }
         }
         // 削除画面URL
         $diary_row_array[$index]['diary_delete_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DeleteDiary') . '&id=' . $target_user_info_row['user_community_id'] . '&diary_id=' . $diary_row['diary_id'];
         // ファイルの画像URL
         $diary_row_array[$index]['file_url'] = "";
         if ($diary_row['file_id'] != "") {
             $diary_row_array[$index]['file_url'] = ACSDiaryFile::get_image_url($diary_row['file_id'], 'thumb');
             //投稿内表示用
             $diary_row_array[$index]['file_url_alink'] = ACSDiaryFile::get_image_url($diary_row['file_id'], '');
             //ポップアップ用
         }
     }
     // 本人のページかどうか
     if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) {
         $is_self_page = 1;
     } else {
         $is_self_page = 0;
     }
     // 書き込みボタンで確認画面を表示
     $action_url = $this->getControllerPath(DEFAULT_MODULE, 'DiaryPre') . '&id=' . $target_user_info_row['user_community_id'] . "&move_id=1";
     //---- アクセス制御 ----//
     $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
     $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array);
     //----------------------//
     // ページング設定
     $display_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'NEW_INFO_LIST_DISPLAY_MAX_COUNT');
     $paging_info = $this->getPagingInfo($controller, $request, $diary_row_array, $display_count);
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('diary_row_array', $diary_row_array);
     $this->setAttribute('paging_info', $paging_info);
     $this->setAttribute('is_self_page', $is_self_page);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('link_page_url', $link_page_url);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('last_open_level_code', $last_open_level_code);
     // インライン表示(カレンダー) 初期値は当月
     //		$this->setAttribute('new_calendar_action_chain', $request->getAttribute('new_calendar_action_chain_html'));
     /*----------------------------------------------*/
     // 初期表示時
     // 現在のレンダーモードを取得
     $renderMode = $controller->getRenderMode();
     //レンダーモードを上書き (画面出力をオフにしてる)
     $controller->setRenderMode(View::RENDER_VAR);
     $this->inlineFlg = true;
     // フォワード側で判断する
     $request->setAttribute("inline_mode", "1");
     // 新着コミュニティ
     $controller->forward("User", "DiaryCalendar");
     $this->setAttribute("DiaryCalendar", $request->getAttribute("DiaryCalendar"));
     // レンダーモードを元に戻す
     $controller->setRenderMode($renderMode);
     $this->inlineFlg = false;
     /*----------------------------------------------*/
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('Diary.tpl.php');
     // 確認画面からキャンセルボタンで戻ってきたときのみの処理
     if ($request->getParameter('move_id') == 3) {
         //ユーザ入力情報
         $form = $user->getAttribute('new_form_obj');
         $this->setAttribute('form', $form);
         $this->setAttribute('move_id', $request->getParameter('move_id'));
     }
     return parent::execute();
 }
コード例 #5
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     // ユーザ情報一覧
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $form = $request->getAttribute('form');
     $folder_row_array = $request->getAttribute('folder_row_array');
     $file_info_row_array = $request->getAttribute('file_info_row_array');
     // 加工
     if (is_array($folder_row_array)) {
         foreach ($folder_row_array as $index => $folder_row) {
             $folder_row_array[$index]['path'] = '/' . implode('/', $folder_row['path_array']);
             $folder_row_array[$index]['folder_url'] = $this->getControllerPath('User', 'Folder') . '&id=' . $target_user_info_row['user_community_id'] . '&folder_id=' . $folder_row['folder_id'];
         }
     }
     if (is_array($file_info_row_array)) {
         foreach ($file_info_row_array as $index => $file_info_row) {
             $file_info_row_array[$index]['path'] = '/' . implode('/', $file_info_row['path_array']);
             $file_info_row_array[$index]['download_file_url'] = $this->getControllerPath('User', 'DownloadFile') . '&id=' . $target_user_info_row['user_community_id'] . '&file_id=' . $file_info_row['file_id'] . '&folder_id=' . $file_info_row['folder_id'];
         }
     }
     // 本人かどうか
     $is_self_page = $target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id'] ? true : false;
     // URL
     $folder_url = $this->getControllerPath('User', 'Folder') . '&id=' . $target_user_info_row['user_community_id'];
     $action_url = $this->getControllerPath();
     //---- アクセス制御 ----//
     $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
     if (is_array($folder_row_array)) {
         $folder_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $folder_row_array);
     }
     if (is_array($file_info_row_array)) {
         $file_info_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $file_info_row_array);
         $_file_info_row_array = array();
         // 本人以外はis_root_folderのファイルを閲覧できない
         foreach ($file_info_row_array as $index => $file_info_row) {
             if (!$is_self_page && $file_info_row['is_root_folder']) {
                 continue;
             } else {
                 array_push($_file_info_row_array, $file_info_row);
             }
         }
         $file_info_row_array = $_file_info_row_array;
     }
     //----------------------//
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('SearchFolder.tpl.php');
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('form', $form);
     $this->setAttribute('folder_row_array', $folder_row_array);
     $this->setAttribute('file_info_row_array', $file_info_row_array);
     $this->setAttribute('is_self_page', $is_self_page);
     $this->setAttribute('folder_url', $folder_url);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('module', 'User');
     $this->setAttribute('action', 'SearchFolder');
     return parent::execute();
 }