Ignore:
Timestamp:
Jun 24, 2012, 9:26:25 PM (12 years ago)
Author:
grum
Message:

feature:2664- compatibility with Piwigo 2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/gally/gally-default/template/comment_list.tpl

    r12592 r16016  
    66*}
    77
    8 <script type="text/javascript">
    9 {literal}
     8{footer_script}{literal}
    109  function editInside(url, text, imageId, key, index)
    1110  {
     
    1817
    1918  }
    20 {/literal}
    21 
    22 </script>
     19{/literal}{/footer_script}
    2320
    2421
    2522<div id="formEditInside" style="display:none;">
    26   <form  method='post' action='' class='filter' id='editComment'>
    27     <fieldset>
    28       <legend>{'Edit a comment'|@translate}</legend>
     23  <form  method='post' action='' id='editComment'>
     24      {'Edit'|@translate}<br>
    2925      <textarea name='content' id='contentEditId' rows='5' cols='80'></textarea></label><br>
    3026      <input type='hidden' name='key' id='feiKey' value=''>
     27      <input type="hidden" name="pwg_token" id='feiToken' value="{$gally->getToken()}">
    3128      <input type='hidden' name='image_id' id='feiImageId' value=''>
    3229      <input class='submit' type='submit' value='{"Submit"|@translate}'>
    33     </fieldset>
    3430  </form>
    3531</div>
     
    3935<li>
    4036  <div class="commentDetail">
    41     {if isset($comment.TN_SRC)}
     37    {if isset($comment.src_image)}
    4238    <div class="illustration">
    4339      <a href="{$comment.U_PICTURE}">
    44         <img src="{$comment.TN_SRC}" alt="{$comment.ALT}" />
     40        <img src="{$pwg->derivative_url($derivative_params, $comment.src_image)}" alt="{$comment.ALT}">
    4541      </a>
    4642    </div>
    4743    {/if}
    4844    <div class="description">
    49       {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) or isset($comment.U_EDIT) }
     45      {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) or isset($comment.U_EDIT)}
    5046      <ul class="actions" style="float:right">
    5147        {if isset($comment.U_DELETE)}
    5248        <li>
    53           <span class="button id_delete" onclick="document.location='{$comment.U_DELETE}';" title="{'delete this comment'|@translate}"></span>
     49          <span class="button id_delete" onclick="document.location='{$comment.U_DELETE}';" title="{'Delete'|@translate}"></span>
    5450        </li>
    5551        {/if}
    5652
    57         {if isset($comment.U_EDIT) and !isset($comment.IN_EDIT)}
     53        {if isset($comment.U_EDIT)}
    5854        <li>
    59           {php}
    60             /*
    61               this php code is used to calculate the key need to be allowed to
    62               edit the comment, and determine the picture number if necessary
    63               (theses properties are not in the template var because with the
    64               default template, Piwigo reloads the page for editing an item :
    65               this template is abble to edit an item without reloading the page)
    66             */
    67             global $conf;
    68             $comment=$this->get_template_vars('comment');
    69             $current=$this->get_template_vars('current');
    70             if(!array_key_exists('image_id', $comment))
    71             {
    72               if(isset($current['id']))
    73               {
    74                 $comment['IMAGE_ID']=$current['id'];
    75               }
    76               else
    77               {
    78                 preg_match('#picture\.php\?/(\d+)/category/#i', $comment['U_PICTURE'], $result);
    79                 if(isset($result[1]))
    80                 {
    81                   $comment['IMAGE_ID']=$result[1];
    82                 }
    83               }
    84             }
    85             $now=time();
    86             $comment['KEY']=$now.":".hash_hmac('md5', $now.':'.$comment['IMAGE_ID'], $conf['secret_key']);
    87             $this->assign_by_ref('comment', $comment);
    88           {/php}
    89           <span class="button id_edit" onclick="editInside('{$comment.U_EDIT}#edit_comment}', '{$comment.CONTENT|@escape}', {$comment.IMAGE_ID|@default:$current.id}, '{$comment.KEY}', {$smarty.foreach.comment_loop.index});" title="{'edit this comment'|@translate}"></span>
    90 
     55          <span class="button id_edit" onclick="editInside('{$comment.U_EDIT}#edit_comment', '{$comment.CONTENT|@escape}', {$gally->getCommentImage($comment.ID)}, '{$gally->getCommentKey($comment.ID)}', {$smarty.foreach.comment_loop.index});" title="{'Edit'|@translate}"></span>
    9156        </li>
    9257        {/if}
    93 
    9458        {if isset($comment.U_VALIDATE)}
    9559        <li>
    96           <span class="button id_validate" onclick="document.location='{$comment.U_VALIDATE}';" title="{'validate this comment'|@translate}"></span>
     60          <span class="button id_validate" onclick="document.location='{$comment.U_VALIDATE}';" title="{'Validate'|@translate}"></span>
    9761        </li>
    9862        {/if}
Note: See TracChangeset for help on using the changeset viewer.