Beispiel #1
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $option = JRequest::getCmd('option');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_mijosql/assets/css/mijosql.css');
     JToolBarHelper::title(JText::_('MijoSQL') . ' - ' . JText::_('COM_MIJOSQL_SAVED_QUERIES'), 'mijosql');
     JToolBarHelper::editList();
     JToolBarHelper::deleteList();
     // ACL
     if (version_compare(JVERSION, '1.6.0', 'ge') && JFactory::getUser()->authorise('core.admin', 'com_mijosql')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_mijosql', '550');
     }
     $this->mainframe = JFactory::getApplication();
     $this->option = JRequest::getWord('option');
     $filter_order = $mainframe->getUserStateFromRequest($option . '.queries.filter_order', 'filter_order', 'title', 'string');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.queries.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($option . '.queries.search', 'search', '', 'string');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $this->lists = $lists;
     $this->items = $this->get('Data');
     $this->pagination = $this->get('Pagination');
     parent::display($tpl);
 }
Beispiel #2
0
 public function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_mijosql/assets/css/mijosql.css');
     // Toolbar
     JToolBarHelper::title(JText::_('MijoSQL') . ' - ' . JText::_('COM_MIJOSQL_RUN_QUERY'), 'mijosql');
     if (MijosqlHelper::is30()) {
         JToolBarHelper::custom('run', 'play.png', 'play.png', JText::_('COM_MIJOSQL_RUN_QUERY'), false);
         JToolBarHelper::divider();
         JToolBarHelper::custom('savequery', 'folder-close.png', 'folder-close.png', JText::_('COM_MIJOSQL_SAVE_QUERY'), false);
         JToolBarHelper::divider();
         JToolBarHelper::custom('csv', 'upload.png', 'upload.png', JText::_('COM_MIJOSQL_EXPORT_CSV'), false);
     } else {
         JToolBarHelper::custom('run', 'run.png', 'run.png', JText::_('COM_MIJOSQL_RUN_QUERY'), false);
         JToolBarHelper::divider();
         JToolBarHelper::custom('savequery', 'savequery.png', 'savequery.png', JText::_('COM_MIJOSQL_SAVE_QUERY'), false);
         JToolBarHelper::divider();
         JToolBarHelper::custom('csv', 'csv.png', 'csv.png', JText::_('COM_MIJOSQL_EXPORT_CSV'), false);
     }
     // ACL
     if (version_compare(JVERSION, '1.6.0', 'ge') && JFactory::getUser()->authorise('core.admin', 'com_mijosql')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_mijosql', '550');
     }
     $this->data = $this->get('Data');
     $this->tables = $this->get('Tables');
     $this->prefix = $this->get('Prefix');
     parent::display($tpl);
 }
Beispiel #3
0
 public function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_mijosql/assets/css/mijosql.css');
     // Toolbar
     JToolBarHelper::title(JText::_('MijoSQL'), 'mijosql');
     JToolBarHelper::save();
     JToolBarHelper::cancel();
     $this->row = $this->get('QueryData');
     parent::display($tpl);
 }
Beispiel #4
0
 public function display($tpl = null)
 {
     $db = JFactory::getDbo();
     $task = JRequest::getCmd('task');
     $table = MijosqlHelper::getVar('tbl');
     $query = MijosqlHelper::getVar('qry');
     $id = JRequest::getInt('id', JRequest::getInt('id', null, 'post'), 'get');
     $key = JRequest::getCmd('key', JRequest::getCmd('key', null, 'post'), 'get');
     $document =& JFactory::getDocument();
     $document->addStyleSheet('components/com_mijosql/assets/css/mijosql.css');
     // Toolbar
     JToolBarHelper::title(JText::_('MijoSQL') . ': <small><small> ' . $table . ' [ ' . $key . ' = ' . $id . ' ]' . ' </small></small>', 'mijosql');
     JToolBarHelper::apply();
     JToolBarHelper::save();
     JToolBarHelper::divider();
     JToolBarHelper::cancel();
     if ($task == 'edit') {
         $fld_value = '$value = $this->rows[$this->id][$field];';
     } else {
         $fld_value = '$value = "";';
     }
     list($rows, $last_key_vol) = $this->get('Data');
     $this->task = $task;
     $this->id = $id;
     $this->key = $key;
     $this->table = $table;
     $this->query = $query;
     $this->fld_value = $fld_value;
     $this->last_key_vol = $last_key_vol;
     $this->rows = $rows;
     $fields = $this->get('Fields');
     if (!MijosqlHelper::is30()) {
         $fields = $fields[$this->table];
     }
     $this->fields = $fields;
     parent::display($tpl);
 }