- Timestamp:
- Jun 24, 2012, 9:26:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gally/gally-default/template/comment_list.tpl
r12592 r16016 6 6 *} 7 7 8 <script type="text/javascript"> 9 {literal} 8 {footer_script}{literal} 10 9 function editInside(url, text, imageId, key, index) 11 10 { … … 18 17 19 18 } 20 {/literal} 21 22 </script> 19 {/literal}{/footer_script} 23 20 24 21 25 22 <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> 29 25 <textarea name='content' id='contentEditId' rows='5' cols='80'></textarea></label><br> 30 26 <input type='hidden' name='key' id='feiKey' value=''> 27 <input type="hidden" name="pwg_token" id='feiToken' value="{$gally->getToken()}"> 31 28 <input type='hidden' name='image_id' id='feiImageId' value=''> 32 29 <input class='submit' type='submit' value='{"Submit"|@translate}'> 33 </fieldset>34 30 </form> 35 31 </div> … … 39 35 <li> 40 36 <div class="commentDetail"> 41 {if isset($comment. TN_SRC)}37 {if isset($comment.src_image)} 42 38 <div class="illustration"> 43 39 <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}"> 45 41 </a> 46 42 </div> 47 43 {/if} 48 44 <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)} 50 46 <ul class="actions" style="float:right"> 51 47 {if isset($comment.U_DELETE)} 52 48 <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> 54 50 </li> 55 51 {/if} 56 52 57 {if isset($comment.U_EDIT) and !isset($comment.IN_EDIT)}53 {if isset($comment.U_EDIT)} 58 54 <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> 91 56 </li> 92 57 {/if} 93 94 58 {if isset($comment.U_VALIDATE)} 95 59 <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> 97 61 </li> 98 62 {/if}
Note: See TracChangeset
for help on using the changeset viewer.