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