コード例 #1
0
 function showActions()
 {
     parent::startActions();
     try {
         // Throws NoSuchUserException
         $user = $this->profile->getUser();
         // Can't notify user if we don't have an email address
         if ($user->email) {
             $this->action->elementStart('li', 'entity_nudge');
             $form = new StaleReminderForm($this->out, $user);
             $form->show();
             $this->action->elementEnd('li');
         } else {
             $this->action->element('li', array('class' => 'none'), 'e-mail not confirmed!' . $user->email);
         }
     } catch (Exception $e) {
         // This shouldn't be possible -- famous last words
         common_log(LOG_ERR, $e->getMessage());
     }
     $cur = common_current_user();
     list($action, $r2args) = $this->out->returnToArgs();
     $r2args['action'] = $action;
     if ($cur instanceof User && $cur->hasRight(Right::DELETEUSER)) {
         $this->elementStart('li', array('class' => 'entity_delete'));
         $df = new DeleteUserForm($this->out, $this->profile, $r2args);
         $df->show();
         $this->elementEnd('li');
     }
     parent::endActions();
 }