primo commit
This commit is contained in:
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title(JText::_('COM_TABULIZER_DATA_SOURCES'));
|
||||
|
||||
$return_url = $this->return_urls['archives'];
|
||||
$data_sources_return_url = '&data_sources_return_url='.urlencode($this->return_urls['data_sources']);
|
||||
|
||||
if (empty($this->data_sources)) {
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_ARCHIVES'), $return_url);
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-edit')) JToolBarHelper::addNew('newDataSource', JText::_('COM_TABULIZER_NEW_DATA_SOURCE'));
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-import')) JToolBarHelper::custom( 'importDataSource', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_IMPORT_DATASOURCE'), false, false );
|
||||
if (TabulizerPermissions::userIsAllowed('data-import')) JToolBarHelper::custom( 'manageDataFiles', 'data_files', 'data_files', JText::_('COM_TABULIZER_MANAGE_DATA_FILES'), false, false );
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
} else {
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_ARCHIVES'), $return_url);
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-edit')) JToolBarHelper::addNew('newDataSource', JText::_('COM_TABULIZER_NEW_DATA_SOURCE'));
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-import')) JToolBarHelper::custom( 'importDataSource', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_IMPORT_DATASOURCE'), false, false );
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-export')) JToolBarHelper::custom( 'exportDataSource', 'export_archive', 'export_archive', JText::_('COM_TABULIZER_EXPORT_DATASOURCE'), true );
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-edit')) JToolBarHelper::custom('clearDataSourceCache', 'clear', 'clear_cache', JText::_('COM_TABULIZER_CLEAR_DATA_SOURCE_CACHE'), true);
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-edit')) JToolBarHelper::deleteList(JText::_('COM_TABULIZER_DELETE_DATA_SOURCE_CONFIRM'), 'deleteDataSource', JText::_('COM_TABULIZER_DELETE_DATA_SOURCE'));
|
||||
if (TabulizerPermissions::userIsAllowed('data-import')) JToolBarHelper::custom( 'manageDataFiles', 'data_files', 'data_files', JText::_('COM_TABULIZER_MANAGE_DATA_FILES'), false, false );
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
}
|
||||
|
||||
if (empty($this->data_sources)) {
|
||||
$msg = sprintf(JText::_('COM_TABULIZER_NO_DATA_SOURCES_WERE_FOUND'), JText::_('COM_TABULIZER_NEW_DATA_SOURCE'));
|
||||
TabulizerUserMessage::printInfo($msg);
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="viewDataSources" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$rows = &$this->data_sources;
|
||||
if (CLIENT_SIDE_PAGINATION) {
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo TabulizerPath::getURLPath('jquery.dataTables.css','datatables_css');?>" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo TabulizerPath::getURLPath('smoothness.css','datatables_css');?>" type="text/css" />
|
||||
|
||||
<script src="<?php echo TabulizerPath::getURLPath('jtquery.min.js','asset_js'); ?>" type="text/javascript"></script>
|
||||
<script src="<?php echo TabulizerPath::getURLPath('jtquery.dataTables.min.js','datatables_js'); ?>" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEvent('domready', function() {
|
||||
$$('.hasTip').each(function(el) {
|
||||
var title = el.get('title');
|
||||
if (title) {
|
||||
var parts = title.split('::', 2);
|
||||
el.store('tip:title', parts[0]);
|
||||
el.store('tip:text', parts[1]);
|
||||
}
|
||||
});
|
||||
var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
|
||||
});
|
||||
|
||||
if (typeof(tabulizer_datatables) == "undefined") tabulizer_datatables = [];
|
||||
jtQuery.noConflict();
|
||||
jtQuery(document).ready(function() {
|
||||
var tabulizer_datatable_id = tabulizer_datatables.length;
|
||||
tabulizer_datatables[tabulizer_datatable_id] = jtQuery("#tab_admin_list").dataTable({"bPaginate": true,
|
||||
"bLengthChange": true,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"bJQueryUI": true,
|
||||
"oLanguage": <?php echo LanguageLiterals::dataTableLabels(); ?>,
|
||||
"aaSorting": [[ 1, "asc" ]],
|
||||
"aoColumnDefs": [ { "bSortable" : false, "aTargets" : [0,4,5 ] } ],
|
||||
"sPaginationType": "full_numbers",
|
||||
"iDisplayLength": 20});
|
||||
} );
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
} // client side pagination
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table id="tab_admin_list" class="adminlist tabtable-tabulizer_backend_admin">
|
||||
<thead>
|
||||
<tr class="tabrow tr_header1">
|
||||
<th class="tabcol" width="20"><input type="checkbox" name="toggle" value="" onclick="Joomla.checkAll(this)" /></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_DATA_SOURCE_TITLE');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_DATA_SOURCE_TAG');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_DATA_SOURCE_TYPE');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_DATA_SOURCE_PARAMS');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_ACTIONS');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
|
||||
$separator_options = $options = TabulizerUtils::getSeparatorListLabels();
|
||||
$enclosure_options = array(ENCLOSURE_NONE=>JText::_('COM_TABULIZER_NO_ENCLOSURE'),
|
||||
ENCLOSURE_DOUBLE_QUOTES=>JText::_('COM_TABULIZER_DOUBLE_QUOTES_ENCLOSURE'),
|
||||
ENCLOSURE_SINGLE_QUOTES=>JText::_('COM_TABULIZER_SINGLE_QUOTES_ENCLOSURE'));
|
||||
$boost_options = array(BOOST_NONE=>JText::_('COM_TABULIZER_BOOST_NONE'),
|
||||
BOOST_NO_EXT=>JText::_('COM_TABULIZER_BOOST_NOEXT'),
|
||||
BOOST_XLSX_PARSER=>JText::_('COM_TABULIZER_XLSX_PARSER'));
|
||||
$cellcache_options = array(CELLCACHE_NONE=>JText::_('COM_TABULIZER_CELLCACHE_NONE'),
|
||||
CELLCACHE_SQLITE3=>JText::_('COM_TABULIZER_CELLCACHE_SQLITE3'));
|
||||
|
||||
jimport('joomla.filter.output');
|
||||
$k=0;
|
||||
$i=0;
|
||||
foreach ($rows as $archive_name => $row) {
|
||||
$tag = $row->tag;
|
||||
$title = htmlspecialchars($row->title,ENT_QUOTES,'UTF-8');
|
||||
$source_type = TabulizerDataSource::getSourceTypeLabel($row->source_type);
|
||||
$source_params = array();
|
||||
if (TabulizerDataSource::decodeParams($row->source_type, $row->source_params, $source_params, $error_msg)) {
|
||||
$source_params_html = '<ul>';
|
||||
foreach ($source_params as $key => $value) {
|
||||
if (empty($key) || empty($value)) continue;
|
||||
if ($key == 'meta') continue;
|
||||
if ($key == 'separator') if (isset($separator_options[$value])) $value = $separator_options[$value];
|
||||
if ($key == 'enclosure') if (isset($enclosure_options[$value])) $value = $enclosure_options[$value];
|
||||
if ($key == 'boost') if (isset($boost_options[$value])) $value = $boost_options[$value];
|
||||
if ($key == 'cellcache') if (isset($cellcache_options[$value])) $value = $cellcache_options[$value];
|
||||
$source_params_html .= '<li><strong>'.TabulizerDataSource::getSourceParamsLabel($key).'</strong>: '. $value. '</li>';
|
||||
}
|
||||
$source_params_html .= '</ul>';
|
||||
} else {
|
||||
$source_params_html = TabulizerUserMessage::printError($error_msg, true);
|
||||
}
|
||||
|
||||
$return_url = $data_sources_return_url;
|
||||
|
||||
$id = $row->id;
|
||||
$k=1-$k;
|
||||
$checked = JHTML::_('grid.id', $i, $id);
|
||||
$preview_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=previewDataSource&ds_id='.$id.'&cid[]='.$id.$return_url);
|
||||
$edit_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=editDataSource&ds_id='.$id.'&cid[]='.$id.$return_url);
|
||||
$delete_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=deleteDataSource&ds_id='.$id.'&cid[]='.$id.'&'. JSession::getFormToken() .'=1'.$return_url);
|
||||
if (TabulizerPermissions::isAllowed('data-source-edit')) {
|
||||
$publishing_preferences_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=editDataSourcePublishingPreferences&ds_id='.$id.$return_url);
|
||||
$action_links = '<a href="'.$preview_link.'">'.JText::_('COM_TABULIZER_PREVIEW').'</a> | <a href="'.$edit_link.'">'.JText::_('COM_TABULIZER_EDIT').'</a> | <a href="'.$delete_link.'" onclick="javascript:return confirm(\''.JText::_('COM_TABULIZER_DELETE_DATA_SOURCE_CONFIRM').'\')">'.JText::_('COM_TABULIZER_DELETE').'</a><br/><a href="'.$publishing_preferences_link.'">'.JText::_('COM_TABULIZER_PUBLISHING_PREFERENCES').'</a>';
|
||||
} else {
|
||||
$action_links = '<a href="'.$preview_link.'">'.JText::_('COM_TABULIZER_PREVIEW').'</a> | <a href="'.$edit_link.'">'.JText::_('COM_TABULIZER_EDIT').'</a> | <a href="'.$delete_link.'" onclick="javascript:return confirm(\''.JText::_('COM_TABULIZER_DELETE_DATA_SOURCE_CONFIRM').'\')">'.JText::_('COM_TABULIZER_DELETE').'</a>';
|
||||
}
|
||||
|
||||
echo '<tr class="tabrow"><td class="tabcol tabcheck">'.$checked.'</td><td class="tabcol tabtitle">'.$title.'</td><td class="tabcol tabtag">'.$tag.'</td><td class="tabcol tabsource">'.$source_type.'</td><td class="tabcol tabparams">'.$source_params_html.'</td><td class="tabcol tabaction" nowrap>'.$action_links.'</td></tr>' ."\n";
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// add pagination, if needed
|
||||
$pagination = $this->pagination;
|
||||
if ($pagination) {
|
||||
?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7"><?php echo $pagination->getListFooter(); ?></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="viewDataSources" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
} // if (empty($this->data_sources))
|
||||
|
||||
?>
|
||||
|
||||
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title(JText::_('COM_TABULIZER_DATA_FILES'));
|
||||
|
||||
$data_files_return_url = str_replace('&','&',JRoute::_('index.php?option=com_tabulizer&task=manageDataFiles'));
|
||||
$data_sources_return_url = str_replace('&','&',JRoute::_('index.php?option=com_tabulizer&task=viewDataSources'));
|
||||
|
||||
if (empty($this->data_files)) {
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_DATA_SOURCES'), $data_sources_return_url);
|
||||
JToolBarHelper::custom( 'importDataFile', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_IMPORT_DATAFILE'), false, false );
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
} else {
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_DATA_SOURCES'), $data_sources_return_url);
|
||||
JToolBarHelper::custom( 'importDataFile', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_IMPORT_DATAFILE'), false, false );
|
||||
JToolBarHelper::custom( 'downloadDataFile', 'export_archive', 'export_archive', JText::_('COM_TABULIZER_DOWNLOAD_DATAFILE'), true, true );
|
||||
JToolBarHelper::deleteList(JText::_('COM_TABULIZER_DELETE_DATA_FILE_CONFIRM'), 'deleteDataFile', JText::_('COM_TABULIZER_DELETE_DATA_FILE'));
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
}
|
||||
|
||||
if (empty($this->data_files)) {
|
||||
$msg = sprintf(JText::_('COM_TABULIZER_NO_DATA_FILES_WERE_FOUND'),JText::_('COM_TABULIZER_IMPORT_DATAFILE'));
|
||||
TabulizerUserMessage::printInfo($msg);
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="viewDataFiles" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$rows = &$this->data_files;
|
||||
if (CLIENT_SIDE_PAGINATION) {
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo TabulizerPath::getURLPath('jquery.dataTables.css','datatables_css');?>" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo TabulizerPath::getURLPath('smoothness.css','datatables_css');?>" type="text/css" />
|
||||
|
||||
<script src="<?php echo TabulizerPath::getURLPath('jtquery.min.js','asset_js'); ?>" type="text/javascript"></script>
|
||||
<script src="<?php echo TabulizerPath::getURLPath('jtquery.dataTables.min.js','datatables_js'); ?>" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEvent('domready', function() {
|
||||
$$('.hasTip').each(function(el) {
|
||||
var title = el.get('title');
|
||||
if (title) {
|
||||
var parts = title.split('::', 2);
|
||||
el.store('tip:title', parts[0]);
|
||||
el.store('tip:text', parts[1]);
|
||||
}
|
||||
});
|
||||
var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
|
||||
});
|
||||
|
||||
if (typeof(tabulizer_datatables) == "undefined") tabulizer_datatables = [];
|
||||
jtQuery.noConflict();
|
||||
jtQuery(document).ready(function() {
|
||||
var tabulizer_datatable_id = tabulizer_datatables.length;
|
||||
tabulizer_datatables[tabulizer_datatable_id] = jtQuery("#tab_admin_list").dataTable({"bPaginate": true,
|
||||
"bLengthChange": true,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"bJQueryUI": true,
|
||||
"oLanguage": <?php echo LanguageLiterals::dataTableLabels(); ?>,
|
||||
"aaSorting": [[ 1, "asc" ]],
|
||||
"aoColumnDefs": [ { "bSortable" : false, "aTargets" : [0,4 ] } ],
|
||||
"sPaginationType": "full_numbers",
|
||||
"iDisplayLength": 20});
|
||||
} );
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
} // client side pagination
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table id="tab_admin_list" class="adminlist tabtable-tabulizer_backend_admin">
|
||||
<thead>
|
||||
<tr class="tabrow tr_header1">
|
||||
<th class="tabcol" width="20"><input type="checkbox" name="toggle" value="" onclick="Joomla.checkAll(this)" /></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_DATA_FILE_NAME');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_DATA_FILE_MODIFIED');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_DATA_FILE_LINKED_DATA_SOURCES');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_ACTIONS');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
jimport('joomla.filter.output');
|
||||
$k=0;
|
||||
$i=0;
|
||||
foreach ($rows as $file_name => $row) {
|
||||
$return_url = $data_files_return_url;
|
||||
$id = urlencode($file_name);
|
||||
$k=1-$k;
|
||||
$checked = JHTML::_('grid.id', $i, $id);
|
||||
$download_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=downloadDataFile&df_name='.$id.'&cid[]='.$id.'&'. JSession::getFormToken() .'=1');
|
||||
$delete_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=deleteDataFile&df_name='.$id.'&cid[]='.$id.'&'. JSession::getFormToken() .'=1');
|
||||
$action_links = '<a href="'.$download_link.'">'.JText::_('COM_TABULIZER_DOWNLOAD').'</a> | <a href="'.$delete_link.'" onclick="javascript:return confirm(\''.JText::_('COM_TABULIZER_DELETE_DATA_FILE_CONFIRM').'\')">'.JText::_('COM_TABULIZER_DELETE').'</a>';
|
||||
|
||||
echo '<tr class="tabrow"><td class="tabcol tabcheck">'.$checked.'</td><td class="tabcol tabname">'.$file_name.'</td><td class="tabcol tabmodified">'.$row['modified'].'</td><td class="tabcol tabsource">'.$row['linked_data_sources'].'</td><td class="tabcol tabaction" nowrap>'.$action_links.'</td></tr>' ."\n";
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// add pagination, if needed
|
||||
$pagination = $this->pagination;
|
||||
if ($pagination) {
|
||||
?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7"><?php echo $pagination->getListFooter(); ?></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="viewDataFiles" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
} // if (empty($this->data_files))
|
||||
|
||||
?>
|
||||
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
|
||||
$return_url = str_replace('&','&',JRoute::_('index.php?option='.$option.'&task=manageDataFiles'));
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
$text = JText::_('COM_TABULIZER_UPLOAD' );
|
||||
JToolBarHelper::title( JText::_('COM_TABULIZER_DATA_FILES' ).': <small><small>[ ' . $text.' ]</small></small>','config' );
|
||||
JToolBarHelper::custom('import', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_UPLOAD'), false, false );
|
||||
JToolBarHelper::cancel( 'cancel', JText::_('COM_TABULIZER_CLOSE') );
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$lists = array();
|
||||
$lists['filename'] = '<input name="data_file" id="data_file" type="file" />';
|
||||
$lists['overwrite'] = '<input type="checkbox" name="overwrite_file" id="overwrite_file" value="1" /> ' . JText::_('COM_TABULIZER_RULESET_ARCHIVE_OVERWRITE_VALUE');
|
||||
|
||||
$allowed_extensions = ALLOWED_FILE_TYPES_FOR_DATA_IMPORTATION;
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function isValidFilename(filename) {
|
||||
regex = /[a-zA-Z0-9\._\-]{2,128}\.(<?php echo str_replace(',','|',$allowed_extensions)?>|zip)$/i;
|
||||
value = filename;
|
||||
if (!regex.test(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function validateAndSubmit() {
|
||||
var form = document.adminForm;
|
||||
var value, regex, valid = true, error_msg = "";
|
||||
if (form.data_file.value == "") {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_FILE_UPLOAD_ERROR_NO_FILE');?>";
|
||||
valid = false;
|
||||
} else if (!isValidFilename(form.data_file.value)) {
|
||||
error_msg = error_msg + "\n* <?php echo sprintf(JText::_('COM_TABULIZER_INVALID_DATA_FILENAME_IMPORT'),$allowed_extensions);?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
form.submit();
|
||||
} else {
|
||||
error_msg = "<?php echo JText::_('COM_TABULIZER_JS_ERRORS_FOUND'); ?>" + error_msg;
|
||||
alert(error_msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?php if(version_compare(JVERSION,'1.6.0','ge')) { ?>
|
||||
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'import') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
function submitbutton(pressbutton) {
|
||||
if (pressbutton == 'import') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</script>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
|
||||
<div class="col edit_frm_div">
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_DATA_FILE_IMPORT_DETAILS' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_FILENAME' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['filename']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_FILE_OVERWRITE_LABEL' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['overwrite']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
<input type="hidden" name="option" value="com_tabulizer" />
|
||||
<input type="hidden" name="task" value="importDataFile" />
|
||||
<input type="hidden" name="import_file" value="1" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
$data_file_path = TabulizerPath::getDirPath('data');
|
||||
TabulizerUserMessage::printHelp(sprintf(JText::_('COM_TABULIZER_FORM_DATA_FILE_IMPORT_HELP'),$data_file_path));
|
||||
?>
|
||||
@ -0,0 +1,519 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JHTML::_('behavior.modal'); // for article selection popup
|
||||
|
||||
$return_url = $this->return_urls['data_sources'];
|
||||
$archive_to_rulesets = $this->archive_to_rulesets;
|
||||
|
||||
$edit = $this->lists['edit'];
|
||||
$text = !$edit ? JText::_('COM_TABULIZER_NEW' ) : JText::_('COM_TABULIZER_EDIT' );
|
||||
JToolBarHelper::title( JText::_('COM_TABULIZER_DATA_SOURCE' ).': <small><small>[ ' . $text.' ]</small></small>','config' );
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::custom( 'saveNew', 'save-new', 'save-new', JText::_('COM_TABULIZER_SAVE_AND_NEW'), false, false );
|
||||
JToolBarHelper::custom( 'saveCopy', 'save-copy', 'save-copy', JText::_('COM_TABULIZER_SAVE_AS_COPY'), false, false );
|
||||
|
||||
if (!$edit) {
|
||||
JToolBarHelper::cancel();
|
||||
} else {
|
||||
// for existing items the button is renamed `close`
|
||||
JToolBarHelper::cancel( 'cancel', JText::_('COM_TABULIZER_CLOSE') );
|
||||
}
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
TabulizerUtils::opentipInit();
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function validateAndSubmit() {
|
||||
var form = document.adminForm;
|
||||
var value, f_value, regex, valid = true, error_msg = "";
|
||||
|
||||
regex = /^[a-zA-Z0-9\._\-]{2,128}\<?php echo XML_FILE_EXT;?>$/i;
|
||||
value = form.ds_ruleset_archive.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_ARCHIVE_FILENAME');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^[a-zA-Z0-9\._\-]{2,128}$/;
|
||||
value = form.ds_ruleset_name.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_NAME');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^.{2,255}$/;
|
||||
value = form.ds_title.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_TITLE');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
var regex_user_param_text = /({user_param_\d_url:text})|({user_param_\d:text})/gmi;
|
||||
|
||||
var source_type = form.ds_source_type.value;
|
||||
|
||||
if ((source_type == 'csv')||(source_type == 'excel')||(source_type == 'html')||(source_type == 'rss')||(source_type == 'json')) {
|
||||
if (form.ds_filepath.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_FILEPATH_OR_URL');?>";
|
||||
valid = false;
|
||||
} else if (regex_user_param_text.test(form.ds_filepath.value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_DATA_SOURCE_FILEPATH_USER_PARAM_TEXT_NOT_ALLOWED');?>";
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
switch (source_type) {
|
||||
case 'csv':
|
||||
break;
|
||||
|
||||
case 'excel':
|
||||
if (form.ds_filepath.value != '') f_value = form.ds_filepath.value;
|
||||
else f_value = false;
|
||||
if (f_value) {
|
||||
f_value = f_value.replace(/\s/g, "");
|
||||
f_regex = new RegExp("^(.+)(xls|xlsx|ods)$","i");
|
||||
if (!f_regex.test(f_value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_SHEET_FILE');?>";
|
||||
valid = false;
|
||||
}
|
||||
$allow_remote_files = true;
|
||||
if (!$allow_remote_files) {
|
||||
f_url_regex = new RegExp("^(http|https)://", "i");
|
||||
if (f_url_regex.test(f_value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_SHEET_FILE_URL');?>";
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (form.ds_sheet_name.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_SHEET_NAME');?>";
|
||||
valid = false;
|
||||
}
|
||||
if (form.ds_sheet_references.value != '') {
|
||||
// placeholder for future use
|
||||
}
|
||||
if (form.ds_sheet_selection.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_SHEET_SELECTION');?>";
|
||||
valid = false;
|
||||
} else {
|
||||
f_value = form.ds_sheet_selection.value;
|
||||
f_value = f_value.replace(/\s/g, "");
|
||||
f_regex = new RegExp("^([a-zA-Z]{1,3})(\\d+):([a-zA-Z]{1,3})(\\d+)$","");
|
||||
f_regex_b = new RegExp("^(\\d+)([a-zA-Z]{1,3}):(\\d+)([a-zA-Z]{1,3})$","");
|
||||
if ((!f_regex.test(f_value))&&(!f_regex_b.test(f_value))&&(f_value.indexOf("{")==-1)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_SHEET_SELECTION');?>";
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'database':
|
||||
if (form.ds_query.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_QUERY');?>";
|
||||
valid = false;
|
||||
} else if (regex_user_param_text.test(form.ds_query.value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_DATA_SOURCE_QUERY_USER_PARAM_TEXT_NOT_ALLOWED');?>";
|
||||
valid = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'external_database':
|
||||
if (form.ds_edb_driver.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_EDB_DRIVER');?>";
|
||||
valid = false;
|
||||
}
|
||||
if (form.ds_edb_host.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_EDB_HOST');?>";
|
||||
valid = false;
|
||||
}
|
||||
if (form.ds_edb_user.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_EDB_USER');?>";
|
||||
valid = false;
|
||||
}
|
||||
if (form.ds_edb_password.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_EDB_PASSWORD');?>";
|
||||
valid = false;
|
||||
}
|
||||
if (form.ds_edb_database.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_EDB_DATABASE');?>";
|
||||
valid = false;
|
||||
}
|
||||
if (form.ds_query.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_QUERY');?>";
|
||||
valid = false;
|
||||
} else if (regex_user_param_text.test(form.ds_query.value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_DATA_SOURCE_QUERY_USER_PARAM_TEXT_NOT_ALLOWED');?>";
|
||||
valid = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'html':
|
||||
if (!form.ds_table_order.value) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_TABLE_ORDER');?>";
|
||||
valid = false;
|
||||
}
|
||||
if ((form.ds_table_attribute_name.value == '') && (form.table_attribute_value.value != '')) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_TABLE_ATTRIBUTE');?>";
|
||||
valid = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'xml':
|
||||
if (!form.ds_td_map.value) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_TD_MAP');?>";
|
||||
valid = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'rss':
|
||||
if (form.ds_feed_type.selectedIndex < 0) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_FEED_TYPE');?>";
|
||||
valid = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'json':
|
||||
break;
|
||||
|
||||
case 'article':
|
||||
if (form.ds_article_id.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_ARTICLE_ID');?>";
|
||||
valid = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'merger':
|
||||
if (form.ds_merging_tree.value == '') {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_MERGING_TREE');?>";
|
||||
valid = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
error_msg = "Unknown source type: " + source_type;
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
|
||||
regex = /^\d+$/;
|
||||
value = form.ds_cache_time.value;
|
||||
if (!regex.test(value)) {
|
||||
if (form.ds_cache_type.value != <?php echo TABULIZER_DATA_SOURCE_CACHE_OFF;?>) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_CACHE_TIME');?>";
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
form.submit();
|
||||
} else {
|
||||
error_msg = "<?php echo JText::_('COM_TABULIZER_JS_ERRORS_FOUND'); ?>" + error_msg;
|
||||
alert(error_msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateSourceParams() {
|
||||
var form = document.adminForm;
|
||||
var show_keys, all_keys = new Array('ruleset_archive','ruleset_name','table_caption','table_summary','server_side','filepath','query','edb_driver','edb_host','edb_user','edb_password','edb_database','edb_prefix','article_id','merging_tree','sheet_name','sheet_references','sheet_selection','read_font','read_color','read_images','read_hyperlinks','boost','cellcache','remove_empty','separator','enclosure','consistency','strip_tags','table_order','table_attribute_name','table_attribute_value','td_map');
|
||||
var source_type = form.ds_source_type.value;
|
||||
|
||||
switch (source_type) {
|
||||
case 'csv': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'separator',
|
||||
'enclosure',
|
||||
'consistency');
|
||||
break;
|
||||
|
||||
case 'excel': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'sheet_name',
|
||||
'sheet_selection',
|
||||
'sheet_references',
|
||||
'read_font',
|
||||
'read_color',
|
||||
'read_images',
|
||||
'read_hyperlinks',
|
||||
'boost',
|
||||
'cellcache',
|
||||
'remove_empty');
|
||||
break;
|
||||
|
||||
case 'database': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name' ,
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side' ,
|
||||
'query');
|
||||
break;
|
||||
|
||||
case 'external_database': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'edb_driver',
|
||||
'edb_host',
|
||||
'edb_user',
|
||||
'edb_password',
|
||||
'edb_database',
|
||||
'edb_prefix',
|
||||
'query');
|
||||
break;
|
||||
|
||||
case 'html': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name' ,
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side' ,
|
||||
'filepath',
|
||||
'table_order',
|
||||
'table_attribute_name',
|
||||
'table_attribute_value');
|
||||
break;
|
||||
|
||||
case 'xml': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name' ,
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side' ,
|
||||
'filepath',
|
||||
'td_map');
|
||||
break;
|
||||
|
||||
case 'rss': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name' ,
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side' ,
|
||||
'filepath',
|
||||
'feed_type',
|
||||
'encoding');
|
||||
break;
|
||||
|
||||
case 'json': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name' ,
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side' ,
|
||||
'filepath',
|
||||
'encoding');
|
||||
break;
|
||||
|
||||
case 'article': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name' ,
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side' ,
|
||||
'article_id',
|
||||
'separator',
|
||||
'enclosure',
|
||||
'consistency',
|
||||
'strip_tags');
|
||||
break;
|
||||
|
||||
case 'merger': show_keys = new Array('ruleset_archive',
|
||||
'ruleset_name' ,
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side' ,
|
||||
'merging_tree');
|
||||
break;
|
||||
|
||||
default:
|
||||
show_keys = new Array();
|
||||
break;
|
||||
}
|
||||
|
||||
var i, el;
|
||||
for (i = 0; i < all_keys.length; i++) {
|
||||
el = document.getElementById('tr_'+all_keys[i]);
|
||||
el.className="hidden_tr";
|
||||
}
|
||||
for (i = 0; i < show_keys.length; i++) {
|
||||
el = document.getElementById('tr_'+show_keys[i]);
|
||||
el.className="";
|
||||
}
|
||||
}
|
||||
|
||||
function TabulizerUpdateRulesetArchive(ruleset_archive_selection) {
|
||||
var archive_to_rulesets = new Array();
|
||||
<?php echo $archive_to_rulesets; ?>
|
||||
var archive_filename = ruleset_archive_selection.value;
|
||||
var ruleset_select = document.getElementById("ds_ruleset_name");
|
||||
var rulesets, ruleset_count = 0;
|
||||
|
||||
if (archive_filename) {
|
||||
rulesets = archive_to_rulesets[archive_filename];
|
||||
if (rulesets) {
|
||||
ruleset_count = 0;
|
||||
ruleset_select.options.length = 0;
|
||||
for(index in rulesets) {
|
||||
ruleset_select.options[ruleset_select.options.length] = new Option(rulesets[index], index);
|
||||
ruleset_count++;
|
||||
}
|
||||
if (ruleset_count == 0) {
|
||||
ruleset_select.options[ruleset_select.options.length] = new Option("<?php echo JText::_('COM_TABULIZER_NONE');?>", 0);
|
||||
}
|
||||
}
|
||||
if (typeof jtQuery != 'undefined') {
|
||||
jtQuery("#ds_ruleset_name").trigger("liszt:updated");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateCacheType() {
|
||||
var cache_type = document.getElementById('ds_cache_type');
|
||||
var cache_time = document.getElementById('ds_cache_time');
|
||||
|
||||
if (cache_type.value != <?php echo TABULIZER_DATA_SOURCE_CACHE_OFF;?>) cache_time.disabled = false; else cache_time.disabled = true;
|
||||
}
|
||||
|
||||
function TabulizerUpdateSheetReferences(ref_type) {
|
||||
var custom_references = document.getElementById("ds_sheet_references_custom");
|
||||
if (ref_type.value == "none") {
|
||||
document.getElementById("ds_sheet_references").value = "";
|
||||
custom_references.style.display="none";
|
||||
} else if (ref_type.value == "all") {
|
||||
document.getElementById("ds_sheet_references").value = "all";
|
||||
custom_references.style.display="none";
|
||||
} else {
|
||||
if (document.getElementById("ds_sheet_references").value == "all") {
|
||||
document.getElementById("ds_sheet_references").value = "";
|
||||
}
|
||||
custom_references.style.display="block";
|
||||
}
|
||||
}
|
||||
|
||||
function jSelectArticle(id, title, object) {
|
||||
document.getElementById('ds_article_id').value = id;
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
|
||||
<?php if(version_compare(JVERSION,'1.6.0','ge')) { ?>
|
||||
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'save') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'saveNew') {
|
||||
document.getElementById('addnew').value = '1';
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'saveCopy') {
|
||||
document.getElementById('addcopy').value = '1';
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
function submitbutton(pressbutton) {
|
||||
if (pressbutton == 'save') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'saveNew') {
|
||||
document.getElementById('addnew').value = '1';
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'saveCopy') {
|
||||
document.getElementById('addcopy').value = '1';
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<div class="col edit_frm_div">
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_DATA_SOURCE_DETAILS' ); ?></legend>
|
||||
|
||||
<table class="admintable">
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_TAG' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['tag']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_TITLE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['title']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_TYPE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['source_type']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_PARAMS' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['source_params']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_CACHE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['cache_params']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
<input type="hidden" name="option" value="com_tabulizer" />
|
||||
<input type="hidden" name="task" value="saveDataSource" />
|
||||
<input type="hidden" name="addnew" id="addnew" value="0" />
|
||||
<input type="hidden" name="addcopy" id="addcopy" value="0" />
|
||||
<?php echo $this->lists['id']; ?>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
|
||||
$return_url = str_replace('&','&',JRoute::_('index.php?option='.$option.'&task=viewDataSources'));
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
$text = JText::_('COM_TABULIZER_IMPORT' );
|
||||
JToolBarHelper::title( JText::_('COM_TABULIZER_DATA_SOURCE' ).': <small><small>[ ' . $text.' ]</small></small>','config' );
|
||||
JToolBarHelper::custom('import', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_IMPORT'), false, false );
|
||||
JToolBarHelper::cancel( 'cancel', JText::_('COM_TABULIZER_CLOSE') );
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$lists = array();
|
||||
$lists['filename'] = '<input name="datasource_filename" id="datasource_filename" type="file" />';
|
||||
$lists['overwrite'] = '<input type="checkbox" name="overwrite_file" id="overwrite_file" value="1" /> ' . JText::_('COM_TABULIZER_DATA_SOURCE_OVERWRITE_VALUE');
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function isValidFilename(filename) {
|
||||
regex = /[a-zA-Z0-9\._\-]{2,128}\.xml$/i;
|
||||
value = filename;
|
||||
if (!regex.test(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function validateAndSubmit() {
|
||||
var form = document.adminForm;
|
||||
var value, regex, valid = true, error_msg = "";
|
||||
if (form.datasource_filename.value == "") {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_FILE_UPLOAD_ERROR_NO_FILE');?>";
|
||||
valid = false;
|
||||
} else if (!isValidFilename(form.datasource_filename.value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_DATA_SOURCE_FILENAME_IMPORT');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
form.submit();
|
||||
} else {
|
||||
error_msg = "<?php echo JText::_('COM_TABULIZER_JS_ERRORS_FOUND'); ?>" + error_msg;
|
||||
alert(error_msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?php if(version_compare(JVERSION,'1.6.0','ge')) { ?>
|
||||
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'import') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
function submitbutton(pressbutton) {
|
||||
if (pressbutton == 'import') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</script>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
|
||||
<div class="col edit_frm_div">
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_DATA_SOURCE_IMPORT_DETAILS' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_FILENAME_XML' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['filename']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_OVERWRITE_LABEL' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['overwrite']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
<input type="hidden" name="option" value="com_tabulizer" />
|
||||
<input type="hidden" name="task" value="importDataSource" />
|
||||
<input type="hidden" name="import_file" value="1" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_FORM_DATA_SOURCE_IMPORT_HELP'));
|
||||
echo "<br/>\n";
|
||||
TabulizerUserMessage::printWarning(JText::_('COM_TABULIZER_FORM_DATA_SOURCE_IMPORT_WARNING'));
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
|
||||
$title = JText::_('COM_TABULIZER_DATA_SOURCE' ) . ' <em>'.$this->data_source->tag.'</em>';
|
||||
|
||||
$return_url = $this->return_urls['data_sources'];
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title($title);
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_DATA_SOURCES'), $return_url);
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$table_html = TabulizerDataSource::getTableHTML($this->data_source->tag);
|
||||
|
||||
TabulizerPath::requireLib('tags_processor','common');
|
||||
$processor = new TabulizerTagsProcessor();
|
||||
|
||||
$processor->init('system');
|
||||
$processor->processTags($table_html);
|
||||
|
||||
echo "<h3>{$title}</h3>\n<hr>\n";
|
||||
echo $table_html;
|
||||
|
||||
?>
|
||||
@ -0,0 +1,196 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
|
||||
$title = JText::_('COM_TABULIZER_DATA_SOURCE' ) . ' <em>'.$this->data_source->tag.'</em>';
|
||||
$return_url = $this->return_urls['data_sources'];
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title($title);
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::cancel( 'cancel', JText::_('COM_TABULIZER_CLOSE') );
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$lists = $this->lists;
|
||||
|
||||
if (!empty($this->preferences)) {
|
||||
$publishing_preferences = $this->preferences;
|
||||
if ($publishing_preferences->status == PUBLISHING_PREFERENCES_STATUS_PUBLISHED) {
|
||||
$base_url = JURI::root().'/index.php?option=com_tabulizer&task=outputDataSource&tmpl=component&output=raw';
|
||||
$base_url .= '&ds_tag='.$this->data_source->tag;
|
||||
$base_url .= '&ds_mode='.$publishing_preferences->mode;
|
||||
$urls = array();
|
||||
if (!empty($publishing_preferences->keyphrases)) {
|
||||
$keyphrases = explode("\n",$publishing_preferences->keyphrases);
|
||||
foreach ($keyphrases as $keyphrase) {
|
||||
$urls[] = $base_url . '&ds_keyphrase='.$keyphrase;
|
||||
}
|
||||
} else {
|
||||
$urls[] = $base_url;
|
||||
}
|
||||
$published_urls = '<div style="font-weight: bold;">'.JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHED_URLS').'</div>';
|
||||
$published_urls .= '<ul>';
|
||||
foreach ($urls as $url) {
|
||||
$published_urls .= '<li>'.$url.'</li>';
|
||||
}
|
||||
$published_urls .= '</ul>';
|
||||
}
|
||||
} else {
|
||||
$published_urls = '';
|
||||
}
|
||||
|
||||
echo "<h3>{$title}</h3>\n<hr>\n";
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function isValidFilename(filename) {
|
||||
regex = /[a-zA-Z0-9\._\-]{2,128}\.xml$/i;
|
||||
value = filename;
|
||||
if (!regex.test(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function validateAndSubmit() {
|
||||
var form = document.adminForm;
|
||||
var value, regex, valid = true, error_msg = "";
|
||||
|
||||
if (valid) {
|
||||
form.submit();
|
||||
} else {
|
||||
error_msg = "<?php echo JText::_('COM_TABULIZER_JS_ERRORS_FOUND'); ?>" + error_msg;
|
||||
alert(error_msg);
|
||||
}
|
||||
}
|
||||
|
||||
function randomString(length, chars) {
|
||||
var result = '';
|
||||
for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
|
||||
return result;
|
||||
}
|
||||
|
||||
function addNewKeyphrase() {
|
||||
var keyphrases = document.getElementById('ds_keyphrases');
|
||||
var new_keyphrase = randomString(32, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
||||
keyphrases.options[keyphrases.options.length] = new Option(new_keyphrase, new_keyphrase);
|
||||
}
|
||||
|
||||
function removeKeyphrase() {
|
||||
var keyphrases = document.getElementById('ds_keyphrases');
|
||||
var keyphrase_id = keyphrases.selectedIndex;
|
||||
if (keyphrase_id>=0) {
|
||||
keyphrases.removeChild(keyphrases[keyphrase_id]);
|
||||
} else {
|
||||
alert("<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_NO_KEYPHRASE_SELECTED_DELETION_JS');?>");
|
||||
}
|
||||
}
|
||||
|
||||
function removeAllKeyphrases() {
|
||||
var keyphrases = document.getElementById('ds_keyphrases');
|
||||
var keyphrases_length = keyphrases.options.length;
|
||||
if (keyphrases_length) {
|
||||
for(var i=keyphrases_length-1;i>=0;i--) {
|
||||
keyphrases.remove(i);
|
||||
}
|
||||
} else {
|
||||
alert("<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_NO_KEYPHRASE_FOR_DELETION_JS');?>");
|
||||
}
|
||||
}
|
||||
|
||||
<?php if(version_compare(JVERSION,'1.6.0','ge')) { ?>
|
||||
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'save') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
function submitbutton(pressbutton) {
|
||||
if (pressbutton == 'import') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</script>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<div class="col edit_frm_div">
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_PREFERENCES' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_PREFERENCE_STATUS' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['status']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_PREFERENCE_MODE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['mode']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_PREFERENCE_KEYPHRASES' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['keyphrases']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
<input type="hidden" name="option" value="com_tabulizer" />
|
||||
<input type="hidden" name="task" value="saveDataSourcePublishingPreferences" />
|
||||
<input type="hidden" name="ds_tag" value="<?php echo $this->data_source->tag;?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if (empty($published_urls)) {
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_FORM_DATA_SOURCE_PUBLISHING_PREFERENCES_HELP'));
|
||||
} else {
|
||||
echo $published_urls;
|
||||
if ($publishing_preferences->mode == 'json') {
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_FORM_DATA_SOURCE_PUBLISHING_PREFERENCES_JSON_URLS'));
|
||||
} else {
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_FORM_DATA_SOURCE_PUBLISHING_PREFERENCES_HTML_URLS'));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user