OWeb/defaults/controllers/OWeb/widgets/jquery/CodeGenerator.php
protected function generateJqueryCode($selector, $function){
	
		$code = '$( "'.$selector.'" ).'.$function.'(';
		$optionsShown = false;
		
		
		foreach($this->necessary as $pname => $v){		
			$pvalue = $this->getParam($pname);
			if($pvalue == null)
				$pvalue = $this->defValues[$pname];
			if(!empty($pvalue) && $pvalue != ""){

				if(!$optionsShown){
					$code .= '{';
					$optionsShown = true;
				}else
					$code .=',';

				$code .= "\n $pname : \"$pvalue\"";
			}

		}
		
		foreach($this->getParams() as $pname => $pvalue){
		
			if((!isset($this->necessary[$pname]) && isset($this->defValues[$pname]))
					|| (isset($this->defValues[$pname]) && strtoupper($this->defValues[$pname]) != strtoupper($pvalue) )){
				
				if(!empty($pvalue) && $pvalue != ""){
				
					if(!$optionsShown){
						$code .= '{';
						$optionsShown = true;
					}else
						$code .=',';

					unset($necessary[$pname]);

				$code .= "\n $pname : $pvalue";
				}
			}
		}
		
		
		
		if($optionsShown)
			$code .= "\n}";
		
		$code .= ');';
		
		return $code;
	}
protected function generateJqueryCode($selector, $function){
	
		$code = '$( "'.$selector.'" ).'.$function.'(';
		$optionsShown = false;
		
		
		foreach($this->necessary as $pname => $v){		
			$pvalue = $this->getParam($pname);
			if($pvalue == null)
				$pvalue = $this->defValues[$pname];
			if(!empty($pvalue) && $pvalue != ""){

				if(!$optionsShown){
					$code .= '{';
					$optionsShown = true;
				}else
					$code .=',';

				$code .= "\n $pname : \"$pvalue\"";
			}

		}
		
		foreach($this->getParams() as $pname => $pvalue){
		
			if((!isset($this->necessary[$pname]) && isset($this->defValues[$pname]))
					|| (isset($this->defValues[$pname]) && strtoupper($this->defValues[$pname]) != strtoupper($pvalue) )){
				
				if(!empty($pvalue) && $pvalue != ""){
				
					if(!$optionsShown){
						$code .= '{';
						$optionsShown = true;
					}else
						$code .=',';

					unset($necessary[$pname]);

				$code .= "\n $pname : $pvalue";
				}
			}
		}
		
		
		
		if($optionsShown)
			$code .= "\n}";
		
		$code .= ');';
		
		return $code;
	}
protected function generateJqueryCode ( $ selector , $ function ) { $ code = '$( "' . $ selector . '" ).' . $ function . '(' ; $ optionsShown = false ; foreach ( $ this -> necessary as $ pname => $ v ) { $ pvalue = $ this -> getParam ( $ pname ) ; if ( $ pvalue == null ) $ pvalue = $ this -> defValues [ $ pname ] ; if ( ! empty ( $ pvalue ) && $ pvalue != "" ) { if ( ! $ optionsShown ) { $ code .= '{' ; $ optionsShown = true ; } else $ code .= ',' ; $ code .= "\n $pname : \"$pvalue\"" ; } } foreach ( $ this -> getParams ( ) as $ pname => $ pvalue ) { if ( ( ! isset ( $ this -> necessary [ $ pname ] ) && isset ( $ this -> defValues [ $ pname ] ) ) || ( isset ( $ this -> defValues [ $ pname ] ) && strtoupper ( $ this -> defValues [ $ pname ] ) != strtoupper ( $ pvalue ) ) ) { if ( ! empty ( $ pvalue ) && $ pvalue != "" ) { if ( ! $ optionsShown ) { $ code .= '{' ; $ optionsShown = true ; } else $ code .= ',' ; unset ( $ necessary [ $ pname ] ) ; $ code .= "\n $pname : $pvalue" ; } } } if ( $ optionsShown ) $ code .= "\n}" ; $ code .= ');' ; return $ code ; }
Generates the jquery code with default values as well

@param type $selector
@param type $function
@return string
Generates the jquery code with default values as well