| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nimes/components/com_rsfeedback/views/feedback/ |
Upload File : |
<?php
/**
* @package RSFeedback!
* @copyright (C) 2010-2018 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
class RSFeedbackViewFeedback extends HtmlView
{
public function display($tpl = null) {
$model = $this->getModel('Feedback');
$layout = $this->getLayout();
$user = Factory::getUser();
$this->state = $this->get('State');
$this->params = $this->state->get('params');
$this->item = $this->get('Item');
$this->category = RSFeedbackHelper::getCategoryDetails($this->item->cat_id);
$this->config = RSFeedbackHelper::getConfig();
$this->tmpl = Factory::getApplication()->input->get('tmpl', '', 'cmd');
$this->flags = RSFeedbackHelper::getFlagNames();
$this->statuses = RSFeedbackHelper::getStatuses();
$this->categories = RSFeedbackHelper::getCategoryNames();
$this->return_page = base64_encode(Uri::getInstance());
$this->feedback_flags = $model->getFeedbackFlags($this->item->id);
$this->permissions = RSFeedbackHelper::getPermissions();
if ($layout == 'default') {
$Itemid = Factory::getApplication()->input->get('Itemid', 0, 'int');
$title = $this->item->title;
$url = Uri::getInstance()->toString(array('scheme', 'host', 'port')).Route::_('index.php?option=com_rsfeedback&view=feedback&id='.$this->item->id.(!empty($Itemid) ? '&Itemid='.$Itemid : ''), false);
$summary = $this->item->text;
$this->comments = RSFeedbackHelper::DisplayComments($this->item->id);
$this->facebook_share_url = 'https://www.facebook.com/sharer/sharer.php?kid_directed_site=0&sdk=joey&u='.urlencode($url).'&display=popup&ref=plugin&src=share_button';
$this->twitter_share_url = 'https://twitter.com/home/?status='.urlencode($title.' - '.$url);
$this->reddit_share_url = 'https://www.reddit.com/submit?title='.urlencode($title).'&url='.urlencode($url);
$this->blogger_share_url = 'https://www.blogger.com/blog-this.g?t='.urlencode($summary).'&u='.urlencode($url).'&n='.urlencode($title);
$this->linkedin_share_url = 'https://www.linkedin.com/shareArticle?url='.urlencode($url).'&title='.urlencode($title).'&summary='.urlencode($summary);
$this->pinterest_share_url = 'https://pinterest.com/pin/create/button/?url='.urlencode($url).'&description='.urlencode($summary);
$this->single = false;
if ($active = Factory::getApplication()->getMenu()->getActive()) {
if (isset($active->query['view']) && $active->query['view'] == 'feedback') {
$this->single = true;
}
}
if ($this->item->published != 1) {
throw new Exception(Text::_('COM_RSFEEDBACK_ERROR_FEEDBACK_NOT_FOUND'), 404);
}
// check voting permission
$this->show_vote_button = false;
if ( ( ($user->guest && $this->category->anonymous_voting) || $user->id ) && $this->statuses[$this->item->status_id]->permissions->allow_voting == 1 ) {
$this->show_vote_button = true;
}
// update hits
$model->getHits();
// required only when displaying the feedback detail
$this->remaining_votes = $model->getUserRemainingVotes();
$this->user_votes_on_feedback = $model->getUserVotesOnFeedback($this->item->id);
}
else if ($layout == 'default_form_flag') {
$canPostFlags = isset($this->permissions['feedback_post_flags']) ? $this->permissions['feedback_post_flags'] : true;
if ($this->item->id && !$canPostFlags) {
Factory::getApplication()->enqueueMessage(Text::_('COM_RSFEEDBACK_POST_FLAG_FEEDBACK_PERMISSION_ERROR'), 'error');
Factory::getApplication()->redirect(Route::_('index.php?option=com_rsfeedback&view=feedbacks', false));
}
$this->session = Factory::getSession();
}
else if ($layout == 'edit') {
if ($this->item->id && (!$this->permissions['feedback_edit'] && !( RSFeedbackHelper::verifyAuthorship($this->item->id) && $this->permissions['feedback_add'] ))) {
Factory::getApplication()->enqueueMessage(Text::_('COM_RSFEEDBACK_EDIT_FEEDBACK_PERMISSION_ERROR'), 'error');
Factory::getApplication()->redirect(Route::_('index.php?option=com_rsfeedback&view=feedbacks'.($this->tmpl ? '&tmpl='.$this->tmpl : ''), false));
}
if (!$this->item->id && !$this->permissions['feedback_add'])
{
Factory::getApplication()->enqueueMessage(Text::_('COM_RSFEEDBACK_ADD_FEEDBACK_PERMISSION_ERROR'), 'error');
Factory::getApplication()->redirect(Route::_('index.php?option=com_rsfeedback&view=feedbacks'.($this->tmpl ? '&tmpl='.$this->tmpl : ''), false));
}
$this->form = $this->get('Form');
Factory::getApplication()->input->set('cat_id', Factory::getApplication()->input->get('cat_id', $this->params->get('default_category','')));
$this->cat_id = Factory::getApplication()->input->get('cat_id');
}
$this->prepareDocument();
parent::display($tpl);
}
protected function prepareDocument() {
$app = Factory::getApplication();
$menus = $app->getMenu();
$title = null;
$cfg = Factory::getConfig();
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $menu->title);
// title tag should be the feedback title even if it has a menu item
if ($menu->query['view'] == 'feedbacks') {
$this->params->set('page_title', $this->item->title);
}
// feedback menu item case
if ($app->input->get('view') == 'feedback') {
if ($this->getLayout() == 'default')
$this->params->set('page_title', $this->params->get('page_title', $this->item->title));
else
$this->params->set('page_title', empty($this->item->id) ? Text::_('COM_RSFEEDBACK_FEEDBACK_ADD_FORM_TITLE') : Text::sprintf('COM_RSFEEDBACK_FEEDBACK_EDIT_FORM_TITLE', $this->item->title));
}
} else {
if ($this->getLayout() == 'default') {
$this->params->def('page_heading', $this->item->title);
} else {
$this->params->def('page_heading', empty($this->item->id) ? Text::_('COM_RSFEEDBACK_FEEDBACK_ADD_FORM_TITLE') : Text::sprintf('COM_RSFEEDBACK_FEEDBACK_EDIT_FORM_TITLE',$this->item->title));
}
}
$title = $this->params->get('page_title', '');
if (empty($title)) {
$title = $cfg->get('sitename');
} elseif ($cfg->get('sitename_pagetitles', 0) == 1) {
$title = Text::sprintf('JPAGETITLE', $cfg->get('sitename'), $title);
} elseif ($cfg->get('sitename_pagetitles', 0) == 2) {
$title = Text::sprintf('JPAGETITLE', $title, $cfg->get('sitename'));
}
$this->document->setTitle($title);
// Description
if ($this->params->get('menu-meta_description')) {
$this->document->setDescription($this->params->get('menu-meta_description'));
}
// Keywords
if ($this->params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
// Robots
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($this->getLayout() == 'default') {
// Breadcrumbs
$pathway = Factory::getApplication()->getPathway();
$pathway->addItem($this->category->name, Route::_(RSFeedbackRoute::Category($this->item->cat_id)));
$pathway->addItem($this->item->title);
}
$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx',''));
}
}