Sindbad~EG File Manager

Current Path : /var/www/ispania.gr/components/com_rsdirectory/controllers/
Upload File :
Current File : /var/www/ispania.gr/components/com_rsdirectory/controllers/ratings.php

<?php
/**
 * @package	RSDirectory!
 * @copyright	(c) 2013 - 2021 RSJoomla!
 * @link		https://www.rsjoomla.com
 * @license	GNU General Public License http://www.gnu.org/licenses/gpl-3.0.en.html
 */

// No direct access.
defined('_JEXEC') or die('Restricted access');

/**
 * Ratings controller.
 */
class RSDirectoryControllerRatings extends JControllerLegacy
{
	/**
     * Load more reviews.
     *
     * @access public
     */
    public function showMoreAjax()
    {
	    // Stop the script if the token is invalid.
	    $this->checkToken('get');
			
		header('Content-Type: application/json');
			
		$app = JFactory::getApplication();
			
		$model = $this->getModel('Ratings');
		$pagination = $model->getPagination();
			
		$items = $model->getItems();
			
		$reviews = '';
			
		if ($items)
		{
			foreach ($items as $item)
			{
				$reviews .= RSDirectoryHelper::getReviewHTML($item);
			}
		}
			
		$response = array(
			'reviews' => $reviews,
		);
			
		if ( $pagination->get('limitstart') + $pagination->get('limit') >= $pagination->get('total') )
		{
			$response['hide'] = 1;
		}
			
		echo json_encode($response);
			
		$app->close();
	}
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists