/** * Default action. Forwards to get action. */ public function __call($action, $params) { $owN = new OntoWiki_Navigation(); $owN->disableNavigation(); $_REQUEST['urlBase'] = $this->_config->staticUrlBase; $this->render(str_replace('Action', '', $action)); }
public function createConfigurationView($urlBase) { $ontowiki = OntoWiki::getInstance(); $model = $ontowiki->selectedModel; $this->view->scovo = true; $this->view->placeholder('main.window.title')->append('Import CSV Data'); $this->view->actionUrl = $urlBase . 'csvimport/mapping'; $this->view->salt = hash("md5", serialize($this->parsedFile)); OntoWiki_Navigation::disableNavigation(); if ($model->isEditable()) { $toolbar = $ontowiki->toolbar; $toolbar->appendButton(OntoWiki_Toolbar::ADD, array('name' => 'Add Dimension', 'id' => 'btn-add-dimension'))->appendButton(OntoWiki_Toolbar::ADD, array('name' => 'Add Attribute', 'id' => 'btn-attribute', 'class' => ''))->appendButton(OntoWiki_Toolbar::EDIT, array('name' => 'Select Data Range', 'id' => 'btn-datarange', 'class' => ''))->appendButton(OntoWiki_Toolbar::SEPARATOR)->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Extract Triples', 'id' => 'extract'))->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel')); $this->view->placeholder('main.window.toolbar')->set($toolbar); $configurationMenu = OntoWiki_Menu_Registry::getInstance()->getMenu('Configurations'); $i = 0; $pattern = '/\'/i'; $replacement = "\\'"; $this->view->configs = array(); if (isset($this->storedConfigurations)) { foreach ($this->storedConfigurations as $configNum => $config) { $this->view->configs[$i] = preg_replace($pattern, $replacement, $config['config']); $configurationMenu->prependEntry('Select ' . $config['label'], 'javascript:useCSVConfiguration(csvConfigs[' . $i . '])'); $i++; } } $menu = new OntoWiki_Menu(); $menu->setEntry('Configurations', $configurationMenu); $event = new Erfurt_Event('onCreateMenu'); $event->menu = $configurationMenu; $this->view->placeholder('main.window.menu')->set($menu->toArray(false, true)); } else { $ontowiki->appendMessage(); } $this->view->table = $this->view->partial('partials/table.phtml', array('data' => $this->parsedFile, 'tableClass' => 'csvimport')); # $this->viewElements = array( # 'table' => array( # 'template' => 'partials/table.phtml', # 'data' => array( # 'data' => $this->parsedFile, # 'tableClass' => 'csvimport' # ) # ) # ); }
public function createConfigurationView($urlBase) { $ontowiki = OntoWiki::getInstance(); $model = $ontowiki->selectedModel; $this->view->placeholder('main.window.title')->append('Import CSV Data'); $this->view->actionUrl = $urlBase . 'csvimport/mapping'; $this->view->salt = hash("md5", serialize($this->parsedFile)); $this->view->modelUri = (string) $model; OntoWiki_Navigation::disableNavigation(); $toolbar = $ontowiki->toolbar; $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Extract Triples', 'id' => 'extract'))->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel')); $this->view->placeholder('main.window.toolbar')->set($toolbar); $headers = array_keys($this->parsedFile[0]); $data = array(); foreach ($headers as $element) { $data[] = array($element); } $this->view->table = $this->view->partial('importer/tabular.phtml', array('data' => $data, 'script' => $this->componentConfig->urlBase . 'extensions/csvimport/scripts/autosuggest.js', 'tableClass' => 'csvimport', 'examples' => $this->parsedFile[0], 'baseUri' => $model->getModelUri(), 'prefixes' => $model->getNamespaces())); }
protected function resultsAction() { $this->view->placeholder('main.window.title')->append('Import CSV Results'); OntoWiki_Navigation::disableNavigation(); }