Changeset 14939 for events/phpframework
- Timestamp:
- 07/01/08 00:08:01 (5 years ago)
- Location:
- events/phpframework/piece_framework/trunk/web/frontend
- Files:
-
- 3 modified
- 5 moved
-
htdocs/.htaccess (modified) (1 diff)
-
htdocs/self.php (moved) (moved from events/phpframework/piece_framework/trunk/web/frontend/htdocs/status.php)
-
webapp/actions/SelfAction.php (moved) (moved from events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/StatusAction.php) (6 diffs)
-
webapp/config/flows/Self.flow (moved) (moved from events/phpframework/piece_framework/trunk/web/frontend/webapp/config/flows/Status.flow)
-
webapp/config/piece-unity-config.yaml (modified) (2 diffs)
-
webapp/config/validations/Self.yaml (moved) (moved from events/phpframework/piece_framework/trunk/web/frontend/webapp/config/validations/StatusView.yaml)
-
webapp/templates/Self (moved) (moved from events/phpframework/piece_framework/trunk/web/frontend/webapp/templates/Status)
-
webapp/templates/Self/Form.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/piece_framework/trunk/web/frontend/htdocs/.htaccess
r14614 r14939 11 11 RewriteRule ^logout/?$ /logout.php [L] 12 12 13 RewriteRule ^home/?$ /s tatus.php?view=home&%{QUERY_STRING} [L]14 RewriteRule ^replies/?$ /s tatus.php?view=replies&%{QUERY_STRING} [L]15 RewriteRule ^account/archive/?$ /s tatus.php?view=archive&%{QUERY_STRING} [L]16 RewriteRule ^public_timeline/?$ /s tatus.php?view=public_timeline&%{QUERY_STRING} [L]17 RewriteRule ^status/update/?$ /s tatus.php [L]13 RewriteRule ^home/?$ /self.php?view=home&%{QUERY_STRING} [L] 14 RewriteRule ^replies/?$ /self.php?view=replies&%{QUERY_STRING} [L] 15 RewriteRule ^account/archive/?$ /self.php?view=archive&%{QUERY_STRING} [L] 16 RewriteRule ^public_timeline/?$ /self.php?view=public_timeline&%{QUERY_STRING} [L] 17 RewriteRule ^status/update/?$ /self.php [L] 18 18 RewriteRule ^status/destroy/([0-9]+)/?$ /status/destroy.php?statusId=$1 [L] 19 19 -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/SelfAction.php
r14488 r14939 13 13 require_once 'Piece/Unity/Service/FlowAction.php'; 14 14 require_once 'Piece/Unity/Service/Runemaster.php'; 15 require_once 'Phwittr/S tatus.php';15 require_once 'Phwittr/Self.php'; 16 16 17 // {{{ S tatusAction17 // {{{ SelfAction 18 18 19 19 /** 20 * Action class for the flow S tatus.20 * Action class for the flow Self. 21 21 * 22 22 * @package Phwittr_PieceFramework … … 25 25 * @since Class available since Release 0.1.0 26 26 */ 27 class S tatusAction extends Piece_Unity_Service_FlowAction27 class SelfAction extends Piece_Unity_Service_FlowAction 28 28 { 29 29 … … 53 53 { 54 54 $request = new stdClass(); 55 if (!$this->_context->getValidation()->validate('S tatusView', $request)) {55 if (!$this->_context->getValidation()->validate('Self', $request)) { 56 56 $this->_view = 'public_timeline'; 57 57 } else { 58 58 $this->_view = $request->view; 59 59 } 60 61 $loginUser = $this->_context->getSession()->getAttribute('loginUser'); 62 $this->_self = new Phwittr_Self($loginUser->id); 60 63 61 64 $this->_page = $this->_context->getAttribute('page'); … … 66 69 function displayForm() 67 70 { 68 $user = $this->_context->getSession()->getAttribute('user'); 69 $statusList = $this->_listStatus($user); 71 $statusList = $this->_listStatus(); 70 72 71 73 $viewElement = $this->_context->getViewElement(); 74 75 $viewElement->setElementByRef('self', $this->_self); 72 76 $viewElement->setElement('statusList', $statusList); 73 77 $viewElement->setElement('view', $this->_view); 74 78 $viewElement->setElement('olderPage', $this->_page + 1); 75 79 $viewElement->setElement('newerPage', $this->_page - 1); 76 $viewElement->setElement('hasOlderStatus', $this->_hasOlderStatus);80 //$viewElement->setElement('hasOlderStatus', $this->_hasOlderStatus); 77 81 78 82 $master = new Piece_Unity_Service_Runemaster(); … … 87 91 } 88 92 89 $user = $this->_context->getSession()->getAttribute('user'); 90 91 $status = new Phwittr_Status($user->userName, $user->id); 92 $status->update($request->status); 93 $this->_self->update($request->status); 93 94 94 95 return 'DisplayForm'; … … 101 102 */ 102 103 103 function _listStatus( &$user)104 function _listStatus() 104 105 { 105 $status = new Phwittr_Status($user->userName, $user->id);106 107 106 switch (strtolower($this->_view)) { 108 107 case 'home': 109 $status es = $status->listByFollowers($this->_page);108 $statusList = $this->_self->listByFollowers($this->_page); 110 109 break; 111 110 case 'replies': 112 $status es = $status->listReplies($this->_page);111 $statusList = $this->_self->listReplies($this->_page); 113 112 break; 114 113 case 'archive': 115 $status es = $status->listArchives($this->_page);114 $statusList = $this->_self->listArchives($this->_page); 116 115 break; 117 116 case 'public_timeline': 118 117 default: 119 $status es = $status->listPublicTimeline($this->_page);118 $statusList = $this->_self->listPublicTimeline($this->_page); 120 119 break; 121 120 } 122 121 123 $this->_hasOlderStatus = $status->hasOlderStatus($this->_page); 124 125 return $statuses; 122 return $statusList; 126 123 } 127 124 -
events/phpframework/piece_framework/trunk/web/frontend/webapp/config/piece-unity-config.yaml
r14937 r14939 36 36 flowName: Authentication 37 37 isExclusive: false 38 - url: /s tatus.php39 flowName: S tatus38 - url: /self.php 39 flowName: Self 40 40 isExclusive: false 41 41 - url: /account/settings.php … … 78 78 value: 79 79 - "^/logout.php" 80 - "^/s tatus.php"80 - "^/self.php" 81 81 - "^/status/destroy.php" 82 82 - "^/friends.php" -
events/phpframework/piece_framework/trunk/web/frontend/webapp/templates/Self/Form.html
r14269 r14939 25 25 <div> 26 26 <a href="?page={newerPage}" if="newerPage > 0">後へ</a> 27 <a href="?page={olderPage}" if=" hasOlderStatus">前へ</a>27 <a href="?page={olderPage}" if="self.hasNextPage()">前へ</a> 28 28 </div>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)