aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/element_set_unit.php88
-rw-r--r--doc/ChangeLog5
-rw-r--r--template/default/admin/cat_modify.tpl2
-rw-r--r--template/default/admin/element_set_unit.tpl61
-rw-r--r--template/default/admin/picture_modify.tpl2
-rw-r--r--template/default/default.css11
6 files changed, 110 insertions, 59 deletions
diff --git a/admin/element_set_unit.php b/admin/element_set_unit.php
index 15dcd62a3..9ccbf9346 100644
--- a/admin/element_set_unit.php
+++ b/admin/element_set_unit.php
@@ -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 ($conf['allow_html_descriptions'])
+ {
+ $data{'comment'} = @$_POST['description-'.$row['id']];
+ }
+ else
+ {
+ $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'];
+ }
- if ('set' == $_POST['date_creation_action-'.$row['id']])
+ $keywords = get_keywords($_POST['keywords-'.$row['id']]);
+ if (count($keywords) > 0)
{
- $data['date_creation'] =
- $_POST['date_creation_year-'.$row['id']]
- .'-'.$_POST['date_creation_month-'.$row['id']]
- .'-'.$_POST['date_creation_day-'.$row['id']]
- ;
+ $data{'keywords'} = implode(',', $keywords);
}
- else if ('leave' == $_POST['date_creation_action-'.$row['id']]
- and !empty($row['date_creation']))
+ else
{
- $data['date_creation'] = $row['date_creation'];
+ $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']
)
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 4996a81c4..14db5793e 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,10 @@
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
top of administration screen element_set_(global|unit),
cat_modify, cat_list, cat_perm.
diff --git a/template/default/admin/cat_modify.tpl b/template/default/admin/cat_modify.tpl
index 54de1af66..b738bae3f 100644
--- a/template/default/admin/cat_modify.tpl
+++ b/template/default/admin/cat_modify.tpl
@@ -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>
diff --git a/template/default/admin/element_set_unit.tpl b/template/default/admin/element_set_unit.tpl
index 494e81478..df1247d2d 100644
--- a/template/default/admin/element_set_unit.tpl
+++ b/template/default/admin/element_set_unit.tpl
@@ -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>
+ </tr>
- <td style="text-align:center;"><input type="text" name="keywords-{element.ID}" value="{element.KEYWORDS}" length="255" /></td>
+ <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>
- <!-- END element -->
</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>
diff --git a/template/default/admin/picture_modify.tpl b/template/default/admin/picture_modify.tpl
index d59c69f59..90a5b7751 100644
--- a/template/default/admin/picture_modify.tpl
+++ b/template/default/admin/picture_modify.tpl
@@ -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>
diff --git a/template/default/default.css b/template/default/default.css
index 2b7ad8bbb..026ca626c 100644
--- a/template/default/default.css
+++ b/template/default/default.css
@@ -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;
+} \ No newline at end of file