Changeset 2447 for trunk/plugins
- Timestamp:
- Jul 22, 2008, 8:17:40 AM (16 years ago)
- Location:
- trunk/plugins/SwiftThemeCreator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/SwiftThemeCreator/theme_creator.php
r2445 r2447 46 46 $errors = array(); 47 47 $infos = array(); 48 $available_templates = array(); 49 $template_dir = PHPWG_ROOT_PATH.'template'; 50 foreach (get_dirs($template_dir) as $dir) 51 { 52 array_push($available_templates, $dir); 53 } 54 48 55 // +-----------------------------------------------------------------------+ 49 56 // | selected templates | … … 109 116 110 117 // 3 - Directory control 111 $available_templates = array();112 $template_dir = PHPWG_ROOT_PATH.'template';113 foreach (get_dirs($template_dir) as $dir)114 {115 array_push($available_templates, $dir);116 }117 118 $templatedir = PHPWG_ROOT_PATH . 'template/' 118 119 . $available_templates[$_POST['template']]; … … 126 127 127 128 // 4 - Picture URL control 129 if ( $_POST['background'] == 'fixed' and (is_dir($_POST['picture_url']) 130 or !is_file($_POST['picture_url'])) ) 131 array_push($errors, 132 l10n('Header picture is not found, check its path and name.')); 133 128 134 // 5 - Width and Height control 129 135 // 6 - Generate missing colors values 130 131 132 // Lors du parse si le second arg est à true, on récupère le résultat133 // http://www.barelyfitz.com/projects/csscolor/csscolor.zip134 136 135 137 /* 136 138 * Build background image for titrePage or definition list (in #menubar) 137 139 **/ 138 $img = imagecreatefrompng(dirname(__FILE__) . '/titrePage-bg.png'); 139 $dest = imagecreate(1, 64); 140 for ($i=0; $i<256; $i++) { 141 imagecolorallocate($dest, $i, $i, $i); 140 if (function_exists('imagecreatefrompng')) 141 { 142 $img = imagecreatefrompng(dirname(__FILE__) . '/titrePage-bg.png'); 143 $dest = imagecreate(1, 64); 144 for ($i=0; $i<256; $i++) { 145 imagecolorallocate($dest, $i, $i, $i); 146 } 147 imagecopy($dest, $img, 0, 0, 0, 0, 1, 64); 148 list($r1,$g1,$b1) = stc_hex2rgb($main['color'][4]); 149 for ($i = 0; $i < 256; $i++) { 150 imagecolorset($dest, $i, min($i * $r1 / 255, 255), 151 min($i * $g1 / 255, 255), 152 min($i * $b1 / 255, 255)); 153 } 154 // to be tested imagecopymerge($dest,$img,0,0,0,0,1,64,33); 155 156 // Uncomment to create the header stc.png 157 // imagepng( $dest, dirname(__FILE__) . '/stc.png', 9 ); 158 imagedestroy ($img); 159 imagedestroy ($dest); 142 160 } 143 imagecopy($dest, $img, 0, 0, 0, 0, 1, 64);144 list($r1,$g1,$b1) = stc_hex2rgb($main['color'][4]);145 for ($i = 0; $i < 256; $i++) {146 imagecolorset($dest, $i, min($i * $r1 / 255, 255),147 min($i * $g1 / 255, 255),148 min($i * $b1 / 255, 255));149 }150 // to be tested imagecopymerge($dest,$img,0,0,0,0,1,64,33);151 152 // Uncomment to create the header stc.png153 // imagepng( $dest, dirname(__FILE__) . '/stc.png', 9 );154 imagedestroy ($img);155 imagedestroy ($dest);156 157 161 /* en gros reste à faire: 158 162 * creation de la directory … … 160 164 * parse pour theme.css et ecriture directe pour les autres 161 165 */ 166 // Lors du parse si le second arg est à true, on récupère le résultat 167 // http://www.barelyfitz.com/projects/csscolor/csscolor.zip 162 168 163 169 // Go ahead … … 231 237 $_POST['src_category']; 232 238 233 $main['picture_url'] = get_absolute_root_url() 234 . 'plugins/SwiftThemeCreator/sample.jpg'; 239 $main['picture_url'] = PHPWG_ROOT_PATH . 'plugins/SwiftThemeCreator/sample.jpg'; 235 240 if (isset($swift_theme_creator->picture_url)) 236 241 $main['picture_url'] = $swift_theme_creator->picture_url; -
trunk/plugins/SwiftThemeCreator/theme_creator.tpl
r2445 r2447 111 111 <tr> 112 112 <td style="padding-right:20px;"> 113 {'Picture address (URL)'|@translate}113 {'Picture relative local path'|@translate} 114 114 </td><td> 115 115 <label>
Note: See TracChangeset
for help on using the changeset viewer.