Пример #1
0
 public function display($tpl = null)
 {
     $document = MFactory::getDocument();
     $document->addStyleSheet(MURL_MIWOSQL . '/admin/assets/css/miwosql.css');
     // Toolbar
     MToolBarHelper::title(MText::_('MiwoSQL') . ' - ' . MText::_('COM_MIWOSQL_RUN_QUERY'), 'miwosql');
     if (MiwosqlHelper::is30()) {
         MToolBarHelper::custom('run', 'play.png', 'play.png', MText::_('COM_MIWOSQL_RUN_QUERY'), false);
         MToolBarHelper::divider();
         MToolBarHelper::custom('savequery', 'folder-close.png', 'folder-close.png', MText::_('COM_MIWOSQL_SAVE_QUERY'), false);
         MToolBarHelper::divider();
         MToolBarHelper::custom('csv', 'upload.png', 'upload.png', MText::_('COM_MIWOSQL_EXPORT_CSV'), false);
     } else {
         MToolBarHelper::custom('run', 'run.png', 'run.png', MText::_('COM_MIWOSQL_RUN_QUERY'), false);
         MToolBarHelper::divider();
         MToolBarHelper::custom('savequery', 'savequery.png', 'savequery.png', MText::_('COM_MIWOSQL_SAVE_QUERY'), false);
         MToolBarHelper::divider();
         MToolBarHelper::custom('csv', 'csv.png', 'csv.png', MText::_('COM_MIWOSQL_EXPORT_CSV'), false);
     }
     // ACL
     if (version_compare(MVERSION, '1.6.0', 'ge') && MFactory::getUser()->authorise('core.admin', 'com_miwosql')) {
         MToolBarHelper::divider();
         MToolBarHelper::preferences('com_miwosql', '550');
     }
     $this->data = $this->get('Data');
     $this->tables = $this->get('Tables');
     $this->prefix = $this->get('Prefix');
     parent::display($tpl);
 }
Пример #2
0
 function display($tpl = null)
 {
     $mainframe = MFactory::getApplication();
     $option = MRequest::getCmd('option');
     $document = MFactory::getDocument();
     $document->addStyleSheet(MURL_MIWOSQL . '/admin/assets/css/miwosql.css');
     MToolBarHelper::title(MText::_('MiwoSQL') . ' - ' . MText::_('COM_MIWOSQL_SAVED_QUERIES'), 'miwosql');
     MToolBarHelper::editList();
     MToolBarHelper::deleteList();
     // ACL
     if (version_compare(MVERSION, '1.6.0', 'ge') && MFactory::getUser()->authorise('core.admin', 'com_miwosql')) {
         MToolBarHelper::divider();
         MToolBarHelper::preferences('com_miwosql', '550');
     }
     $this->mainframe = MFactory::getApplication();
     $this->option = MRequest::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);
 }
Пример #3
0
 public function display($tpl = null)
 {
     $document = MFactory::getDocument();
     $document->addStyleSheet(MURL_MIWOSQL . '/admin/assets/css/miwosql.css');
     // Toolbar
     MToolBarHelper::title(MText::_('MiwoSQL'), 'miwosql');
     MToolBarHelper::save();
     MToolBarHelper::cancel();
     $this->row = $this->get('QueryData');
     parent::display($tpl);
 }
Пример #4
0
 public function display($tpl = null)
 {
     $db = MFactory::getDbo();
     $task = MRequest::getCmd('task');
     $table = MiwosqlHelper::getVar('tbl');
     $query = MiwosqlHelper::getVar('qry');
     $id = MRequest::getInt('id', MRequest::getInt('id', null, 'post'), 'get');
     $key = MRequest::getCmd('key', MRequest::getCmd('key', null, 'post'), 'get');
     $document = MFactory::getDocument();
     $document->addStyleSheet(MURL_MIWOSQL . '/admin/assets/css/miwosql.css');
     // Toolbar
     MToolBarHelper::title(MText::_('MiwoSQL') . ': <small><small> ' . $table . ' [ ' . $key . ' = ' . $id . ' ]' . ' </small></small>', 'miwosql');
     MToolBarHelper::apply();
     MToolBarHelper::save();
     MToolBarHelper::divider();
     MToolBarHelper::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 (!MiwosqlHelper::is30()) {
         $fields = $fields[$this->table];
     }
     $this->fields = $fields;
     parent::display($tpl);
 }