Beispiel #1
0
 /**
  * Get module contents
  *
  * @return  void
  */
 public function run()
 {
     require_once \Component::path('com_feedback') . DS . 'models' . DS . 'quote.php';
     // Get the admin configured settings
     $this->charlimit = $this->params->get('charlimit', 150);
     $this->showauthor = $this->params->get('show_author', 1);
     $this->showall = $this->params->get('show_all_link', 1);
     $quotesrc = $this->params->get('quotesrc', 'miniquote');
     // Get quotes
     $quote = Quote::all()->whereEquals('notable_quote', $this->params->get('quotepool') == 'notable_quotes' ? 1 : 0)->whereEquals('miniquote', $quotesrc == 'miniquote' ? 1 : 0)->limit(1)->rows()->first();
     /*$quote = $sq->find('one', array(
     			'limit'         => 1,
     			'notable_quote' => ($this->params->get('quotepool') == 'notable_quotes' ?  1 : 0),
     			'miniquote'     => ($quotesrc == 'miniquote' ?  1 : 0),
     			'sort'          => 'RAND()',
     			'sort_Dir'      => ''
     		));*/
     if ($quote) {
         $this->quote_to_show = $quotesrc == 'miniquote' ? stripslashes($quote->get('miniquote')) : stripslashes($quote->get('short_quote'));
     } else {
         $this->quote_to_show = '';
     }
     $this->quote = $quote;
     require $this->getLayoutPath($this->params->get('layout', 'default'));
 }
Beispiel #2
0
 /**
  * Display a list of quotes
  *
  * @return  void
  */
 public function displayTask()
 {
     // Incoming
     $this->view->filters = array('search' => urldecode(Request::getState($this->_option . '.search', 'search', '')), 'sort' => Request::getState($this->_option . '.sortby', 'filter_order', 'date'), 'sort_Dir' => Request::getState($this->_option . '.sortdir', 'filter_order_Dir', 'DESC'));
     $record = Quote::all();
     if ($this->view->filters['search']) {
         $record->whereLike('fullname', $this->view->filters['search']);
     }
     $this->view->rows = $record->ordered('filter_order', 'filter_order_Dir')->paginated();
     // Output the HTML
     $this->view->display();
 }
Beispiel #3
0
 /**
  * Get module contents
  *
  * @return  void
  */
 public function run()
 {
     require_once Component::path('com_feedback') . DS . 'models' . DS . 'quote.php';
     //Get the admin configured settings
     $this->filters = array('limit' => trim($this->params->get('maxquotes')), 'id' => Request::getInt('quoteid', 0), 'notable_quote' => 1);
     // Get quotes
     $sq = Quote::all()->whereEquals('notable_quote', 1);
     if ($this->filters['id']) {
         $sq->whereEquals('id', $this->filters['id']);
     }
     $this->quotes = $sq->limit($this->filters['limit'])->rows();
     require $this->getLayoutPath($this->module->module);
 }
Beispiel #4
0
 /**
  * Show a list of quotes
  *
  * @return  void
  */
 public function quotesTask()
 {
     // Get quotes
     $quotes = Quote::all()->whereEquals('notable_quote', 1)->ordered()->rows();
     $quoteId = Request::getInt('quoteid');
     $this->view->set('quotes', $quotes)->set('quoteId', $quoteId)->display();
 }