fix batch manager unit photo titles with quotes (+ send all photo data to template)

fix batch manager global fix tiptip selector for thumbs

git-svn-id: http://piwigo.org/svn/trunk@17856 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices 2012-09-11 02:47:32 +00:00
parent 4a2f9da888
commit c78c9760ca
3 changed files with 23 additions and 23 deletions

View file

@ -198,7 +198,7 @@ if (count($page['cat_elements_id']) > 0)
$query = ' $query = '
SELECT id,path,representative_ext,name,date_creation,comment,author,level,file SELECT *
FROM '.IMAGES_TABLE; FROM '.IMAGES_TABLE;
if ($is_category) if ($is_category)
@ -263,23 +263,23 @@ SELECT
} }
$template->append( $template->append(
'elements', 'elements', array_merge($row,
array( array(
'ID' => $row['id'], 'ID' => $row['id'],
'TN_SRC' => DerivativeImage::url(IMG_THUMB, $src_image), 'TN_SRC' => DerivativeImage::url(IMG_THUMB, $src_image),
'FILE_SRC' => DerivativeImage::url(IMG_LARGE, $src_image), 'FILE_SRC' => DerivativeImage::url(IMG_LARGE, $src_image),
'LEGEND' => $legend, 'LEGEND' => $legend,
'U_EDIT' => get_root_url().'admin.php?page=photo-'.$row['id'], 'U_EDIT' => get_root_url().'admin.php?page=photo-'.$row['id'],
'NAME' => !empty($row['name'])?$row['name']:'', 'NAME' => htmlspecialchars(@$row['name']),
'AUTHOR' => !empty($row['author'])?htmlspecialchars($row['author']):'', 'AUTHOR' => htmlspecialchars(@$row['author']),
'LEVEL' => !empty($row['level'])?$row['level']:'0', 'LEVEL' => !empty($row['level'])?$row['level']:'0',
'DESCRIPTION' => !empty($row['comment'])?$row['comment']:'', 'DESCRIPTION' => htmlspecialchars(@$row['comment']),
'DATE_CREATION_YEAR' => $year, 'DATE_CREATION_YEAR' => $year,
'DATE_CREATION_MONTH' => (int)$month, 'DATE_CREATION_MONTH' => (int)$month,
'DATE_CREATION_DAY' => (int)$day, 'DATE_CREATION_DAY' => (int)$day,
'TAGS' => $tag_selection, 'TAGS' => $tag_selection,
) )
); ));
} }
$template->assign('ELEMENT_IDS', implode(',', $element_ids)); $template->assign('ELEMENT_IDS', implode(',', $element_ids));

View file

@ -238,7 +238,7 @@ $(document).ready(function() {
} }
} }
$('img.thumbnail').tipTip({ $('.thumbnails img').tipTip({
'delay' : 0, 'delay' : 0,
'fadeIn' : 200, 'fadeIn' : 200,
'fadeOut' : 200 'fadeOut' : 200

View file

@ -11,7 +11,7 @@ var prefix = "";
{else} {else}
prefix = ", "; prefix = ", ";
{/if} {/if}
tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.ID}; tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.id};
{/foreach} {/foreach}
jQuery(document).ready(function() {ldelim} jQuery(document).ready(function() {ldelim}
@ -55,54 +55,54 @@ jQuery(document).ready(function() {ldelim}
<legend>{$element.LEGEND}</legend> <legend>{$element.LEGEND}</legend>
<span class="thumb"> <span class="thumb">
<a href="{$element.FILE_SRC}" class="preview-box" title="{$element.LEGEND}"><img src="{$element.TN_SRC}" alt=""></a> <a href="{$element.FILE_SRC}" class="preview-box" title="{$element.LEGEND|@htmlspecialchars}"><img src="{$element.TN_SRC}" alt=""></a>
<br/> <br/>
<a href="{$element.U_EDIT}">{'Informations'|@translate}</a> <a href="{$element.U_EDIT}">{'Edit'|@translate}</a>
</span> </span>
<table> <table>
<tr> <tr>
<td><strong>{'Title'|@translate}</strong></td> <td><strong>{'Title'|@translate}</strong></td>
<td><input type="text" class="large" name="name-{$element.ID}" value="{$element.NAME}"></td> <td><input type="text" class="large" name="name-{$element.id}" value="{$element.NAME}"></td>
</tr> </tr>
<tr> <tr>
<td><strong>{'Author'|@translate}</strong></td> <td><strong>{'Author'|@translate}</strong></td>
<td><input type="text" class="large" name="author-{$element.ID}" value="{$element.AUTHOR}"></td> <td><input type="text" class="large" name="author-{$element.id}" value="{$element.AUTHOR}"></td>
</tr> </tr>
<tr> <tr>
<td><strong>{'Creation date'|@translate}</strong></td> <td><strong>{'Creation date'|@translate}</strong></td>
<td> <td>
<label><input type="radio" name="date_creation_action-{$element.ID}" value="unset"> {'unset'|@translate}</label> <label><input type="radio" name="date_creation_action-{$element.id}" value="unset"> {'unset'|@translate}</label>
<label><input type="radio" name="date_creation_action-{$element.ID}" value="set" id="date_creation_action_set-{$element.ID}"> {'set to'|@translate}</label> <label><input type="radio" name="date_creation_action-{$element.id}" value="set" id="date_creation_action_set-{$element.id}"> {'set to'|@translate}</label>
<select id="date_creation_day-{$element.ID}" name="date_creation_day-{$element.ID}"> <select id="date_creation_day-{$element.id}" name="date_creation_day-{$element.id}">
<option value="0">--</option> <option value="0">--</option>
{section name=day start=1 loop=32} {section name=day start=1 loop=32}
<option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$element.DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option> <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$element.DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option>
{/section} {/section}
</select> </select>
<select id="date_creation_month-{$element.ID}" name="date_creation_month-{$element.ID}"> <select id="date_creation_month-{$element.id}" name="date_creation_month-{$element.id}">
{html_options options=$month_list selected=$element.DATE_CREATION_MONTH} {html_options options=$month_list selected=$element.DATE_CREATION_MONTH}
</select> </select>
<input id="date_creation_year-{$element.ID}" <input id="date_creation_year-{$element.id}"
name="date_creation_year-{$element.ID}" name="date_creation_year-{$element.id}"
type="text" type="text"
size="4" size="4"
maxlength="4" maxlength="4"
value="{$element.DATE_CREATION_YEAR}"> value="{$element.DATE_CREATION_YEAR}">
<input id="date_creation_linked_date-{$element.ID}" name="date_creation_linked_date-{$element.ID}" type="hidden" size="10" disabled="disabled"> <input id="date_creation_linked_date-{$element.id}" name="date_creation_linked_date-{$element.id}" type="hidden" size="10" disabled="disabled">
{footer_script} {footer_script}
pwg_initialization_datepicker("#date_creation_day-{$element.ID}", "#date_creation_month-{$element.ID}", "#date_creation_year-{$element.ID}", "#date_creation_linked_date-{$element.ID}", "#date_creation_action_set-{$element.ID}"); pwg_initialization_datepicker("#date_creation_day-{$element.id}", "#date_creation_month-{$element.id}", "#date_creation_year-{$element.id}", "#date_creation_linked_date-{$element.id}", "#date_creation_action_set-{$element.id}");
{/footer_script} {/footer_script}
</td> </td>
</tr> </tr>
<tr> <tr>
<td><strong>{'Who can see this photo?'|@translate}</strong></td> <td><strong>{'Who can see this photo?'|@translate}</strong></td>
<td> <td>
<select name="level-{$element.ID}"> <select name="level-{$element.id}">
{html_options options=$level_options selected=$element.LEVEL} {html_options options=$level_options selected=$element.LEVEL}
</select> </select>
</td> </td>
@ -112,7 +112,7 @@ jQuery(document).ready(function() {ldelim}
<td><strong>{'Tags'|@translate}</strong></td> <td><strong>{'Tags'|@translate}</strong></td>
<td> <td>
<select id="tags-{$element.ID}" name="tags-{$element.ID}"> <select id="tags-{$element.id}" name="tags-{$element.id}">
{foreach from=$element.TAGS item=tag} {foreach from=$element.TAGS item=tag}
<option value="{$tag.id}" class="selected">{$tag.name}</option> <option value="{$tag.id}" class="selected">{$tag.name}</option>
{/foreach} {/foreach}
@ -123,7 +123,7 @@ jQuery(document).ready(function() {ldelim}
<tr> <tr>
<td><strong>{'Description'|@translate}</strong></td> <td><strong>{'Description'|@translate}</strong></td>
<td><textarea cols="50" rows="5" name="description-{$element.ID}" id="description-{$element.ID}" class="description">{$element.DESCRIPTION}</textarea></td> <td><textarea cols="50" rows="5" name="description-{$element.id}" id="description-{$element.id}" class="description">{$element.DESCRIPTION}</textarea></td>
</tr> </tr>
</table> </table>