Current Path :
/
home
/
develito
/
www
/
components
/
com_raforms
/
controllers
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/www/components/com_raforms/controllers/formresultlist.php
<?php /* ------------------------------------------------------------------------ # com_raforms - rootArea Forms # ------------------------------------------------------------------------ # author Markus Döhla # copyright Copyright (C) 2012 rootarea.de. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # @license - Please read policy about plugins development in administrator/components/com_raforms/license-plugins.txt carefully # @license - Additional EULA on www.rootarea.de DOES NOT apply to ANY lite packages # Websites: http://www.rootarea.de # Technical Support: Forum - http://www.rootarea.de/en/forum ------------------------------------------------------------------------- */ //-- No direct access defined('_JEXEC') or die('=;)'); jimport('joomla.application.component.controller'); class RAformsControllerFormResultList extends JControllerLegacy { function __construct() { $Itemid = JRequest::getVar('Itemid'); $ids = $this->checkRoute(); if (!in_array($Itemid, $ids)) { $link = JRoute::_('index.php?Itemid='.$ids[0], false); $msg = JText::_('RAFORMS_RESTRICTED'); $msg .= '<br>'; $msg .= 'Itemid: ' . $Itemid . ' ;; ids: ' . print_r($ids); $error = 'error'; $this->setRedirect($link, $msg, $error); $this->redirect(); } else { parent::__construct(); } } protected function checkRoute() { $db = JFactory::getDBO(); $user = JFactory::getUser(); $ids = array(); $sql = $db->getQuery(true); $sql->select('a.id'); $sql->from('#__menu a'); $sql->join('left', '#__extensions b on a.component_id = b.extension_id'); $sql->where('b.element = ' . $db->quote('com_raforms')); $sql->where('b.type = ' . $db->quote('component')); $sql->where('a.menutype != ' . $db->quote('main')); $sql->where('a.access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'); $db->setQuery($sql); //die(preg_replace('/#__/', 'jos_', $sql)); $ids = $db->loadColumn(); return $ids; } function display($cachable = false, $urlparams = array()) { $app = JFactory::getApplication(); $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'models'); $view = $this->getView('FormResultList', 'html'); $model1 = $this->getModel('FormResultList'); $view->setModel($model1, true); $model2 = $this->getModel('FForm'); $model2->_name = 'fform'; $view->setModel($model2); $model3 = $this->getModel('RAform'); $model3->_name = 'raform'; $view->setModel($model3); $view->display(); } } ?>