[zi-cvs] packages/com.zzoss.installer.lib ConfigInput.php,1.2,1.3 Widget.php,1.7,1.8

Sandro Zic <[email protected]> Fri, 26 Mar 2004 10:26:33 +0000
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23633/com.zzoss.installer.lib

Modified Files:
	ConfigInput.php Widget.php 
Log Message:
new widget attributes @mode and @not_mode that allows to specify if a widget should (not) be displayed if installer is in dev/prod/setup mode

Index: ConfigInput.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/ConfigInput.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConfigInput.php	5 Mar 2004 14:25:23 -0000	1.2
--- ConfigInput.php	26 Mar 2004 10:26:31 -0000	1.3
***************
*** 31,35 ****
  	
  	// turn off case folding  
! 	var $folding = false;  
  
  	/**  
--- 31,35 ----
  	
  	// turn off case folding  
! 	var $folding = false;
  
  	/**  
***************
*** 52,56 ****
  		//echo $element;
  		if($element == "widget"){
! 			//print_r($attribs);
  			// set default value?
  			if(isset($attribs['default'])){
--- 52,80 ----
  		//echo $element;
  		if($element == "widget"){
!             
!             // check if a certain mode must be met 
!             if(isset($attribs['mode']) && strlen($attribs['mode'])){
!                 $modes = explode('|',$attribs['mode']);
!                 //echo $attribs['variable'];
!                 //print_r($modes);
!                 if(!in_array($GLOBALS['ZI']['mode'], $modes)){
!                     return false;
!                 }
!             }
!             
!             // check if a certain mode is not allowed 
!             if(isset($attribs['not_mode']) && strlen($attribs['not_mode'])){
!                 $modes = explode('|',$attribs['not_mode']);
!                 //echo $attribs['variable'];
!                 //print_r($modes);
!                 if(in_array($GLOBALS['ZI']['mode'], $modes)){
!                     return false;
!                 }
!             }
! 			
!             if(!isset($attribs['label'])){
!                 $attribs['label'] = null;
!             }
!             
  			// set default value?
  			if(isset($attribs['default'])){

Index: Widget.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Widget.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Widget.php	22 Mar 2004 08:33:39 -0000	1.7
--- Widget.php	26 Mar 2004 10:26:31 -0000	1.8
***************
*** 534,536 ****
--- 534,560 ----
  		return $output;
  	}
+     
+     function hidden()
+ 	{
+ 	  	ob_start();
+ 			if(isset($this->errors[$this->name])){
+                 ?>
+                 <tr>
+                 <td align="left" valign="top"><span class="label"><?php echo $this->label; ?></span></td>
+                 <td align="left" valign="top"><?php
+                 echo '<div class="warning-inline">'.$this->errors[$this->name].'</div>';
+                 ?>
+                 </td>
+                 <td align="left" valign="middle"><?php if(isset($this->options['help'])) echo $this->help($this->helpPath.$this->options['help'], $this->label); ?></td>
+                 </tr>
+             <?php
+ 			}
+ 			?>
+             <input type="hidden" name="ZI_VALUES[<?php echo $this->name; ?>]" value="<?php if(isset($this->options['default'])) echo $this->options['default']; ?>">
+ 			<input type="hidden" name="ZI_VALIDATIONS[<?php echo $this->name; ?>]" value="<?php if(isset($this->options['validation'])) echo $this->options['validation']; ?>">
+ 		<?php
+ 		$output = ob_get_contents();
+ 		ob_end_clean();
+ 		return $output;
+ 	}
  }
\ No newline at end of file



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click