OSDN Git Service

add ACS webapp, sql, htdocs
[acs/acs.git] / webapp / modules / Community / views / CommunityLinkSuccessView.class.php
1 <?php
2 // $Id: CommunityLinkSuccessView.class.php,v 1.1 2006/03/07 07:35:16 w-ota Exp $
3
4 class CommunityLinkSuccessView extends BaseView
5 {
6         function execute() {
7                 $context = $this->getContext();
8                 $controller = $context->getController();
9                 $request =  $context->getRequest();
10                 $user = $context->getUser();
11                 $acs_user_info_row = $user->getAttribute('acs_user_info_row');
12
13                 // get
14                 $community_row = $request->getAttribute('community_row');
15                 $sub_community_row_array = $request->getAttribute('sub_community_row_array');
16                 $parent_community_row_array = $request->getAttribute('parent_community_row_array');
17                 $community_id = $community_row['community_id'];
18
19                 // ¿Æ¥³¥ß¥å¥Ë¥Æ¥£
20                 foreach ($parent_community_row_array as $index => $parent_community_row) {
21                         $parent_community_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $parent_community_row['community_id'];
22                         $parent_community_row_array[$index]['delete_community_link_url'] = $this->getControllerPath('Community', 'DeleteCommunityLink') . '&community_id=' . $community_row['community_id'] . '&delete_community_id=' . $parent_community_row['community_id'] . '&mode=parent';
23                 }
24                 // ¥µ¥Ö¥³¥ß¥å¥Ë¥Æ¥£
25                 foreach ($sub_community_row_array as $index => $sub_community_row) {
26                         $sub_community_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $sub_community_row['community_id'];
27                         $sub_community_row_array[$index]['delete_community_link_url'] = $this->getControllerPath('Community', 'DeleteCommunityLink') . '&community_id=' . $community_row['community_id'] . '&delete_community_id=' . $sub_community_row['community_id'] . '&mode=sub';
28                 }
29
30                 // ¥³¥ß¥å¥Ë¥Æ¥£¥È¥Ã¥×¥Ú¡¼¥¸¤ÎURL
31                 $community_top_page_url = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id'];
32
33                 // ¥³¥ß¥å¥Ë¥Æ¥£´Ö¥ê¥ó¥¯ÄɲÃURL
34                 $add_community_link_url = $this->getControllerPath('Community', 'AddCommunityLink') . '&community_id=' . $community_id;
35
36                 // set
37                 $this->setAttribute('community_row', $community_row);
38                 $this->setAttribute('parent_community_row_array', $parent_community_row_array);
39                 $this->setAttribute('sub_community_row_array', $sub_community_row_array);
40
41                 $this->setAttribute('community_top_page_url', $community_top_page_url);
42                 $this->setAttribute('add_community_link_url', $add_community_link_url);
43
44                 // ¥Æ¥ó¥×¥ì¡¼¥È
45                 $this->setScreenId("0001");
46                 $this->setTemplate('CommunityLink.tpl.php');
47
48                 return parent::execute();
49         }
50 }
51
52 ?>