Changeset 20593 for events/phpframework/rhaco
- Timestamp:
- 10/03/08 12:53:45 (5 years ago)
- Location:
- events/phpframework/rhaco/trunk
- Files:
-
- 13 modified
-
index.php (modified) (3 diffs)
-
library/Phwittr.php (modified) (4 diffs)
-
library/PhwittrStatus.php (modified) (1 diff)
-
library/PhwittrUser.php (modified) (1 diff)
-
library/model/StandBy.php (modified) (1 diff)
-
library/model/table/FollowTable.php (modified) (8 diffs)
-
library/model/table/FollowingTable.php (modified) (13 diffs)
-
library/model/table/ReplytoTable.php (modified) (13 diffs)
-
library/model/table/StandByTable.php (modified) (8 diffs)
-
library/model/table/StatusTable.php (modified) (11 diffs)
-
library/model/table/TmpRegistrationTable.php (modified) (12 diffs)
-
library/model/table/UserTable.php (modified) (28 diffs)
-
resources/templates/default/js/application.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/rhaco/trunk/index.php
r20591 r20593 16 16 17 17 $db = new DbUtil(User::connection()); 18 RequestLogin::silent(new RequestLoginConditionDb($db, new User())); 18 19 $parser = Urls::parser( 19 20 array( … … 61 62 'method' => 'disFollow', 62 63 ), 63 64 // Request 65 '^friend_requests$' => array( 66 'class' => 'PhwittrUser', 67 'method' => 'friend_requests', 68 ), 69 '^friend_requests\/accept\/(\d+)$' => array( 70 'class' => 'PhwittrUser', 71 'method' => 'acceptRequest', 72 ), 73 '^friend_requests\/deny\/(\d+)$' => array( 74 'class' => 'PhwittrUser', 75 'method' => 'denyRequest', 76 ), 77 64 78 // ログイン/サインアップ 65 79 '^login$' => array( … … 129 143 $parser->setVariable('pf', new PhwittrFormatter()); 130 144 $parser->write(); 145 -
events/phpframework/rhaco/trunk/library/Phwittr.php
r20587 r20593 50 50 $login = $this->getLoginSession(); 51 51 if($this->isLogin() && $user->getId() == $login->getId()){ 52 $criteria = new C( 52 $selectC = new Criteria(Q::eq(Follow::columnUserId(), $user->getId())); 53 } else { 54 $selectC = new Criteria(Q::eq(Follow::columnUserId(), $user->getId()), Q::eq(User::columnPrivateFlag(), false)); 55 } 56 57 $parser = $this->read( 58 new Status(), 59 new C( 53 60 Q::eq(Status::columnUserId(), $user->getId()), 54 61 Q::orc( … … 56 63 Status::columnUserId(), 57 64 Follow::columnFollowId(), 58 new Criteria(Q::eq(Follow::columnUserId(), $user->getId()))65 $selectC 59 66 ) 60 67 ), 61 68 Q::orderDesc(Status::columnCreatedAt()) 62 ); 63 } else { 64 $criteria = new C( 65 Q::eq(Status::columnUserId(), $user->getId()), 66 Q::orc( 67 Q::selectIn( 68 Status::columnUserId(), 69 Follow::columnFollowId(), 70 new Criteria(Q::eq(Follow::columnUserId(), $user->getId()), Q::eq(User::columnPrivateFlag(), false)) 71 ) 72 ), 73 Q::orderDesc(Status::columnCreatedAt()) 74 ); 75 } 76 77 $parser = $this->read( 78 new Status(), 79 $criteria 69 ) 80 70 ); 81 71 $parser->setVariable('user', $user); … … 134 124 Header::inline(Rhaco::constant(VAR_UPLOAD_PATH).'/default.gif', 'default', 'image/gif'); 135 125 Rhaco::end(); 136 }137 138 function _getLoginedParser(){139 if(RequestLogin::isLogin()){140 $user = RequestLogin::getLoginSession();141 $parser = new HtmlParser();142 $parser->setVariable('user', $user);143 $parser->setVariable('following', $this->_getFollowing($user));144 return $parser;145 }146 return false;147 126 } 148 127 … … 206 185 207 186 function loginRequired(){ 208 if(RequestLogin::silent(new RequestLoginConditionDb($this->dbUtil, new User()))){ 187 if(RequestLogin::isLoginSession()) return RequestLogin::getLoginSession(); 188 if(RequestLogin::isLoginCookie() && RequestLogin::silent(new RequestLoginConditionDb($this->dbUtil, new User()))){ 209 189 return RequestLogin::getLoginSession(); 210 190 } 191 RequestLogin::loginRequired(new RequestLoginConditionDb($this->dbUtil, new User())); 211 192 Header::redirect(Rhaco::url('login')); 212 193 Rhaco::end(); -
events/phpframework/rhaco/trunk/library/PhwittrStatus.php
r20589 r20593 40 40 $status = $this->dbUtil->insert($this->toObject(new Status())); 41 41 } 42 switch($this->getVariable('type', 'html')){ 43 case 'json': 44 if(Variable::istype('TableObjectBase', $status)){ 45 // success 46 $replyUserName = $status->getReplyUserName(); 47 $status->comment = PhwittrFormatter::c($status->comment); 48 $status->createdAt = TemplateFormatter::dateformat($status->createdAt); 49 $status->replyTo = ($status->replyUserId) ? sprintf(' in reply to <a href="%s">%s</a>', Rhaco::url($replyUserName), $replyUserName) : ''; 50 $response = array( 51 'error' => 0, 52 'message' => 'status updated!', 53 'status' => $status, 54 'user' => $user, 55 ); 56 } else { 57 // fail 58 $error = array_shift(ExceptionTrigger::get('Status_comment')); 59 $response = array( 60 'error' => 1, 61 'message' => $error->getMessage(), 62 ); 63 } 64 $response = V::toJson($response); 65 header('Content-type: application/json; charset=UTF-8'); 66 header(sprintf("X-JSON: (%s)", $response)); 67 echo $response; 68 break; 69 default: 70 if(Variable::istype('TableObjectBase', $status)) 71 $this->setSession('notice', 'status updated!'); 72 Header::redirect(Rhaco::url('home')); 42 if(Variable::istype('TableObjectBase', $status)){ 43 // success 44 $replyUserName = $status->getReplyUserName(); 45 $status->comment = PhwittrFormatter::c($status->comment); 46 $status->createdAt = TemplateFormatter::dateformat($status->createdAt); 47 $status->replyTo = ($status->replyUserId) ? sprintf(' in reply to <a href="%s">%s</a>', Rhaco::url($replyUserName), $replyUserName) : ''; 48 $response = array( 49 'error' => 0, 50 'message' => 'status updated!', 51 'status' => $status, 52 'user' => $user, 53 ); 54 } else { 55 // fail 56 $error = array_shift(ExceptionTrigger::get('Status_comment')); 57 $response = array( 58 'error' => 1, 59 'message' => $error->getMessage(), 60 ); 73 61 } 62 $response = V::toJson($response); 63 header('Content-type: application/json; charset=UTF-8'); 64 header(sprintf("X-JSON: (%s)", $response)); 65 echo $response; 74 66 Rhaco::end(); 75 67 } -
events/phpframework/rhaco/trunk/library/PhwittrUser.php
r20592 r20593 168 168 } 169 169 170 function friend_requests(){ 171 $user = $this->loginRequired(); 172 if($user->privateFlag == false){ 173 Header::redirect(Rhaco::url('home')); 174 } 175 $parser = $this->read(new StandBy(), new C(Q::eq(StandBy::columnRequestId(), $user->getId()), Q::fact())); 176 $parser->setTemplate(Rhaco::constant('THEME').'/friend_requests.html'); 177 $parser->setVariable('user', $user); 178 $parser->setVariable('following', $this->_getFollowing($user)); 179 return $parser; 180 } 181 function acceptRequest($id){ 182 $user = $this->loginRequired(); 183 $request = $this->dbUtil->get(new StandBy($id)); 184 if(Variable::istype('TableObjectBase', $request) && $request->requestId == $user->id){ 185 $request->accept($this->dbUtil); 186 } 187 Header::redirect(Rhaco::url('friend_requests')); 188 } 189 function denyRequest($id){ 190 $user = $this->loginRequired(); 191 $request = $this->dbUtil->get(new StandBy($id)); 192 if(Variable::istype('TableObjectBase', $request) && $request->requestId == $user->id){ 193 $request->deny($this->dbUtil); 194 } 195 Header::redirect(Rhaco::url('friend_requests')); 196 } 197 170 198 function login(){ 171 199 $user = $this->loginRequired(); -
events/phpframework/rhaco/trunk/library/model/StandBy.php
r14912 r20593 1 1 <?php 2 2 Rhaco::import("model.table.StandByTable"); 3 Rhaco::import('model.Follow'); 3 4 /** 4 5 * 5 6 */ 6 7 class StandBy extends StandByTable{ 7 8 // 相互接続した方がいいのかな? 9 function accept(&$db){ 10 $follow = new Follow(); 11 $follow->setUserId($this->userId); 12 $follow->setFollowId($this->requestId); 13 if($follow->save($db)){ 14 $db->delete($this); 15 return true; 16 } 17 return false; 18 } 19 function deny(&$db){ 20 return $db->delete($this); 21 } 8 22 } 9 23 -
events/phpframework/rhaco/trunk/library/model/table/FollowTable.php
r20590 r20593 50 50 function columnId(){ 51 51 if(!Rhaco::isVariable("_R_D_C_","Follow::Id")){ 52 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true," );52 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true,",__CLASS__); 53 53 $column->label(Message::_("id")); 54 54 Rhaco::addVariable("_R_D_C_",$column,"Follow::Id"); … … 58 58 /** 59 59 * 60 * @return serial */ 60 * @return serial 61 */ 61 62 function setId($value){ 62 63 $this->id = TableObjectUtil::cast($value,"serial"); … … 74 75 function columnUserId(){ 75 76 if(!Rhaco::isVariable("_R_D_C_","Follow::UserId")){ 76 $column = new Column("column=user_id,variable=userId,type=integer,size=22,unique=true,reference=User::Id,uniqueWith=Follow::FollowId," );77 $column = new Column("column=user_id,variable=userId,type=integer,size=22,unique=true,reference=User::Id,uniqueWith=Follow::FollowId,",__CLASS__); 77 78 $column->label(Message::_("user_id")); 78 79 Rhaco::addVariable("_R_D_C_",$column,"Follow::UserId"); … … 82 83 /** 83 84 * 84 * @return integer */ 85 * @return integer 86 */ 85 87 function setUserId($value){ 86 88 $this->userId = TableObjectUtil::cast($value,"integer"); … … 98 100 function columnFollowId(){ 99 101 if(!Rhaco::isVariable("_R_D_C_","Follow::FollowId")){ 100 $column = new Column("column=follow_id,variable=followId,type=integer,size=22,require=true,unique=true,uniqueWith=Follow::UserId," );102 $column = new Column("column=follow_id,variable=followId,type=integer,size=22,require=true,unique=true,uniqueWith=Follow::UserId,",__CLASS__); 101 103 $column->label(Message::_("follow_id")); 102 104 Rhaco::addVariable("_R_D_C_",$column,"Follow::FollowId"); … … 106 108 /** 107 109 * 108 * @return integer */ 110 * @return integer 111 */ 109 112 function setFollowId($value){ 110 113 $this->followId = TableObjectUtil::cast($value,"integer"); … … 122 125 function columnCreatedAt(){ 123 126 if(!Rhaco::isVariable("_R_D_C_","Follow::CreatedAt")){ 124 $column = new Column("column=created_at,variable=createdAt,type=timestamp," );127 $column = new Column("column=created_at,variable=createdAt,type=timestamp,",__CLASS__); 125 128 $column->label(Message::_("created_at")); 126 129 Rhaco::addVariable("_R_D_C_",$column,"Follow::CreatedAt"); … … 130 133 /** 131 134 * 132 * @return timestamp */ 135 * @return timestamp 136 */ 133 137 function setCreatedAt($value){ 134 138 $this->createdAt = TableObjectUtil::cast($value,"timestamp"); -
events/phpframework/rhaco/trunk/library/model/table/FollowingTable.php
r20590 r20593 26 26 function columnId(){ 27 27 if(!Rhaco::isVariable("_R_D_C_","Following::Id")){ 28 Rhaco::addVariable("_R_D_C_",new Column(parent::columnId() ),"Following::Id");28 Rhaco::addVariable("_R_D_C_",new Column(parent::columnId(),__CLASS__),"Following::Id"); 29 29 } 30 30 return Rhaco::getVariable("_R_D_C_",null,"Following::Id"); … … 32 32 function columnName(){ 33 33 if(!Rhaco::isVariable("_R_D_C_","Following::Name")){ 34 Rhaco::addVariable("_R_D_C_",new Column(parent::columnName() ),"Following::Name");34 Rhaco::addVariable("_R_D_C_",new Column(parent::columnName(),__CLASS__),"Following::Name"); 35 35 } 36 36 return Rhaco::getVariable("_R_D_C_",null,"Following::Name"); … … 38 38 function columnPassword(){ 39 39 if(!Rhaco::isVariable("_R_D_C_","Following::Password")){ 40 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPassword() ),"Following::Password");40 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPassword(),__CLASS__),"Following::Password"); 41 41 } 42 42 return Rhaco::getVariable("_R_D_C_",null,"Following::Password"); … … 44 44 function columnEmail(){ 45 45 if(!Rhaco::isVariable("_R_D_C_","Following::Email")){ 46 Rhaco::addVariable("_R_D_C_",new Column(parent::columnEmail() ),"Following::Email");46 Rhaco::addVariable("_R_D_C_",new Column(parent::columnEmail(),__CLASS__),"Following::Email"); 47 47 } 48 48 return Rhaco::getVariable("_R_D_C_",null,"Following::Email"); … … 50 50 function columnImage(){ 51 51 if(!Rhaco::isVariable("_R_D_C_","Following::Image")){ 52 Rhaco::addVariable("_R_D_C_",new Column(parent::columnImage() ),"Following::Image");52 Rhaco::addVariable("_R_D_C_",new Column(parent::columnImage(),__CLASS__),"Following::Image"); 53 53 } 54 54 return Rhaco::getVariable("_R_D_C_",null,"Following::Image"); … … 56 56 function columnPrivateFlag(){ 57 57 if(!Rhaco::isVariable("_R_D_C_","Following::PrivateFlag")){ 58 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPrivateFlag() ),"Following::PrivateFlag");58 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPrivateFlag(),__CLASS__),"Following::PrivateFlag"); 59 59 } 60 60 return Rhaco::getVariable("_R_D_C_",null,"Following::PrivateFlag"); … … 62 62 function columnCreatedAt(){ 63 63 if(!Rhaco::isVariable("_R_D_C_","Following::CreatedAt")){ 64 Rhaco::addVariable("_R_D_C_",new Column(parent::columnCreatedAt() ),"Following::CreatedAt");64 Rhaco::addVariable("_R_D_C_",new Column(parent::columnCreatedAt(),__CLASS__),"Following::CreatedAt"); 65 65 } 66 66 return Rhaco::getVariable("_R_D_C_",null,"Following::CreatedAt"); … … 68 68 function columnUpdatedAt(){ 69 69 if(!Rhaco::isVariable("_R_D_C_","Following::UpdatedAt")){ 70 Rhaco::addVariable("_R_D_C_",new Column(parent::columnUpdatedAt() ),"Following::UpdatedAt");70 Rhaco::addVariable("_R_D_C_",new Column(parent::columnUpdatedAt(),__CLASS__),"Following::UpdatedAt"); 71 71 } 72 72 return Rhaco::getVariable("_R_D_C_",null,"Following::UpdatedAt"); … … 74 74 function columnDeleteFlag(){ 75 75 if(!Rhaco::isVariable("_R_D_C_","Following::DeleteFlag")){ 76 Rhaco::addVariable("_R_D_C_",new Column(parent::columnDeleteFlag() ),"Following::DeleteFlag");76 Rhaco::addVariable("_R_D_C_",new Column(parent::columnDeleteFlag(),__CLASS__),"Following::DeleteFlag"); 77 77 } 78 78 return Rhaco::getVariable("_R_D_C_",null,"Following::DeleteFlag"); … … 80 80 function columnHash(){ 81 81 if(!Rhaco::isVariable("_R_D_C_","Following::Hash")){ 82 Rhaco::addVariable("_R_D_C_",new Column(parent::columnHash() ),"Following::Hash");82 Rhaco::addVariable("_R_D_C_",new Column(parent::columnHash(),__CLASS__),"Following::Hash"); 83 83 } 84 84 return Rhaco::getVariable("_R_D_C_",null,"Following::Hash"); … … 86 86 function columnStatusCount(){ 87 87 if(!Rhaco::isVariable("_R_D_C_","Following::StatusCount")){ 88 Rhaco::addVariable("_R_D_C_",new Column(parent::columnStatusCount() ),"Following::StatusCount");88 Rhaco::addVariable("_R_D_C_",new Column(parent::columnStatusCount(),__CLASS__),"Following::StatusCount"); 89 89 } 90 90 return Rhaco::getVariable("_R_D_C_",null,"Following::StatusCount"); … … 92 92 function columnFollowingCount(){ 93 93 if(!Rhaco::isVariable("_R_D_C_","Following::FollowingCount")){ 94 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowingCount() ),"Following::FollowingCount");94 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowingCount(),__CLASS__),"Following::FollowingCount"); 95 95 } 96 96 return Rhaco::getVariable("_R_D_C_",null,"Following::FollowingCount"); … … 98 98 function columnFollowerCount(){ 99 99 if(!Rhaco::isVariable("_R_D_C_","Following::FollowerCount")){ 100 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowerCount() ),"Following::FollowerCount");100 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowerCount(),__CLASS__),"Following::FollowerCount"); 101 101 } 102 102 return Rhaco::getVariable("_R_D_C_",null,"Following::FollowerCount"); -
events/phpframework/rhaco/trunk/library/model/table/ReplytoTable.php
r20590 r20593 24 24 function columnId(){ 25 25 if(!Rhaco::isVariable("_R_D_C_","Replyto::Id")){ 26 Rhaco::addVariable("_R_D_C_",new Column(parent::columnId() ),"Replyto::Id");26 Rhaco::addVariable("_R_D_C_",new Column(parent::columnId(),__CLASS__),"Replyto::Id"); 27 27 } 28 28 return Rhaco::getVariable("_R_D_C_",null,"Replyto::Id"); … … 30 30 function columnName(){ 31 31 if(!Rhaco::isVariable("_R_D_C_","Replyto::Name")){ 32 Rhaco::addVariable("_R_D_C_",new Column(parent::columnName() ),"Replyto::Name");32 Rhaco::addVariable("_R_D_C_",new Column(parent::columnName(),__CLASS__),"Replyto::Name"); 33 33 } 34 34 return Rhaco::getVariable("_R_D_C_",null,"Replyto::Name"); … … 36 36 function columnPassword(){ 37 37 if(!Rhaco::isVariable("_R_D_C_","Replyto::Password")){ 38 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPassword() ),"Replyto::Password");38 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPassword(),__CLASS__),"Replyto::Password"); 39 39 } 40 40 return Rhaco::getVariable("_R_D_C_",null,"Replyto::Password"); … … 42 42 function columnEmail(){ 43 43 if(!Rhaco::isVariable("_R_D_C_","Replyto::Email")){ 44 Rhaco::addVariable("_R_D_C_",new Column(parent::columnEmail() ),"Replyto::Email");44 Rhaco::addVariable("_R_D_C_",new Column(parent::columnEmail(),__CLASS__),"Replyto::Email"); 45 45 } 46 46 return Rhaco::getVariable("_R_D_C_",null,"Replyto::Email"); … … 48 48 function columnImage(){ 49 49 if(!Rhaco::isVariable("_R_D_C_","Replyto::Image")){ 50 Rhaco::addVariable("_R_D_C_",new Column(parent::columnImage() ),"Replyto::Image");50 Rhaco::addVariable("_R_D_C_",new Column(parent::columnImage(),__CLASS__),"Replyto::Image"); 51 51 } 52 52 return Rhaco::getVariable("_R_D_C_",null,"Replyto::Image"); … … 54 54 function columnPrivateFlag(){ 55 55 if(!Rhaco::isVariable("_R_D_C_","Replyto::PrivateFlag")){ 56 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPrivateFlag() ),"Replyto::PrivateFlag");56 Rhaco::addVariable("_R_D_C_",new Column(parent::columnPrivateFlag(),__CLASS__),"Replyto::PrivateFlag"); 57 57 } 58 58 return Rhaco::getVariable("_R_D_C_",null,"Replyto::PrivateFlag"); … … 60 60 function columnCreatedAt(){ 61 61 if(!Rhaco::isVariable("_R_D_C_","Replyto::CreatedAt")){ 62 Rhaco::addVariable("_R_D_C_",new Column(parent::columnCreatedAt() ),"Replyto::CreatedAt");62 Rhaco::addVariable("_R_D_C_",new Column(parent::columnCreatedAt(),__CLASS__),"Replyto::CreatedAt"); 63 63 } 64 64 return Rhaco::getVariable("_R_D_C_",null,"Replyto::CreatedAt"); … … 66 66 function columnUpdatedAt(){ 67 67 if(!Rhaco::isVariable("_R_D_C_","Replyto::UpdatedAt")){ 68 Rhaco::addVariable("_R_D_C_",new Column(parent::columnUpdatedAt() ),"Replyto::UpdatedAt");68 Rhaco::addVariable("_R_D_C_",new Column(parent::columnUpdatedAt(),__CLASS__),"Replyto::UpdatedAt"); 69 69 } 70 70 return Rhaco::getVariable("_R_D_C_",null,"Replyto::UpdatedAt"); … … 72 72 function columnDeleteFlag(){ 73 73 if(!Rhaco::isVariable("_R_D_C_","Replyto::DeleteFlag")){ 74 Rhaco::addVariable("_R_D_C_",new Column(parent::columnDeleteFlag() ),"Replyto::DeleteFlag");74 Rhaco::addVariable("_R_D_C_",new Column(parent::columnDeleteFlag(),__CLASS__),"Replyto::DeleteFlag"); 75 75 } 76 76 return Rhaco::getVariable("_R_D_C_",null,"Replyto::DeleteFlag"); … … 78 78 function columnHash(){ 79 79 if(!Rhaco::isVariable("_R_D_C_","Replyto::Hash")){ 80 Rhaco::addVariable("_R_D_C_",new Column(parent::columnHash() ),"Replyto::Hash");80 Rhaco::addVariable("_R_D_C_",new Column(parent::columnHash(),__CLASS__),"Replyto::Hash"); 81 81 } 82 82 return Rhaco::getVariable("_R_D_C_",null,"Replyto::Hash"); … … 84 84 function columnStatusCount(){ 85 85 if(!Rhaco::isVariable("_R_D_C_","Replyto::StatusCount")){ 86 Rhaco::addVariable("_R_D_C_",new Column(parent::columnStatusCount() ),"Replyto::StatusCount");86 Rhaco::addVariable("_R_D_C_",new Column(parent::columnStatusCount(),__CLASS__),"Replyto::StatusCount"); 87 87 } 88 88 return Rhaco::getVariable("_R_D_C_",null,"Replyto::StatusCount"); … … 90 90 function columnFollowingCount(){ 91 91 if(!Rhaco::isVariable("_R_D_C_","Replyto::FollowingCount")){ 92 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowingCount() ),"Replyto::FollowingCount");92 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowingCount(),__CLASS__),"Replyto::FollowingCount"); 93 93 } 94 94 return Rhaco::getVariable("_R_D_C_",null,"Replyto::FollowingCount"); … … 96 96 function columnFollowerCount(){ 97 97 if(!Rhaco::isVariable("_R_D_C_","Replyto::FollowerCount")){ 98 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowerCount() ),"Replyto::FollowerCount");98 Rhaco::addVariable("_R_D_C_",new Column(parent::columnFollowerCount(),__CLASS__),"Replyto::FollowerCount"); 99 99 } 100 100 return Rhaco::getVariable("_R_D_C_",null,"Replyto::FollowerCount"); -
events/phpframework/rhaco/trunk/library/model/table/StandByTable.php
r20591 r20593 51 51 function columnId(){ 52 52 if(!Rhaco::isVariable("_R_D_C_","StandBy::Id")){ 53 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true," );53 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true,",__CLASS__); 54 54 $column->label(Message::_("id")); 55 55 Rhaco::addVariable("_R_D_C_",$column,"StandBy::Id"); … … 59 59 /** 60 60 * 61 * @return serial */ 61 * @return serial 62 */ 62 63 function setId($value){ 63 64 $this->id = TableObjectUtil::cast($value,"serial"); … … 75 76 function columnUserId(){ 76 77 if(!Rhaco::isVariable("_R_D_C_","StandBy::UserId")){ 77 $column = new Column("column=user_id,variable=userId,type=integer,size=22,unique=true,reference=User::Id,uniqueWith=StandBy::RequestId," );78 $column = new Column("column=user_id,variable=userId,type=integer,size=22,unique=true,reference=User::Id,uniqueWith=StandBy::RequestId,",__CLASS__); 78 79 $column->label(Message::_("user_id")); 79 80 Rhaco::addVariable("_R_D_C_",$column,"StandBy::UserId"); … … 83 84 /** 84 85 * 85 * @return integer */ 86 * @return integer 87 */ 86 88 function setUserId($value){ 87 89 $this->userId = TableObjectUtil::cast($value,"integer"); … … 99 101 function columnRequestId(){ 100 102 if(!Rhaco::isVariable("_R_D_C_","StandBy::RequestId")){ 101 $column = new Column("column=request_id,variable=requestId,type=integer,size=22,require=true,unique=true,reference=Following::Id,uniqueWith=StandBy::UserId," );103 $column = new Column("column=request_id,variable=requestId,type=integer,size=22,require=true,unique=true,reference=Following::Id,uniqueWith=StandBy::UserId,",__CLASS__); 102 104 $column->label(Message::_("request_id")); 103 105 Rhaco::addVariable("_R_D_C_",$column,"StandBy::RequestId"); … … 107 109 /** 108 110 * 109 * @return integer */ 111 * @return integer 112 */ 110 113 function setRequestId($value){ 111 114 $this->requestId = TableObjectUtil::cast($value,"integer"); … … 123 126 function columnCreatedAt(){ 124 127 if(!Rhaco::isVariable("_R_D_C_","StandBy::CreatedAt")){ 125 $column = new Column("column=created_at,variable=createdAt,type=timestamp," );128 $column = new Column("column=created_at,variable=createdAt,type=timestamp,",__CLASS__); 126 129 $column->label(Message::_("created_at")); 127 130 Rhaco::addVariable("_R_D_C_",$column,"StandBy::CreatedAt"); … … 131 134 /** 132 135 * 133 * @return timestamp */ 136 * @return timestamp 137 */ 134 138 function setCreatedAt($value){ 135 139 $this->createdAt = TableObjectUtil::cast($value,"timestamp"); -
events/phpframework/rhaco/trunk/library/model/table/StatusTable.php
r20590 r20593 55 55 function columnId(){ 56 56 if(!Rhaco::isVariable("_R_D_C_","Status::Id")){ 57 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true," );57 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true,",__CLASS__); 58 58 $column->label(Message::_("id")); 59 59 Rhaco::addVariable("_R_D_C_",$column,"Status::Id"); … … 63 63 /** 64 64 * 65 * @return serial */ 65 * @return serial 66 */ 66 67 function setId($value){ 67 68 $this->id = TableObjectUtil::cast($value,"serial"); … … 79 80 function columnUserId(){ 80 81 if(!Rhaco::isVariable("_R_D_C_","Status::UserId")){ 81 $column = new Column("column=user_id,variable=userId,type=integer,size=22,reference=User::Id," );82 $column = new Column("column=user_id,variable=userId,type=integer,size=22,reference=User::Id,",__CLASS__); 82 83 $column->label(Message::_("user_id")); 83 84 Rhaco::addVariable("_R_D_C_",$column,"Status::UserId"); … … 87 88 /** 88 89 * 89 * @return integer */ 90 * @return integer 91 */ 90 92 function setUserId($value){ 91 93 $this->userId = TableObjectUtil::cast($value,"integer"); … … 103 105 function columnComment(){ 104 106 if(!Rhaco::isVariable("_R_D_C_","Status::Comment")){ 105 $column = new Column("column=comment,variable=comment,type=string,size=140,require=true," );107 $column = new Column("column=comment,variable=comment,type=string,size=140,require=true,",__CLASS__); 106 108 $column->label(Message::_("comment")); 107 109 Rhaco::addVariable("_R_D_C_",$column,"Status::Comment"); … … 111 113 /** 112 114 * 113 * @return string */ 115 * @return string 116 */ 114 117 function setComment($value){ 115 118 $this->comment = TableObjectUtil::cast($value,"string"); … … 127 130 function columnReplyUserId(){ 128 131 if(!Rhaco::isVariable("_R_D_C_","Status::ReplyUserId")){ 129 $column = new Column("column=reply_user_id,variable=replyUserId,type=integer,size=22," );132 $column = new Column("column=reply_user_id,variable=replyUserId,type=integer,size=22,",__CLASS__); 130 133 $column->label(Message::_("reply_user_id")); 131 134 Rhaco::addVariable("_R_D_C_",$column,"Status::ReplyUserId"); … … 135 138 /** 136 139 * 137 * @return integer */ 140 * @return integer 141 */ 138 142 function setReplyUserId($value){ 139 143 $this->replyUserId = TableObjectUtil::cast($value,"integer"); … … 151 155 function columnCreatedAt(){ 152 156 if(!Rhaco::isVariable("_R_D_C_","Status::CreatedAt")){ 153 $column = new Column("column=created_at,variable=createdAt,type=timestamp," );157 $column = new Column("column=created_at,variable=createdAt,type=timestamp,",__CLASS__); 154 158 $column->label(Message::_("created_at")); 155 159 Rhaco::addVariable("_R_D_C_",$column,"Status::CreatedAt"); … … 159 163 /** 160 164 * 161 * @return timestamp */ 165 * @return timestamp 166 */ 162 167 function setCreatedAt($value){ 163 168 $this->createdAt = TableObjectUtil::cast($value,"timestamp"); … … 184 189 /** 185 190 * 186 * @return string */ 191 * @return string 192 */ 187 193 function setReplyUserName($value){ 188 194 $this->replyUserName = TableObjectUtil::cast($value,"string"); -
events/phpframework/rhaco/trunk/library/model/table/TmpRegistrationTable.php
r20590 r20593 55 55 function columnId(){ 56 56 if(!Rhaco::isVariable("_R_D_C_","TmpRegistration::Id")){ 57 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true," );57 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true,",__CLASS__); 58 58 $column->label(Message::_("id")); 59 59 Rhaco::addVariable("_R_D_C_",$column,"TmpRegistration::Id"); … … 63 63 /** 64 64 * 65 * @return serial */ 65 * @return serial 66 */ 66 67 function setId($value){ 67 68 $this->id = TableObjectUtil::cast($value,"serial"); … … 79 80 function columnName(){ 80 81 if(!Rhaco::isVariable("_R_D_C_","TmpRegistration::Name")){ 81 $column = new Column("column=name,variable=name,type=string,size=30,require=true,unique=true,chartype=/^[A-Za-z0-9_-]+$/," );82 $column = new Column("column=name,variable=name,type=string,size=30,require=true,unique=true,chartype=/^[A-Za-z0-9_-]+$/,",__CLASS__); 82 83 $column->label(Message::_("name")); 83 84 Rhaco::addVariable("_R_D_C_",$column,"TmpRegistration::Name"); … … 87 88 /** 88 89 * 89 * @return string */ 90 * @return string 91 */ 90 92 function setName($value){ 91 93 $this->name = TableObjectUtil::cast($value,"string"); … … 103 105 function columnPassword(){ 104 106 if(!Rhaco::isVariable("_R_D_C_","TmpRegistration::Password")){ 105 $column = new Column("column=password,variable=password,type=string,size=100,require=true," );107 $column = new Column("column=password,variable=password,type=string,size=100,require=true,",__CLASS__); 106 108 $column->label(Message::_("password")); 107 109 Rhaco::addVariable("_R_D_C_",$column,"TmpRegistration::Password"); … … 111 113 /** 112 114 * 113 * @return string */ 115 * @return string 116 */ 114 117 function setPassword($value){ 115 118 $this->password = TableObjectUtil::cast($value,"string"); … … 127 130 function columnEmail(){ 128 131 if(!Rhaco::isVariable("_R_D_C_","TmpRegistration::Email")){ 129 $column = new Column("column=email,variable=email,type=email,size=255,require=true," );132 $column = new Column("column=email,variable=email,type=email,size=255,require=true,",__CLASS__); 130 133 $column->label(Message::_("email")); 131 134 Rhaco::addVariable("_R_D_C_",$column,"TmpRegistration::Email"); … … 135 138 /** 136 139 * 137 * @return email */ 140 * @return email 141 */ 138 142 function setEmail($value){ 139 143 $this->email = TableObjectUtil::cast($value,"email"); … … 151 155 function columnHash(){ 152 156 if(!Rhaco::isVariable("_R_D_C_","TmpRegistration::Hash")){ 153 $column = new Column("column=hash,variable=hash,type=string," );157 $column = new Column("column=hash,variable=hash,type=string,",__CLASS__); 154 158 $column->label(Message::_("hash")); 155 159 Rhaco::addVariable("_R_D_C_",$column,"TmpRegistration::Hash"); … … 159 163 /** 160 164 * 161 * @return string */ 165 * @return string 166 */ 162 167 function setHash($value){ 163 168 $this->hash = TableObjectUtil::cast($value,"string"); … … 175 180 function columnCreatedAt(){ 176 181 if(!Rhaco::isVariable("_R_D_C_","TmpRegistration::CreatedAt")){ 177 $column = new Column("column=created_at,variable=createdAt,type=timestamp," );182 $column = new Column("column=created_at,variable=createdAt,type=timestamp,",__CLASS__); 178 183 $column->label(Message::_("created_at")); 179 184 Rhaco::addVariable("_R_D_C_",$column,"TmpRegistration::CreatedAt"); … … 183 188 /** 184 189 * 185 * @return timestamp */ 190 * @return timestamp 191 */ 186 192 function setCreatedAt($value){ 187 193 $this->createdAt = TableObjectUtil::cast($value,"timestamp"); -
events/phpframework/rhaco/trunk/library/model/table/UserTable.php
r20590 r20593 80 80 function columnId(){ 81 81 if(!Rhaco::isVariable("_R_D_C_","User::Id")){ 82 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true," );82 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true,",__CLASS__); 83 83 $column->label(Message::_("id")); 84 84 $column->depend("Status::UserId","Follow::UserId","StandBy::UserId"); … … 89 89 /** 90 90 * 91 * @return serial */ 91 * @return serial 92 */ 92 93 function setId($value){ 93 94 $this->id = TableObjectUtil::cast($value,"serial"); … … 105 106 function columnName(){ 106 107 if(!Rhaco::isVariable("_R_D_C_","User::Name")){ 107 $column = new Column("column=name,variable=name,type=string,size=30,require=true,unique=true,chartype=/^[A-Za-z0-9_-]+$/," );108 $column = new Column("column=name,variable=name,type=string,size=30,require=true,unique=true,chartype=/^[A-Za-z0-9_-]+$/,",__CLASS__); 108 109 $column->label(Message::_("name")); 109 110 Rhaco::addVariable("_R_D_C_",$column,"User::Name"); … … 113 114 /** 114 115 * 115 * @return string */ 116 * @return string 117 */ 116 118 function setName($value){ 117 119 $this->name = TableObjectUtil::cast($value,"string"); … … 129 131 function columnPassword(){ 130 132 if(!Rhaco::isVariable("_R_D_C_","User::Password")){ 131 $column = new Column("column=password,variable=password,type=string,size=100,require=true," );133 $column = new Column("column=password,variable=password,type=string,size=100,require=true,",__CLASS__); 132 134 $column->label(Message::_("password")); 133 135 Rhaco::addVariable("_R_D_C_",$column,"User::Password"); … … 137 139 /** 138 140 * 139 * @return string */ 141 * @return string 142 */ 140 143 function setPassword($value){ 141 144 $this->password = TableObjectUtil::cast($value,"string"); … … 153 156 function columnEmail(){ 154 157 if(!Rhaco::isVariable("_R_D_C_","User::Email")){ 155 $column = new Column("column=email,variable=email,type=email,size=255,require=true," );158 $column = new Column("column=email,variable=email,type=email,size=255,require=true,",__CLASS__); 156 159 $column->label(Message::_("email")); 157 160 Rhaco::addVariable("_R_D_C_",$column,"User::Email"); … … 161 164 /** 162 165 * 163 * @return email */ 166 * @return email 167 */ 164 168 function setEmail($value){ 165 169 $this->email = TableObjectUtil::cast($value,"email"); … … 177 181 function columnImage(){ 178 182 if(!Rhaco::isVariable("_R_D_C_","User::Image")){ 179 $column = new Column("column=image,variable=image,type=string,size=50," );183 $column = new Column("column=image,variable=image,type=string,size=50,",__CLASS__); 180 184 $column->label(Message::_("image")); 181 185 Rhaco::addVariable("_R_D_C_",$column,"User::Image"); … … 185 189 /** 186 190 * 187 * @return string */ 191 * @return string 192 */ 188 193 function setImage($value){ 189 194 $this->image = TableObjectUtil::cast($value,"string"); … … 201 206 function columnPrivateFlag(){ 202 207 if(!Rhaco::isVariable("_R_D_C_","User::PrivateFlag")){ 203 $column = new Column("column=private_flag,variable=privateFlag,type=boolean," );208 $column = new Column("column=private_flag,variable=privateFlag,type=boolean,",__CLASS__); 204 209 $column->label(Message::_("private_flag")); 205 210 Rhaco::addVariable("_R_D_C_",$column,"User::PrivateFlag"); … … 209 214 /** 210 215 * 211 * @return boolean */ 216 * @return boolean 217 */ 212 218 function setPrivateFlag($value){ 213 219 $this->privateFlag = TableObjectUtil::cast($value,"boolean"); … … 221 227 /** */ 222 228 function isPrivateFlag(){ 223 return $this->privateFlag;229 return Variable::bool($this->privateFlag); 224 230 } 225 231 /** … … 229 235 function columnCreatedAt(){ 230 236 if(!Rhaco::isVariable("_R_D_C_","User::CreatedAt")){ 231 $column = new Column("column=created_at,variable=createdAt,type=timestamp," );237 $column = new Column("column=created_at,variable=createdAt,type=timestamp,",__CLASS__); 232 238 $column->label(Message::_("created_at")); 233 239 Rhaco::addVariable("_R_D_C_",$column,"User::CreatedAt"); … … 237 243 /** 238 244 * 239 * @return timestamp */ 245 * @return timestamp 246 */ 240 247 function setCreatedAt($value){ 241 248 $this->createdAt = TableObjectUtil::cast($value,"timestamp"); … … 257 264 function columnUpdatedAt(){ 258 265 if(!Rhaco::isVariable("_R_D_C_","User::UpdatedAt")){ 259 $column = new Column("column=updated_at,variable=updatedAt,type=timestamp," );266 $column = new Column("column=updated_at,variable=updatedAt,type=timestamp,",__CLASS__); 260 267 $column->label(Message::_("updated_at")); 261 268 Rhaco::addVariable("_R_D_C_",$column,"User::UpdatedAt"); … … 265 272 /** 266 273 * 267 * @return timestamp */ 274 * @return timestamp 275 */ 268 276 function setUpdatedAt($value){ 269 277 $this->updatedAt = TableObjectUtil::cast($value,"timestamp"); … … 285 293 function columnDeleteFlag(){ 286 294 if(!Rhaco::isVariable("_R_D_C_","User::DeleteFlag")){ 287 $column = new Column("column=delete_flag,variable=deleteFlag,type=boolean," );295 $column = new Column("column=delete_flag,variable=deleteFlag,type=boolean,",__CLASS__); 288 296 $column->label(Message::_("delete_flag")); 289 297 Rhaco::addVariable("_R_D_C_",$column,"User::DeleteFlag"); … … 293 301 /** 294 302 * 295 * @return boolean */ 303 * @return boolean 304 */ 296 305 function setDeleteFlag($value){ 297 306 $this->deleteFlag = TableObjectUtil::cast($value,"boolean"); … … 305 314 /** */ 306 315 function isDeleteFlag(){ 307 return $this->deleteFlag;316 return Variable::bool($this->deleteFlag); 308 317 } 309 318 /** … … 313 322 function columnHash(){ 314 323 if(!Rhaco::isVariable("_R_D_C_","User::Hash")){ 315 $column = new Column("column=hash,variable=hash,type=string," );324 $column = new Column("column=hash,variable=hash,type=string,",__CLASS__); 316 325 $column->label(Message::_("hash")); 317 326 Rhaco::addVariable("_R_D_C_",$column,"User::Hash"); … … 321 330 /** 322 331 * 323 * @return string */ 332 * @return string 333 */ 324 334 function setHash($value){ 325 335 $this->hash = TableObjectUtil::cast($value,"string"); … … 337 347 function columnStatusCount(){ 338 348 if(!Rhaco::isVariable("_R_D_C_","User::StatusCount")){ 339 $column = new Column("column=status_count,variable=statusCount,type=integer,size=22," );349 $column = new Column("column=status_count,variable=statusCount,type=integer,size=22,",__CLASS__); 340 350 $column->label(Message::_("status_count")); 341 351 Rhaco::addVariable("_R_D_C_",$column,"User::StatusCount"); … … 345 355 /** 346 356 * 347 * @return integer */ 357 * @return integer 358 */ 348 359 function setStatusCount($value){ 349 360 $this->statusCount = TableObjectUtil::cast($value,"integer"); … … 361 372 function columnFollowingCount(){ 362 373 if(!Rhaco::isVariable("_R_D_C_","User::FollowingCount")){ 363 $column = new Column("column=following_count,variable=followingCount,type=integer,size=22," );374 $column = new Column("column=following_count,variable=followingCount,type=integer,size=22,",__CLASS__); 364 375 $column->label(Message::_("following_count")); 365 376 Rhaco::addVariable("_R_D_C_",$column,"User::FollowingCount"); … … 369 380 /** 370 381 * 371 * @return integer */ 382 * @return integer 383 */ 372 384 function setFollowingCount($value){ 373 385 $this->followingCount = TableObjectUtil::cast($value,"integer"); … … 385 397 function columnFollowerCount(){ 386 398 if(!Rhaco::isVariable("_R_D_C_","User::FollowerCount")){ 387 $column = new Column("column=follower_count,variable=followerCount,type=integer,size=22," );399 $column = new Column("column=follower_count,variable=followerCount,type=integer,size=22,",__CLASS__); 388 400 $column->label(Message::_("follower_count")); 389 401 Rhaco::addVariable("_R_D_C_",$column,"User::FollowerCount"); … … 393 405 /** 394 406 * 395 * @return integer */ 407 * @return integer 408 */ 396 409 function setFollowerCount($value){ 397 410 $this->followerCount = TableObjectUtil::cast($value,"integer"); -
events/phpframework/rhaco/trunk/resources/templates/default/js/application.js
r20581 r20593 41 41 $.post( 42 42 phwittr_url + 'status/update', 43 {"comment": comment , "type": "json"},43 {"comment": comment}, 44 44 function(response, status){ 45 45 notice(response['message']);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)