Changeset 13052 for trunk/admin


Ignore:
Timestamp:
Feb 7, 2012, 10:25:20 PM (12 years ago)
Author:
rvelices
Message:

upgrade jquery to 1.7.1
mouseout on index drop down bozes
improved multisize center of interest

Location:
trunk/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r13025 r13052  
    203203
    204204    $ok = true;
    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                 }
     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    }
    217217
    218218    if ($ok)
     
    23072307}
    23082308
    2309 function delete_element_derivatives($infos)
     2309function delete_element_derivatives($infos, $type='all')
    23102310{
    23112311  $path = $infos['path'];
     
    23182318    $path = substr($path, 3);
    23192319  }
    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);
    23222330  foreach( glob(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$path) as $file)
    23232331  {
  • trunk/admin/picture_coi.php

    r13038 r13052  
    5858if (isset($_POST['submit']))
    5959{
    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}
     75else
     76{
     77  $uid = '';
    6178}
    6279
     
    7794}
    7895
    79 if (isset($_POST['submit']))
     96foreach(ImageStdParams::get_defined_type_map() as $params)
    8097{
    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  }
    86106}
    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
    92108
    93109$template->assign($tpl_var);
  • trunk/admin/themes/default/template/picture_coi.tpl

    r13038 r13052  
    99</div>
    1010
    11 <div>
    12 <img src="{$U_SQUARE}" alt="{$ALT}">
    13 <img src="{$U_THUMB}" alt="{$ALT}">
    14 </div>
     11<form method="post">
    1512
    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>
    1822<input type="hidden" id="l" name="l" value="{if isset($coi)}{$coi.l}{/if}">
    1923<input type="hidden" id="t" name="t" value="{if isset($coi)}{$coi.t}{/if}">
     
    2630<input type="submit" name="submit" value="{'Submit'|@translate}">
    2731</p>
     32</fieldset>
    2833</form>
    29 </div>
    3034
    3135{footer_script}
     
    5256{/literal}
    5357jQuery("#jcrop").Jcrop( {ldelim}
    54         boxWidth: 400, boxHeight: 400,
     58        boxWidth: 500, boxHeight: 400,
    5559        onChange: jOnChange,
    5660        onRelease: jOnRelease
Note: See TracChangeset for help on using the changeset viewer.