Пример #1
0
 /**
  * Content area
  *
  * Shows the list of popular notices
  *
  * @return void
  */
 function showContent()
 {
     $this->showForm();
     $this->elementStart('div', array('id' => 'profile_directory'));
     $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
     $alphaNav->show();
     $profile = null;
     $profile = $this->getUsers();
     $cnt = 0;
     if (!empty($profile)) {
         $profileList = new SortableSubscriptionList($profile, common_current_user(), $this);
         $cnt = $profileList->show();
         $profile->free();
         if (0 == $cnt) {
             $this->showEmptyListMessage();
         }
     }
     $args = array();
     if (isset($this->q)) {
         $args['q'] = $this->q;
     } else {
         $args['filter'] = $this->filter;
     }
     $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, $this->page, 'userdirectory', $args);
     $this->elementEnd('div');
 }
Пример #2
0
 /**
  * Content area
  *
  * Shows the groups
  *
  * @return void
  */
 function showContent()
 {
     if (common_logged_in() && common_current_user()->hasrole('grader')) {
         $this->elementStart('p', array('id' => 'new_group'));
         $this->element('a', array('href' => common_local_url('newgroup'), 'class' => 'more'), _m('Create a new group'));
         $this->elementEnd('p');
     }
     $this->showForm();
     $this->elementStart('div', array('id' => 'profile_directory'));
     // @todo FIXME: Does "All" need i18n here?
     $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
     $alphaNav->show();
     $group = null;
     $group = $this->getGroups();
     $cnt = 0;
     if (!empty($group)) {
         $groupList = new SortableGroupList($group, common_current_user(), $this);
         $cnt = $groupList->show();
         $group->free();
         if (0 == $cnt) {
             $this->showEmptyListMessage();
         }
     }
     $args = array();
     if (isset($this->q)) {
         $args['q'] = $this->q;
     } else {
         $args['filter'] = $this->filter;
     }
     $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, $this->page, 'groupdirectory', $args);
     $this->elementEnd('div');
 }