mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-08 17:53:08 +02:00
- improvement : screen admin/picture_modify rewritten. Presentation copied
from admin/cat_modify : fieldsets regroup fields. Ability to synchronize metadata for the displayed item. - bug 110 fixed : "return to element view from element edition fails depending on permissions". If a reachable (for the connected admin) category is available, a "jump to" link is displayed, by default, using the category given in URL. - bug fixed : in mass_updates function, the first item of $fields['update'] has not always 0 for id (as in any array). - modification : get_keywords function understands spaces as separator, allow less than 3 chars keywords, allow quotes. - new : ability to allow HTML in picture or category description (false by default) git-svn-id: http://piwigo.org/svn/trunk@825 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+21
-31
@@ -39,39 +39,29 @@ if ( !isset( $_GET['cat_id'] ) || !is_numeric( $_GET['cat_id'] ) )
|
||||
$template->set_filenames( array('categories'=>'admin/cat_modify.tpl') );
|
||||
|
||||
//--------------------------------------------------------- form criteria check
|
||||
if ( isset( $_POST['submit'] ) )
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
$query = 'UPDATE '.CATEGORIES_TABLE;
|
||||
$query.= ' SET name = ';
|
||||
if ( empty($_POST['name']))
|
||||
$query.= 'NULL';
|
||||
else
|
||||
$query.= "'".htmlentities( $_POST['name'], ENT_QUOTES)."'";
|
||||
|
||||
$query.= ', comment = ';
|
||||
if ( empty($_POST['comment']))
|
||||
$query.= 'NULL';
|
||||
else
|
||||
$query.= "'".htmlentities( $_POST['comment'], ENT_QUOTES )."'";
|
||||
|
||||
if ( isset( $_POST['uploadable'] ) )
|
||||
$query.= ", uploadable = '".$_POST['uploadable']."'";
|
||||
|
||||
if ( isset( $_POST['commentable'] ) )
|
||||
$query.= ", commentable = '".$_POST['commentable']."'";
|
||||
|
||||
if ( isset( $_POST['associate'] ) )
|
||||
{
|
||||
$query.= ', id_uppercat = ';
|
||||
if ( $_POST['associate'] == -1 or $_POST['associate'] == '' )
|
||||
$query.= 'NULL';
|
||||
else
|
||||
$query.= $_POST['associate'];
|
||||
}
|
||||
$query.= ' WHERE id = '.$_GET['cat_id'];
|
||||
$query.= ';';
|
||||
pwg_query( $query );
|
||||
$data =
|
||||
array(
|
||||
'id' => $_GET['cat_id'],
|
||||
'name' => @$_POST['name'],
|
||||
'commentable' => $_POST['commentable'],
|
||||
'uploadable' =>
|
||||
isset($_POST['uploadable']) ? $_POST['uploadable'] : 'false',
|
||||
'comment' =>
|
||||
$conf['allow_html_descriptions'] ?
|
||||
@$_POST['comment'] : strip_tags(@$_POST['comment'])
|
||||
);
|
||||
|
||||
mass_updates(
|
||||
CATEGORIES_TABLE,
|
||||
array(
|
||||
'primary' => array('id'),
|
||||
'update' => array_diff(array_keys($data), array('id'))
|
||||
),
|
||||
array($data)
|
||||
);
|
||||
|
||||
set_cat_visible(array($_GET['cat_id']), $_POST['visible']);
|
||||
set_cat_status(array($_GET['cat_id']), $_POST['status']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user