Changeset 13052 for trunk/admin
- Timestamp:
- Feb 7, 2012, 10:25:20 PM (12 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r13025 r13052 203 203 204 204 $ok = true; 205 206 207 208 209 210 211 212 213 214 215 216 205 if (!isset($conf['never_delete_originals'])) 206 { 207 foreach ($files as $path) 208 { 209 if (is_file($path) and !unlink($path)) 210 { 211 $ok = false; 212 trigger_error('"'.$path.'" cannot be removed', E_USER_WARNING); 213 break; 214 } 215 } 216 } 217 217 218 218 if ($ok) … … 2307 2307 } 2308 2308 2309 function delete_element_derivatives($infos )2309 function delete_element_derivatives($infos, $type='all') 2310 2310 { 2311 2311 $path = $infos['path']; … … 2318 2318 $path = substr($path, 3); 2319 2319 } 2320 $dot = strpos($path, '.'); 2321 $path = substr_replace($path, '-*', $dot, 0); 2320 $dot = strrpos($path, '.'); 2321 if ($type=='all') 2322 { 2323 $pattern = '-*'; 2324 } 2325 else 2326 { 2327 $pattern = '-'.derivative_to_url($type).'*'; 2328 } 2329 $path = substr_replace($path, $pattern, $dot, 0); 2322 2330 foreach( glob(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$path) as $file) 2323 2331 { -
trunk/admin/picture_coi.php
r13038 r13052 58 58 if (isset($_POST['submit'])) 59 59 { 60 delete_element_derivatives($row); 60 foreach(ImageStdParams::get_defined_type_map() as $params) 61 { 62 if ($params->sizing->max_crop != 0) 63 { 64 delete_element_derivatives($row, $params->type); 65 } 66 } 67 delete_element_derivatives($row, IMG_CUSTOM); 68 $uid = '&b='.time(); 69 $conf['question_mark_in_urls'] = $conf['php_extension_in_urls'] = true; 70 if ($conf['derivative_url_style']==1) 71 { 72 $conf['derivative_url_style']=0; //auto 73 } 74 } 75 else 76 { 77 $uid = ''; 61 78 } 62 79 … … 77 94 } 78 95 79 if (isset($_POST['submit']))96 foreach(ImageStdParams::get_defined_type_map() as $params) 80 97 { 81 $uid = '&b='.time(); 82 $conf['question_mark_in_urls'] = $conf['php_extension_in_urls'] = true; 83 $conf['derivative_url_style']=2; //script 84 $tpl_var['U_SQUARE'] = DerivativeImage::url(IMG_SQUARE, $row).$uid; 85 $tpl_var['U_THUMB'] = DerivativeImage::url(IMG_THUMB, $row).$uid; 98 if ($params->sizing->max_crop != 0) 99 { 100 $derivative = new DerivativeImage($params, new SrcImage($row) ); 101 $template->append( 'cropped_derivatives', array( 102 'U_IMG' => $derivative->get_url().$uid, 103 'HTM_SIZE' => $derivative->get_size_htm(), 104 ) ); 105 } 86 106 } 87 else 88 { 89 $tpl_var['U_SQUARE'] = DerivativeImage::url(IMG_SQUARE, $row); 90 $tpl_var['U_THUMB'] = DerivativeImage::url(IMG_THUMB, $row); 91 } 107 92 108 93 109 $template->assign($tpl_var); -
trunk/admin/themes/default/template/picture_coi.tpl
r13038 r13052 9 9 </div> 10 10 11 <div> 12 <img src="{$U_SQUARE}" alt="{$ALT}"> 13 <img src="{$U_THUMB}" alt="{$ALT}"> 14 </div> 11 <form method="post"> 15 12 16 <div> 17 <form method="post"> 13 <fieldset> 14 <legend>{'Crop'|@translate}</legend> 15 {foreach from=$cropped_derivatives item=deriv} 16 <img src="{$deriv.U_IMG}" alt="{$ALT}" {$deriv.HTM_SIZE}> 17 {/foreach} 18 </fieldset> 19 20 <fieldset> 21 <legend>{'Center of interest'|@translate}</legend> 18 22 <input type="hidden" id="l" name="l" value="{if isset($coi)}{$coi.l}{/if}"> 19 23 <input type="hidden" id="t" name="t" value="{if isset($coi)}{$coi.t}{/if}"> … … 26 30 <input type="submit" name="submit" value="{'Submit'|@translate}"> 27 31 </p> 32 </fieldset> 28 33 </form> 29 </div>30 34 31 35 {footer_script} … … 52 56 {/literal} 53 57 jQuery("#jcrop").Jcrop( {ldelim} 54 boxWidth: 400, boxHeight: 400,58 boxWidth: 500, boxHeight: 400, 55 59 onChange: jOnChange, 56 60 onRelease: jOnRelease
Note: See TracChangeset
for help on using the changeset viewer.