예제 #1
0
파일: view.html.php 프로젝트: LGBGit/tierno
 /**
  * Display
  *
  * @param   string $tmpl Template
  *
  * @return  void
  */
 public function display($tmpl = 'default')
 {
     $srcs = FabrikHelperHTML::framework();
     $input = $this->app->input;
     FabrikHelperHTML::script($srcs);
     $model = $this->getModel();
     $usersConfig = JComponentHelper::getParams('com_fabrik');
     $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))));
     $visualization = $model->getVisualization();
     $pluginParams = $model->getPluginParams();
     $pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikModel');
     $plugin = $pluginManager->getPlugIn($visualization->plugin, 'visualization');
     $plugin->_row = $visualization;
     if ($visualization->published == 0) {
         $this->app->enqueueMessage(FText::_('COM_FABRIK_SORRY_THIS_VISUALIZATION_IS_UNPUBLISHED'), 'warning');
         return '';
     }
     // Plugin is basically a model
     $pluginTask = $input->get('plugintask', 'render', 'request');
     // @FIXME cant set params directly like this, but I think plugin model setParams() is not right
     $plugin->_params = $pluginParams;
     $tmpl = $plugin->getParams()->get('calendar_layout', $tmpl);
     $plugin->{$pluginTask}($this);
     $this->plugin = $plugin;
     $this->addTemplatePath($this->_basePath . '/plugins/' . $this->_name . '/' . $plugin->_name . '/tmpl/' . $tmpl);
     $root = $this->app->isAdmin() ? JPATH_ADMINISTRATOR : JPATH_SITE;
     $this->addTemplatePath($root . '/templates/' . $this->app->getTemplate() . '/html/com_fabrik/visualization/' . $plugin->_name . '/' . $tmpl);
     $ab_css_file = JPATH_SITE . '/plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/template.css';
     if (JFile::exists($ab_css_file)) {
         JHTML::stylesheet('template.css', 'plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/', true);
     }
     echo parent::display();
 }
예제 #2
0
파일: view.html.php 프로젝트: LGBGit/tierno
 /**
  * Display the view
  *
  * @param   string $tpl Template name
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  */
 public function display($tpl = null)
 {
     $this->listid = $this->app->input->get('listid', 0);
     $listModel = JModelLegacy::getInstance('List', 'FabrikFEModel');
     $listModel->setId($this->listid);
     $this->setModel($listModel, true);
     $this->table = $listModel->getTable();
     $data = array();
     $this->getManagementJS($data);
     $this->id = $listModel->getId();
     $this->form = $listModel->getForm();
     $this->shim();
     if (!$listModel->canCSVExport()) {
         throw new RuntimeException('Naughty naughty!', 400);
     }
     $this->addTemplatePath(JPATH_SITE . '/components/com_fabrik/views/csv/tmpl');
     return parent::display($tpl);
 }
예제 #3
0
 /**
  * Display the view
  *
  * @param   string $tpl template
  *
  * @return  this
  */
 public function display($tpl = null)
 {
     $srcs = FabrikHelperHTML::framework();
     FabrikHelperHTML::script($srcs);
     $input = $this->app->input;
     $this->listid = $input->getInt('listid', 0);
     $this->model = JModelLegacy::getInstance('List', 'FabrikFEModel');
     $this->model->setId($this->listid);
     $this->table = $this->model->getTable();
     $this->form = $this->get('Form');
     if (!$this->model->canCSVImport()) {
         throw new RuntimeException('Naughty naughty!', 400);
     }
     $layout = FabrikWorker::j3() ? 'bootstrap' : 'default';
     $this->setLayout($layout);
     $this->fieldsets = $this->setFieldSets();
     parent::display($tpl);
     return $this;
 }