/** * show the "favorite" form * * @return void */ function showFaveForm() { $user = common_current_user(); if ($user) { if ($user->hasFave($this->notice)) { $disfavor = new DisfavorForm($this->out, $this->notice); $disfavor->show(); } else { $favor = new FavorForm($this->out, $this->notice); $favor->show(); } } }
/** * show the "favorite" form in the notice options element * FIXME: Don't let a NoticeListItemAdapter slip in here (or extend that from NoticeListItem) * * @return void */ public function onStartShowNoticeOptionItems($nli) { if (Event::handle('StartShowFaveForm', array($nli))) { $scoped = Profile::current(); if ($scoped instanceof Profile) { if (Fave::existsForProfile($nli->notice, $scoped)) { $disfavor = new DisfavorForm($nli->out, $nli->notice); $disfavor->show(); } else { $favor = new FavorForm($nli->out, $nli->notice); $favor->show(); } } Event::handle('EndShowFaveForm', array($nli)); } }
/** * show the "favorite" form * * @return void */ function showFaveForm() { if (Event::handle('StartShowFaveForm', array($this))) { $user = common_current_user(); if ($user) { if ($user->hasFave($this->notice)) { $disfavor = new DisfavorForm($this->out, $this->notice); $disfavor->show(); } else { $favor = new FavorForm($this->out, $this->notice); $favor->show(); } } Event::handle('EndShowFaveForm', array($this)); } }