primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -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;
?>

View File

@ -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);
}
}
}
?>

View File

@ -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'));
?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -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);
}
}
}
?>

View File

@ -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);
}
}
?>