- improvement : less compact presentation of screen admin/element_set_unit.

git-svn-id: http://piwigo.org/svn/trunk@836 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall 2005-08-19 19:07:13 +00:00
parent abed8b4a18
commit dded962ded
6 changed files with 113 additions and 62 deletions

View file

@ -45,17 +45,7 @@ if (isset($_POST['submit']))
{
$collection = explode(',', $_POST['list']);
// echo '<pre>';
// print_r($_POST);
// echo '</pre>';
// exit();
$datas = array();
$dbfields =
array(
'primary' => array('id'),
'update' => array('name','author','comment','date_creation','keywords')
);
$query = '
SELECT id, date_creation
@ -67,34 +57,70 @@ SELECT id, date_creation
while ($row = mysql_fetch_array($result))
{
$data = array();
$data['id'] = $row['id'];
foreach (array_diff($dbfields['update'], array('date_creation')) as $field)
$data{'id'} = $row['id'];
$data{'name'} = $_POST['name-'.$row['id']];
$data{'author'} = $_POST['author-'.$row['id']];
foreach (array('name', 'author') as $field)
{
if (!empty($_POST[$field.'-'.$row['id']]))
{
$data[$field] = $_POST[$field.'-'.$row['id']];
$data{$field} = strip_tags($_POST[$field.'-'.$row['id']]);
}
}
if ('set' == $_POST['date_creation_action-'.$row['id']])
if ($conf['allow_html_descriptions'])
{
$data['date_creation'] =
$_POST['date_creation_year-'.$row['id']]
.'-'.$_POST['date_creation_month-'.$row['id']]
.'-'.$_POST['date_creation_day-'.$row['id']]
;
$data{'comment'} = @$_POST['description-'.$row['id']];
}
else if ('leave' == $_POST['date_creation_action-'.$row['id']]
and !empty($row['date_creation']))
else
{
$data['date_creation'] = $row['date_creation'];
$data{'comment'} = strip_tags(@$_POST['description-'.$row['id']]);
}
if (isset($_POST['date_creation_action-'.$row['id']]))
{
if ('set' == $_POST['date_creation_action-'.$row['id']])
{
$data{'date_creation'} =
$_POST['date_creation_year-'.$row['id']]
.'-'.$_POST['date_creation_month-'.$row['id']]
.'-'.$_POST['date_creation_day-'.$row['id']];
}
else if ('unset' == $_POST['date_creation_action-'.$row['id']])
{
$data{'date_creation'} = '';
}
}
else
{
$data{'date_creation'} = $row['date_creation'];
}
$keywords = get_keywords($_POST['keywords-'.$row['id']]);
if (count($keywords) > 0)
{
$data{'keywords'} = implode(',', $keywords);
}
else
{
$data{'keywords'} = '';
}
array_push($datas, $data);
}
// echo '<pre>'; print_r($datas); echo '</pre>';
mass_updates(IMAGES_TABLE, $dbfields, $datas);
mass_updates(
IMAGES_TABLE,
array(
'primary' => array('id'),
'update' => array('name','author','comment','date_creation','keywords')
),
$datas
);
array_push($page['infos'], l10n('Picture informations updated'));
}
// +-----------------------------------------------------------------------+
@ -148,7 +174,7 @@ if (count($page['cat_elements_id']) > 0)
$element_ids = array();
$query = '
SELECT id,path,tn_ext,name,date_creation,comment,keywords,author
SELECT id,path,tn_ext,name,date_creation,comment,keywords,author,file
FROM '.IMAGES_TABLE.'
WHERE id IN ('.implode(',', $page['cat_elements_id']).')
'.$conf['order_by'].'
@ -176,12 +202,20 @@ SELECT id,path,tn_ext,name,date_creation,comment,keywords,author
$template->assign_block_vars(
'element',
array(
'LEGEND' =>
!empty($row['name']) ?
$row['name'] : get_name_from_file($row['file']),
'U_EDIT' =>
add_session_id(
PHPWG_ROOT_PATH.'admin.php?page=picture_modify'.
'&amp;image_id='.$row['id']
),
'ID' => $row['id'],
'FILENAME' => $row['path'],
'TN_SRC' => $src,
'NAME' => @$row['name'],
'AUTHOR' => @$row['author'],
'COMMENT' => @$row['comment'],
'DESCRIPTION' => @$row['comment'],
'DATE_CREATION_YEAR' => $year,
'KEYWORDS' => @$row['keywords']
)

View file

@ -1,3 +1,8 @@
2005-08-19 Pierrick LE GALL
* improvement : less compact presentation of screen
admin/element_set_unit.
2005-08-19 Pierrick LE GALL
* improvement : standardization of categories navigation bar on

View file

@ -42,7 +42,7 @@
<tr>
<td><strong>{L_EDIT_COMMENT}</strong></td>
<td>
<textarea name="comment" rows="3" cols="50" >{CAT_COMMENT}</textarea>
<textarea name="comment" class="description">{CAT_COMMENT}</textarea>
</td>
</tr>
</table>

View file

@ -24,39 +24,31 @@
</fieldset>
<fieldset>
<div class="navigationBar">{NAV_BAR}</div>
<legend>Elements</legend>
<!-- BEGIN element -->
<fieldset class="elementEdit">
<legend>{element.LEGEND}</legend>
<div class="navigationBar">{NAV_BAR}</div>
<a href="{element.U_EDIT}"><img src="{element.TN_SRC}" alt="" class="miniature" title="{lang:Edit all picture informations}" /></a>
<table width="100%">
<table>
<tr>
<th class="row2" style="text-align:center;">&nbsp;</td>
<th class="row2" style="text-align:center;">name</td>
<th class="row2" style="text-align:center;">author</td>
<th class="row2" style="text-align:center;">description</td>
<th class="row2" style="text-align:center;">creation date</td>
<th class="row2" style="text-align:center;">keywords</td>
<td><strong>{lang:Name}</strong></td>
<td><input type="text" name="name-{element.ID}" value="{element.NAME}" /></td>
</tr>
<!-- BEGIN element -->
<tr>
<td><strong>{lang:Author}</strong></td>
<td><input type="text" name="author-{element.ID}" value="{element.AUTHOR}" /></td>
</tr>
<td style="text-align:center;"><img src="{element.TN_SRC}" alt="" class="miniature" title="{element.FILENAME}" /></td>
<td style="text-align:center;"><input type="text" name="name-{element.ID}" value="{element.NAME}" maxlength="255"/></td>
<td style="text-align:center;"><input type="text" name="author-{element.ID}" value="{element.AUTHOR}" maxlength="255" size="12" /></td>
<td style="text-align:center;"><textarea name="comment-{element.ID}" rows="5" cols="30" style="overflow:auto">{element.COMMENT}</textarea></td>
<td style="text-align:left;">
<input type="radio" name="date_creation_action-{element.ID}" value="leave" checked="checked" /> leave unchanged
<br /><input type="radio" name="date_creation_action-{element.ID}" value="unset" /> unset
<br /><input type="radio" name="date_creation_action-{element.ID}" value="set" id="date_creation_action_set-{element.ID}" />
<tr>
<td><strong>{lang:Creation date}</strong></td>
<td>
<label><input type="radio" name="date_creation_action-{element.ID}" value="unset" /> unset</label>
<input type="radio" name="date_creation_action-{element.ID}" value="set" id="date_creation_action_set-{element.ID}" /> set to
<select onmousedown="document.getElementById('date_creation_action_set-{element.ID}').checked = true;" name="date_creation_day-{element.ID}">
<!-- BEGIN date_creation_day -->
<option {element.date_creation_day.SELECTED} value="{element.date_creation_day.VALUE}">{element.date_creation_day.OPTION}</option>
@ -74,18 +66,27 @@
maxlength="4"
value="{element.DATE_CREATION_YEAR}" />
</td>
<td style="text-align:center;"><input type="text" name="keywords-{element.ID}" value="{element.KEYWORDS}" length="255" /></td>
</tr>
<!-- END element -->
<tr>
<td><strong>{lang:Keywords}</strong></td>
<td><input type="text" name="keywords-{element.ID}" value="{element.KEYWORDS}" size="50" /></td>
</tr>
<tr>
<td><strong>{lang:Description}</strong></td>
<td><textarea name="description-{element.ID}" class="description">{element.DESCRIPTION}</textarea></td>
</tr>
</table>
<p style="text-align:center;">
<input type="submit" value="{L_SUBMIT}" name="submit" class="bouton" />
</p>
</fieldset>
<!-- END element -->
<p style="text-align:center;">
<input type="submit" value="{L_SUBMIT}" name="submit" />
<input type="reset" value="{lang:Reset}" />
</p>
</form>

View file

@ -104,7 +104,7 @@
<tr>
<td><strong>{lang:Description}</strong></td>
<td><textarea name="description" rows="5" cols="50" style="overflow:auto">{DESCRIPTION}</textarea></td>
<td><textarea name="description" class="description">{DESCRIPTION}</textarea></td>
</tr>
</table>

View file

@ -616,3 +616,14 @@ div#adminMain img.thumbnail {
margin: 0 auto;
display: block;
}
textarea.description {
height: 100px;
width: 500px;
overflow: auto;
}
fieldset.elementEdit>a {
display: block;
float: right;
}