PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/jairosvt/public_html/afmediosc/modules/mod_jatabs/elements/
Server: Linux server2.noticiasdecolima.com 4.18.0-553.30.1.el8_10.x86_64 #1 SMP Tue Nov 26 02:30:26 EST 2024 x86_64
IP: 107.161.180.42
Choose File :

Url:
Dir : /home/jairosvt/public_html/afmediosc/modules/mod_jatabs/elements/jalist.php

<?php
/*
# ------------------------------------------------------------------------
# JA Tabs module for Joomla 1.5
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

class JElementJalist extends JElement
{
	/**
	* Element type
	*
	* @access	protected
	* @var		string
	*/
	var	$_name = 'Jalist';

	function fetchElement($name, $value, &$node, $control_name)
	{	
		$options = array ();
		foreach ($node->children() as $option)
		{
			$val	= $option->attributes('value');
			$text	= $option->data();
			$options[] = JHTML::_('select.option', $val, JText::_($text));
		}
		$class = ( $node->attributes('class') ? 'class="'.$node->attributes('class').'"' : 'class="inputbox"' );
		$class .= " onchange=\"javascript: switchGroup(this)\"";
		$str = JHTML::_('select.genericlist',  $options, ''.$control_name.'['.$name.']', $class, 'value', 'text', $value, $control_name.$name);		
		$str .= "<script type=\"text/javascript\" language=\"javascript\">				
					function getElementsByGroup (group) {
					  if (!group) return;
					  var els=[];					 
					  $$(document.adminForm.elements).each(function(el){ 
						if (el.id.test(group+'-')) els.push(el);
					  });
						
					  return els;
					}
					
					function switchGroup (selectcontrol) {
						selectedel = selectcontrol.options[selectcontrol.selectedIndex];
						groupsel = selectedel.value.split('-')[0];
					  $$(selectcontrol.options).each(function (el) {
					  	var group = el.value.split('-')[0];
  						var groups = getElementsByGroup (group);
  						if (!groups) return;
						var disabled = (groupsel==group)?'':'disabled';
  						groups.each(function(g){
  							g.disabled = disabled;
  						});
					  });
					}
					
					function getTR (el) {
					  el = $(el);
					  var p;
					  while ((p = el.getParent()) && p.tagName != 'TR') {el = p;}
					  
					  return p;
					}
					
					function disableall(){
					  var selectct = $('params".$name."');
					  switchGroup(selectct);					 
					}

					function jaInit () {
					   disableall();
					   document.adminForm.onsubmit = enableall;
					}

					function enableall(){
					  var selectct = $('params".$name."');
					  $$(selectct.options).each(function (el) {
					  	var group = el.value.split('-')[0];
  						var groups = getElementsByGroup (group);
  						if (!groups) return;
  						groups.each(function(g){
  							g.disabled = '';
  						});
					  });
					}

					window.addEvent('load', jaInit);
				</script>";
		return $str;
	}
}
?>