コード例 #1
0
ファイル: form.php プロジェクト: rogeriocc/fabrik
 /**
  * Show the form in the admin
  *
  * @return null
  */
 public function view()
 {
     $document = JFactory::getDocument();
     $model = JModel::getInstance('Form', 'FabrikFEModel');
     $viewType = $document->getType();
     $this->setPath('view', COM_FABRIK_FRONTEND . '/views');
     $viewLayout = JRequest::getCmd('layout', 'default');
     $view = $this->getView('form', $viewType, '');
     $view->setModel($model, true);
     $view->isMambot = $this->isMambot;
     // Set the layout
     $view->setLayout($viewLayout);
     // @TODO check for cached version
     JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_FORMS'), 'forms.png');
     if (in_array(JRequest::getCmd('format'), array('raw', 'csv', 'pdf'))) {
         $view->display();
     } else {
         $user = JFactory::getUser();
         $post = JRequest::get('post');
         $cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
         $cache = JFactory::getCache('com_fabrik', 'view');
         ob_start();
         $cache->get($view, 'display', $cacheid);
         $contents = ob_get_contents();
         ob_end_clean();
         $token = JUtility::getToken();
         $search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
         $replacement = '<input type="hidden" name="' . $token . '" value="1" />';
         echo preg_replace($search, $replacement, $contents);
     }
     FabrikAdminHelper::addSubmenu(JRequest::getWord('view', 'lists'));
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: glauberm/cinevi
 /**
  * Display the view
  *
  * @param   string  $tpl  Template name
  *
  * @return void
  */
 public function display($tpl = null)
 {
     switch ($this->getLayout()) {
         case 'confirmdelete':
             $this->confirmdelete();
             return;
             break;
         case 'import':
             $this->import($tpl);
             return;
             break;
     }
     // Initialise variables.
     $app = JFactory::getApplication();
     $input = $app->input;
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->packageOptions = $this->get('PackageOptions');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
         return false;
     }
     $this->table_groups = $this->get('TableGroups');
     FabrikAdminHelper::setViewLayout($this);
     $this->addToolbar();
     FabrikAdminHelper::addSubmenu($input->getWord('view', 'lists'));
     if (FabrikWorker::j3()) {
         $this->sidebar = JHtmlSidebar::render();
     }
     FabrikHelperHTML::iniRequireJS();
     parent::display($tpl);
 }
コード例 #3
0
ファイル: controller.php プロジェクト: rogeriocc/fabrik
 /**
  * Display the view
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return  void
  */
 public function display($cachable = false, $urlparams = false)
 {
     $this->default_view = 'home';
     require_once JPATH_COMPONENT . '/helpers/fabrik.php';
     parent::display();
     // Load the submenu.
     FabrikAdminHelper::addSubmenu(JRequest::getWord('view', 'lists'));
 }
コード例 #4
0
ファイル: details.php プロジェクト: rogeriocc/fabrik
 /**
  * show the form in the admin
  */
 function view()
 {
     $document = JFactory::getDocument();
     $model = JModel::getInstance('Form', 'FabrikFEModel');
     JRequest::setVar('view', 'details');
     $viewType = $document->getType();
     $this->setPath('view', COM_FABRIK_FRONTEND . '/views');
     $viewLayout = JRequest::getCmd('layout', 'default');
     $view = $this->getView('form', $viewType, '');
     $view->setModel($model, true);
     // Set the layout
     $view->setLayout($viewLayout);
     // @Todo check for cached version
     JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_FORMS'), 'forms.png');
     $view->display();
     FabrikAdminHelper::addSubmenu(JRequest::getWord('view', 'lists'));
 }
コード例 #5
0
ファイル: view.html.php プロジェクト: glauberm/cinevi
 /**
  * Display the view
  *
  * @param   string  $tpl  template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $srcs = FabrikHelperHTML::framework();
     FabrikHelperHTML::script($srcs);
     $db = FabrikWorker::getDbo(true);
     $query = $db->getQuery(true);
     $query->select('*')->from('#__{package}_log')->where('message_type != ""')->order('timedate_created DESC');
     $db->setQuery($query, 0, 10);
     $this->logs = $db->loadObjectList();
     $this->feed = $this->get('RSSFeed');
     $this->addToolbar();
     FabrikAdminHelper::addSubmenu('home');
     FabrikAdminHelper::setViewLayout($this);
     if (FabrikWorker::j3()) {
         $this->sidebar = JHtmlSidebar::render();
     }
     FabrikHelperHTML::iniRequireJS();
     parent::display($tpl);
 }
コード例 #6
0
ファイル: details.php プロジェクト: glauberm/cinevi
 /**
  * Show the form in the admin
  *
  * @return  void
  */
 public function view()
 {
     $document = JFactory::getDocument();
     $model = JModelLegacy::getInstance('Form', 'FabrikFEModel');
     $app = JFactory::getApplication();
     $input = $app->input;
     $input->set('view', 'details');
     $viewType = $document->getType();
     $this->setPath('view', COM_FABRIK_FRONTEND . '/views');
     $viewLayout = $input->get('layout', 'default');
     $this->name = 'Fabrik';
     $view = $this->getView('Form', $viewType, '');
     $view->setModel($model, true);
     // Set the layout
     $view->setLayout($viewLayout);
     // @TODO check for cached version
     JToolBarHelper::title(FText::_('COM_FABRIK_MANAGER_FORMS'), 'file-2');
     $view->display();
     FabrikAdminHelper::addSubmenu($input->getWord('view', 'lists'));
 }
コード例 #7
0
ファイル: view.html.php プロジェクト: ppantilla/bbninja
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $input = $app->input;
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     FabrikAdminHelper::setViewLayout($this);
     $this->addToolbar();
     FabrikAdminHelper::addSubmenu($input->getWord('view', 'lists'));
     if (FabrikWorker::j3()) {
         $this->sidebar = JHtmlSidebar::render();
     }
     FabrikHelperHTML::iniRequireJS();
     parent::display($tpl);
 }
コード例 #8
0
ファイル: view.html.php プロジェクト: ppantilla/bbninja
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     if ($this->getLayout() == 'confirmdelete') {
         if (FabrikWorker::j3()) {
             $this->setLayout('bootstrap_confirmdelete');
         }
         $this->confirmdelete();
         return;
     }
     if ($this->getLayout() == 'copyselectgroup') {
         $this->copySelectGroup();
         return;
     }
     // Initialise variables.
     $app = JFactory::getApplication();
     $input = $app->input;
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->formOptions = $this->get('FormOptions');
     $this->showInListOptions = $this->get('ShowInListOptions');
     $this->groupOptions = $this->get('GroupOptions');
     $this->pluginOptions = $this->get('PluginOptions');
     $this->packageOptions = $this->get('PackageOptions');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     FabrikAdminHelper::setViewLayout($this);
     $this->addToolbar();
     FabrikAdminHelper::addSubmenu($input->getWord('view', 'lists'));
     if (FabrikWorker::j3()) {
         $this->sidebar = JHtmlSidebar::render();
     }
     FabrikHelperHTML::iniRequireJS();
     parent::display($tpl);
 }
コード例 #9
0
ファイル: list.php プロジェクト: ppantilla/bbninja
 /**
  * Show the lists data in the admin
  *
  * @param   object  $model  list model
  *
  * @return  null
  */
 public function view($model = null)
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $cid = $input->get('cid', array(0), 'array');
     $cid = $cid[0];
     if (is_null($model)) {
         $cid = $input->getInt('listid', $cid);
         // Grab the model and set its id
         $model = JModelLegacy::getInstance('List', 'FabrikFEModel');
         $model->setState('list.id', $cid);
     }
     $app = JFactory::getApplication();
     $input = $app->input;
     $viewType = JFactory::getDocument()->getType();
     // Use the front end renderer to show the table
     $this->setPath('view', COM_FABRIK_FRONTEND . '/views');
     $viewLayout = $input->getWord('layout', 'default');
     $view = $this->getView($this->view_item, $viewType, 'FabrikView');
     $view->setModel($model, true);
     // Set the layout
     $view->setLayout($viewLayout);
     JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_LISTS'), 'lists.png');
     // Build unique cache id on url, post and user id
     $user = JFactory::getUser();
     $uri = JURI::getInstance();
     $uri = $uri->toString(array('path', 'query'));
     $cacheid = serialize(array($uri, $input->post, $user->get('id'), get_class($view), 'display', $this->cacheId));
     $cache = JFactory::getCache('com_fabrik', 'view');
     if (in_array($input->get('format'), array('raw', 'csv', 'pdf', 'json', 'fabrikfeed'))) {
         $view->display();
     } else {
         $cache->get($view, 'display', $cacheid);
     }
     FabrikAdminHelper::addSubmenu($input->getWord('view', 'lists'));
 }
コード例 #10
0
ファイル: list.raw.php プロジェクト: rogeriocc/fabrik
 /**
  * Show the lists data in the admin
  *
  * @return  void
  */
 public function view()
 {
     $cid = JRequest::getVar('cid', array(0), 'method', 'array');
     if (is_array($cid)) {
         $cid = $cid[0];
     }
     $cid = JRequest::getInt('listid', $cid);
     // Grab the model and set its id
     $model = JModel::getInstance('List', 'FabrikFEModel');
     $model->setState('list.id', $cid);
     $viewType = JFactory::getDocument()->getType();
     // Use the front end renderer to show the table
     $this->setPath('view', COM_FABRIK_FRONTEND . '/views');
     $viewLayout = JRequest::getCmd('layout', 'default');
     $view = $this->getView($this->view_item, $viewType, '');
     $view->setModel($model, true);
     // Set the layout
     $view->setLayout($viewLayout);
     JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_LISTS'), 'lists.png');
     $view->display();
     FabrikAdminHelper::addSubmenu(JRequest::getWord('view', 'lists'));
 }