OSDN Git Service

add ACS webapp, sql, htdocs
[acs/acs.git] / webapp / modules / User / actions / CommunityListAction.class.php
diff --git a/webapp/modules/User/actions/CommunityListAction.class.php b/webapp/modules/User/actions/CommunityListAction.class.php
new file mode 100644 (file)
index 0000000..6258b47
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+// $Id: CommunityListAction.class.php,v 1.5 2006/11/20 08:44:25 w-ota Exp $
+
+
+class CommunityListAction extends BaseAction
+{
+       // GET
+       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');
+
+               // ¥æ¡¼¥¶¾ðÊó
+               $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
+
+               // ¥Þ¥¤¥³¥ß¥å¥Ë¥Æ¥£
+               $community_row_array = ACSUser::get_community_row_array($user_community_id);
+
+               // ¥³¥ß¥å¥Ë¥Æ¥£Á´ÂΤθø³«ÈϰϤò¥»¥Ã¥È¤¹¤ë
+               foreach ($community_row_array as $index => $community_row) {
+                       $community_row_array[$index]['contents_row_array']['self'] = ACSCommunity::get_contents_row($community_row['community_id'], ACSMsg::get_mst('contents_type_master','D00'));
+                       $community_row_array[$index]['is_community_member'] = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']);
+               }
+
+               // set
+               $request->setAttribute('target_user_info_row', $target_user_info_row);
+               $request->setAttribute('community_row_array', $community_row_array);
+
+               return View::SUCCESS;
+       }
+
+       function isSecure () {
+               return false;
+       }
+}
+
+?>