Beispiel #1
0
 /**
  * Gets the HTML for the initial mode of the exporthandler.
  *
  * @return string The HTML for the screen
  */
 public function _getInitHtml()
 {
     $action = Tools::dispatch_url($this->m_node->m_module . '.' . $this->m_node->m_type, 'export');
     $sm = SessionManager::getInstance();
     $params = [];
     $params['formstart'] = '<form name="entryform" enctype="multipart/form-data" action="' . $action . '" method="post" class="form-horizontal">';
     $params['formstart'] .= $sm->formState();
     $params['formstart'] .= '<input type="hidden" name="phase" value="process"/>';
     $params['buttons'][] = Tools::atkButton(Tools::atktext('cancel', 'atk'), '', SessionManager::SESSION_BACK, true);
     $params['buttons'][] = '<input class="btn" type="submit" value="' . Tools::atktext('export', 'atk') . '"/>';
     $params['buttons'][] = '<input id="export_save_button" style="display:none;" value="' . Tools::atktext('save_export_selection', 'atk') . '" name="save_export" class="btn" type="submit" /> ';
     $params['content'] = '<b>' . Tools::atktext('export_config_explanation', 'atk', $this->m_node->m_type) . '</b><br/><br/>';
     $params['content'] .= $this->_getOptions();
     $params['formend'] = '</form>';
     return Ui::getInstance()->renderAction('export', $params, $this->m_node->m_module);
 }
Beispiel #2
0
 /**
  * Get import buttons.
  *
  * @param string $phase import phase ('init', 'upload', 'process', 'analyze')
  */
 public function getImportButtons($phase)
 {
     $result = [];
     $sm = SessionManager::getInstance();
     if ($sm->atkLevel() > 0) {
         $result[] = Tools::atkButton($this->m_node->text('cancel', 'atk'), '', SessionManager::SESSION_BACK, true);
     }
     if ($phase == 'init') {
         $result[] = '<input class="btn btn-primary" type="submit" value="' . $this->m_node->text('import_upload') . '">';
     } else {
         if ($phase == 'analyze') {
             $result[] = '<input type="submit" class="btn btn-primary" name="analyse" value="' . $this->m_node->text('import_analyse') . '">';
             $result[] = '<input type="submit" class="btn btn-primary" name="import" value="' . $this->m_node->text('import_import') . '"> ';
         }
     }
     return $result;
 }