primo commit
This commit is contained in:
		| @ -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); | ||||
| 		} | ||||
| 						 | ||||
| 	} | ||||
| }	 | ||||
| ?> | ||||
		Reference in New Issue
	
	Block a user