Beispiel #1
0
 /**
  * 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);
 }
Beispiel #2
0
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialiase variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->pluginFields = $this->get('PluginHTML');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     $this->addToolbar();
     FabrikAdminHelper::setViewLayout($this);
     $srcs = FabrikHelperHTML::framework();
     $srcs['Fabrik'] = FabrikHelperHTML::mediaFile('fabrik.js');
     $srcs['Namespace'] = 'administrator/components/com_fabrik/views/namespace.js';
     $srcs['PluginManager'] = 'administrator/components/com_fabrik/views/pluginmanager.js';
     $srcs['CronAdmin'] = 'administrator/components/com_fabrik/views/cron/admincron.js';
     $shim = array();
     $dep = new stdClass();
     $dep->deps = array('admin/pluginmanager');
     $shim['admin/cron/admincron'] = $dep;
     $opts = new stdClass();
     $opts->plugin = $this->item->plugin;
     $js = array();
     $js[] = "\twindow.addEvent('domready', function () {";
     $js[] = "\t\tFabrik.controller = new CronAdmin(" . json_encode($opts) . ");";
     $js[] = "\t})";
     FabrikHelperHTML::iniRequireJS($shim);
     FabrikHelperHTML::script($srcs, implode("\n", $js));
     parent::display($tpl);
 }
Beispiel #3
0
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialise variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->pluginFields = $this->get('PluginHTML');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     $this->addToolbar();
     FabrikAdminHelper::setViewLayout($this);
     $srcs = FabrikHelperHTML::framework();
     $srcs[] = 'media/com_fabrik/js/fabrik.js';
     $srcs[] = 'administrator/components/com_fabrik/views/namespace.js';
     $srcs[] = 'administrator/components/com_fabrik/views/pluginmanager.js';
     $srcs[] = 'administrator/components/com_fabrik/views/visualization/adminvisualization.js';
     $shim = array();
     $dep = new stdClass();
     $dep->deps = array('admin/pluginmanager');
     $shim['admin/visualization/adminvisualization'] = $dep;
     FabrikHelperHTML::iniRequireJS($shim);
     $opts = new stdClass();
     $opts->plugin = $this->item->plugin;
     $js = "\n\tvar options = " . json_encode($opts) . ";\n\t\tFabrik.controller = new AdminVisualization(options);\n";
     FabrikHelperHTML::script($srcs, $js);
     parent::display($tpl);
 }
Beispiel #4
0
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->form = $this->get('Form');
     $this->addToolBar();
     FabrikAdminHelper::setViewLayout($this);
     parent::display($tpl);
 }
Beispiel #5
0
 /**
  * Display the view
  *
  * @param   string $tpl template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialise variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->js = $this->get('Js');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     $this->addToolbar();
     FabrikAdminHelper::setViewLayout($this);
     // Set up the script shim
     $shim = array();
     $dep = new stdClass();
     $dep->deps = array('fab/fabrik');
     $shim['admin/pluginmanager'] = $dep;
     FabrikHelperHTML::iniRequireJS($shim);
     $srcs = FabrikHelperHTML::framework();
     $srcs['Fabrik'] = FabrikHelperHTML::mediaFile('fabrik.js');
     $srcs['Namespace'] = 'administrator/components/com_fabrik/views/namespace.js';
     $srcs['PluginManager'] = 'administrator/components/com_fabrik/views/pluginmanager.js';
     FabrikHelperHTML::script($srcs, $this->js);
     parent::display($tpl);
 }
Beispiel #6
0
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialise variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     $this->addToolbar();
     FabrikAdminHelper::setViewLayout($this);
     $srcs = FabrikHelperHTML::framework();
     FabrikHelperHTML::iniRequireJS();
     FabrikHelperHTML::script($srcs);
     parent::display($tpl);
 }
Beispiel #7
0
 /**
  * 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);
 }
Beispiel #8
0
 /**
  * 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);
 }
Beispiel #9
0
 /**
  * Display the view
  *
  * @param   string  $tpl  template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialiase variables.
     $model = $this->getModel();
     $this->item = $this->get('Item');
     $model->checkDefault($this->item);
     $this->form = $this->get('Form');
     $this->form->bind($this->item);
     $this->state = $this->get('State');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     $this->addToolbar();
     FabrikAdminHelper::setViewLayout($this);
     $srcs = FabrikHelperHTML::framework();
     $srcs['Fabrik'] = 'media/com_fabrik/js/fabrik.js';
     FabrikHelperHTML::iniRequireJS();
     FabrikHelperHTML::script($srcs);
     parent::display($tpl);
 }
Beispiel #10
0
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     if ($this->getLayout() == 'confirmupdate') {
         $this->confirmupdate();
         return;
     }
     // Initialiase variables.
     $model = $this->getModel();
     $this->form = $model->getForm();
     $this->item = $model->getItem();
     $this->state = $model->getState();
     $this->pluginFields = $model->getPluginHTML();
     $this->js = $model->getJs();
     // Check for errors.
     if (count($errors = $model->getErrors())) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     $this->addToolbar();
     $this->parent = $model->getParent();
     FabrikAdminHelper::setViewLayout($this);
     JText::script('COM_FABRIK_ERR_ELEMENT_JS_ACTION_NOT_DEFINED');
     $srcs = FabrikHelperHTML::framework();
     $srcs[] = 'media/com_fabrik/js/fabrik.js';
     $srcs[] = 'administrator/components/com_fabrik/views/namespace.js';
     $srcs[] = 'administrator/components/com_fabrik/views/pluginmanager.js';
     $srcs[] = 'administrator/components/com_fabrik/views/element/tmpl/adminelement.js';
     $shim = array();
     $dep = new stdClass();
     $dep->deps = array('admin/pluginmanager');
     $shim['admin/element/tmpl/adminelement'] = $dep;
     $shim['adminfields/tables'] = $dep;
     $plugManagerDeps = new stdClass();
     $plugManagerDeps->deps = array('admin/namespace');
     $shim['admin/pluginmanager'] = $plugManagerDeps;
     FabrikHelperHTML::iniRequireJS($shim);
     FabrikHelperHTML::script($srcs, $this->js);
     parent::display($tpl);
 }
Beispiel #11
0
 /**
  * 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);
 }
Beispiel #12
0
 /**
  * Display the view
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialise variables.
     JHtml::_('behavior.modal', 'a.modal');
     $model = $this->getModel();
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->listform = $this->get('PackageListForm');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new RuntimeException(implode("\n", $errors), 500);
     }
     $this->addToolbar();
     $canvas = FArrayHelper::getValue($this->item->params, 'canvas', array());
     $blocks = new stdClass();
     $b = FArrayHelper::getValue($canvas, 'blocks', array());
     $blocks->form = FArrayHelper::getValue($b, 'form', array());
     $blocks->list = FArrayHelper::getValue($b, 'list', array());
     $blocks->visualization = FArrayHelper::getValue($b, 'visualization', array());
     $opts = JArrayHelper::getvalue($canvas, 'options', array());
     $d = new stdClass();
     $layout = FArrayHelper::getValue($canvas, 'layout', $d);
     $document = JFactory::getDocument();
     $opts = new stdClass();
     $opts->blocks = $blocks;
     $opts->layout = $layout;
     $opts = json_encode($opts);
     $this->js = "PackageCanvas = new AdminPackage({$opts});";
     $srcs[] = 'administrator/components/com_fabrik/views/package/adminpackage.js';
     FabrikHelperHTML::iniRequireJS();
     FabrikHelperHTML::script($srcs, $this->js);
     // Simple layout
     $this->listOpts = $model->getListOpts();
     $this->formOpts = $model->getFormOpts();
     $this->selFormOpts = $model->getSelFormOpts();
     $this->selListOpts = $model->getSelListOpts();
     FabrikAdminHelper::setViewLayout($this);
     parent::display($tpl);
 }
Beispiel #13
0
 /**
  * Display the list
  *
  * @param   string $tpl template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialise variables.
     $model = $this->getModel();
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $formModel = $this->get('FormModel');
     $formModel->setId($this->item->form_id);
     $this->state = $this->get('State');
     $this->js = $model->getJs();
     $this->addToolbar();
     if ($this->item->id == 0) {
         $this->order_by = array(FText::_('COM_FABRIK_AVAILABLE_AFTER_SAVE'));
         $this->group_by = FText::_('COM_FABRIK_AVAILABLE_AFTER_SAVE');
     } else {
         $this->order_by = array();
         $feListModel = $formModel->getListModel();
         $orderBys = $feListModel->getOrderBys();
         foreach ($orderBys as $orderBy) {
             $this->order_by[] = $formModel->getElementList('order_by[]', $orderBy, true, false, false, 'id');
         }
         if (empty($this->order_by)) {
             $this->order_by[] = $formModel->getElementList('order_by[]', '', true, false, false, 'id');
         }
         $orderDir[] = JHTML::_('select.option', 'ASC', FText::_('COM_FABRIK_ASCENDING'));
         $orderDir[] = JHTML::_('select.option', 'DESC', FText::_('COM_FABRIK_DESCENDING'));
         $orderdirs = FabrikWorker::JSONtoData($this->item->order_dir, true);
         $this->order_dir = array();
         $attribs = 'class="inputbox" size="1" ';
         foreach ($orderdirs as $orderdir) {
             $this->order_dir[] = JHTML::_('select.genericlist', $orderDir, 'order_dir[]', $attribs, 'value', 'text', $orderdir);
         }
         if (empty($this->order_dir)) {
             $this->order_dir[] = JHTML::_('select.genericlist', $orderDir, 'order_dir[]', $attribs, 'value', 'text', '');
         }
         $this->group_by = $formModel->getElementList('group_by', $this->item->group_by, true, false, false);
     }
     FabrikAdminHelper::setViewLayout($this);
     $srcs = FabrikHelperHTML::framework();
     $srcs['Fabrik'] = FabrikHelperHTML::mediaFile('fabrik.js');
     $srcs['NameSpace'] = 'administrator/components/com_fabrik/views/namespace.js';
     $srcs['PluginManager'] = 'administrator/components/com_fabrik/views/pluginmanager.js';
     $srcs['AdminList'] = 'administrator/components/com_fabrik/views/list/tmpl/adminlist.js';
     $srcs['ListForm'] = 'administrator/components/com_fabrik/views/listform.js';
     $srcs['adminFilters'] = 'administrator/components/com_fabrik/views/list/tmpl/admin-filters.js';
     $shim = array();
     $dep = new stdClass();
     $dep->deps = array('admin/pluginmanager');
     $shim['admin/list/tmpl/adminlist'] = $dep;
     $shim['adminfields/tables'] = $dep;
     FabrikHelperHTML::iniRequireJS($shim);
     FabrikHelperHTML::script($srcs, $this->js);
     parent::display($tpl);
 }