primo commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1,873 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 1.0.0 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.alterora.gr
|
||||
*
|
||||
*
|
||||
* @MVC architecture generated by MVC generator tool at http://www.alphaplug.com
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class tabulizerViewDatasources extends JViewLegacy
|
||||
{
|
||||
function __construct(){
|
||||
// add tabulizer CSS to override form styling
|
||||
$doc=JFactory::getDocument();
|
||||
$cssfile = TabulizerPath::getURLPath('tabulizer.css', 'admin_css');
|
||||
$doc->addStyleSheet($cssfile);
|
||||
|
||||
TabulizerPath::requireLib('data_source','common');
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function display($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$data_sources = $model->getDataSources();
|
||||
$pagination = $model->getPagination();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$this->assignRef('data_sources', $data_sources);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
$this->assignRef('pagination', $pagination);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayPreview($tpl = null) {
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
TabulizerPath::requireLib('ruleset','admin');
|
||||
|
||||
$model = $this->getModel();
|
||||
$model->getReturnURLs($return_urls);
|
||||
$data_source = $model->getDataSource();
|
||||
|
||||
TabulizerDataSource::decodeParams($data_source->source_type, $data_source->source_params, $source_params, $errors);
|
||||
|
||||
$ruleset = new Ruleset();
|
||||
$selected_ruleset = $ruleset->getRuleset($source_params['ruleset_name'], $source_params['ruleset_archive']);
|
||||
if (empty($selected_ruleset)) {
|
||||
$error_msg = sprintf(JText::_('COM_TABULIZER_DATA_SOURCE_ERROR_RULESET_NOT_FOUND'),$source_params['ruleset_archive'],$source_params['ruleset_name']);
|
||||
TabulizerUserMessage::printError($error_msg);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->assignRef('ruleset', $selected_ruleset);
|
||||
$this->assignRef('data_source', $data_source);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayNew($tpl = null) {
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$default_source_type = 'csv';
|
||||
$default_source_params = "strip_tags=1\nremove_empty=1";
|
||||
|
||||
$lists = array();
|
||||
|
||||
$lists['edit'] = false;
|
||||
|
||||
$lists['id'] = '<input type="hidden" name="ds_id" id="ds_id" value="">';
|
||||
|
||||
$lists['title'] = TabulizerForm::getTextCtrl('ds_title', null, array('class'=>'ds_param_wide'));
|
||||
|
||||
$random_tag = TabulizerString::generateRandomString(24);
|
||||
$lists['tag'] = TabulizerForm::getTextCtrl("ds_tag",$random_tag, array('readonly'=>'readonly')) . ' <span class="tip">'.JText::_('COM_TABULIZER_DATA_SOURCE_TAG_TIP').'</span>';
|
||||
|
||||
$options = TabulizerDataSource::getSourceTypeLabel();
|
||||
$attributes = array('onchange'=>'updateSourceParams()');
|
||||
$lists['source_type'] = TabulizerForm::getSelectCtrl('ds_source_type',$default_source_type,$options,$attributes);
|
||||
|
||||
$default_cache_type = TABULIZER_DATA_SOURCE_DEFAULT_CACHE_TYPE;
|
||||
$options = array(TABULIZER_DATA_SOURCE_CACHE_OFF => JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_OFF'), TABULIZER_DATA_SOURCE_CACHE_ON => JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_ON'));
|
||||
$attributes = array('onchange'=>'updateCacheType()');
|
||||
$cache_type = TabulizerForm::getSelectCtrl('ds_cache_type',$default_cache_type,$options,$attributes);
|
||||
|
||||
$default_cache_time = TABULIZER_DATA_SOURCE_DEFAULT_CACHE_TIME; // minutes
|
||||
$attributes = ($default_cache_type==TABULIZER_DATA_SOURCE_CACHE_OFF)?array('disabled'=>'disabled'):array();
|
||||
$cache_time = TabulizerForm::getTextCtrl('ds_cache_time',$default_cache_time,$attributes). ' <span class="tip">'.JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_TIME_TIP').'</span>';
|
||||
|
||||
$lists['cache_params'] = '<table><tr><td class="ds_param_label">'.JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_TYPE').': </td><td>'.$cache_type.'</td></tr><tr><td class="ds_param_label">'.JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_TIME').': </td><td>'.$cache_time.'</td></tr></table>';
|
||||
|
||||
$source_params = array(
|
||||
'ruleset_archive' => null,
|
||||
'ruleset_name' => null,
|
||||
'table_caption' => null,
|
||||
'table_summary' => null,
|
||||
'server_side' => null,
|
||||
'filepath'=> null,
|
||||
'encoding'=> null,
|
||||
'feed_type'=> null,
|
||||
'article_id'=>null,
|
||||
'query'=> null,
|
||||
'edb_driver'=>'mysqli',
|
||||
'edb_host'=>'localhost',
|
||||
'edb_user'=>null,
|
||||
'edb_password'=>null,
|
||||
'edb_database'=>null,
|
||||
'edb_prefix'=>null,
|
||||
'sheet_name'=> null,
|
||||
'sheet_selection'=> null,
|
||||
'sheet_references'=>null,
|
||||
'read_font'=> null,
|
||||
'read_color'=> null,
|
||||
'read_images'=> null,
|
||||
'read_hyperlinks'=> null,
|
||||
'boost'=>null,
|
||||
'cellcache'=>null,
|
||||
'remove_empty'=> null,
|
||||
'separator'=> null,
|
||||
'enclosure'=> null,
|
||||
'consistency'=>null,
|
||||
'strip_tags'=>null,
|
||||
'table_order'=> null,
|
||||
'table_attribute_name'=> null,
|
||||
'table_attribute_value'=> null,
|
||||
'merging_tree'=> null,
|
||||
'td_map'=>null);
|
||||
|
||||
TabulizerDataSource::decodeParams($default_source_type, $default_source_params, $source_params, $errors);
|
||||
|
||||
TabulizerPath::requireLib('ruleset','admin');
|
||||
$rs = new Ruleset();
|
||||
$ruleset_archive_options = array(0=>JText::_('COM_TABULIZER_NONE'));
|
||||
$ruleset_name_options = array();
|
||||
$archive_to_rulesets = '';
|
||||
|
||||
$ruleset_archives = $rs->loadRulesets(null, 0, 0, $total_count);
|
||||
if ($total_count) {
|
||||
$ruleset_archives = $rs->getRulesets(null, 0, 0, $total_count);
|
||||
uasort($ruleset_archives, array($this,'sortArrayByTitle'));
|
||||
foreach ($ruleset_archives as $ruleset_archive) {
|
||||
$ruleset_archive_options[$ruleset_archive['filename']] = $ruleset_archive['title'];
|
||||
if (!empty($ruleset_archive['rulesets'])) {
|
||||
$rulesets = $ruleset_archive['rulesets'];
|
||||
uasort($rulesets, array($this,'sortArrayByTitle'));
|
||||
$archive_to_ruleset_entries = array();
|
||||
foreach ($rulesets as $ruleset_name => $ruleset) {
|
||||
if ($source_params['ruleset_archive'] == $ruleset_archive['filename']) {
|
||||
$ruleset_name_options[$ruleset['name']] = $ruleset['title'];
|
||||
}
|
||||
$archive_to_ruleset_entries[] = '"'.$ruleset['name'].'": "'.htmlspecialchars($ruleset['title'],ENT_COMPAT,'UTF-8'). '"';
|
||||
}
|
||||
if (!empty($archive_to_ruleset_entries)) $archive_to_rulesets .= ' archive_to_rulesets["'.$ruleset_archive['filename'].'"] = {'.implode(',',$archive_to_ruleset_entries).'};' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($ruleset_name_options)) $ruleset_name_options = array(0=>JText::_('COM_TABULIZER_NONE'));
|
||||
$this->assignRef('archive_to_rulesets', $archive_to_rulesets);
|
||||
|
||||
$labels = TabulizerDataSource::getSourceParamsLabel();
|
||||
$tips = TabulizerDataSource::getSourceParamsTip();
|
||||
|
||||
$source_params_html = '<table>';
|
||||
foreach ($source_params as $key => $value) {
|
||||
switch ($key) {
|
||||
case 'ruleset_archive':
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key, $source_params[$key], $ruleset_archive_options, array('onchange'=>'TabulizerUpdateRulesetArchive(this)', 'class'=>'ds_param_wide'));
|
||||
break;
|
||||
case 'ruleset_name':
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key, $source_params[$key], $ruleset_name_options, array('class'=>'ds_param_wide'));
|
||||
break;
|
||||
case 'table_caption':
|
||||
$attributes = array('maxlength'=>TABLE_CAPTION_MAX_LEN,'class'=>'ds_param_wide');
|
||||
$html_value = TabulizerForm::getInputCtrl('ds_'.$key, $source_params[$key],$attributes);
|
||||
$tip = '<br style="clear: both"><div class="tipdiv">'.JText::_('COM_TABULIZER_DATA_SOURCE_PARAM_TABLE_CAPTION_TIP').'</div>';
|
||||
$html_value .= $tip;
|
||||
break;
|
||||
case 'table_summary':
|
||||
$attributes = array('maxlength'=>TABLE_CAPTION_MAX_LEN, 'style'=>'width:98%; height: 80px;');
|
||||
$html_value = TabulizerForm::getTextareaCtrl('ds_'.$key, $source_params[$key],$attributes);
|
||||
break;
|
||||
case 'server_side':
|
||||
$checked = empty($value)?false:true;
|
||||
$html_value = TabulizerForm::getCheckboxCtrl('ds_'.$key, '1', $checked, array());
|
||||
break;
|
||||
case 'article_id':
|
||||
$html_value = $this->getArticleSelectionInput('ds_'.$key, $source_params[$key]);
|
||||
break;
|
||||
case 'filepath':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_extra_wide')); // '<input type="text" name="ds_'.$key.'" id="ds_'.$key.'" value="'.$value.'" class="ds_param_wide" />';
|
||||
$site_path = TabulizerPath::getDirPath('site_root');
|
||||
$data_path = TabulizerPath::getDirPath('data');
|
||||
$data_manage = JRoute::_('index.php?option=com_tabulizer&task=manageDataFiles');
|
||||
$tip = '<br style="clear: both"><div class="tipdiv">'.sprintf(JText::_('COM_TABULIZER_DATA_SOURCE_FILEPATH_TIP'),$site_path,$site_path,$site_path,$data_path,$data_manage).'</div>';
|
||||
$html_value .= $tip;
|
||||
break;
|
||||
case 'encoding':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key,$value); // '<input type="text" name="ds_'.$key.'" id="ds_'.$key.'" value="'.$value.'" class="ds_param_wide" />';
|
||||
$tip = '<br style="clear: both"><div class="tipdiv">'.JText::_('COM_TABULIZER_DATA_SOURCE_ENCODING_TIP').'</div>';
|
||||
$html_value .= $tip;
|
||||
break;
|
||||
case 'feed_type':
|
||||
$feed_types = array('rss2'=>'RSS 2.0','atom'=>'Atom');
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$value,$feed_types);
|
||||
break;
|
||||
case 'query':
|
||||
$html_value = TabulizerForm::getTextareaCtrl('ds_'.$key,$value,array('style'=>'width:98%; height:120px;')); // '<input type="text" name="ds_'.$key.'" id="ds_'.$key.'" value="'.$value.'" class="ds_param_wide" />';
|
||||
break;
|
||||
case 'edb_driver':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_wide'));
|
||||
$supported_drivers = array('mysql','mysqli');
|
||||
if (class_exists('PDO')) {
|
||||
$drivers = PDO::getAvailableDrivers();
|
||||
if (!empty($drivers)) {
|
||||
foreach ($drivers as $driver) {
|
||||
$supported_drivers[] = $driver;
|
||||
}
|
||||
}
|
||||
}
|
||||
$supported_drivers_str = implode(', ',$supported_drivers);
|
||||
$tip = sprintf(JText::_('COM_TABULIZER_DATA_SOURCE_EXTERNAL_DATABASE_SUPPORTED_DRIVERS'),$supported_drivers_str);
|
||||
$html_value .= '<br style="clear: both" /><div class="tipdiv">'.$tip.'</div>';
|
||||
break;
|
||||
case 'edb_host':
|
||||
case 'edb_user':
|
||||
case 'edb_password':
|
||||
case 'edb_database':
|
||||
case 'edb_prefix':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_wide'));
|
||||
break;
|
||||
case 'sheet_name':
|
||||
case 'sheet_selection':
|
||||
case 'table_attribute_value':
|
||||
case 'merging_tree':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_wide')); // '<input type="text" name="ds_'.$key.'" id="ds_'.$key.'" value="'.$value.'" class="ds_param_wide" />';
|
||||
break;
|
||||
case 'td_map':
|
||||
$html_value = TabulizerForm::getTextareaCtrl('ds_'.$key,$value,array('style'=>'width:98%; height:120px;'));
|
||||
break;
|
||||
case 'sheet_references':
|
||||
$sheet_references_custom_style ='none';
|
||||
$attr_none = array('onclick'=>'TabulizerUpdateSheetReferences(this)', 'style'=>'float:none');
|
||||
$attr_all = array('onclick'=>'TabulizerUpdateSheetReferences(this)', 'style'=>'float:none');
|
||||
$attr_custom = array('onclick'=>'TabulizerUpdateSheetReferences(this)', 'style'=>'float:none');
|
||||
if (empty($value)) {
|
||||
$attr_none['checked'] = 'checked';
|
||||
} else if ($value == 'all') {
|
||||
$attr_all['checked'] = 'checked';
|
||||
} else {
|
||||
$attr_custom['checked'] = 'checked';
|
||||
$sheet_references_custom_style ='block';
|
||||
}
|
||||
$html_value = TabulizerForm::getInputCtrl('ds_sheet_references_type', 'none', $attr_none, 'radio') . ' ' . JText::_('COM_TABULIZER_SHEET_REFERENCES_NONE') . ' ' .
|
||||
TabulizerForm::getInputCtrl('ds_sheet_references_type', 'all', $attr_all, 'radio') . ' ' . JText::_('COM_TABULIZER_SHEET_REFERENCES_ALL') . ' ' .
|
||||
TabulizerForm::getInputCtrl('ds_sheet_references_type', 'custom', $attr_custom, 'radio') . ' ' . JText::_('COM_TABULIZER_SHEET_REFERENCES_CUSTOM') .
|
||||
'<div id="ds_sheet_references_custom" style="display:'.$sheet_references_custom_style.'">' .
|
||||
TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_wide')) .
|
||||
'</div>';
|
||||
break;
|
||||
case 'table_attribute_name':
|
||||
$options = array(0=>JText::_('COM_TABULIZER_NONE'),'id'=>'id','name'=>'name','class'=>'class');
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'table_order':
|
||||
$options = array();
|
||||
for ($j=1;$j<=32;$j++) $options[$j] = $j;
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'separator':
|
||||
$options = TabulizerUtils::getSeparatorListLabels();
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$value,$options);
|
||||
break;
|
||||
case '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'));
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'consistency':
|
||||
$options = array(1 => JText::_('COM_TABULIZER_COLUMN_CONSISTENCY_STRICT'),
|
||||
0 => JText::_('COM_TABULIZER_COLUMN_CONSISTENCY_LOOSE'));
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case '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')
|
||||
);
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'cellcache':
|
||||
$options = array(CELLCACHE_NONE => JText::_('COM_TABULIZER_CELLCACHE_NONE'),
|
||||
CELLCACHE_SQLITE3 => JText::_('COM_TABULIZER_CELLCACHE_SQLITE3')
|
||||
);
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'read_font':
|
||||
case 'read_color':
|
||||
case 'read_images':
|
||||
case 'read_hyperlinks':
|
||||
case 'remove_empty':
|
||||
case 'strip_tags':
|
||||
$value = empty($value)?false:true;
|
||||
$html_value = TabulizerForm::getCheckboxCtrl('ds_'.$key, 1, $value);
|
||||
break;
|
||||
default:
|
||||
$html_value = null;
|
||||
}
|
||||
|
||||
if (isset($tips[$key])) $tip = TabulizerUtils::opentip($tips[$key], $labels[$key]); else $tip = '';
|
||||
if (isset($html_value)) $source_params_html .= '<tr id="tr_'.$key.'" class="'.$this->getShowHideClass($default_source_type, $key).'"><td class="ds_param_label">'.$labels[$key].$tip.': </td><td>'.$html_value.'</td></tr>';
|
||||
}
|
||||
$source_params_html .= '</table>';
|
||||
|
||||
$lists['source_params'] = $source_params_html;
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayEdit($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$model->getReturnURLs($return_urls);
|
||||
$data_source = $model->getDataSource();
|
||||
|
||||
$lists = array();
|
||||
|
||||
$lists['edit'] = true;
|
||||
$lists['id'] = '<input type="hidden" name="ds_id" id="ds_id" value="'.$data_source->id.'">';
|
||||
$lists['title'] = TabulizerForm::getTextCtrl('ds_title', $data_source->title, array('class'=>'ds_param_wide'));
|
||||
$lists['tag'] = TabulizerForm::getTextCtrl('ds_tag', $data_source->tag, array('readonly'=>'readonly')) . ' <span class="tip">'.JText::_('COM_TABULIZER_DATA_SOURCE_TAG_TIP').'</span>';
|
||||
|
||||
$options = array(TABULIZER_DATA_SOURCE_CACHE_OFF => JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_OFF'), TABULIZER_DATA_SOURCE_CACHE_ON => JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_ON'));
|
||||
$attributes = array('onchange'=>'updateCacheType()');
|
||||
$cache_type = TabulizerForm::getSelectCtrl('ds_cache_type',$data_source->cache_type,$options,$attributes);
|
||||
|
||||
if ($data_source->cache_type!=TABULIZER_DATA_SOURCE_CACHE_OFF) {
|
||||
$cache_clear_url = str_replace('&','&',JRoute::_('index.php?option=com_tabulizer&task=clearDataSourceCache&ds_id='.$data_source->id));
|
||||
if (!empty($return_urls['data_sources'])) $cache_clear_url .= '&data_sources_return_url='.urlencode($return_urls['data_sources']);
|
||||
$cache_type .= ' <a href="'.$cache_clear_url.'">'.JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_CLEAR').'</a>';
|
||||
}
|
||||
|
||||
$attributes = ($data_source->cache_type==TABULIZER_DATA_SOURCE_CACHE_OFF)?array('disabled'=>'disabled'):array();
|
||||
$cache_time = TabulizerForm::getTextCtrl('ds_cache_time',$data_source->cache_time,$attributes). ' <span class="tip">'.JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_TIME_TIP').'</span>';
|
||||
|
||||
$lists['cache_params'] = '<table><tr><td class="ds_param_label">'.JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_TYPE').': </td><td>'.$cache_type.'</td></tr><tr><td class="ds_param_label">'.JText::_('COM_TABULIZER_DATA_SOURCE_CACHE_TIME').': </td><td>'.$cache_time.'</td></tr></table>';
|
||||
|
||||
$options = TabulizerDataSource::getSourceTypeLabel();
|
||||
$attributes = array('onchange'=>'updateSourceParams()');
|
||||
$lists['source_type'] = TabulizerForm::getSelectCtrl('ds_source_type',$data_source->source_type,$options,$attributes);
|
||||
|
||||
$source_params = array(
|
||||
'ruleset_archive' => null,
|
||||
'ruleset_name' => null,
|
||||
'table_caption'=>null,
|
||||
'table_summary'=>null,
|
||||
'server_side' => null,
|
||||
'filepath'=> null,
|
||||
'encoding'=> null,
|
||||
'feed_type'=>null,
|
||||
'article_id'=>null,
|
||||
'query'=> null,
|
||||
'edb_driver'=>null,
|
||||
'edb_host'=>null,
|
||||
'edb_user'=>null,
|
||||
'edb_password'=>null,
|
||||
'edb_database'=>null,
|
||||
'edb_prefix'=>null,
|
||||
'sheet_name'=> null,
|
||||
'sheet_references'=>null,
|
||||
'sheet_selection'=> null,
|
||||
'read_font'=> null,
|
||||
'read_color'=> null,
|
||||
'read_images'=> null,
|
||||
'read_hyperlinks'=> null,
|
||||
'boost'=> null,
|
||||
'cellcache'=> null,
|
||||
'remove_empty'=> null,
|
||||
'separator'=> null,
|
||||
'enclosure'=> null,
|
||||
'consistency'=>null,
|
||||
'strip_tags'=>null,
|
||||
'table_order'=> null,
|
||||
'table_attribute_name'=> null,
|
||||
'table_attribute_value'=> null,
|
||||
'merging_tree'=> null,
|
||||
'td_map'=>null);
|
||||
|
||||
TabulizerDataSource::decodeParams($data_source->source_type, $data_source->source_params, $source_params, $errors);
|
||||
|
||||
TabulizerPath::requireLib('ruleset','admin');
|
||||
$rs = new Ruleset();
|
||||
$ruleset_archive_options = array(0=>JText::_('COM_TABULIZER_NONE'));
|
||||
$ruleset_name_options = array();
|
||||
$archive_to_rulesets = '';
|
||||
|
||||
$ruleset_archives = $rs->loadRulesets(null, 0, 0, $total_count);
|
||||
if ($total_count) {
|
||||
$ruleset_archives = $rs->getRulesets(null, 0, 0, $total_count);
|
||||
uasort($ruleset_archives, array($this,'sortArrayByTitle'));
|
||||
foreach ($ruleset_archives as $ruleset_archive) {
|
||||
$ruleset_archive_options[$ruleset_archive['filename']] = $ruleset_archive['title'];
|
||||
if (!empty($ruleset_archive['rulesets'])) {
|
||||
$rulesets = $ruleset_archive['rulesets'];
|
||||
uasort($rulesets, array($this,'sortArrayByTitle'));
|
||||
$archive_to_ruleset_entries = array();
|
||||
foreach ($rulesets as $ruleset_name => $ruleset) {
|
||||
if ($source_params['ruleset_archive'] == $ruleset_archive['filename']) {
|
||||
$ruleset_name_options[$ruleset['name']] = $ruleset['title'];
|
||||
}
|
||||
$archive_to_ruleset_entries[] = '"'.$ruleset['name'].'": "'.htmlspecialchars($ruleset['title'],ENT_COMPAT,'UTF-8'). '"';
|
||||
}
|
||||
if (!empty($archive_to_ruleset_entries)) $archive_to_rulesets .= ' archive_to_rulesets["'.$ruleset_archive['filename'].'"] = {'.implode(',',$archive_to_ruleset_entries).'};' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($ruleset_name_options)) $ruleset_name_options = array(0=>JText::_('COM_TABULIZER_NONE'));
|
||||
$this->assignRef('archive_to_rulesets', $archive_to_rulesets);
|
||||
|
||||
$labels = TabulizerDataSource::getSourceParamsLabel();
|
||||
$tips = TabulizerDataSource::getSourceParamsTip();
|
||||
$source_params_html = '<table>';
|
||||
foreach ($source_params as $key => $value) {
|
||||
switch ($key) {
|
||||
case 'ruleset_archive':
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key, $source_params[$key], $ruleset_archive_options, array('onchange'=>'TabulizerUpdateRulesetArchive(this)', 'class'=>'ds_param_wide'));
|
||||
break;
|
||||
case 'ruleset_name':
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key, $source_params[$key], $ruleset_name_options, array('class'=>'ds_param_wide'));
|
||||
break;
|
||||
case 'table_caption':
|
||||
$attributes = array('maxlength'=>TABLE_CAPTION_MAX_LEN,'class'=>'ds_param_wide');
|
||||
$html_value = TabulizerForm::getInputCtrl('ds_'.$key, $source_params[$key],$attributes);
|
||||
break;
|
||||
case 'table_summary':
|
||||
$attributes = array('maxlength'=>TABLE_CAPTION_MAX_LEN, 'style'=>'width:98%;height:80px;');
|
||||
$html_value = TabulizerForm::getTextareaCtrl('ds_'.$key, $source_params[$key],$attributes);
|
||||
break;
|
||||
case 'server_side':
|
||||
$checked = empty($value)?false:true;
|
||||
$html_value = TabulizerForm::getCheckboxCtrl('ds_'.$key, '1', $checked, array());
|
||||
break;
|
||||
case 'article_id':
|
||||
$html_value = $this->getArticleSelectionInput('ds_'.$key, $source_params[$key]);
|
||||
break;
|
||||
case 'filepath':
|
||||
case 'encoding':
|
||||
case 'sheet_name':
|
||||
case 'sheet_selection':
|
||||
case 'table_attribute_value':
|
||||
case 'merging_tree':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key, $value, array('class'=>'ds_param_wide'));
|
||||
break;
|
||||
case 'td_map':
|
||||
$html_value = TabulizerForm::getTextareaCtrl('ds_'.$key, $value, array('style'=>'width:98%; height:120px;'));
|
||||
break;
|
||||
case 'feed_type':
|
||||
$feed_types = array('rss2'=>'RSS 2.0','atom'=>'Atom');
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key, $value, $feed_types);
|
||||
break;
|
||||
case 'query':
|
||||
$html_value = TabulizerForm::getTextareaCtrl('ds_'.$key, $value, array('style'=>'width:98%; height:120px;'));
|
||||
break;
|
||||
case 'edb_driver':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_wide'));
|
||||
$supported_drivers = array('mysql','mysqli');
|
||||
if (class_exists('PDO')) {
|
||||
$drivers = PDO::getAvailableDrivers();
|
||||
if (!empty($drivers)) {
|
||||
foreach ($drivers as $driver) {
|
||||
$supported_drivers[] = $driver;
|
||||
}
|
||||
}
|
||||
}
|
||||
$supported_drivers_str = implode(', ',$supported_drivers);
|
||||
$tip = sprintf(JText::_('COM_TABULIZER_DATA_SOURCE_EXTERNAL_DATABASE_SUPPORTED_DRIVERS'),$supported_drivers_str);
|
||||
$html_value .= '<br style="clear: both" /><div class="tipdiv">'.$tip.'</span>';
|
||||
break;
|
||||
case 'edb_host':
|
||||
case 'edb_user':
|
||||
case 'edb_password':
|
||||
case 'edb_database':
|
||||
case 'edb_prefix':
|
||||
$html_value = TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_wide'));
|
||||
break;
|
||||
case 'sheet_references':
|
||||
$sheet_references_custom_style ='none';
|
||||
$attr_none = array('onclick'=>'TabulizerUpdateSheetReferences(this)', 'style'=>'float:none');
|
||||
$attr_all = array('onclick'=>'TabulizerUpdateSheetReferences(this)', 'style'=>'float:none');
|
||||
$attr_custom = array('onclick'=>'TabulizerUpdateSheetReferences(this)', 'style'=>'float:none');
|
||||
if (empty($value)) {
|
||||
$attr_none['checked'] = 'checked';
|
||||
} else if ($value == 'all') {
|
||||
$attr_all['checked'] = 'checked';
|
||||
} else {
|
||||
$attr_custom['checked'] = 'checked';
|
||||
$sheet_references_custom_style ='block';
|
||||
}
|
||||
$html_value = TabulizerForm::getInputCtrl('ds_sheet_references_type', 'none', $attr_none, 'radio') . ' ' . JText::_('COM_TABULIZER_SHEET_REFERENCES_NONE') . ' ' .
|
||||
TabulizerForm::getInputCtrl('ds_sheet_references_type', 'all', $attr_all, 'radio') . ' ' . JText::_('COM_TABULIZER_SHEET_REFERENCES_ALL') . ' ' .
|
||||
TabulizerForm::getInputCtrl('ds_sheet_references_type', 'custom', $attr_custom, 'radio') . ' ' . JText::_('COM_TABULIZER_SHEET_REFERENCES_CUSTOM') .
|
||||
'<div id="ds_sheet_references_custom" style="display:'.$sheet_references_custom_style.'">' .
|
||||
TabulizerForm::getTextCtrl('ds_'.$key,$value,array('class'=>'ds_param_wide')) .
|
||||
'</div>';
|
||||
break;
|
||||
case 'table_attribute_name':
|
||||
$options = array(0=>JText::_('COM_TABULIZER_NONE'),'id'=>'id','name'=>'name','class'=>'class');
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'table_order':
|
||||
$options = array();
|
||||
for ($j=1;$j<=32;$j++) $options[$j] = $j;
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'separator':
|
||||
$options = TabulizerUtils::getSeparatorListLabels();
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case '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'));
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'consistency':
|
||||
$options = array(1 => JText::_('COM_TABULIZER_COLUMN_CONSISTENCY_STRICT'),
|
||||
0 => JText::_('COM_TABULIZER_COLUMN_CONSISTENCY_LOOSE'));
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case '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')
|
||||
);
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'cellcache':
|
||||
$options = array(CELLCACHE_NONE => JText::_('COM_TABULIZER_CELLCACHE_NONE'),
|
||||
CELLCACHE_SQLITE3 => JText::_('COM_TABULIZER_CELLCACHE_SQLITE3')
|
||||
);
|
||||
$html_value = TabulizerForm::getSelectCtrl('ds_'.$key,$source_params[$key],$options);
|
||||
break;
|
||||
case 'read_font':
|
||||
case 'read_color':
|
||||
case 'read_images':
|
||||
case 'read_hyperlinks':
|
||||
case 'remove_empty':
|
||||
case 'strip_tags':
|
||||
$value = empty($value)?false:true;
|
||||
$html_value = TabulizerForm::getCheckboxCtrl('ds_'.$key, 1, $value);
|
||||
break;
|
||||
default:
|
||||
$html_value = null;
|
||||
}
|
||||
|
||||
if (isset($tips[$key])) $tip = TabulizerUtils::opentip($tips[$key], $labels[$key]); else $tip = '';
|
||||
if (isset($html_value)) $source_params_html .= '<tr id="tr_'.$key.'" class="'.$this->getShowHideClass($data_source->source_type, $key).'"><td class="ds_param_label">'.$labels[$key].$tip.': </td><td>'.$html_value.'</td></tr>';
|
||||
}
|
||||
$source_params_html .= '</table>';
|
||||
|
||||
$lists['source_params'] = $source_params_html;
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayImport($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayDataFiles($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$data_files = $model->getDataFiles();
|
||||
$pagination = $model->getPagination();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$this->assignRef('data_files', $data_files);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
$this->assignRef('pagination', $pagination);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayDataFileImport($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function editPublishingPreferences($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
|
||||
$data_source = $model->getDataSource();
|
||||
$preferences = $model->getPublishingPreferences();
|
||||
$return_urls = null;
|
||||
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
if (!empty($preferences)) {
|
||||
$status = $preferences->status;
|
||||
$mode = $preferences->mode;
|
||||
$keyphrases = $preferences->keyphrases;
|
||||
} else {
|
||||
$status = 0;
|
||||
$mode = 'json';
|
||||
$keyphrases = array();
|
||||
}
|
||||
|
||||
$lists = array();
|
||||
|
||||
$options = array(PUBLISHING_PREFERENCES_STATUS_UNPUBLISHED=>JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_STATUS_UNPUBLISHED'), PUBLISHING_PREFERENCES_STATUS_PUBLISHED=>JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_STATUS_PUBLISHED'));
|
||||
$lists['status'] = TabulizerForm::getSelectCtrl('ds_status',$status,$options);
|
||||
|
||||
$options = array(PUBLISHING_PREFERENCES_MODE_JSON=>JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_MODE_JSON'), PUBLISHING_PREFERENCES_MODE_HTML=>JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_MODE_HTML'));
|
||||
$lists['mode'] = TabulizerForm::getSelectCtrl('ds_mode',$mode,$options);
|
||||
|
||||
$attributes = array('style'=>'height: 125px; width: 220px;');
|
||||
if (!empty($keyphrases)) {
|
||||
$lists['keyphrases'] = TabulizerForm::getSelectCtrlMultiple('ds_keyphrases', array(), $keyphrases, $attributes);
|
||||
} else {
|
||||
$lists['keyphrases'] = '<select name="ds_keyphrases" id="ds_keyphrases" multiple style="'.$attributes['style'].'"></select>';
|
||||
}
|
||||
$lists['keyphrases'] .= '<br style="clear: both;"/><a href="javascript:addNewKeyphrase();">'.JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_KEYPHRASE_ADD').'</a> | <a href="javascript:removeKeyphrase();">'.JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_KEYPHRASE_REMOVE').'</a> | <a href="javascript:removeAllKeyphrases();">'.JText::_('COM_TABULIZER_DATA_SOURCE_PUBLISHING_KEYPHRASE_REMOVE_ALL').'</a>';
|
||||
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
$this->assignRef('data_source', $data_source);
|
||||
$this->assignRef('preferences', $preferences);
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function sortArrayByTitle($a, $b) {
|
||||
return ($a['title'] > $b['title']);
|
||||
}
|
||||
|
||||
function getShowHideClass($source_type, $param_key) {
|
||||
$class = 'hidden_tr';
|
||||
switch ($source_type) {
|
||||
case 'csv': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'encoding',
|
||||
'separator',
|
||||
'enclosure',
|
||||
'consistency');
|
||||
break;
|
||||
|
||||
case 'excel': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'sheet_name',
|
||||
'sheet_references',
|
||||
'sheet_selection',
|
||||
'read_font',
|
||||
'read_color',
|
||||
'read_images',
|
||||
'read_hyperlinks',
|
||||
'boost',
|
||||
'cellcache',
|
||||
'remove_empty');
|
||||
break;
|
||||
|
||||
case 'database': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'query');
|
||||
break;
|
||||
|
||||
case 'external_database': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'query',
|
||||
'edb_driver',
|
||||
'edb_host',
|
||||
'edb_user',
|
||||
'edb_password',
|
||||
'edb_database',
|
||||
'edb_prefix');
|
||||
break;
|
||||
|
||||
case 'html': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'encoding',
|
||||
'table_order',
|
||||
'table_attribute_name',
|
||||
'table_attribute_value');
|
||||
break;
|
||||
|
||||
case 'xml': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'encoding',
|
||||
'td_map');
|
||||
break;
|
||||
|
||||
case 'rss': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'encoding',
|
||||
'feed_type');
|
||||
break;
|
||||
|
||||
case 'json': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'filepath',
|
||||
'encoding');
|
||||
break;
|
||||
|
||||
case 'article': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'article_id',
|
||||
'separator',
|
||||
'enclosure',
|
||||
'consistency',
|
||||
'strip_tags');
|
||||
break;
|
||||
|
||||
case 'merger': $show_keys = array('ruleset_archive',
|
||||
'ruleset_name',
|
||||
'table_caption',
|
||||
'table_summary',
|
||||
'server_side',
|
||||
'merging_tree');
|
||||
break;
|
||||
|
||||
default:
|
||||
$show_keys = array();
|
||||
break;
|
||||
}
|
||||
|
||||
if (in_array($param_key, $show_keys)) $class = '';
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
function getArticleSelectionInput($element_id, $element_value = 0) {
|
||||
if (defined('JOOMLA_1_MODE')) {
|
||||
$session_token = JSession::getFormToken();
|
||||
$element_value = (empty($element_value))?'':intval($element_value);
|
||||
$html = TabulizerForm::getTextCtrl($element_id, $element_value) .
|
||||
' <a rel="{handler: \'iframe\', size: {x: 650, y: 375}}" href="'.JRoute::_("index.php?option=com_content&task=element&tmpl=component&object=id'&{$session_token}=1").'" class="modal">'.JText::_('COM_TABULIZER_DATA_SOURCE_PARAM_ARTICLE_ID_VIEW_LIST').'</a>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
// Load the modal behavior script.
|
||||
JHtml::_('behavior.modal', 'a.modal');
|
||||
|
||||
// Build the script.
|
||||
$script = array();
|
||||
$script[] = ' function jSelectArticle_'.$element_id.'(id, title, catid, object) {';
|
||||
$script[] = ' document.id("'.$element_id.'").value = id;';
|
||||
$script[] = ' document.id("'.$element_id.'_title").value = title;';
|
||||
$script[] = ' SqueezeBox.close();';
|
||||
$script[] = ' }';
|
||||
|
||||
// Add the script to the document head.
|
||||
TabulizerJS::addScriptDeclaration(implode("\n", $script));
|
||||
|
||||
// Setup variables for display.
|
||||
$html = array();
|
||||
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&function=jSelectArticle_'.$element_id;
|
||||
|
||||
if (!empty($element_value)) {
|
||||
$db = JFactory::getDBO();
|
||||
$db->setQuery(
|
||||
'SELECT title' .
|
||||
' FROM #__content' .
|
||||
' WHERE id = '.(int) $element_value
|
||||
);
|
||||
$title = $db->loadResult();
|
||||
if ($error = $db->getErrorMsg()) {
|
||||
JFactory::getApplication()->enqueueMessage($error, 'error');
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
$element_value = '';
|
||||
$title = '';
|
||||
}
|
||||
|
||||
if (empty($title)) {
|
||||
$title = JText::_('COM_TABULIZER_NO_ARTICLE_IS_SELECTED');
|
||||
}
|
||||
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
$session_token = JSession::getFormToken();
|
||||
|
||||
// The current user display field.
|
||||
$html[] = '<span class="article_selection_title">';
|
||||
$html[] = '<input type="text" id="'.$element_id.'_title" value="'.$title.'" disabled="disabled" /> ';
|
||||
$html[] = '<a class="modal" title="'.JText::_('COM_TABULIZER_CHANGE_ARTICLE').'" href="'.$link.'&'.$session_token.'=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">'.JText::_('COM_TABULIZER_CHANGE_ARTICLE_BUTTON').'</a>';
|
||||
$html[] = '</span>';
|
||||
|
||||
// The active article id field.
|
||||
if (empty($element_value)) {
|
||||
$value = '';
|
||||
} else {
|
||||
$value = (int)$element_value;
|
||||
}
|
||||
|
||||
$html[] = '<input type="hidden" id="'.$element_id.'" name="'.$element_id.'" value="'.$value.'" />';
|
||||
|
||||
return implode("\n", $html);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
1
administrator/components/com_tabulizer/views/index.html
Normal file
1
administrator/components/com_tabulizer/views/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,24 @@
|
||||
<?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');
|
||||
|
||||
?>
|
||||
|
||||
RESERVED FOR FUTURE USE
|
||||
|
||||
|
||||
1303
administrator/components/com_tabulizer/views/rule/tmpl/form.php
Normal file
1303
administrator/components/com_tabulizer/views/rule/tmpl/form.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
1037
administrator/components/com_tabulizer/views/rule/view.html.php
Normal file
1037
administrator/components/com_tabulizer/views/rule/view.html.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,292 @@
|
||||
<?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');
|
||||
|
||||
$archive_filename = $this->ruleset_file;
|
||||
$ruleset_name = $this->ruleset_name;
|
||||
$ruleset_title = $this->ruleset_title;
|
||||
$ruleset_name_url = urlencode($ruleset_name);
|
||||
$archive_filename_url = urlencode($archive_filename);
|
||||
|
||||
$title = JText::_('COM_TABULIZER_RULESET' );
|
||||
if (!empty($ruleset_title)) $title .= ': ' . $ruleset_title;
|
||||
else if (!empty($ruleset_name)) $title .= ': '.$ruleset_name;
|
||||
else $title .= ': '.$archive_filename.XML_FILE_EXT;
|
||||
|
||||
$archives_return_url = '&archives_return_url='.urlencode($this->return_urls['archives']);
|
||||
$archive_return_url = '&archive_return_url='.urlencode($this->return_urls['archive']);
|
||||
$return_url = $this->return_urls['archive'].$archives_return_url;
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title($title);
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_RULESET_ARCHIVE'), $return_url);
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) JToolBarHelper::addNew('newRule', JText::_('COM_TABULIZER_NEW_RULE'));
|
||||
if (!empty($this->rules)) {
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) JToolBarHelper::deleteList(JText::_('COM_TABULIZER_DELETE_RULE_CONFIRM'), 'deleteRule', JText::_('COM_TABULIZER_DELETE_RULE'));
|
||||
}
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
if (empty($this->rules)) {
|
||||
$msg = sprintf(JText::_('COM_TABULIZER_NO_RULES_WERE_FOUND'), JText::_('COM_TABULIZER_NEW_RULE'));
|
||||
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="" />
|
||||
<input type="hidden" name="ruleset_name" value="<?php echo htmlspecialchars($ruleset_name,ENT_COMPAT,'UTF-8');?>" />
|
||||
<input type="hidden" name="archive_filename" value="<?php echo htmlspecialchars($archive_filename,ENT_COMPAT,'UTF-8');?>" />
|
||||
<input type="hidden" name="archives_return_url" value="<?php echo TabulizerString::makeHTMLSafe($this->return_urls['archives']); ?>"/>
|
||||
<input type="hidden" name="archive_return_url" value="<?php echo TabulizerString::makeHTMLSafe($this->return_urls['archive']); ?>"/>
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
$rows = &$this->rules;
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="table table-striped" id="itemList">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20"><input type="checkbox" name="toggle" value="" onclick="Joomla.checkAll(this)" /></th>
|
||||
<th width="10%" class="title"><?php echo JText::_('COM_TABULIZER_ELEMENT_TYPE');?></th>
|
||||
<th width="10%"><?php echo JText::_('COM_TABULIZER_ELEMENT_RANGE');?></th>
|
||||
<th width="10%"><?php echo JText::_('COM_TABULIZER_ELEMENT_RANGE_KEY');?></th>
|
||||
<th width="10%"><?php echo JText::_('COM_TABULIZER_ELEMENT_SECTION');?></th>
|
||||
<th width="10%"><?php echo JText::_('COM_TABULIZER_ELEMENT_STYLE');?></th>
|
||||
<th><?php echo JText::_('COM_TABULIZER_RULE_SHORT_DESCRIPTION');?></th>
|
||||
<th width="120"><?php echo JText::_('COM_TABULIZER_ACTIONS');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
jimport('joomla.filter.output');
|
||||
$k=0;
|
||||
$i=0;
|
||||
|
||||
foreach ($rows as $rule_id => $row) {
|
||||
$rule_element = $row['element'];
|
||||
$rule_range = $row['range'];
|
||||
$rule_range_key = empty($row['range_key'])?0:$row['range_key'];
|
||||
$rule_element_section = empty($row['element_section'])?'':$row['element_section'];
|
||||
$rule_style = '';
|
||||
$rule_description_parts = array();
|
||||
|
||||
$return_url = $archive_return_url . $archives_return_url;
|
||||
|
||||
if (!empty($row['style'])) {
|
||||
$rule_style = $row['style'];
|
||||
}
|
||||
if (!empty($row['autospan'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_AUTOSPAN');
|
||||
}
|
||||
if (!empty($row['th_tag'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_TH_TAG');
|
||||
}
|
||||
if (!empty($row['remove'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_REMOVE');
|
||||
}
|
||||
if (!empty($row['attribute'])) {
|
||||
list($attribute_name,$attribute_value) = explode(ATTRIBUTE_SEPARATOR,$row['attribute'],2);
|
||||
if ((!empty($attribute_name))) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_ATTRIBUTE') . ': '.$attribute_name . '=' . TabulizerString::makeHTMLSafe($attribute_value);
|
||||
}
|
||||
}
|
||||
if (!empty($row['format'])) {
|
||||
$rule_format = '';
|
||||
list($data_type,$data_type_params) = explode(DATA_TYPE_SEPARATOR,$row['format']);
|
||||
switch ($data_type) {
|
||||
case DATA_TYPE_TEXT:
|
||||
$text_format = $data_type_params;
|
||||
$options = array(FORMAT_TEXT_UPPERCASE => JText::_('COM_TABULIZER_FORMAT_TEXT_UPPERCASE'),
|
||||
FORMAT_TEXT_LOWERCASE => JText::_('COM_TABULIZER_FORMAT_TEXT_LOWERCASE'),
|
||||
FORMAT_TEXT_UCFIRST => JText::_('COM_TABULIZER_FORMAT_TEXT_UCFIRST'),
|
||||
FORMAT_TEXT_UCWORDS => JText::_('COM_TABULIZER_FORMAT_TEXT_UCWORDS'));
|
||||
if (isset($options[$text_format])) {
|
||||
$rule_format = JText::_('COM_TABULIZER_DATA_TYPE_TEXT') . ' <em>' . $options[$text_format] . '</em>';
|
||||
}
|
||||
break;
|
||||
case DATA_TYPE_NUMERIC:
|
||||
list($numeric_decimals, $numeric_dec_point, $numeric_thousands_sep) = explode(FORMAT_NUMERIC_SEPARATOR, $data_type_params);
|
||||
$rule_format = JText::_('COM_TABULIZER_DATA_TYPE_NUMERIC');
|
||||
break;
|
||||
case DATA_TYPE_CURRENCY:
|
||||
list($currency_decimals, $currency_dec_point, $currency_thousands_sep, $currency_symbol, $currency_symbol_order) = explode(FORMAT_CURRENCY_SEPARATOR, $data_type_params);
|
||||
$rule_format = JText::_('COM_TABULIZER_DATA_TYPE_CURRENCY');
|
||||
break;
|
||||
case DATA_TYPE_DATE:
|
||||
$date_format = $data_type_params;
|
||||
$options = array(FORMAT_DATE_DDMMYY_1 => JText::_('COM_TABULIZER_FORMAT_DATE_DDMMYY_1'),
|
||||
FORMAT_DATE_DDMMYY_2 => JText::_('COM_TABULIZER_FORMAT_DATE_DDMMYY_2'),
|
||||
FORMAT_DATE_DDMMYY_3 => JText::_('COM_TABULIZER_FORMAT_DATE_DDMMYY_3'),
|
||||
FORMAT_DATE_MMDDYY_1 => JText::_('COM_TABULIZER_FORMAT_DATE_MMDDYY_1'),
|
||||
FORMAT_DATE_MMDDYY_2 => JText::_('COM_TABULIZER_FORMAT_DATE_MMDDYY_2'),
|
||||
FORMAT_DATE_DDMMYYYY_1 => JText::_('COM_TABULIZER_FORMAT_DATE_DDMMYYYY_1'),
|
||||
FORMAT_DATE_DDMMYYYY_2 => JText::_('COM_TABULIZER_FORMAT_DATE_DDMMYYYY_2'),
|
||||
FORMAT_DATE_DDMMYYYY_4 => JText::_('COM_TABULIZER_FORMAT_DATE_DDMMYYYY_4'),
|
||||
FORMAT_DATE_DDMMYYYY_3 => JText::_('COM_TABULIZER_FORMAT_DATE_DDMMYYYY_3'),
|
||||
FORMAT_DATE_MMDDYYYY_1 => JText::_('COM_TABULIZER_FORMAT_DATE_MMDDYYYY_1'),
|
||||
FORMAT_DATE_MMDDYYYY_2 => JText::_('COM_TABULIZER_FORMAT_DATE_MMDDYYYY_2'),
|
||||
FORMAT_DATE_MMDDYYYY_3 => JText::_('COM_TABULIZER_FORMAT_DATE_MMDDYYYY_3'),
|
||||
FORMAT_DATE_dDDMMYYYY_1 => JText::_('COM_TABULIZER_FORMAT_DATE_DDDMMYYYY_1'),
|
||||
FORMAT_DATE_dDDMMYYYY_2 => JText::_('COM_TABULIZER_FORMAT_DATE_DDDMMYYYY_2'),
|
||||
FORMAT_DATE_dMMDDYYYY_1 => JText::_('COM_TABULIZER_FORMAT_DATE_DMMDDYYYY_1'),
|
||||
FORMAT_DATE_dMMDDYYYY_2 => JText::_('COM_TABULIZER_FORMAT_DATE_DMMDDYYYY_2'),
|
||||
FORMAT_DATE_dDDm_1 => JText::_('COM_TABULIZER_FORMAT_DATE_DDDM_1'),
|
||||
FORMAT_DATE_dmDD_1 => JText::_('COM_TABULIZER_FORMAT_DATE_DMDD_1'));
|
||||
if (isset($options[$date_format])) {
|
||||
$rule_format = JText::_('COM_TABULIZER_DATA_TYPE_DATE') . ' <em>' . $options[$date_format] . '</em>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!empty($rule_format)) $rule_description_parts[] = $rule_format;
|
||||
}
|
||||
|
||||
if (!empty($row['replacement'])) {
|
||||
$rule_replacement = '';
|
||||
list($replace_cs, $replace_from, $replace_to) = explode(REPLACEMENT_SEPARATOR,$row['replacement']);
|
||||
$replace_from = base64_decode($replace_from);
|
||||
$replace_to = base64_decode($replace_to);
|
||||
$rule_replacement = TabulizerString::makeHTMLSafe($replace_from) . ' -> ' . TabulizerString::makeHTMLSafe($replace_to);
|
||||
if ($replace_cs) $rule_replacement = ' <em>(' . JText::_('COM_TABULIZER_REPLACEMENT_CS') . ')</em><br/>'.$rule_replacement;
|
||||
if (!empty($rule_replacement)) $rule_description_parts[] = $rule_replacement;
|
||||
}
|
||||
|
||||
if (!empty($row['calculation'])) {
|
||||
$rule_calculation = '';
|
||||
// backward compatibility
|
||||
$options = array(
|
||||
CALCULATION_NONE => JText::_('COM_TABULIZER_CALCULATION_NONE'),
|
||||
CALCULATION_ADD_ABOVE => JText::_('COM_TABULIZER_CALCULATION_ADD_ABOVE'),
|
||||
CALCULATION_ADD_BELOW => JText::_('COM_TABULIZER_CALCULATION_ADD_BELOW'),
|
||||
CALCULATION_ADD_LEFT => JText::_('COM_TABULIZER_CALCULATION_ADD_LEFT'),
|
||||
CALCULATION_ADD_RIGHT => JText::_('COM_TABULIZER_CALCULATION_ADD_RIGHT'),
|
||||
CALCULATION_MUL_ABOVE => JText::_('COM_TABULIZER_CALCULATION_MUL_ABOVE'),
|
||||
CALCULATION_MUL_BELOW => JText::_('COM_TABULIZER_CALCULATION_MUL_BELOW'),
|
||||
CALCULATION_MUL_LEFT => JText::_('COM_TABULIZER_CALCULATION_MUL_LEFT'),
|
||||
CALCULATION_MUL_RIGHT => JText::_('COM_TABULIZER_CALCULATION_MUL_RIGHT'),
|
||||
CALCULATION_AVG_ABOVE => JText::_('COM_TABULIZER_CALCULATION_AVG_ABOVE'),
|
||||
CALCULATION_AVG_BELOW => JText::_('COM_TABULIZER_CALCULATION_AVG_BELOW'),
|
||||
CALCULATION_AVG_LEFT => JText::_('COM_TABULIZER_CALCULATION_AVG_LEFT'),
|
||||
CALCULATION_AVG_RIGHT => JText::_('COM_TABULIZER_CALCULATION_AVG_RIGHT'),
|
||||
CALCULATION_MED_ABOVE => JText::_('COM_TABULIZER_CALCULATION_MED_ABOVE'),
|
||||
CALCULATION_MED_BELOW => JText::_('COM_TABULIZER_CALCULATION_MED_BELOW'),
|
||||
CALCULATION_MED_LEFT => JText::_('COM_TABULIZER_CALCULATION_MED_LEFT'),
|
||||
CALCULATION_MED_RIGHT => JText::_('COM_TABULIZER_CALCULATION_MED_RIGHT'),
|
||||
CALCULATION_MIN_ABOVE => JText::_('COM_TABULIZER_CALCULATION_MIN_ABOVE'),
|
||||
CALCULATION_MIN_BELOW => JText::_('COM_TABULIZER_CALCULATION_MIN_BELOW'),
|
||||
CALCULATION_MIN_LEFT => JText::_('COM_TABULIZER_CALCULATION_MIN_LEFT'),
|
||||
CALCULATION_MIN_RIGHT => JText::_('COM_TABULIZER_CALCULATION_MIN_RIGHT'),
|
||||
CALCULATION_MAX_ABOVE => JText::_('COM_TABULIZER_CALCULATION_MAX_ABOVE'),
|
||||
CALCULATION_MAX_BELOW => JText::_('COM_TABULIZER_CALCULATION_MAX_BELOW'),
|
||||
CALCULATION_MAX_LEFT => JText::_('COM_TABULIZER_CALCULATION_MAX_LEFT'),
|
||||
CALCULATION_MAX_RIGHT => JText::_('COM_TABULIZER_CALCULATION_MAX_RIGHT'));
|
||||
|
||||
if (isset($options[$row['calculation']])) {
|
||||
$rule_calculation = $options[$row['calculation']];
|
||||
} else {
|
||||
$parts = explode(CALCULATION_SEP, $row['calculation']);
|
||||
if (count($parts) == 3) {
|
||||
$function_name = $parts[0];
|
||||
$rule_calculation = $function_name;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($rule_calculation)) $rule_description_parts[] = $rule_calculation;
|
||||
}
|
||||
if (!empty($row['modification'])) {
|
||||
$rule_modification = '';
|
||||
$parts = explode(MODIFICATION_SEP, $row['modification']);
|
||||
if (count($parts) == 2) {
|
||||
$function_name = $parts[0];
|
||||
$rule_modification = $function_name;
|
||||
}
|
||||
if (!empty($rule_modification)) $rule_description_parts[] = $rule_modification;
|
||||
}
|
||||
if (!empty($row['prepend'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_PREPEND');
|
||||
}
|
||||
if (!empty($row['append'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_APPEND');
|
||||
}
|
||||
if (!empty($row['add_files'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_ADD_FILES');
|
||||
}
|
||||
if (!empty($row['split'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_SPLIT');
|
||||
}
|
||||
if (!empty($row['pagination'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_PAGINATION');
|
||||
}
|
||||
if (!empty($row['scroll'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_SCROLL');
|
||||
}
|
||||
if (!empty($row['filter'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_FILTER');
|
||||
}
|
||||
if (!empty($row['column_filter'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_FILTER');
|
||||
}
|
||||
if (!empty($row['sort'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_SORT');
|
||||
}
|
||||
if (!empty($row['theme'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_THEME');
|
||||
}
|
||||
if (!empty($row['responsive'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_RESPONSIVE');
|
||||
}
|
||||
if (!empty($row['graph'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_GRAPH');
|
||||
}
|
||||
if (!empty($row['export_table'])) {
|
||||
$rule_description_parts[] = JText::_('COM_TABULIZER_ELEMENT_EXPORT_TABLE');
|
||||
}
|
||||
|
||||
|
||||
// combine all rule description parts together
|
||||
$rule_short_description = empty($rule_description_parts)?'':implode(', ',$rule_description_parts);
|
||||
|
||||
$id = $i;
|
||||
$k=1-$k;
|
||||
$checked = JHTML::_('grid.id', $i, $id);
|
||||
$edit_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=editRule&rule_id='.$rule_id.'&ruleset_name='.$ruleset_name_url.'&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
$delete_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=deleteRule&rule_id='.$rule_id.'&ruleset_name='.$ruleset_name_url.'&archive_filename='.$archive_filename_url.'&cid[]='.$id.'&'. JSession::getFormToken() .'=1'.$return_url);
|
||||
|
||||
$action_links = '';
|
||||
$sep = '';
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) { $action_links .= $sep. '<a href="'.$edit_link.'">'.JText::_('COM_TABULIZER_EDIT').'</a>'; $sep = ' | '; }
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) { $action_links .= $sep. '<a href="'.$delete_link.'" onclick="javascript:return confirm(\''.JText::_('COM_TABULIZER_DELETE_RULE_CONFIRM').'\')">'.JText::_('COM_TABULIZER_DELETE').'</a>'; $sep = ' | '; }
|
||||
if (empty($action_links)) $action_links = JText::_('COM_TABULIZER_NA');
|
||||
|
||||
echo '<tr class="row'.$k.'"><td>'.$checked.'</td><td>'.$rule_element.'</a></td><td>'.$rule_range.'</td><td>'.$rule_range_key.'</td><td>'.$rule_element_section.'</td><td>'.$rule_style.'</td><td>'.$rule_short_description.'</td><td>'.$action_links.'</td></tr>' ."\n";
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="ruleset_name" value="<?php echo htmlspecialchars($ruleset_name,ENT_COMPAT,'UTF-8');?>" />
|
||||
<input type="hidden" name="archive_filename" value="<?php echo htmlspecialchars($archive_filename,ENT_COMPAT,'UTF-8');?>" />
|
||||
<input type="hidden" name="archives_return_url" value="<?php echo TabulizerString::makeHTMLSafe($this->return_urls['archives']); ?>"/>
|
||||
<input type="hidden" name="archive_return_url" value="<?php echo TabulizerString::makeHTMLSafe($this->return_urls['archive']); ?>"/>
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
} // if (!empty($this->rules))
|
||||
?>
|
||||
@ -0,0 +1,227 @@
|
||||
<?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');
|
||||
|
||||
$used_ruleset_name = $this->lists['used_ruleset_names'];
|
||||
$used_ruleset_title = $this->lists['used_ruleset_titles'];
|
||||
|
||||
$archives_return_url = '&archives_return_url='.urlencode($this->return_urls['archives']);
|
||||
$archive_return_url = '&archive_return_url='.urlencode($this->return_urls['archive']);
|
||||
$return_url = $this->return_urls['archive'].$archives_return_url;
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
$edit = $this->lists['edit'];
|
||||
$text = !$edit ? JText::_('COM_TABULIZER_NEW' ) : JText::_('COM_TABULIZER_EDIT' );
|
||||
JToolBarHelper::title( JText::_('COM_TABULIZER_RULESET' ).': <small><small>[ ' . $text.' ]</small></small>','config' );
|
||||
JToolBarHelper::save();
|
||||
if (!$edit) {
|
||||
JToolBarHelper::cancel();
|
||||
} else {
|
||||
JToolBarHelper::custom( 'saveCopy', 'save-copy', 'save-copy', JText::_('COM_TABULIZER_SAVE_AS_COPY'), false, false );
|
||||
// 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 isUsedName(name) {
|
||||
var used_names = [<?php echo $used_ruleset_name; ?>];
|
||||
if (used_names.indexOf(name) >=0) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
function isUsedTitle(title) {
|
||||
var used_titles = [<?php echo $used_ruleset_title; ?>];
|
||||
if (used_titles.indexOf(title) >=0) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
function updateSampleData(btn) {
|
||||
var span = document.getElementById('sample_data_span');
|
||||
if (btn.checked) {
|
||||
span.className = '';
|
||||
} else {
|
||||
span.className = 'hidden_span';
|
||||
}
|
||||
}
|
||||
|
||||
function validateSampleData() {
|
||||
var flag = document.getElementById('sample_data_check').checked;
|
||||
var text = document.getElementById('sample_data_text').value;
|
||||
if ((flag) && (text=="")) return false; else return true;
|
||||
}
|
||||
|
||||
function validateAndSubmit() {
|
||||
var form = document.adminForm;
|
||||
var value, regex, valid = true, error_msg = "";
|
||||
|
||||
regex = /^.{2,128}$/;
|
||||
value = form.ruleset_title.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_TITLE');?>";
|
||||
valid = false;
|
||||
} else if (isUsedTitle(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_RULESET_TITLE_ALREADY_IN_USE');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^[a-zA-Z0-9\._\-]{2,128}$/;
|
||||
value = form.ruleset_name.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_NAME');?>";
|
||||
valid = false;
|
||||
} else if (isUsedName(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_RULESET_NAME_ALREADY_IN_USE');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^[a-zA-Z0-9_\-]{2,128}$/;
|
||||
value = form.ruleset_suffix.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_SUFFIX');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^([a-zA-Z0-9\._\-]{2,128}\.css)+(;[a-zA-Z0-9\._\-]{2,128}\.css)*$/i;
|
||||
value = form.ruleset_style.value;
|
||||
if (value != '') {
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_STYLE');?>";
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!validateSampleData()) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_SAMPLE_DATA');?>";
|
||||
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 == 'save') {
|
||||
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 == '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_RULESET_DETAILS' ); ?></legend>
|
||||
|
||||
<table class="admintable">
|
||||
<tr class="row1">
|
||||
<td valign="top" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_TITLE' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_TITLE_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['title']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td valign="top" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_DESCRIPTION' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_DESCRIPTION_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['description']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row1">
|
||||
<td valign="top" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_NAME' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_NAME_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['name']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td valign="top" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_SUFFIX' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_SUFFIX_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['suffix']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row1">
|
||||
<td valign="top" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_STYLE' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_STYLE_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['style']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td valign="top" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_SAMPLE_DATA_LABEL' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_SAMPLE_DATA_LABEL_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['sample_data']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
<input type="hidden" name="option" value="com_tabulizer" />
|
||||
<input type="hidden" name="task" value="saveRuleset" />
|
||||
<input type="hidden" name="addcopy" id="addcopy" value="0" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
<?php echo $this->lists['filename']; ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_FORM_RULESET_HELP'));
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,81 @@
|
||||
<?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');
|
||||
|
||||
$archive_filename = $this->ruleset_file;
|
||||
$ruleset_name = $this->ruleset_name;
|
||||
$ruleset_title = $this->ruleset_title;
|
||||
$ruleset_description = $this->ruleset_description;
|
||||
$ruleset_style = empty($this->ruleset_style)?$this->ruleset_style_inherited:$this->ruleset_style;
|
||||
$ruleset_name_url = urlencode($ruleset_name);
|
||||
$archive_filename_url = urlencode($archive_filename);
|
||||
|
||||
$ruleset_sample_data_caption = (empty($this->sample_data_caption))?null:$this->sample_data_caption;
|
||||
$ruleset_sample_data_text = (empty($this->sample_data_text))?null:$this->sample_data_text;
|
||||
$ruleset_sample_data_sep = (empty($this->sample_data_sep))?'cm':$this->sample_data_sep;
|
||||
$ruleset_sample_data_enc = (empty($this->sample_data_enc))?'none':$this->sample_data_enc;
|
||||
|
||||
$title = JText::_('COM_TABULIZER_RULESET' );
|
||||
if (!empty($ruleset_title)) $title .= ': ' . $ruleset_title;
|
||||
else if (!empty($ruleset_name)) $title .= ': '.$ruleset_name;
|
||||
else $title .= ': '.$archive_filename;
|
||||
|
||||
$archives_return_url = '&archives_return_url='.urlencode($this->return_urls['archives']);
|
||||
$archive_return_url = '&archive_return_url='.urlencode($this->return_urls['archive']);
|
||||
$return_url = $this->return_urls['archive'].$archives_return_url;
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title($title);
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_RULESET_ARCHIVE'), $return_url);
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
TabulizerPath::requireLib('tabulizer','common');
|
||||
$table = new Tabulizer();
|
||||
|
||||
echo '<strong><em>'.JText::_('COM_TABULIZER_SAMPLE_TABLE').'</em></strong>' . "<br/>\n";
|
||||
|
||||
$name = $ruleset_name;
|
||||
$title = $ruleset_title;
|
||||
$description = $ruleset_description;
|
||||
$html = '';
|
||||
$errors = array();
|
||||
|
||||
if (!empty($description)) {
|
||||
$tooltip = JHTML::tooltip($description, $title);
|
||||
$title = $title . ' ' . $tooltip;
|
||||
}
|
||||
|
||||
$sample_data = array();
|
||||
$sample_data['meta'] = empty($ruleset_sample_data_caption)?null:array('caption'=>$ruleset_sample_data_caption);
|
||||
$sample_data['text'] = $ruleset_sample_data_text;
|
||||
$sample_data['separator'] = $ruleset_sample_data_sep;
|
||||
$sample_data['enclosure'] = $ruleset_sample_data_enc;
|
||||
|
||||
echo "<hr><h3>{$title}</h3>\n";
|
||||
if ($table->previewRuleset($archive_filename, $name, $sample_data, $html, $errors)) {
|
||||
echo $html;
|
||||
} else {
|
||||
$msg = JText::_('COM_TABULIZER_ERRORS_FOUND'). '<br/><ul>';
|
||||
foreach ($errors as $error) {
|
||||
$msg .= '<li>'.$error.'</li>';
|
||||
}
|
||||
$msg .= '</ul>';
|
||||
TabulizerUserMessage::printError($msg);
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1,239 @@
|
||||
<?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');
|
||||
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class tabulizerViewRuleset extends JViewLegacy
|
||||
{
|
||||
function __construct(){
|
||||
// add tabulizer CSS to override form styling
|
||||
$doc=JFactory::getDocument();
|
||||
$cssfile = TabulizerPath::getURLPath('tabulizer.css', 'admin_css');
|
||||
$doc->addStyleSheet($cssfile);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function display($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$ruleset = $model->getRuleset();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
if (!empty($ruleset)) {
|
||||
$this->assignRef('ruleset_name', $ruleset['name']);
|
||||
$this->assignRef('ruleset_title', $ruleset['title']);
|
||||
$this->assignRef('ruleset_description', $ruleset['description']);
|
||||
$this->assignRef('ruleset_style', $ruleset['style']);
|
||||
$this->assignRef('ruleset_file', $ruleset['filename']);
|
||||
$this->assignRef('rules', $ruleset['rules']);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayPreview($tpl = null) {
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$ruleset = $model->getRuleset();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
if (!empty($ruleset)) {
|
||||
$this->assignRef('ruleset_name', $ruleset['name']);
|
||||
$this->assignRef('ruleset_title', $ruleset['title']);
|
||||
$this->assignRef('ruleset_description', $ruleset['description']);
|
||||
$this->assignRef('ruleset_style', $ruleset['style']);
|
||||
$this->assignRef('ruleset_style_inherited', $ruleset['style_inherited']);
|
||||
$this->assignRef('ruleset_file', $ruleset['filename']);
|
||||
$this->assignRef('rules', $ruleset['rules']);
|
||||
if (!empty($ruleset['sample_data'])) {
|
||||
$this->assignRef('sample_data_caption', $ruleset['sample_data_caption']);
|
||||
$this->assignRef('sample_data_text', $ruleset['sample_data_text']);
|
||||
$this->assignRef('sample_data_sep', $ruleset['sample_data_sep']);
|
||||
$this->assignRef('sample_data_enc', $ruleset['sample_data_enc']);
|
||||
}
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayNew($tpl = null) {
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$archive = $model->getRulesetArchive();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$ruleset_name = $model->getRecommendedName();
|
||||
$ruleset_suffix = $ruleset_name;
|
||||
|
||||
$lists = array();
|
||||
|
||||
$lists['edit'] = false;
|
||||
|
||||
$lists['title'] = TabulizerForm::getTextCtrl('ruleset_title',"");
|
||||
$lists['description'] = TabulizerForm::getTextCtrl('ruleset_description',"");
|
||||
$lists['name'] = TabulizerForm::getTextCtrl('ruleset_name',$ruleset_name);
|
||||
$lists['style'] = TabulizerForm::getTextCtrl('ruleset_style',"");
|
||||
$lists['suffix'] = TabulizerForm::getTextCtrl('ruleset_suffix',$ruleset_suffix);
|
||||
$lists['preselected'] = '<input type="checkbox" name="ruleset_preselected" id="ruleset_preselected" value="1"> ' . JText::_('COM_TABULIZER_YES');
|
||||
|
||||
$sep_options = TabulizerUtils::getSeparatorListLabels();
|
||||
$sample_data_sep_options = '';
|
||||
foreach ($sep_options as $key => $value) { $sample_data_sep_options .= '<option value="'.$key.'">'.$value.'</option>'; }
|
||||
|
||||
|
||||
$enc_options = array( ENCLOSURE_DOUBLE_QUOTES => JText::_('COM_TABULIZER_DOUBLE_QUOTES_ENCLOSURE'),
|
||||
ENCLOSURE_SINGLE_QUOTES => JText::_('COM_TABULIZER_SINGLE_QUOTES_ENCLOSURE'),
|
||||
ENCLOSURE_NONE => JText::_('COM_TABULIZER_NO_ENCLOSURE'));
|
||||
$sample_data_enc_options = '';
|
||||
foreach ($enc_options as $key => $value) { $sample_data_enc_options .= '<option value="'.$key.'">'.$value.'</option>'; }
|
||||
|
||||
$lists['sample_data'] = '<input type="checkbox" name="sample_data_check" id="sample_data_check" value="1" onclick="updateSampleData(this);"> ' . JText::_('COM_TABULIZER_YES') . "<br/>\n" .
|
||||
'<span id="sample_data_span" class="hidden_span">' .
|
||||
'<div style="padding-bottom: 15px;">' .
|
||||
'<em>'.JText::_('COM_TABULIZER_SAMPLE_DATA_CAPTION').'</em><br/>' .
|
||||
'<input type="text" name="sample_data_caption" id="sample_data_caption" > <br/>' .
|
||||
'<em>'.JText::_('COM_TABULIZER_SAMPLE_DATA_TEXT').'</em><br/>' .
|
||||
'<textarea name="sample_data_text" id="sample_data_text" rows="10" ></textarea> <br/>' .
|
||||
'<em>'.JText::_('COM_TABULIZER_SAMPLE_DATA_SEP').'</em><br/>' .
|
||||
'<select name="sample_data_sep" id="sample_data_sep">'.$sample_data_sep_options.'</select><br/>' .
|
||||
'<em>'.JText::_('COM_TABULIZER_SAMPLE_DATA_ENC').'</em><br/>' .
|
||||
'<select name="sample_data_enc" id="sample_data_enc">'.$sample_data_enc_options.'</select>' .
|
||||
'</div>' .
|
||||
'</span>';
|
||||
|
||||
$ruleset_names = $model->getAllRulesetNames(array($ruleset_name));
|
||||
if (empty($ruleset_names)) {
|
||||
$lists['used_ruleset_names'] = '';
|
||||
} else {
|
||||
$lists['used_ruleset_names'] = '"'.implode('","', $ruleset_names).'"';
|
||||
}
|
||||
|
||||
$ruleset_titles = $model->getAllRulesetTitles(array());
|
||||
if (empty($ruleset_titles)) {
|
||||
$lists['used_ruleset_titles'] = '';
|
||||
} else {
|
||||
$lists['used_ruleset_titles'] = '"'.implode('","', $ruleset_titles).'"';
|
||||
}
|
||||
|
||||
$lists['filename'] = '<input type="hidden" name="archive_filename" value="'.htmlspecialchars($archive['filename'],ENT_COMPAT,'UTF-8').'" />';
|
||||
$lists['filename_value'] = $archive['filename'];
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayEdit($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$ruleset = $model->getRuleset();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$lists = array();
|
||||
|
||||
$lists['edit'] = true;
|
||||
|
||||
$ruleset_description = empty($ruleset['description'])?'':$ruleset['description'];
|
||||
$ruleset_style = empty($ruleset['style'])?'':$ruleset['style'];
|
||||
$ruleset_suffix = empty($ruleset['suffix'])?'':$ruleset['suffix'];
|
||||
|
||||
$lists['name'] = TabulizerForm::getTextCtrl('ruleset_name', $ruleset['name'], array('readonly'=>'readonly', 'style'=>'background-color: #c9c9c9'));
|
||||
$lists['title'] = TabulizerForm::getTextCtrl('ruleset_title',$ruleset['title']);
|
||||
$lists['description'] = TabulizerForm::getTextCtrl('ruleset_description', $ruleset_description);
|
||||
|
||||
$lists['style'] = TabulizerForm::getTextCtrl('ruleset_style',$ruleset_style);
|
||||
$lists['suffix'] = TabulizerForm::getTextCtrl('ruleset_suffix',$ruleset_suffix);
|
||||
if (!empty($ruleset['preselected'])) $preselected = 'checked'; else $preselected = '';
|
||||
$lists['preselected'] = '<input type="checkbox" name="ruleset_preselected" id="ruleset_preselected" value="1" '.$preselected.'> ' . JText::_('COM_TABULIZER_YES');
|
||||
|
||||
if (!empty($ruleset['sample_data'])) {
|
||||
$preselected = 'checked="checked"';
|
||||
$sample_data_span_class = '';
|
||||
$sample_data_text = $ruleset['sample_data_text'];
|
||||
$sample_data_sep = $ruleset['sample_data_sep'];
|
||||
$sample_data_enc = $ruleset['sample_data_enc'];
|
||||
} else {
|
||||
$preselected = '';
|
||||
$sample_data_span_class = 'hidden_span';
|
||||
$sample_data_text = '';
|
||||
$sample_data_sep = '';
|
||||
$sample_data_enc = '';
|
||||
}
|
||||
|
||||
$sep_options = TabulizerUtils::getSeparatorListLabels();
|
||||
$sample_data_sep_options = '';
|
||||
foreach ($sep_options as $key => $value) { if ($key == $sample_data_sep) $sample_data_sep_options .= '<option value="'.$key.'" selected="selected">'.$value.'</option>'; else $sample_data_sep_options .= '<option value="'.$key.'">'.$value.'</option>'; }
|
||||
|
||||
$enc_options = array( ENCLOSURE_DOUBLE_QUOTES => JText::_('COM_TABULIZER_DOUBLE_QUOTES_ENCLOSURE'),
|
||||
ENCLOSURE_SINGLE_QUOTES => JText::_('COM_TABULIZER_SINGLE_QUOTES_ENCLOSURE'),
|
||||
ENCLOSURE_NONE => JText::_('COM_TABULIZER_NO_ENCLOSURE'));
|
||||
$sample_data_enc_options = '';
|
||||
foreach ($enc_options as $key => $value) { if ($key == $sample_data_enc) $sample_data_enc_options .= '<option value="'.$key.'" selected="selected">'.$value.'</option>'; else $sample_data_enc_options .= '<option value="'.$key.'">'.$value.'</option>'; }
|
||||
|
||||
$lists['sample_data'] = '<input type="checkbox" name="sample_data_check" id="sample_data_check" value="1" '.$preselected.' onclick="updateSampleData(this);"> ' . JText::_('COM_TABULIZER_YES') . "<br/>\n" .
|
||||
'<span id="sample_data_span" class="'.$sample_data_span_class.'">' .
|
||||
'<div style="padding-bottom: 15px;">' .
|
||||
'<em>'.JText::_('COM_TABULIZER_SAMPLE_DATA_TEXT').'</em><br/>' .
|
||||
'<textarea name="sample_data_text" id="sample_data_text" rows="10">'.$sample_data_text.'</textarea><br/>' .
|
||||
'<em>'.JText::_('COM_TABULIZER_SAMPLE_DATA_SEP').'</em><br/>' .
|
||||
'<select name="sample_data_sep" id="sample_data_sep">'.$sample_data_sep_options.'</select><br/>' .
|
||||
'<em>'.JText::_('COM_TABULIZER_SAMPLE_DATA_ENC').'</em><br/>' .
|
||||
'<select name="sample_data_enc" id="sample_data_enc">'.$sample_data_enc_options.'</select>' .
|
||||
'</div>';
|
||||
'</span>';
|
||||
|
||||
$ruleset_names = $model->getAllRulesetNames(array($ruleset['name']));
|
||||
|
||||
if (empty($ruleset_names)) {
|
||||
$lists['used_ruleset_names'] = '';
|
||||
} else {
|
||||
$lists['used_ruleset_names'] = '"'.implode('","', $ruleset_names).'"';
|
||||
}
|
||||
|
||||
$ruleset_titles = $model->getAllRulesetTitles(array($ruleset['title']));
|
||||
if (empty($ruleset_titles)) {
|
||||
$lists['used_ruleset_titles'] = '';
|
||||
} else {
|
||||
$lists['used_ruleset_titles'] = '"'.implode('","', $ruleset_titles).'"';
|
||||
}
|
||||
|
||||
$lists['filename'] = '<input type="hidden" name="archive_filename" value="'.$ruleset['filename'].'" />';
|
||||
$lists['filename_value'] = $ruleset['filename'];
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,182 @@
|
||||
<?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');
|
||||
|
||||
$archive_filename = $this->archive_filename;
|
||||
$archive_name = $this->archive_name;
|
||||
$archive_title = $this->archive_title;
|
||||
$title = JText::_('COM_TABULIZER_RULESET_ARCHIVE' );
|
||||
if (!empty($archive_title)) $title .= ': ' . $archive_title;
|
||||
else if (!empty($archive_name)) $title .= ': ' . $archive_name;
|
||||
else $title .= ' ('.$archive_filename.XML_FILE_EXT.')';
|
||||
|
||||
$archives_return_url = '&archives_return_url='.urlencode($this->return_urls['archives']);
|
||||
$archive_return_url = '&archive_return_url='.urlencode($this->return_urls['archive']);
|
||||
$return_url = $this->return_urls['archives'];
|
||||
|
||||
if (!empty($this->archive_help_contents)) {
|
||||
$archive_help_contents = '<div class="archive_help"><span class="archive_help_header">'.JText::_('COM_TABULIZER_ARCHIVE_HELP_HEADER').'</span>' . $this->archive_help_contents . '</div>';
|
||||
} else {
|
||||
$archive_help_contents = '';
|
||||
}
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title($title);
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_ARCHIVES'), $return_url);
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) JToolBarHelper::addNew('newRuleset', JText::_('COM_TABULIZER_NEW_RULESET'));
|
||||
if (!empty($this->rulesets)) {
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) JToolBarHelper::deleteList(JText::_('COM_TABULIZER_DELETE_RULESET_CONFIRM'), 'deleteRuleset', JText::_('COM_TABULIZER_DELETE_RULESET'));
|
||||
}
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
if (empty($this->rulesets)) {
|
||||
$msg = sprintf(JText::_('COM_TABULIZER_NO_RULESET_WERE_FOUND'), JText::_('COM_TABULIZER_NEW_RULESET'));
|
||||
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="" />
|
||||
<input type="hidden" name="archive_filename" value="<?php echo TabulizerString::makeHTMLSafe($archive_filename);?>" />
|
||||
<input type="hidden" name="archives_return_url" value="<?php echo TabulizerString::makeHTMLSafe($this->return_urls['archives']); ?>"/>
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
$rows = &$this->rulesets;
|
||||
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_RULESET_TITLE');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_RULESET_NAME');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_RULESET_SUFFIX');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_RULESET_STYLE');?></th>
|
||||
<th class="tabcol" width="220"><?php echo JText::_('COM_TABULIZER_ACTIONS');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
jimport('joomla.filter.output');
|
||||
$k=0;
|
||||
$i=0;
|
||||
foreach ($rows as $row) {
|
||||
$ruleset_name = urlencode($row['name']);
|
||||
$ruleset_name_url = urlencode($ruleset_name);
|
||||
$archive_filename_url = urlencode($archive_filename);
|
||||
$return_url = $archive_return_url . $archives_return_url;
|
||||
|
||||
$id = $ruleset_name_url;
|
||||
$k=1-$k;
|
||||
$checked = JHTML::_('grid.id', $i, $id);
|
||||
|
||||
$view_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=viewRuleset&ruleset_name='.$ruleset_name_url.'&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
$preview_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=viewRulesetPreview&ruleset_name='.$ruleset_name_url.'&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
$edit_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=editRuleset&ruleset_name='.$ruleset_name_url.'&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
$delete_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=deleteRuleset&archive_filename='.$archive_filename_url.'&cid[]='.$id.'&'. JSession::getFormToken() .'=1'.$return_url);
|
||||
$action_links = '<a href="'.$view_link.'">'.JText::_('COM_TABULIZER_VIEW').'</a> | <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_RULESET_CONFIRM').'\')">'.JText::_('COM_TABULIZER_DELETE').'</a>';
|
||||
|
||||
$action_links = '';
|
||||
$sep = '';
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-view')) { $action_links .= $sep. '<a href="'.$view_link.'">'.JText::_('COM_TABULIZER_VIEW').'</a>'; $sep = ' | '; }
|
||||
if (true) { $action_links .= $sep. '<a href="'.$preview_link.'">'.JText::_('COM_TABULIZER_PREVIEW').'</a>'; $sep = ' | '; }
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) { $action_links .= $sep. '<a href="'.$edit_link.'">'.JText::_('COM_TABULIZER_EDIT').'</a>'; $sep = ' | '; }
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) { $action_links .= $sep. '<a href="'.$delete_link.'" onclick="javascript:return confirm(\''.JText::_('COM_TABULIZER_DELETE_RULESET_CONFIRM').'\')">'.JText::_('COM_TABULIZER_DELETE').'</a>'; $sep = ' | '; }
|
||||
if (empty($action_links)) $action_links = JText::_('COM_TABULIZER_NA');
|
||||
|
||||
echo '<tr class="tabrow"><td class="tabcol tabcheck">'.$checked.'</td><td class="tabcol tabtitle"><a href="'.$view_link.'">'.$row['title'].'</a></td><td class="tabcol tabname">'.$row['name'].'</td><td class="tabcol tabsuffix">'.$row['suffix'].'</td><td class="tabcol tabstyle">'.$row['style'].'</td><td class="tabcol tabaction">'.$action_links.'</td></tr>' ."\n";
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// add pagination, if needed
|
||||
$pagination = $this->pagination;
|
||||
if ($pagination) {
|
||||
?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6"><?php echo $pagination->getListFooter(); ?></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="viewRulesetArchive" />
|
||||
<input type="hidden" name="archive_filename" value="<?php echo htmlspecialchars($archive_filename,ENT_COMPAT,'UTF-8');?>" />
|
||||
<input type="hidden" name="archives_return_url" value="<?php echo TabulizerString::makeHTMLSafe($this->return_urls['archives']); ?>"/>
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
} // if (empty($this->rulesets))
|
||||
|
||||
echo $archive_help_contents;
|
||||
|
||||
?>
|
||||
@ -0,0 +1,177 @@
|
||||
<?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');
|
||||
|
||||
$text = $this->css['new'] ? JText::_('COM_TABULIZER_NEW' ) : JText::_('COM_TABULIZER_EDIT' );
|
||||
JToolBarHelper::title( JText::_('COM_TABULIZER_CSS_FILE' ).' '.$this->css['css_filename'].': <small><small>[ ' . $text.' ]</small></small>','config' );
|
||||
|
||||
$return_url = $this->return_urls['archives'];
|
||||
|
||||
JToolBarHelper::save('saveCSSFile');
|
||||
JToolBarHelper::apply('applyCSSFile', JText::_('COM_TABULIZER_APPLY'));
|
||||
JToolBarHelper::cancel('cancel', JText::_('COM_TABULIZER_CLOSE'));
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$lists = array();
|
||||
$lists['archive_filename'] = $this->css['archive_filename'];
|
||||
$lists['ruleset_name'] = empty($this->css['ruleset_name'])?JText::_('COM_TABULIZER_NA'):$this->css['ruleset_name'];
|
||||
$lists['css_contents'] = '<textarea name="css_contents" id="css_contents" style="width:580px; height: 400px">'.$this->css['css_contents'].'</textarea>';
|
||||
$lists['css_skeleton'] = '<a href="#" onclick="appendCSSskeleton()">'.JText::_('COM_TABULIZER_CSS_SKELETON_APPEND_BTN').'</a>';
|
||||
|
||||
$skeleton_css = $this->css['css_skeleton'];
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function appendCSSskeleton() {
|
||||
var css_contents = document.getElementById('css_contents');
|
||||
var skeleton_css = <?php echo $skeleton_css; ?>
|
||||
css_contents.value = css_contents.value + "\n" + skeleton_css;
|
||||
}
|
||||
</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_CSS_FILE_DETAILS' ); ?></legend>
|
||||
|
||||
<table class="admintable">
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_CSS_FILE_RULESET_ARCHIVE_FILENAME' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['archive_filename']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_CSS_FILE_RULESET_NAME' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['ruleset_name']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_CSS_FILE_CONTENTS' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['css_contents']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_CSS_SKELETON' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['css_skeleton']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
<input type="hidden" name="css_filename" value="<?php echo $this->css['css_filename']; ?>" />
|
||||
<input type="hidden" name="archive_filename" value="<?php echo $this->css['archive_filename']; ?>" />
|
||||
<input type="hidden" name="ruleset_name" value="<?php echo $this->css['ruleset_name']; ?>" />
|
||||
<input type="hidden" name="option" value="com_tabulizer" />
|
||||
<input type="hidden" name="task" value="saveCSSFile" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_EDIT_CSS_FILE_HELP'));
|
||||
?>
|
||||
|
||||
<br/>
|
||||
|
||||
<?php
|
||||
|
||||
# preview rulesets
|
||||
|
||||
$archive_filename = $this->css['archive_filename'];
|
||||
$archive_name = $this->css['rulesets']['name'];
|
||||
$archive_title = empty($this->css['rulesets']['title'])?'':$this->css['rulesets']['title'];
|
||||
$archive_style = empty($this->css['rulesets']['style'])?'':$this->css['rulesets']['style'];
|
||||
$title = JText::_('COM_TABULIZER_RULESET_ARCHIVE' );
|
||||
if (!empty($archive_title)) $title .= ': ' . $archive_title;
|
||||
else if (!empty($archive_name)) $title .= ': ' . $archive_name;
|
||||
else $title .= ' ('.$archive_filename.')';
|
||||
|
||||
$rules_path = TabulizerPath::getDirPath('rules');
|
||||
$css_path = TabulizerPath::getDirPath('css');
|
||||
|
||||
if (empty($this->css['rulesets']['rulesets'])) {
|
||||
$msg = JText::_('COM_TABULIZER_NO_RULESET_WERE_FOUND_FOR_PREVIEW');
|
||||
TabulizerUserMessage::printInfo($msg);
|
||||
} else {
|
||||
TabulizerPath::requireLib('tabulizer','common');
|
||||
$table = new Tabulizer();
|
||||
|
||||
echo '<strong><em>'.JText::_('COM_TABULIZER_SAMPLE_TABLES').'</em></strong>' . "<br>\n";
|
||||
|
||||
$rows = $this->css['rulesets']['rulesets'];
|
||||
foreach ($rows as $row) {
|
||||
|
||||
$name = $row['name'];
|
||||
$title = $row['title'];
|
||||
$description = $row['description'];
|
||||
$html = '';
|
||||
$errors = array();
|
||||
|
||||
if (!empty($description)) {
|
||||
$tooltip = JHTML::tooltip($description, $title);
|
||||
$title = $title . ' ' . $tooltip;
|
||||
}
|
||||
|
||||
if (!empty($row['sample_data'])) {
|
||||
$ruleset_sample_data_caption = (empty($row['sample_data_caption']))?'':$row['sample_data_caption'];
|
||||
$ruleset_sample_data_text = $row['sample_data_text'];
|
||||
$ruleset_sample_data_sep = empty($row['sample_data_sep'])?'cm':$row['sample_data_sep'];
|
||||
$ruleset_sample_data_enc = empty($row['sample_data_enc'])?'none':$row['sample_data_enc'];
|
||||
} else {
|
||||
$ruleset_sample_data_caption = null;
|
||||
$ruleset_sample_data_text = null;
|
||||
$ruleset_sample_data_sep = null;
|
||||
}
|
||||
$sample_data = array();
|
||||
$sample_data['meta'] = empty($ruleset_sample_data_caption)?null:array('caption'=>$ruleset_sample_data_caption);
|
||||
$sample_data['text'] = $ruleset_sample_data_text;
|
||||
$sample_data['separator'] = $ruleset_sample_data_sep;
|
||||
$sample_data['enclosure'] = $ruleset_sample_data_enc;
|
||||
|
||||
echo "<hr><h3>{$title}</h3>\n";
|
||||
if ($table->previewRuleset($archive_filename, $name, $sample_data, $html, $errors)) {
|
||||
echo $html;
|
||||
} else {
|
||||
$msg = JText::_('COM_TABULIZER_ERRORS_FOUND'). '<br/><ul>';
|
||||
foreach ($errors as $error) {
|
||||
$msg .= '<li>'.$error.'</li>';
|
||||
}
|
||||
$msg .= '</ul>';
|
||||
TabulizerUserMessage::printError($msg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -0,0 +1,250 @@
|
||||
<?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');
|
||||
|
||||
$used_archive_filename = $this->lists['used_archive_filenames'];
|
||||
$used_archive_name = $this->lists['used_archive_names'];
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
|
||||
$return_url = $this->return_urls['archives'];
|
||||
|
||||
$edit = $this->lists['edit'];
|
||||
$text = !$edit ? JText::_('COM_TABULIZER_NEW' ) : JText::_('COM_TABULIZER_EDIT' );
|
||||
JToolBarHelper::title( JText::_('COM_TABULIZER_RULESET_ARCHIVE' ).': <small><small>[ ' . $text.' ]</small></small>','config' );
|
||||
JToolBarHelper::save();
|
||||
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 updateArchiveFields(default_filename) {
|
||||
var form = document.adminForm;
|
||||
var filename = form.archive_filename;
|
||||
var style = form.archive_style;
|
||||
|
||||
var valid = true, error_msg = '';
|
||||
var regex = /^[a-zA-Z0-9\._\-]{2,128}$/;
|
||||
var value = form.archive_name.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = "<?php echo JText::_('COM_TABULIZER_INVALID_RULESET_ARCHIVE_NAME');?>";
|
||||
valid = false;
|
||||
} else if (isUsedName(value)) {
|
||||
error_msg = "<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_NAME_ALREADY_IN_USE');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
if (filename.value == default_filename) filename.value = value + '.xml';
|
||||
if (style.value == '') style.value = value + '.css';
|
||||
} else alert(error_msg);
|
||||
|
||||
}
|
||||
|
||||
function isUsedFilename(filename) {
|
||||
var used_filenames = [<?php echo $used_archive_filename; ?>];
|
||||
var new_file = <?php echo ($edit)?'0':'1'; ?>;
|
||||
if ((used_filenames.indexOf(filename) >=0)&&(new_file)) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
function isUsedName(name) {
|
||||
var used_names = [<?php echo $used_archive_name; ?>];
|
||||
var new_file = <?php echo ($edit)?'0':'1'; ?>;
|
||||
if ((used_names.indexOf(name) >=0)&&(new_file)) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
function validateAndSubmit() {
|
||||
var form = document.adminForm;
|
||||
var value, regex, valid = true, error_msg = "";
|
||||
|
||||
regex = /^.{2,128}$/;
|
||||
value = form.archive_title.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_ARCHIVE_TITLE');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^[a-zA-Z0-9\._\-]{2,128}$/;
|
||||
value = form.archive_name.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_ARCHIVE_NAME');?>";
|
||||
valid = false;
|
||||
} else if (isUsedName(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_NAME_ALREADY_IN_USE');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^[a-zA-Z0-9\._\-]{2,128}\.xml$/i;
|
||||
value = form.archive_filename.value;
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_ARCHIVE_FILENAME');?>";
|
||||
valid = false;
|
||||
} else if (isUsedFilename(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_FILENAME_ALREADY_IN_USE');?>";
|
||||
valid = false;
|
||||
}
|
||||
|
||||
regex = /^([a-zA-Z0-9\._\-]{2,128}\.css)+(;[a-zA-Z0-9\._\-]{2,128}\.css)*$/i;
|
||||
value = form.archive_style.value;
|
||||
if (value != '') {
|
||||
if (!regex.test(value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_ARCHIVE_STYLE');?>";
|
||||
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 == 'save') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
function submitbutton(pressbutton) {
|
||||
if (pressbutton == 'save') {
|
||||
validateAndSubmit();
|
||||
} else if (pressbutton == 'cancel') {
|
||||
window.location = "<?php echo $return_url;?>";
|
||||
}
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</script>
|
||||
|
||||
<?php $row_ord = 1; ?>
|
||||
|
||||
<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_RULESET_ARCHIVE_DETAILS' ); ?></legend>
|
||||
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_TITLE' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_TITLE_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['title']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_DESCRIPTION' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_DESCRIPTION_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['description']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_NAME' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_NAME_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['name']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_FILENAME' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_FILENAME_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['filename']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_STYLE' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_STYLE_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['style']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_VERSION' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_VERSION_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['meta']['version']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_AUTHOR_NAME' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_AUTHOR_NAME_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['meta']['author_name']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_AUTHOR_EMAIL' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_AUTHOR_EMAIL_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['meta']['author_email']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = (1-$row_ord); echo $row_ord; ?>">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_AUTHOR_URL' ). TabulizerUtils::labelTooltip(JText::_('COM_TABULIZER_RULESET_ARCHIVE_META_AUTHOR_URL_HELP')); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['meta']['author_url']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
<input type="hidden" name="option" value="com_tabulizer" />
|
||||
<input type="hidden" name="task" value="saveRulesetArchive" />
|
||||
<input type="hidden" name="meta_compatibility" value="<?php echo $this->lists['meta']['compatibility'];?>" />
|
||||
<input type="hidden" name="meta_generator" value="<?php echo htmlspecialchars($this->lists['meta']['generator'],ENT_QUOTES);?>" />
|
||||
<input type="hidden" name="meta_last_modified" value="<?php echo $this->lists['meta']['last_modified'];?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_FORM_RULESET_ARCHIVE_HELP'));
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,89 @@
|
||||
<?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');
|
||||
|
||||
$archive_filename = $this->archive_filename;
|
||||
$archive_name = $this->archive_name;
|
||||
$archive_title = $this->archive_title;
|
||||
$archive_style = empty($this->archive_style)?'':$this->archive_style;
|
||||
$title = JText::_('COM_TABULIZER_RULESET_ARCHIVE' );
|
||||
if (!empty($archive_title)) $title .= ': ' . $archive_title;
|
||||
else if (!empty($archive_name)) $title .= ': ' . $archive_name;
|
||||
else $title .= ' ('.$archive_filename.')';
|
||||
|
||||
$return_url = $this->return_urls['archives'];
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JToolBarHelper::title($title);
|
||||
JToolBarHelper::back(JText::_('COM_TABULIZER_BACK_TO_ARCHIVES'), $return_url);
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
if (empty($this->rulesets)) {
|
||||
$msg = JText::_('COM_TABULIZER_NO_RULESET_WERE_FOUND_FOR_PREVIEW');
|
||||
TabulizerUserMessage::printInfo($msg);
|
||||
} else {
|
||||
TabulizerPath::requireLib('tabulizer','common');
|
||||
$table = new Tabulizer();
|
||||
|
||||
echo '<strong><em>'.JText::_('COM_TABULIZER_SAMPLE_TABLES').'</em></strong>' . "<br>\n";
|
||||
|
||||
$rows = &$this->rulesets;
|
||||
foreach ($rows as $row) {
|
||||
$name = $row['name'];
|
||||
$title = $row['title'];
|
||||
$description = $row['description'];
|
||||
$html = '';
|
||||
$errors = array();
|
||||
|
||||
if (!empty($description)) {
|
||||
$tooltip = JHTML::tooltip($description, $title);
|
||||
$title = $title . ' ' . $tooltip;
|
||||
}
|
||||
|
||||
if (!empty($row['sample_data'])) {
|
||||
$ruleset_sample_data_caption = (empty($row['sample_data_caption']))?'':$row['sample_data_caption'];
|
||||
$ruleset_sample_data_text = $row['sample_data_text'];
|
||||
$ruleset_sample_data_sep = empty($row['sample_data_sep'])?'cm':$row['sample_data_sep'];
|
||||
$ruleset_sample_data_enc = empty($row['sample_data_enc'])?'none':$row['sample_data_enc'];
|
||||
} else {
|
||||
$ruleset_sample_data_caption = null;
|
||||
$ruleset_sample_data_text = null;
|
||||
$ruleset_sample_data_sep = null;
|
||||
$ruleset_sample_data_enc = null;
|
||||
}
|
||||
$sample_data = array();
|
||||
$sample_data['meta'] = empty($ruleset_sample_data_caption)?null:array('caption'=>$ruleset_sample_data_caption);
|
||||
$sample_data['text'] = $ruleset_sample_data_text;
|
||||
$sample_data['separator'] = $ruleset_sample_data_sep;
|
||||
$sample_data['enclosure'] = $ruleset_sample_data_enc;
|
||||
|
||||
echo "<hr><h3>{$title}</h3>\n";
|
||||
if ($table->previewRuleset($archive_filename, $name, $sample_data, $html, $errors)) {
|
||||
echo $html;
|
||||
} else {
|
||||
$msg = JText::_('COM_TABULIZER_ERRORS_FOUND'). '<br/><ul>';
|
||||
foreach ($errors as $error) {
|
||||
$msg .= '<li>'.$error.'</li>';
|
||||
}
|
||||
$msg .= '</ul>';
|
||||
TabulizerUserMessage::printError($msg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,225 @@
|
||||
<?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');
|
||||
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class tabulizerViewRulesetarchive extends JViewLegacy
|
||||
{
|
||||
function __construct(){
|
||||
// add tabulizer CSS to override form styling
|
||||
$doc=JFactory::getDocument();
|
||||
$cssfile = TabulizerPath::getURLPath('tabulizer.css', 'admin_css');
|
||||
$doc->addStyleSheet($cssfile);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function display($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$ruleset_archive = $model->getRulesetArchive();
|
||||
$pagination = $model->getPagination();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
if (!empty($ruleset_archive)) {
|
||||
$this->assignRef('archive_name', $ruleset_archive['name']);
|
||||
$this->assignRef('archive_title', $ruleset_archive['title']);
|
||||
$this->assignRef('archive_description', $ruleset_archive['archive_description']);
|
||||
$this->assignRef('archive_filename', $ruleset_archive['filename']);
|
||||
$this->assignRef('rulesets', $ruleset_archive['rulesets']);
|
||||
$this->assignRef('pagination', $pagination);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
// is there any help doc present
|
||||
$archive_help_contents = '';
|
||||
if (ARCHIVE_HELP_DISPLAY != 'none') {
|
||||
if (preg_match('/([a-z0-9\.\-\_]+)\.xml/',$ruleset_archive['filename'],$matches)) {
|
||||
$archive_help_html = 'help-'. $matches[1] . '.html';
|
||||
$archive_help_path = TabulizerPath::getFilePath($archive_help_html, 'docs');
|
||||
switch (ARCHIVE_HELP_DISPLAY) {
|
||||
case 'text':
|
||||
if (file_exists($archive_help_path)) {
|
||||
$archive_help_contents = file_get_contents($archive_help_path);
|
||||
}
|
||||
break;
|
||||
case 'html':
|
||||
if (file_exists($archive_help_path)) {
|
||||
$archive_help_contents = file_get_contents($archive_help_path);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->assignRef('archive_help_contents', $archive_help_contents);
|
||||
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayPreview($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$ruleset_archive = $model->getRulesetArchive();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
if (!empty($ruleset_archive)) {
|
||||
$this->assignRef('archive_name', $ruleset_archive['name']);
|
||||
$this->assignRef('archive_title', $ruleset_archive['title']);
|
||||
$this->assignRef('archive_description', $ruleset_archive['archive_description']);
|
||||
$this->assignRef('archive_style', $ruleset_archive['style']);
|
||||
$this->assignRef('archive_filename', $ruleset_archive['filename']);
|
||||
$this->assignRef('rulesets', $ruleset_archive['rulesets']);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayNew($tpl = null) {
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$user = JFactory::getUser();
|
||||
$author_name = $user->name;
|
||||
$author_email = $user->email;
|
||||
$author_url = '';
|
||||
|
||||
$lists = array();
|
||||
|
||||
$lists['edit'] = false;
|
||||
|
||||
$default_name = 'rs_'. strtolower(TabulizerString::generateRandomString(8)); // '*'.XML_FILE_EXT;
|
||||
$default_filename = $default_name.'.xml';
|
||||
$default_style = $default_name.'.css';
|
||||
$name_attr = array('onchange'=>'updateArchiveFields(\''.$default_filename.'\')');
|
||||
|
||||
$lists['filename'] = TabulizerForm::getTextCtrl('archive_filename',$default_filename);
|
||||
$lists['name'] = TabulizerForm::getTextCtrl('archive_name',$default_name,$name_attr);
|
||||
$lists['title'] = TabulizerForm::getTextCtrl('archive_title',"");
|
||||
$lists['description'] = TabulizerForm::getTextCtrl('archive_description', "");
|
||||
$lists['style'] = TabulizerForm::getTextCtrl('archive_style',$default_style);
|
||||
$lists['meta'] = array();
|
||||
$lists['meta']['version'] = TabulizerForm::getTextCtrl('meta_version',"1");
|
||||
$lists['meta']['author_name'] = TabulizerForm::getTextCtrl('meta_author_name',$author_name);
|
||||
$lists['meta']['author_email'] = TabulizerForm::getTextCtrl('meta_author_email',$author_email);
|
||||
$lists['meta']['author_url'] = TabulizerForm::getTextCtrl('meta_author_url',$author_url);
|
||||
$lists['meta']['compatibility'] = '4'; // meaning it's compatible with Tabulizer v4
|
||||
$lists['meta']['generator'] = 'Tabulizer v.'.TABULIZER_APP_VERSION;
|
||||
$lists['meta']['last_modified'] = date('Y-m-d H:i:s');
|
||||
|
||||
$lists['used_archive_names'] = '';
|
||||
$archive_names = $model->getAllRulesetArchiveNames();
|
||||
if (!empty($archive_names)) {
|
||||
$lists['used_archive_names'] = '"'.implode('","', $archive_names).'"';
|
||||
}
|
||||
|
||||
$lists['used_archive_filenames'] = '';
|
||||
$archive_filenames = $model->getAllRulesetArchiveFilenames();
|
||||
if (!empty($archive_filenames)) {
|
||||
$lists['used_archive_filenames'] = '"'.implode('","', $archive_filenames).'"';
|
||||
}
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayEdit($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$archive = $model->getRulesetArchive();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$lists = array();
|
||||
|
||||
$lists['edit'] = true;
|
||||
|
||||
$name = $archive['name'];
|
||||
$description = isset($archive['description'])?$archive['description']:'';
|
||||
$title = isset($archive['title'])?$archive['title']:'';
|
||||
$style = isset($archive['style'])?$archive['style']:'';
|
||||
|
||||
$author_name = isset($archive['meta']['author_name'])?trim($archive['meta']['author_name']):'';
|
||||
$author_email = isset($archive['meta']['author_email'])?trim($archive['meta']['author_email']):'';
|
||||
$author_url = isset($archive['meta']['author_url'])?trim($archive['meta']['author_url']):'';
|
||||
$version = isset($archive['meta']['version'])?trim($archive['meta']['version']):'';
|
||||
|
||||
$lists['filename'] = '<input type="text" name="archive_filename" id="archive_filename" value="'.$archive['filename'].'" readonly class="fieldvalue_readonly">';
|
||||
$lists['name'] = TabulizerForm::getTextCtrl('archive_name', $name, array('readonly'=>'readonly', 'class'=>'fieldvalue_readonly'));
|
||||
$lists['title'] = TabulizerForm::getTextCtrl('archive_title', $title);
|
||||
$lists['description'] = TabulizerForm::getTextCtrl('archive_description', $description);
|
||||
$lists['style'] = TabulizerForm::getTextCtrl('archive_style', $style);
|
||||
$lists['meta'] = array();
|
||||
$lists['meta']['version'] = TabulizerForm::getTextCtrl('meta_version',$version);
|
||||
$lists['meta']['author_name'] = TabulizerForm::getTextCtrl('meta_author_name',$author_name);
|
||||
$lists['meta']['author_email'] = TabulizerForm::getTextCtrl('meta_author_email',$author_email);
|
||||
$lists['meta']['author_url'] = TabulizerForm::getTextCtrl('meta_author_url',$author_url);
|
||||
$lists['meta']['compatibility'] = RANGE_COMPATIBILITY_5;
|
||||
$lists['meta']['generator'] = 'Tabulizer v.'.TABULIZER_APP_VERSION;
|
||||
$lists['meta']['last_modified'] = date('Y-m-d H:i:s');
|
||||
|
||||
$lists['used_archive_names'] = '';
|
||||
$archive_names = $model->getAllRulesetArchiveNames(array($archive['name']));
|
||||
if (!empty($archive_names)) {
|
||||
$lists['used_archive_names'] = '"'.implode('","', $archive_names).'"';
|
||||
}
|
||||
|
||||
$lists['used_archive_filenames'] = '';
|
||||
$archive_filenames = $model->getAllRulesetArchiveFilenames(array($archive['filename']));
|
||||
if (!empty($archive_filenames)) {
|
||||
$lists['used_archive_filenames'] = '"'.implode('","', $archive_filenames).'"';
|
||||
}
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayCSSEdit($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$css = $model->getCSSFile();
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$this->assignRef('css', $css);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,229 @@
|
||||
<?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_RULESET_ARCHIVES'));
|
||||
|
||||
$archives_return_url = '&archives_return_url='.urlencode($this->return_urls['archives']);
|
||||
|
||||
$show_options = TabulizerPermissions::isAllowed('core.admin');
|
||||
|
||||
if (empty($this->ruleset_archives)) {
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) JToolBarHelper::addNew('newRulesetArchive', JText::_('COM_TABULIZER_NEW_RULESET_ARCHIVE'));
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-import')) JToolBarHelper::custom( 'importRulesetArchive', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_IMPORT_RULESET_ARCHIVE'), false, false );
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-view')) JToolBarHelper::custom( 'viewDataSourcesStart', 'data_sources', 'data_sources', JText::_('COM_TABULIZER_DATA_SOURCES'), false, false );
|
||||
JToolBarHelper::custom( 'editUserPreferences', 'user_preferences', 'user_preferences', JText::_('COM_TABULIZER_USER_PREFERENCES'), false, false );
|
||||
JToolBarHelper::custom( 'viewStatus', 'status', 'status', JText::_('COM_TABULIZER_STATUS'), false, false );
|
||||
if ($show_options) JToolBarHelper::preferences('com_tabulizer');
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
} else {
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) JToolBarHelper::addNew('newRulesetArchive', JText::_('COM_TABULIZER_NEW_RULESET_ARCHIVE'));
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-import')) JToolBarHelper::custom( 'importRulesetArchive', 'import_archive', 'import_archive', JText::_('COM_TABULIZER_IMPORT_RULESET_ARCHIVE'), false, false );
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-export')) JToolBarHelper::custom( 'exportRulesetArchive', 'export_archive', 'export_archive', JText::_('COM_TABULIZER_EXPORT_RULESET_ARCHIVE'), true );
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) JToolBarHelper::deleteList(JText::_('COM_TABULIZER_DELETE_RULESET_ARCHIVE_CONFIRM'), 'deleteRulesetArchive', JText::_('COM_TABULIZER_DELETE_RULESET_ARCHIVE'));
|
||||
if (TabulizerPermissions::userIsAllowed('data-source-view')) JToolBarHelper::custom( 'viewDataSourcesStart', 'data_sources', 'data_sources', JText::_('COM_TABULIZER_DATA_SOURCES'), false, false );
|
||||
JToolBarHelper::custom( 'editUserPreferences', 'user_preferences', 'user_preferences', JText::_('COM_TABULIZER_USER_PREFERENCES'), false, false );
|
||||
JToolBarHelper::custom( 'viewStatus', 'status', 'status', JText::_('COM_TABULIZER_STATUS'), false, false );
|
||||
if ($show_options) JToolBarHelper::preferences('com_tabulizer');
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
}
|
||||
|
||||
if (empty($this->ruleset_archives)) {
|
||||
$msg = sprintf(JText::_('COM_TABULIZER_NO_RULESET_ARCHIVES_WERE_FOUND'), JText::_('COM_TABULIZER_NEW_RULESET_ARCHIVE'));
|
||||
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="viewRulesetArchives" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$rows = &$this->ruleset_archives;
|
||||
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_RULESET_ARCHIVE_TITLE');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_NAME');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_FILENAME');?></th>
|
||||
<th class="tabcol"><?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_STYLE');?></th>
|
||||
<th class="tabcol" width="200"><?php echo JText::_('COM_TABULIZER_ACTIONS');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
jimport('joomla.filter.output');
|
||||
$k=0;
|
||||
$i=0;
|
||||
foreach ($rows as $archive_name => $row) {
|
||||
$archive_name = $row['name'];
|
||||
$archive_title = $row['title'];
|
||||
$archive_filename = $row['filename'];
|
||||
$archive_filename_url = urlencode($archive_filename);
|
||||
$archive_style = $row['style'];
|
||||
$return_url = $archives_return_url;
|
||||
|
||||
$id = $archive_filename_url;
|
||||
$k=1-$k;
|
||||
$checked = JHTML::_('grid.id', $i, $id);
|
||||
$view_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=viewrulesetarchive&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
$preview_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=viewrulesetarchivepreview&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
$edit_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=editrulesetarchive&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
$delete_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=deleterulesetarchive&cid[]='.$id.'&'. JSession::getFormToken() .'=1'.$return_url);
|
||||
$export_link = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=exportrulesetarchivecss&archive_filename='.$archive_filename_url.'&cid[]='.$id.$return_url);
|
||||
|
||||
$action_links = '';
|
||||
$sep = '';
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-view')) { $action_links .= $sep.'<a href="'.$view_link.'">'.JText::_('COM_TABULIZER_VIEW').'</a>'; $sep = ' | '; }
|
||||
if (true) { $action_links .= $sep.'<a href="'.$preview_link.'">'.JText::_('COM_TABULIZER_PREVIEW').'</a>'; $sep = ' | '; }
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) { $action_links .= $sep.'<a href="'.$edit_link.'">'.JText::_('COM_TABULIZER_EDIT').'</a>'; $sep = ' | '; }
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) { $action_links .= $sep.'<a href="'.$delete_link.'" onclick="javascript:return confirm(\''.JText::_('COM_TABULIZER_DELETE_RULESET_ARCHIVE_CONFIRM').'\')">'.JText::_('COM_TABULIZER_DELETE').'</a>'; $sep = ' | '; }
|
||||
if (empty($action_links)) $action_links = JText::_('COM_TABULIZER_NA');
|
||||
|
||||
if (!empty($archive_style)) {
|
||||
if (TabulizerPermissions::userIsAllowed('ruleset-edit')) {
|
||||
$edit_css = JFilterOutput::ampReplace('index.php?option=' . $option . '&task=editcssfile&css_filename=' . urlencode($archive_style) . '&archive_filename=' . $archive_filename_url . '&cid[]=' . $id . '&' . JSession::getFormToken() . '=1');
|
||||
$archive_style = $archive_style . ' <a href="' . $edit_css . '">[' . JText::_('COM_TABULIZER_EDIT') . ']</a>';
|
||||
}
|
||||
}
|
||||
if (!empty($archive_filename)) {
|
||||
$edit_xml = JFilterOutput::ampReplace ('index.php?option='.$option.'&task=editxmlfile&filename='.urlencode($archive_filename).'&cid[]='.$id.'&'. JSession::getFormToken() .'=1');
|
||||
//$archive_filename = $archive_filename.' <a href="'.$edit_xml.'">['.JText::_('COM_TABULIZER_EDIT').']</a>';
|
||||
}
|
||||
|
||||
echo '<tr class="tabrow"><td class="tabcol tabcheck">'.$checked.'</td><td class="tabcol tabtitle"><a href="'.$view_link.'">'.$archive_title.'</a></td><td class="tabcol tabname">'.$archive_name.'</td><td class="tabcol tabfile">'.$archive_filename.'</td><td class="tabcol tabstyle">'.$archive_style.'</td><td class="tabcol tabaction">'.$action_links.'</td></tr>' ."\n";
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// add pagination, if needed
|
||||
$pagination = $this->pagination;
|
||||
if ($pagination) {
|
||||
?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6"><?php echo $pagination->getListFooter(); ?></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
if (!empty($this->ruleset_conflicts)) {
|
||||
$msg = JText::_('COM_TABULIZER_RULESET_CONFLICTS_FOUND') . "<br>\n";
|
||||
$msg .='<ol>';
|
||||
if (!empty($this->ruleset_conflicts['rulesets']['names'])) {
|
||||
$msg .='<li>';
|
||||
$msg .= '<strong>'.JText::_('COM_TABULIZER_RULESET_CONFLICTS_IN_NAMES').'</strong>' . "<br/>\n";
|
||||
$msg .= '<ul>';
|
||||
foreach ($this->ruleset_conflicts['rulesets']['names'] as $archive_filename => $name_conflicts) {
|
||||
$archive_filename .= XML_FILE_EXT;
|
||||
foreach ($name_conflicts as $name_conflict) {
|
||||
$msg .= '<li>'.sprintf(JText::_('COM_TABULIZER_RULESET_NAME_ALREADY_DEFINED'),$name_conflict['value'],$archive_filename,$name_conflict['already_defined'].XML_FILE_EXT).'</li>';
|
||||
}
|
||||
}
|
||||
$msg .= '</ul>';
|
||||
$msg .='</li>';
|
||||
}
|
||||
if (!empty($this->ruleset_conflicts['rulesets']['titles'])) {
|
||||
$msg .='<li>';
|
||||
$msg .= '<strong>'.JText::_('COM_TABULIZER_RULESET_CONFLICTS_IN_TITLES').'</strong>' . "<br>\n";
|
||||
$msg .= '<ul>';
|
||||
foreach ($this->ruleset_conflicts['rulesets']['titles'] as $archive_filename => $title_conflicts) {
|
||||
$archive_filename .= XML_FILE_EXT;
|
||||
foreach ($title_conflicts as $title_conflict) {
|
||||
$msg .= '<li>'.sprintf(JText::_('COM_TABULIZER_RULESET_TITLE_ALREADY_DEFINED'),$title_conflict['value'],$archive_filename,$title_conflict['already_defined'].XML_FILE_EXT).'</li>';
|
||||
}
|
||||
}
|
||||
$msg .= '</ul>';
|
||||
$msg .='</li>';
|
||||
}
|
||||
$msg .='</ol>';
|
||||
|
||||
echo "<br/><br/>\n";
|
||||
|
||||
TabulizerUserMessage::printWarning($msg);
|
||||
}
|
||||
|
||||
} // if (empty($this->ruleset_archives))
|
||||
|
||||
?>
|
||||
|
||||
<br/>
|
||||
|
||||
<?php echo TabulizerUserMessage::printPromo(JText::_('COM_TABULIZER_FIND_MORE_RULESETS_PROMO')); ?>
|
||||
@ -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=viewrulesetarchives'));
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
$text = JText::_('COM_TABULIZER_IMPORT' );
|
||||
JToolBarHelper::title( JText::_('COM_TABULIZER_RULESET_ARCHIVE' ).': <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="zip_filename" id="zip_filename" type="file" />';
|
||||
$lists['overwrite'] = '<input type="checkbox" name="overwrite_file" id="overwrite_file" value="1" /> ' . JText::_('COM_TABULIZER_RULESET_ARCHIVE_OVERWRITE_VALUE');
|
||||
if (TabulizerPermissions::canOverwriteSafemode()) $lists['overwrite'] .= '<br/>' . '<input type="checkbox" name="overwrite_safemode" id="overwrite_safemode" value="1" /> ' . JText::_('COM_TABULIZER_RULESET_ARCHIVE_OVERWRITE_SAFEMODE');
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function isValidFilename(filename) {
|
||||
regex = /[a-zA-Z0-9\._\-]{2,128}\.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.zip_filename.value == "") {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_FILE_UPLOAD_ERROR_NO_FILE');?>";
|
||||
valid = false;
|
||||
} else if (!isValidFilename(form.zip_filename.value)) {
|
||||
error_msg = error_msg + "\n* <?php echo JText::_('COM_TABULIZER_INVALID_RULESET_ARCHIVE_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_RULESET_ARCHIVE_IMPORT_DETAILS' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row1">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_FILENAME_ZIP' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['filename']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row0">
|
||||
<td class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_ARCHIVE_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="importRulesetArchive" />
|
||||
<input type="hidden" name="import_file" value="1" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
TabulizerUserMessage::printHelp(JText::_('COM_TABULIZER_FORM_RULESET_ARCHIVE_IMPORT_HELP'));
|
||||
echo "<br/>\n";
|
||||
TabulizerUserMessage::printWarning(JText::_('COM_TABULIZER_FORM_RULESET_ARCHIVE_IMPORT_WARNING'));
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,72 @@
|
||||
<?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_STATUS'));
|
||||
|
||||
JToolBarHelper::cancel('cancel', JText::_('COM_TABULIZER_CLOSE'));
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$status = $this->status;
|
||||
$lists = $status;
|
||||
|
||||
if (isset($status['wordpress']['version'])) {
|
||||
$cms_type = 'wordpress';
|
||||
} else {
|
||||
$cms_type = 'joomla';
|
||||
}
|
||||
$cms_version = $status[$cms_type]['version'];
|
||||
?>
|
||||
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_STATUS_TABULIZER' ); ?></legend>
|
||||
<table class="info_table">
|
||||
<tr class="row1"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_TABULIZER_VERSION');?></td><td ><?php echo $lists['tabulizer']['version'];?></td></tr>
|
||||
<tr class="row0"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_TABULIZER_LATEST_VERSION');?></td>
|
||||
<td >
|
||||
<iframe src="http://www.tabulizer.com/index.php?option=com_latestversion&task=getLatestTabulizer&tmpl=component¤t_version=<?php echo $lists['tabulizer']['version'];?>&cms_type=<?php echo $cms_type; ?>&cms_version=<?php echo $cms_version; ?>" frameborder="0" height="40px"></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_STATUS_SYSTEM' ); ?></legend>
|
||||
<table class="info_table">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_JOOMLA_VERSION');?></td><td ><?php echo $lists['joomla']['version'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_PHP_VERSION');?></td><td ><?php echo $lists['php']['version'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_MBSTRING_LIB');?></td><td ><?php echo $lists['php']['mbstring'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_ZIP_LIB');?></td><td ><?php echo $lists['php']['zip'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_XML_LIB');?></td><td ><?php echo $lists['php']['xml'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_DIR_PERMISSIONS');?></td><td ><?php echo $lists['php']['file_permissions'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_PHP_MEMORY');?></td><td ><?php echo $lists['php']['memory_limit'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_PHP_MAX_EXECUTION_TIME');?></td><td ><?php echo $lists['php']['max_execution_time'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_PHP_UPLOAD_MAX_SIZE');?></td><td ><?php echo $lists['php']['upload_max_size'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_PHP_POST_MAX_SIZE');?></td><td ><?php echo $lists['php']['post_max_size'];?></td></tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>"><td class="key"><?php echo JText::_('COM_TABULIZER_STATUS_PHP_MAGIC_QUOTES');?></td><td ><?php echo $lists['php']['magic_quotes'];?></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<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="" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 4.0.11 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_USER_PERMISSIONS'));
|
||||
|
||||
JToolBarHelper::save('saveUserPermissions', JText::_('COM_TABULIZER_USER_PERMISSIONS_SAVE'));
|
||||
JToolBarHelper::cancel('cancel', JText::_('COM_TABULIZER_USER_PERMISSIONS_CANCEL'));
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$lists = $this->lists;
|
||||
|
||||
?>
|
||||
|
||||
<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_USER_PERMISSIONS_LEGEND_TITLE' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<?php
|
||||
$i=0;
|
||||
foreach ($lists as $permission) {
|
||||
$i=(1-$i);
|
||||
?>
|
||||
<tr class="row<?php echo $i;?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo $permission['label']; ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $permission['value']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1,329 @@
|
||||
<?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_USER_PREFERENCES'));
|
||||
|
||||
JToolBarHelper::save('saveUserPreferences', JText::_('COM_TABULIZER_USER_PREFERENCES_SAVE'));
|
||||
JToolBarHelper::cancel('cancel', JText::_('COM_TABULIZER_USER_PREFERENCES_CANCEL'));
|
||||
JToolBarHelper::help( 'all_topics', true );
|
||||
|
||||
$lists = $this->lists;
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function TabulizerUpdateRulesetArchive(ruleset_archive_selection) {
|
||||
var archive_to_rulesets = new Array();
|
||||
<?php echo $this->archive_to_rulesets; ?>
|
||||
var archive_filename = ruleset_archive_selection.value;
|
||||
var ruleset_select = document.getElementById("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("#ruleset_name").trigger("liszt:updated");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
|
||||
<div class="col edit_frm_div">
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_TABULIZER_DIALOG' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_COLUMN_SEPARATOR' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['column_separator']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_COLUMN_ENCLOSURE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['column_enclosure']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_COLUMN_CONSISTENCY' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['column_consistency']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_ARCHIVE_NAME' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['ruleset_archive']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RULESET_NAME' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['ruleset_name']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_RETABULIZE_REMOVE_LEFTOVERS' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['retabulize_remove_leftovers']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_EXCEL' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_COLOR' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_color']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_BACKGROUND_COLOR' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_background_color']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_SIZE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_size']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_BOLD' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_bold']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_ITALIC' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_italic']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_STRIKETHROUGH' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_strikethrough']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_UNDERLINE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_underline']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_SUPERSCRIPT' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_superscript']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EXCEL_FONT_SUBSCRIPT' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['excel_font_subscript']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
$action = 'system-save';
|
||||
$allow_save = (TabulizerPermissions::isAllowed($action))?1:0;
|
||||
if ($allow_save) {
|
||||
?>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_DATASOURCES' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATASOURCES_DISPLAY_WARNING' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['datasources_display_warning']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_DATASOURCES_REFRESH_KEYPHRASE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['datasources_refresh_keyphrase']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_ARCHIVE_HELP' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_ARCHIVE_HELP_DISPLAY' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['archive_help_display']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_EMAIL_CLOAKING' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_EMAIL_CLOAKING_AUTO_DISABLE' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['email_cloaking_auto_disable']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_DATATABLES' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_PAGINATION_LENGTH_MENU' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['pagination_length_menu']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_SCROLL_LIBRARY' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo sprintf(JText::_('COM_TABULIZER_SCROLL_LIBRARY_ENABLED' ),strtoupper(SCROLL_LIBRARY_NAME)); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['scroll_library_enabled']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_SCROLL_LIBRARY_OPTIONS' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['scroll_library_options']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_SCROLL_LIBRARY_ADJUST_DATATABLES' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['scroll_library_adjust_datatables']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<?php $row_ord = 0; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('COM_TABULIZER_USER_PREFERENCES_SAFE_MODE' ); ?></legend>
|
||||
<table class="admintable">
|
||||
<tr class="row<?php $row_ord = 1 - $row_ord; echo $row_ord; ?>">
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('COM_TABULIZER_SAFE_MODE_ENABLED' ); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $lists['safe_mode_enabled']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="boxchecked" value="0"/>
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1,231 @@
|
||||
<?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');
|
||||
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class tabulizerViewRulesetarchives extends JViewLegacy
|
||||
{
|
||||
function __construct(){
|
||||
// add tabulizer CSS to override form styling
|
||||
$doc= JFactory::getDocument();
|
||||
$cssfile = TabulizerPath::getURLPath('tabulizer.css', 'admin_css');
|
||||
$doc->addStyleSheet($cssfile);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function display($tpl = null){
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$option = $jinput->getCmd('option');
|
||||
$return_urls = null;
|
||||
|
||||
$model = $this->getModel();
|
||||
$ruleset_archives = $model->getRulesetArchives();
|
||||
$ruleset_conflicts = $model->getRulesetConflicts();
|
||||
$model->getReturnURLs($return_urls);
|
||||
$pagination = $model->getPagination();
|
||||
|
||||
$this->assignRef('ruleset_archives', $ruleset_archives);
|
||||
$this->assignRef('ruleset_conflicts', $ruleset_conflicts);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
$this->assignRef('pagination', $pagination);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayUserPreferences($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
$user_preferences = $model->getUserPreferences();
|
||||
$return_urls = null;
|
||||
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$lists = array();
|
||||
|
||||
// column separator
|
||||
$options = TabulizerUtils::getSeparatorListLabels();
|
||||
$lists['column_separator'] = TabulizerForm::getSelectCtrl('column_separator',$user_preferences['column_separator'],$options);
|
||||
|
||||
// column 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'));
|
||||
$lists['column_enclosure'] = TabulizerForm::getSelectCtrl('column_enclosure',$user_preferences['column_enclosure'],$options);
|
||||
|
||||
// column consistency
|
||||
$options = array(1=>JText::_('COM_TABULIZER_COLUMN_CONSISTENCY_STRICT'),
|
||||
0=>JText::_('COM_TABULIZER_COLUMN_CONSISTENCY_LOOSE'));
|
||||
$lists['column_consistency'] = TabulizerForm::getSelectCtrl('column_consistency',$user_preferences['column_consistency'],$options);
|
||||
|
||||
// when retabulize, remove leftovers
|
||||
$options = array(1=>JText::_('COM_TABULIZER_YES'),
|
||||
0=>JText::_('COM_TABULIZER_NO'));
|
||||
$lists['retabulize_remove_leftovers'] = TabulizerForm::getSelectCtrl('retabulize_remove_leftovers',$user_preferences['retabulize_remove_leftovers'],$options);
|
||||
|
||||
// ruleset archives and names
|
||||
TabulizerPath::requireLib('ruleset','admin');
|
||||
$rs = new Ruleset();
|
||||
$ruleset_archive_options = array(0=>JText::_('COM_TABULIZER_NONE'));
|
||||
$ruleset_name_options = array();
|
||||
$archive_to_rulesets = '';
|
||||
|
||||
$ruleset_archives = $rs->loadRulesets(null, 0, 0, $total_count);
|
||||
if ($total_count) {
|
||||
$ruleset_archives = $rs->getRulesets(null, 0, 0, $total_count);
|
||||
foreach ($ruleset_archives as $ruleset_archive) {
|
||||
$ruleset_archive_options[$ruleset_archive['filename']] = $ruleset_archive['title'];
|
||||
if (!empty($ruleset_archive['rulesets'])) {
|
||||
$archive_to_ruleset_entries = array();
|
||||
foreach ($ruleset_archive['rulesets'] as $ruleset_name => $ruleset) {
|
||||
if ($user_preferences['ruleset_archive'] == $ruleset_archive['filename']) {
|
||||
$ruleset_name_options[$ruleset['name']] = $ruleset['title'];
|
||||
}
|
||||
$archive_to_ruleset_entries[] = '"'.$ruleset['name'].'": "'.htmlspecialchars($ruleset['title'],ENT_COMPAT,'UTF-8'). '"';
|
||||
}
|
||||
if (!empty($archive_to_ruleset_entries)) $archive_to_rulesets .= ' archive_to_rulesets["'.$ruleset_archive['filename'].'"] = {'.implode(',',$archive_to_ruleset_entries).'};' . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($ruleset_name_options)) $ruleset_name_options = array(0=>JText::_('COM_TABULIZER_NONE'));
|
||||
$this->assignRef('archive_to_rulesets', $archive_to_rulesets);
|
||||
|
||||
$lists['ruleset_archive'] = TabulizerForm::getSelectCtrl('ruleset_archive', $user_preferences['ruleset_archive'], $ruleset_archive_options, array('onchange'=>'TabulizerUpdateRulesetArchive(this)', 'class'=>'ds_param_wide'));
|
||||
|
||||
$lists['ruleset_name'] = TabulizerForm::getSelectCtrl('ruleset_name', $user_preferences['ruleset_name'], $ruleset_name_options, array('class'=>'ds_param_wide'));
|
||||
|
||||
// Excel reading
|
||||
$lists['excel_font_color'] = TabulizerForm::getCheckboxCtrl('excel_font_color',1,$user_preferences['excel_font_color']);
|
||||
$lists['excel_background_color'] = TabulizerForm::getCheckboxCtrl('excel_background_color',1,$user_preferences['excel_background_color']);
|
||||
$lists['excel_font_size'] = TabulizerForm::getCheckboxCtrl('excel_font_size',1,$user_preferences['excel_font_size']);
|
||||
$lists['excel_font_bold'] = TabulizerForm::getCheckboxCtrl('excel_font_bold',1,$user_preferences['excel_font_bold']);
|
||||
$lists['excel_font_italic'] = TabulizerForm::getCheckboxCtrl('excel_font_italic',1,$user_preferences['excel_font_italic']);
|
||||
$lists['excel_font_strikethrough'] = TabulizerForm::getCheckboxCtrl('excel_font_strikethrough',1,$user_preferences['excel_font_strikethrough']);
|
||||
$lists['excel_font_underline'] = TabulizerForm::getCheckboxCtrl('excel_font_underline',1,$user_preferences['excel_font_underline']);
|
||||
$lists['excel_font_superscript'] = TabulizerForm::getCheckboxCtrl('excel_font_superscript',1,$user_preferences['excel_font_superscript']);
|
||||
$lists['excel_font_subscript'] = TabulizerForm::getCheckboxCtrl('excel_font_subscript',1,$user_preferences['excel_font_subscript']);
|
||||
|
||||
// Datasources
|
||||
$lists['datasources_display_warning'] = TabulizerForm::getCheckboxCtrl('datasources_display_warning',1,$user_preferences['datasources_display_warning']);
|
||||
$lists['datasources_refresh_keyphrase'] = TabulizerForm::getInputCtrl('datasources_refresh_keyphrase', $user_preferences['datasources_refresh_keyphrase']);
|
||||
if (!empty($user_preferences['datasources_refresh_keyphrase'])) {
|
||||
$refresh_url = JURI::root().'index.php?option=com_tabulizer&task=refreshDataSources&keyphrase='.$user_preferences['datasources_refresh_keyphrase'];
|
||||
$lists['datasources_refresh_keyphrase'] .= '<span class="cache_tip">'.JText::_('COM_TABULIZER_DATASOURCES_REFRESH_URL').': '.$refresh_url.'</span>';
|
||||
}
|
||||
|
||||
// Archive Help
|
||||
$options = array('none'=>JText::_('COM_TABULIZER_ARCHIVE_HELP_DISPLAY_NONE'),'text'=>JText::_('COM_TABULIZER_ARCHIVE_HELP_DISPLAY_TEXT'),'html'=>JText::_('COM_TABULIZER_ARCHIVE_HELP_DISPLAY_HTML'));
|
||||
$lists['archive_help_display'] = TabulizerForm::getSelectCtrl('archive_help_display',$user_preferences['archive_help_display'],$options);
|
||||
|
||||
// Email cloaking auto disable
|
||||
$lists['email_cloaking_auto_disable'] = TabulizerForm::getCheckboxCtrl('email_cloaking_auto_disable',1,$user_preferences['email_cloaking_auto_disable']);
|
||||
|
||||
// Safe mode
|
||||
$lists['safe_mode_enabled'] = TabulizerForm::getCheckboxCtrl('safe_mode_enabled',1,$user_preferences['safe_mode_enabled']);
|
||||
|
||||
// Pagination
|
||||
$lists['pagination_length_menu'] = TabulizerForm::getInputCtrl('pagination_length_menu', $user_preferences['pagination_length_menu']);
|
||||
|
||||
// JQuery libraries support
|
||||
$options = array(0=>JText::_('COM_TABULIZER_NO'), 1=>JText::_('COM_TABULIZER_YES'));
|
||||
$lists['jquery_include'] = TabulizerForm::getSelectCtrl('jquery_include', $user_preferences['jquery_include'], $options);
|
||||
$lists['jqplot_include'] = TabulizerForm::getSelectCtrl('jqplot_include', $user_preferences['jqplot_include'], $options);
|
||||
$lists['datatable_include'] = TabulizerForm::getSelectCtrl('datatable_include', $user_preferences['datatable_include'], $options);
|
||||
$lists['scroll_library_enabled'] = TabulizerForm::getCheckboxCtrl('scroll_library_enabled', '1', $user_preferences['scroll_library_enabled']);
|
||||
$lists['scroll_library_name'] = TabulizerForm::getHiddenCtrl('scroll_library_name', empty($user_preferences['scroll_library_name'])?'nicescroll':$user_preferences['scroll_library_name']);
|
||||
$lists['scroll_library_options'] = TabulizerForm::getInputCtrl('scroll_library_options', $user_preferences['scroll_library_options']);
|
||||
$lists['scroll_library_adjust_datatables'] = TabulizerForm::getCheckboxCtrl('scroll_library_adjust_datatables', '1', $user_preferences['scroll_library_adjust_datatables']);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayUserPermissions($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
$user_permissions = $model->getAccessPermissions();
|
||||
$return_urls = null;
|
||||
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$lists = array();
|
||||
|
||||
$role_options = array('administrator' => JText::_('COM_TABULIZER_ROLE_ADMINISTRATOR'),
|
||||
'editor' => JText::_('COM_TABULIZER_ROLE_EDITOR'),
|
||||
'author' => JText::_('COM_TABULIZER_ROLE_AUTHOR'),
|
||||
'contributor' => JText::_('COM_TABULIZER_ROLE_CONTRIBUTOR'),
|
||||
'subscriber' => JText::_('COM_TABULIZER_ROLE_SUBSCRIBER'));
|
||||
|
||||
$capabilities = array('ruleset-use' => JText::_('COM_TABULIZER_RULESET_USE_PERMISSION_LABEL'),
|
||||
'ruleset-view' => JText::_('COM_TABULIZER_RULESET_VIEW_PERMISSION_LABEL'),
|
||||
'ruleset-edit' => JText::_('COM_TABULIZER_RULESET_EDIT_PERMISSION_LABEL'),
|
||||
'ruleset-import' => JText::_('COM_TABULIZER_RULESET_IMPORT_PERMISSION_LABEL'),
|
||||
'ruleset-export' => JText::_('COM_TABULIZER_RULESET_EXPORT_PERMISSION_LABEL'),
|
||||
'data-source-view' => JText::_('COM_TABULIZER_DATA_SOURCE_VIEW_PERMISSION_LABEL'),
|
||||
'data-source-edit' => JText::_('COM_TABULIZER_DATA_SOURCE_EDIT_PERMISSION_LABEL'),
|
||||
'data-source-import' => JText::_('COM_TABULIZER_DATA_SOURCE_IMPORT_PERMISSION_LABEL'),
|
||||
'data-source-export' => JText::_('COM_TABULIZER_DATA_SOURCE_EXPORT_PERMISSION_LABEL'),
|
||||
'data-import' => JText::_('COM_TABULIZER_DATA_IMPORT_PERMISSION_LABEL'));
|
||||
|
||||
foreach ($capabilities as $key => $label) {
|
||||
$lists[$key] = array('value'=> TabulizerForm::getSelectCtrlMultiple($key,$user_permissions[$key],$role_options), 'label'=>$label);
|
||||
}
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayStatus($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
$status = $model->getStatus();
|
||||
$return_urls = null;
|
||||
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$this->assignRef('status', $status);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayExport($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
$css_code = $model->getRulesetArchivesSkeletonCSSCode();
|
||||
$return_urls = null;
|
||||
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$this->assignRef('css_code', $css_code);
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function displayImport($tpl = null) {
|
||||
$model = $this->getModel();
|
||||
$return_urls = null;
|
||||
|
||||
$model->getReturnURLs($return_urls);
|
||||
|
||||
$this->assignRef('return_urls', $return_urls);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user