Exemple #1
0
 /**
  * Method to load a User object by user id number
  *
  * @param   integer  $id  The user id of the user to load
  *
  * @return  boolean  True on success
  */
 public function load($id)
 {
     $table = new UserTable();
     // Load the UserTable object based on the user id or throw a warning.
     if (!$table->load($id)) {
         $this->app->enqueueMessage(TextHelper::sprintf('JLIB_USER_ERROR_UNABLE_TO_LOAD_USER', $id), 'error');
         return false;
     }
     $this->setProperties($table->getProperties());
     unset($this->password);
     return true;
 }
Exemple #2
0
 /**
  * Create and return the pagination result set counter string, e.g. Results 1-10 of 42
  *
  * @return string Pagination result set counter string.
  *
  * @since   11.1
  */
 public function getResultsCounter()
 {
     // Initialise variables.
     $html = null;
     $fromResult = $this->limitstart + 1;
     // If the limit is reached before the end of the list.
     if ($this->limitstart + $this->limit < $this->total) {
         $toResult = $this->limitstart + $this->limit;
     } else {
         $toResult = $this->total;
     }
     // If there are results found.
     if ($this->total > 0) {
         $msg = TextHelper::sprintf('JLIB_HTML_RESULTS_OF', $fromResult, $toResult, $this->total);
         $html .= "\n" . $msg;
     } else {
         $html .= "\n" . TextHelper::_('JLIB_HTML_NO_RECORDS_FOUND');
     }
     return $html;
 }