[ Index ] |
|
Code source de e107 0.7.8 |
1 // $Id: imageselector.sc,v 1.4 2006/05/31 06:33:28 e107coders Exp $ 2 3 global $sql,$parm; 4 5 if(strstr($parm,"=")){ // query style parms. 6 parse_str($parm, $tmp); 7 extract($tmp); 8 }else{ // comma separated parms. 9 list($name,$path,$default,$width,$height,$multiple,$label,$subdirs) = explode(",",$parm); 10 } 11 12 13 require_once(e_HANDLER."file_class.php"); 14 $fl = new e_file; 15 16 // $paths = explode("|",$path); 17 $recurse = ($subdirs) ? $subdirs : 0; 18 if($imagelist = $fl->get_files($path,".jpg|.gif|.png|.JPG|.GIF|.PNG", 'standard', $recurse)){ 19 sort($imagelist); 20 } 21 22 $multi = ($multiple == "TRUE" || $multiple == "1") ? "multiple='multiple' style='height:{$height}'" : "style='float:left'"; 23 $width = ($width) ? $width : "*"; 24 $height = ($height) ? $height : "*"; 25 $label = ($label) ? $label : " -- -- "; 26 27 $text .= "<select {$multi} class='tbox' name='$name' id='$name' onchange=\"preview_image('$name','$path');\"> 28 <option value=''>".$label."</option>\n"; 29 foreach($imagelist as $icon) 30 { 31 $dir = str_replace($path,"",$icon['path']); 32 $selected = ($default == $dir.$icon['fname']) ? " selected='selected'" : ""; 33 $text .= "<option value='".$dir.$icon['fname']."'".$selected.">".$dir.$icon['fname']."</option>\n"; 34 } 35 $text .= "</select>"; 36 37 $pvw_default = ($default) ? $path.$default : e_IMAGE."generic/blank.gif"; 38 $text .= " <img id='{$name}_prev' src='{$pvw_default}' alt='' style='width:{$width};height:{$height}' />\n"; 39 40 41 return "\n\n<!-- Start Image Selector -->\n\n".$text."\n\n<!-- End Image Selector -->\n\n";
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |