Changeset 825


Ignore:
Timestamp:
Aug 18, 2005, 7:59:00 PM (19 years ago)
Author:
plg
Message:
  • 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 $fieldsupdate 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)
Location:
trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r809 r825  
    4040
    4141//--------------------------------------------------------- form criteria check
    42 if ( isset( $_POST['submit'] ) )
    43 {
    44   $query = 'UPDATE '.CATEGORIES_TABLE;
    45   $query.= ' SET name = ';
    46   if ( empty($_POST['name']))
    47     $query.= 'NULL';
    48   else
    49     $query.= "'".htmlentities( $_POST['name'], ENT_QUOTES)."'";
    50 
    51   $query.= ', comment = ';
    52   if ( empty($_POST['comment']))
    53     $query.= 'NULL';
    54   else
    55     $query.= "'".htmlentities( $_POST['comment'], ENT_QUOTES )."'";
    56 
    57   if ( isset( $_POST['uploadable'] ) )
    58     $query.= ", uploadable = '".$_POST['uploadable']."'";
    59 
    60   if ( isset( $_POST['commentable'] ) )
    61     $query.= ", commentable = '".$_POST['commentable']."'";
    62 
    63   if ( isset( $_POST['associate'] ) )
    64   {
    65     $query.= ', id_uppercat = ';
    66     if ( $_POST['associate'] == -1 or $_POST['associate'] == '' )
    67       $query.= 'NULL';
    68     else
    69       $query.= $_POST['associate'];
    70   }
    71   $query.= ' WHERE id = '.$_GET['cat_id'];
    72   $query.= ';';
    73   pwg_query( $query );
    74 
     42if (isset($_POST['submit']))
     43{
     44  $data =
     45    array(
     46      'id' => $_GET['cat_id'],
     47      'name' => @$_POST['name'],
     48      'commentable' => $_POST['commentable'],
     49      'uploadable' =>
     50        isset($_POST['uploadable']) ? $_POST['uploadable'] : 'false',
     51      'comment' =>
     52        $conf['allow_html_descriptions'] ?
     53          @$_POST['comment'] : strip_tags(@$_POST['comment'])
     54      );
     55
     56  mass_updates(
     57    CATEGORIES_TABLE,
     58    array(
     59      'primary' => array('id'),
     60      'update' => array_diff(array_keys($data), array('id'))
     61      ),
     62    array($data)
     63    );
     64 
    7565  set_cat_visible(array($_GET['cat_id']), $_POST['visible']);
    7666  set_cat_status(array($_GET['cat_id']), $_POST['status']);
  • trunk/admin/cat_perm.php

    r817 r825  
    202202$template->assign_vars(
    203203  array(
    204     'TITLE' =>
    205       sprintf(
    206         l10n('Manage permissions for category "%s"'),
    207         get_cat_display_name_from_id($page['cat'])
    208         )
     204    'CATEGORIES_NAV' =>
     205      get_cat_display_name_from_id(
     206        $page['cat'],
     207        'admin.php?page=cat_modify&cat_id='
     208        ),
    209209    'F_ACTION' =>
    210210      add_session_id(
  • trunk/admin/include/functions.php

    r809 r825  
    583583}
    584584
    585 // get_keywords returns an array with relevant keywords found in the string
    586 // given in argument. Keywords must be separated by comma in this string.
    587 // keywords must :
    588 //   - be longer or equal to 3 characters
    589 //   - not contain ', " or blank characters
    590 //   - unique in the string ("test,test" -> "test")
    591 function get_keywords( $keywords_string )
    592 {
    593   $keywords = array();
    594 
    595   $candidates = explode( ',', $keywords_string );
    596   foreach ( $candidates as $candidate ) {
    597     if ( strlen($candidate) >= 3 and !preg_match( '/(\'|"|\s)/', $candidate ) )
    598       array_push( $keywords, $candidate );
    599   }
    600 
    601   return array_unique( $keywords );
     585/**
     586 * returns an array with relevant keywords found in the given string.
     587 *
     588 * Keywords must be separated by comma or space characters.
     589 *
     590 * @param string keywords_string
     591 * @return array
     592 */
     593function get_keywords($keywords_string)
     594{
     595  return
     596    array_unique(
     597      preg_split(
     598        '/[\s,]+/',
     599        $keywords_string
     600        )
     601      );
    602602}
    603603
     
    743743UPDATE '.$tablename.'
    744744  SET ';
     745      $is_first = true;
    745746      foreach ($dbfields['update'] as $num => $key)
    746747      {
    747         if ($num >= 1)
     748        if (!$is_first)
    748749        {
    749750          $query.= ",\n      ";
    750751        }
    751752        $query.= $key.' = ';
    752         if (isset($data[$key]))
     753        if (isset($data[$key]) and $data[$key] != '')
    753754        {
    754755          $query.= '\''.$data[$key].'\'';
     
    758759          $query.= 'NULL';
    759760        }
     761        $is_first = false;
    760762      }
    761763      $query.= '
  • trunk/admin/include/functions_metadata.php

    r738 r825  
    205205  return $files;
    206206}
     207
     208// used_metadata string is displayed to inform admin which metadata will be
     209// used from files for synchronization
     210function get_used_metadata_list()
     211{
     212  global $conf;
     213 
     214  $used_metadata = array('filesize', 'width', 'height');
     215
     216  if ($conf['use_exif'])
     217  {
     218    array_push($used_metadata, 'date_creation');
     219  }
     220
     221  if ($conf['use_iptc'])
     222  {
     223    foreach (array_keys($conf['use_iptc_mapping']) as $key)
     224    {
     225      array_push($used_metadata, $key);
     226    }
     227  }
     228
     229  return array_unique($used_metadata);
     230}
    207231?>
  • trunk/admin/picture_modify.php

    r817 r825  
    2828if(!defined("PHPWG_ROOT_PATH"))
    2929{
    30   die ("Hacking attempt!");
     30  die('Hacking attempt!');
    3131}
    3232include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php');
     33
     34// +-----------------------------------------------------------------------+
     35// |                          synchronize metadata                         |
     36// +-----------------------------------------------------------------------+
     37
     38if (isset($_GET['sync_metadata']))
     39{
     40  $query = '
     41SELECT path
     42  FROM '.IMAGES_TABLE.'
     43  WHERE id = '.$_GET['image_id'].'
     44;';
     45  list($path) = mysql_fetch_row(pwg_query($query));
     46  update_metadata(array($_GET['image_id'] => $path));
     47
     48  array_push($page['infos'], l10n('Metadata synchronized from file'));
     49}
     50
    3351//--------------------------------------------------------- update informations
     52
    3453// first, we verify whether there is a mistake on the given creation date
    35 if (isset($_POST['date_creation']) and !empty($_POST['date_creation']))
    36 {
    37   if (!check_date_format($_POST['date_creation']))
     54if (isset($_POST['date_creation_action'])
     55    and 'set' == $_POST['date_creation_action'])
     56{
     57  if (!checkdate(
     58        $_POST['date_creation_month'],
     59        $_POST['date_creation_day'],
     60        $_POST['date_creation_year'])
     61    )
    3862  {
    3963    array_push($page['errors'], $lang['err_date']);
    4064  }
    4165}
     66
    4267if (isset($_POST['submit']) and count($page['errors']) == 0)
    4368{
    44   $query = 'UPDATE '.IMAGES_TABLE.' SET name = ';
    45   if ($_POST['name'] == '')
    46     $query.= 'NULL';
     69  $data = array();
     70  $data{'id'} = $_GET['image_id'];
     71  $data{'name'} = $_POST['name'];
     72  $data{'author'} = $_POST['author'];
     73
     74  if ($conf['allow_html_descriptions'])
     75  {
     76    $data{'comment'} = @$_POST['description'];
     77  }
    4778  else
    48     $query.= "'".htmlentities($_POST['name'], ENT_QUOTES)."'";
    49  
    50   $query.= ', author = ';
    51   if ($_POST['author'] == '')
    52     $query.= 'NULL';
     79  {
     80    $data{'comment'} = strip_tags(@$_POST['description']);
     81  }
     82
     83  if (isset($_POST['date_creation_action']))
     84  {
     85    if ('set' == $_POST['date_creation_action'])
     86    {
     87      $data{'date_creation'} = $_POST['date_creation_year']
     88                                 .'-'.$_POST['date_creation_month']
     89                                 .'-'.$_POST['date_creation_day'];
     90    }
     91    else if ('unset' == $_POST['date_creation_action'])
     92    {
     93      $data{'date_creation'} = '';
     94    }
     95  }
     96
     97  $keywords = get_keywords($_POST['keywords']);
     98  if (count($keywords) > 0)
     99  {
     100    $data{'keywords'} = implode(',', $keywords);
     101  }
    53102  else
    54     $query.= "'".htmlentities($_POST['author'],ENT_QUOTES)."'";
    55 
    56   $query.= ', comment = ';
    57   if ($_POST['comment'] == '')
    58     $query.= 'NULL';
    59   else
    60     $query.= "'".htmlentities($_POST['comment'],ENT_QUOTES)."'";
    61 
    62   $query.= ', date_creation = ';
    63   if (!empty($_POST['date_creation']))
    64     $query.= "'".date_convert($_POST['date_creation'])."'";
    65   else if ($_POST['date_creation'] == '')
    66     $query.= 'NULL';
    67 
    68   $query.= ', keywords = ';
    69   $keywords_array = get_keywords($_POST['keywords']);
    70   if (count($keywords_array) == 0)
    71     $query.= 'NULL';
    72   else
    73   {
    74     $query.= "'";
    75     foreach ($keywords_array as $i => $keyword) {
    76       if ($i > 0) $query.= ',';
    77       $query.= $keyword;
    78     }
    79     $query.= "'";
    80   }
    81 
    82   $query.= ' WHERE id = '.$_GET['image_id'];
    83   $query.= ';';
    84   pwg_query($query);
     103  {
     104    $data{'keywords'} = '';
     105  }
     106
     107  mass_updates(
     108    IMAGES_TABLE,
     109    array(
     110      'primary' => array('id'),
     111      'update' => array_diff(array_keys($data), array('id'))
     112      ),
     113    array($data)
     114    );
     115
     116  array_push($page['infos'], l10n('Picture informations updated'));
    85117}
    86118// associate the element to other categories than its storage category
     
    138170// retrieving direct information about picture
    139171$query = '
    140 SELECT i.*, c.uppercats
    141   FROM '.IMAGES_TABLE.' AS i
    142    INNER JOIN '.CATEGORIES_TABLE.' AS c ON i.storage_category_id = c.id
    143   WHERE i.id = '.$_GET['image_id'].'
     172SELECT *
     173  FROM '.IMAGES_TABLE.'
     174  WHERE id = '.$_GET['image_id'].'
    144175;';
    145176$row = mysql_fetch_array(pwg_query($query));
     
    147178$storage_category_id = $row['storage_category_id'];
    148179
    149 if (empty($row['name']))
    150 {
    151   $title = str_replace('_', ' ',get_filename_wo_extension($row['file']));
    152 }
    153 else
    154 {
    155   $title = $row['name'];
    156 }
    157180// Navigation path
    158 $thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']);
    159 
    160 $url_img = PHPWG_ROOT_PATH.'picture.php?image_id='.$_GET['image_id'];
    161 $url_img .= '&cat='.$row['storage_category_id'];
     181
    162182$date = isset($_POST['date_creation']) && empty($page['errors'])
    163183?$_POST['date_creation']:date_convert_back(@$row['date_creation']);
    164184
    165 $url = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id=';
    166 $storage_category = get_cat_display_name_cache($row['uppercats'],
    167                                                $url,
    168                                                false);
    169 //----------------------------------------------------- template initialization
     185// +-----------------------------------------------------------------------+
     186// |                             template init                             |
     187// +-----------------------------------------------------------------------+
     188
    170189$template->set_filenames(
    171190  array(
     
    174193  );
    175194
    176 $template->assign_vars(array(
    177   'TITLE_IMG'=>$title,
    178   'STORAGE_CATEGORY_IMG'=>$storage_category,
    179   'PATH_IMG'=>$row['path'],
    180   'FILE_IMG'=>$row['file'],
    181   'TN_URL_IMG'=>$thumbnail_url,
    182   'URL_IMG'=>add_session_id($url_img),
    183   'DEFAULT_NAME_IMG'=>str_replace('_',' ',get_filename_wo_extension($row['file'])),
    184   'FILE_IMG'=>$row['file'],
    185   'NAME_IMG'=>isset($_POST['name'])?$_POST['name']:@$row['name'],
    186   'SIZE_IMG'=>@$row['width'].' * '.@$row['height'],
    187   'FILESIZE_IMG'=>@$row['filesize'].' KB',
    188   'REGISTRATION_DATE_IMG'
    189   => format_date($row['date_available'], 'mysql_datetime', true),
    190   'AUTHOR_IMG'=>isset($_POST['author'])?$_POST['author']:@$row['author'],
    191   'CREATION_DATE_IMG'=>$date,
    192   'KEYWORDS_IMG'=>isset($_POST['keywords'])?$_POST['keywords']:@$row['keywords'],
    193   'COMMENT_IMG'=>isset($_POST['comment'])?$_POST['comment']:@$row['comment'],
     195$template->assign_vars(
     196  array(
     197    'U_SYNC' =>
     198      add_session_id(
     199        PHPWG_ROOT_PATH.'admin.php?page=picture_modify'.
     200        '&image_id='.$_GET['image_id'].
     201        (isset($_GET['cat_id']) ? '&cat_id='.$_GET['cat_id'] : '').
     202        '&sync_metadata=1'
     203        ),
     204   
     205    'PATH'=>$row['path'],
     206   
     207    'TN_SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']),
     208   
     209    'NAME' =>
     210      isset($_POST['name']) ?
     211        stripslashes($_POST['name']) : @$row['name'],
     212   
     213    'DIMENSIONS' => @$row['width'].' * '.@$row['height'],
     214   
     215    'FILESIZE' => @$row['filesize'].' KB',
     216   
     217    'REGISTRATION_DATE' =>
     218      format_date($row['date_available'], 'mysql_datetime', false),
     219   
     220    'AUTHOR' => isset($_POST['author']) ? $_POST['author'] : @$row['author'],
     221   
     222    'CREATION_DATE' => $date,
     223   
     224    'KEYWORDS' =>
     225      isset($_POST['keywords']) ?
     226        stripslashes($_POST['keywords']) : @$row['keywords'],
     227   
     228    'DESCRIPTION' =>
     229      isset($_POST['description']) ?
     230        stripslashes($_POST['description']) : @$row['comment'],
    194231 
    195   'L_UPLOAD_NAME'=>$lang['upload_name'],
    196   'L_DEFAULT'=>$lang['default'],
    197   'L_FILE'=>$lang['file'],
    198   'L_SIZE'=>$lang['size'],
    199   'L_FILESIZE'=>$lang['filesize'],
    200   'L_REGISTRATION_DATE'=>$lang['registration_date'],
    201   'L_AUTHOR'=>$lang['author'],
    202   'L_CREATION_DATE'=>$lang['creation_date'],
    203   'L_KEYWORDS'=>$lang['keywords'],
    204   'L_COMMENT'=>$lang['description'],
    205   'L_CATEGORIES'=>$lang['categories'],
    206   'L_DISSOCIATE'=>$lang['dissociate'],
    207   'L_INFOIMAGE_ASSOCIATE'=>$lang['infoimage_associate'],
    208   'L_SUBMIT'=>$lang['submit'],
    209   'L_RESET'=>$lang['reset'],
    210   'L_CAT_ASSOCIATED'=>$lang['infoimage_associated'],
    211   'L_CAT_DISSOCIATED'=>$lang['infoimage_dissociated'],
    212   'L_PATH'=>$lang['path'],
    213   'L_STORAGE_CATEGORY'=>$lang['storage_category'],
    214   'L_REPRESENTS'=>$lang['represents'],
    215   'L_DOESNT_REPRESENT'=>$lang['doesnt_represent'],
     232    'F_ACTION' =>
     233      add_session_id(
     234        PHPWG_ROOT_PATH.'admin.php'
     235        .get_query_string_diff(array('sync_metadata'))
     236        )
     237    )
     238  );
     239
     240// creation date
     241unset($day, $month, $year);
     242
     243if (isset($_POST['date_creation_action'])
     244    and 'set' == $_POST['date_creation_action'])
     245{
     246  foreach (array('day', 'month', 'year') as $varname)
     247  {
     248    $$varname = $_POST['date_creation_'.$varname];
     249  }
     250}
     251else if (isset($row['date_creation']) and !empty($row['date_creation']))
     252{
     253  list($year, $month, $day) = explode('-', $row['date_creation']);
     254}
     255else
     256{
     257  list($year, $month, $day) = array('', 0, 0);
     258}
     259get_day_list('date_creation_day', $day);
     260get_month_list('date_creation_month', $month);
     261$template->assign_vars(array('DATE_CREATION_YEAR_VALUE' => $year));
    216262 
    217   'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?'.$_SERVER['QUERY_STRING'])
    218  ));
     263$query = '
     264SELECT category_id, uppercats
     265  FROM '.IMAGE_CATEGORY_TABLE.' AS ic
     266    INNER JOIN '.CATEGORIES_TABLE.' AS c
     267      ON c.id = ic.category_id
     268  WHERE image_id = '.$_GET['image_id'].'
     269;';
     270$result = pwg_query($query);
     271
     272if (mysql_num_rows($result) > 1)
     273{
     274  $template->assign_block_vars('links', array());
     275}
     276
     277while ($row = mysql_fetch_array($result))
     278{
     279  $name =
     280    get_cat_display_name_cache(
     281      $row['uppercats'],
     282      PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id=',
     283      false
     284      );
     285   
     286  if ($row['category_id'] == $storage_category_id)
     287  {
     288    $template->assign_vars(array('STORAGE_CATEGORY' => $name));
     289  }
     290  else
     291  {
     292    $template->assign_block_vars('links.category', array('NAME' => $name));
     293  }
     294}
     295
     296// jump to link
     297//
     298// 1. find all linked categories that are reachable for the current user.
     299// 2. if a category is available in the URL, use it if reachable
     300// 3. if URL category not available or reachable, use the first reachable
     301//    linked category
     302// 4. if no category reachable, no jumpto link
     303$base_url_img = PHPWG_ROOT_PATH.'picture.php';
     304$base_url_img.= '?image_id='.$_GET['image_id'];
     305$base_url_img.= '&cat=';
     306unset($url_img);
     307
     308$query = '
     309SELECT category_id
     310  FROM '.IMAGE_CATEGORY_TABLE.'
     311  WHERE image_id = '.$_GET['image_id'].'
     312;';
     313$authorizeds = array_diff(
     314  array_from_query($query, 'category_id'),
     315  explode(',', calculate_permissions($user['id'], $user['status']))
     316  );
     317
     318if (isset($_GET['cat_id'])
     319    and in_array($_GET['cat_id'], $authorizeds))
     320{
     321  $url_img = $base_url_img.$_GET['cat_id'];
     322}
     323else
     324{
     325  foreach ($authorizeds as $category)
     326  {
     327    $url_img = $base_url_img.$category;
     328    break;
     329  }
     330}
     331
     332if (isset($url_img))
     333{
     334  $template->assign_block_vars(
     335    'jumpto',
     336    array(
     337      'URL' => $url_img
     338      )
     339    );
     340}
    219341 
    220342// associate to another category ?
     
    259381//----------------------------------------------------------- sending html code
    260382
    261 
    262383$template->assign_var_from_handle('ADMIN_CONTENT', 'picture_modify');
    263384?>
  • trunk/doc/ChangeLog

    r818 r825  
     12005-08-18 Pierrick LE GALL
     2
     3        * improvement : screen admin/picture_modify
     4        rewritten. Presentation copied from admin/cat_modify : fieldsets
     5        regroup fields. Ability to synchronize metadata for the displayed
     6        item.
     7
     8        * bug 110 fixed : "return to element view from element edition
     9        fails depending on permissions". If a reachable (for the connected
     10        admin) category is available, a "jump to" link is displayed, by
     11        default, using the category given in URL.
     12
     13        * bug fixed : in mass_updates function, the first item of
     14        $fields['update'] has not always 0 for id (as in any array).
     15
     16        * modification : get_keywords function understands spaces as
     17        separator, allow less than 3 chars keywords, allow quotes.
     18
     19        * new : ability to allow HTML in picture or category description
     20        (false by default)
     21
    1222005-08-17 Pierrick LE GALL
    223
  • trunk/include/config_default.inc.php

    r809 r825  
    266266// Maintenance].
    267267$conf['allow_random_representative'] = false;
     268
     269// allow_html_descriptions : authorize administrators to use HTML in
     270// category and element description.
     271$conf['allow_html_descriptions'] = true;
    268272?>
  • trunk/include/functions_html.inc.php

    r817 r825  
    260260    else
    261261    {
    262       $output.= '
    263 <a class="" href="'.add_session_id(PHPWG_ROOT_PATH.$url.$id).'">'.$name.'</a>';
     262      $output.= '<a class=""';
     263      $output.= ' href="'.add_session_id(PHPWG_ROOT_PATH.$url.$id).'">';
     264      $output.= $name.'</a>';
    264265    }
    265266  }
     
    456457{
    457458  $cat_info = get_cat_info($cat_id);
    458   get_cat_display_name($cat_info['id'], $url, $replace_space);
     459  return get_cat_display_name($cat_info['name'], $url, $replace_space);
    459460}
    460461?>
  • trunk/template/default/admin/cat_perm.tpl

    r817 r825  
    1 <h1>{TITLE}</h1>
     1<h1>{lang:Manage permissions for a category}</h1>
     2
     3<h2>{CATEGORIES_NAV}</h2>
    24
    35<form action="{F_ACTION}" method="post" id="categoryPermissions">
  • trunk/template/default/admin/picture_modify.tpl

    r817 r825  
    11<h1>{lang:title_picmod}</h1>
    22
    3 <div class="admin">{TITLE_IMG}</div>
    4 <form action="{F_ACTION}" method="POST">
    5   <table style="width:100%;">
    6     <tr>
    7       <td colspan="2" align="center"><a href="{URL_IMG}" class="thumbnail"><img src="{TN_URL_IMG}" alt="" class="miniature" /></a></td>
    8     </tr>
    9     <tr>
    10       <td style="width:50%;"><strong>{L_UPLOAD_NAME}</strong></td>
    11       <td class="row1"><input type="text" name="name" value="{NAME_IMG}" /> [ {L_DEFAULT} : {DEFAULT_NAME_IMG} ]</td>
    12     </tr>
    13     <tr>
    14       <td style="width:50%;"><strong>{L_FILE}</strong></td>
    15       <td class="row1">{FILE_IMG}</td>
    16     </tr>
    17     <tr>
    18       <td style="width:50%;"><strong>{L_SIZE}</strong></td>
    19       <td class="row1">{SIZE_IMG}</td>
    20     </tr>
    21     <tr>
    22       <td style="width:50%;"><strong>{L_FILESIZE}</strong></td>
    23       <td class="row1">{FILESIZE_IMG}</td>
    24     </tr>
    25     <tr>
    26       <td style="width:50%;"><strong>{L_REGISTRATION_DATE}</strong></td>
    27       <td class="row1">{REGISTRATION_DATE_IMG}</td>
    28     </tr>
    29     <tr>
    30       <td style="width:50%;"><strong>{L_PATH}</strong></td>
    31       <td class="row1">{PATH_IMG}</td>
    32     </tr>
    33     <tr>
    34       <td style="width:50%;"><strong>{L_STORAGE_CATEGORY}</strong></td>
    35       <td class="row1">{STORAGE_CATEGORY_IMG}</td>
    36     </tr>
    37     <tr>
    38       <td style="width:50%;"><strong>{L_AUTHOR}</strong></td>
    39       <td class="row1"><input type="text" name="author" value="{AUTHOR_IMG}" /></td>
    40     </tr>
    41     <tr>
    42       <td style="width:50%;"><strong>{L_CREATION_DATE}</strong></td>
    43       <td class="row1"><input type="text" name="date_creation" value="{CREATION_DATE_IMG}" /></td>
    44     </tr>
    45     <tr>
    46       <td style="width:50%;"><strong>{L_KEYWORDS}</strong></td>
    47       <td class="row1"><input type="text" name="keywords" value="{KEYWORDS_IMG}" size="50" /></td>
    48     </tr>
    49     <tr>
    50       <td style="width:50%;"><strong>{L_COMMENT}</strong></td>
    51       <td class="row1"><textarea name="comment" rows="5" cols="50" style="overflow:auto">{COMMENT_IMG}</textarea></td>
    52     </tr>
    53     <tr>
    54       <td colspan="2"><div style="margin-bottom:0px">&nbsp;</div></td>
    55     </tr>
    56     <tr>
    57       <td colspan="2" align="center">
    58         <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" />
    59         <input type="reset" name="reset" value="{L_RESET}" class="bouton" />
    60       </td>
    61     </tr>
    62   </table>
     3<img src="{TN_SRC}" alt="{lang:thumbnail}" class="thumbnail" />
     4
     5<ul class="categoryActions">
     6  <!-- BEGIN jumpto -->
     7  <li><a href="{jumpto.URL}" title="{lang:jump to image}"><img src="./template/default/theme/category_jump-to.png" alt="{lang:jump to}" /></a></li>
     8  <!-- END jumpto -->
     9  <li><a href="{U_SYNC}" title="{lang:synchronize metadata}"><img src="./template/default/theme/sync_metadata.png" alt="{lang:synchronize}" /></a></li>
     10</ul>
     11
     12<form action="{F_ACTION}" method="post">
     13
     14  <fieldset>
     15    <legend>{lang:Informations}</legend>
     16
     17    <table>
     18
     19      <tr>
     20        <td><strong>{lang:Path}</strong></td>
     21        <td>{PATH}</td>
     22      </tr>
     23
     24      <tr>
     25        <td><strong>{lang:Registration date}</strong></td>
     26        <td>{REGISTRATION_DATE}</td>
     27      </tr>
     28
     29      <tr>
     30        <td><strong>{lang:Dimensions}</strong></td>
     31        <td>{DIMENSIONS}</td>
     32      </tr>
     33
     34      <tr>
     35        <td><strong>{lang:Filesize}</strong></td>
     36        <td>{FILESIZE}</td>
     37      </tr>
     38
     39      <tr>
     40        <td><strong>{lang:Storage category}</strong></td>
     41        <td>{STORAGE_CATEGORY}</td>
     42      </tr>
     43
     44      <!-- BEGIN links -->
     45      <tr>
     46        <td><strong>{lang:Linked categories}</strong></td>
     47        <td>
     48          <ul>
     49            <!-- BEGIN category -->
     50            <li>{links.category.NAME}</li>
     51            <!-- END category -->
     52          </ul>
     53        </td>
     54      </tr>
     55      <!-- END links -->
     56
     57    </table>
     58
     59  </fieldset>
     60
     61  <fieldset>
     62    <legend>{lang:Properties}</legend>
     63
     64    <table>
     65
     66      <tr>
     67        <td><strong>{lang:Name}</strong></td>
     68        <td><input type="text" name="name" value="{NAME}" /></td>
     69      </tr>
     70
     71      <tr>
     72        <td><strong>{lang:Author}</strong></td>
     73        <td><input type="text" name="author" value="{AUTHOR}" /></td>
     74      </tr>
     75
     76      <tr>
     77        <td><strong>{lang:Creation date}</strong></td>
     78        <td>
     79          <label><input type="radio" name="date_creation_action" value="unset" /> unset</label>
     80          <input type="radio" name="date_creation_action" value="set" id="date_creation_action_set" /> set to
     81          <select onmousedown="document.getElementById('date_creation_action_set').checked = true;" name="date_creation_day">
     82            <!-- BEGIN date_creation_day -->
     83            <option {date_creation_day.SELECTED} value="{date_creation_day.VALUE}">{date_creation_day.OPTION}</option>
     84            <!-- END date_creation_day -->
     85          </select>
     86          <select onmousedown="document.getElementById('date_creation_action_set').checked = true;" name="date_creation_month">
     87            <!-- BEGIN date_creation_month -->
     88            <option {date_creation_month.SELECTED} value="{date_creation_month.VALUE}">{date_creation_month.OPTION}</option>
     89            <!-- END date_creation_month -->
     90          </select>
     91          <input onmousedown="document.getElementById('date_creation_action_set').checked = true;"
     92                 name="date_creation_year"
     93                 type="text"
     94                 size="4"
     95                 maxlength="4"
     96                 value="{DATE_CREATION_YEAR_VALUE}" />
     97        </td>
     98      </tr>
     99
     100      <tr>
     101        <td><strong>{lang:Keywords}</strong></td>
     102        <td><input type="text" name="keywords" value="{KEYWORDS}" size="50" /></td>
     103      </tr>
     104
     105      <tr>
     106        <td><strong>{lang:Description}</strong></td>
     107        <td><textarea name="description" rows="5" cols="50" style="overflow:auto">{DESCRIPTION}</textarea></td>
     108      </tr>
     109
     110    </table>
     111
     112    <p style="text-align:center;">
     113      <input type="submit" value="{lang:Submit}" name="submit" />
     114      <input type="reset" value="{lang:Reset}" name="reset" />
     115    </p>
     116
     117  </fieldset>
     118
    63119</form>
    64120
    65 <form name="form1" method="post" action="{F_ACTION}">
     121<form id="associations" method="post" action="{F_ACTION}#associations">
    66122  <fieldset>
    67123    <legend>{lang:Association to categories}</legend>
     
    70126      <tr>
    71127        <td>
    72           <h3>{L_CAT_ASSOCIATED}</h3>
     128          <h3>{lang:Associated}</h3>
    73129          <select class="categoryList" name="cat_associated[]" multiple="multiple" size="30">
    74130            <!-- BEGIN associated_option -->
     
    80136
    81137        <td>
    82           <h3>{L_CAT_DISSOCIATED}</h3>
     138          <h3>{lang:Dissociated}</h3>
    83139          <select class="categoryList" name="cat_dissociated[]" multiple="multiple" size="30">
    84140            <!-- BEGIN dissociated_option -->
     
    94150</form>
    95151
    96 <form name="form2" method="post" action="{F_ACTION}">
     152<form id="representation" method="post" action="{F_ACTION}#representation">
    97153  <fieldset>
    98154    <legend>{lang:Representation of categories}</legend>
     
    101157      <tr>
    102158        <td>
    103           <h3>{L_REPRESENTS}</h3>
     159          <h3>{lang:Represents}</h3>
    104160          <select class="categoryList" name="cat_elected[]" multiple="multiple" size="30">
    105161            <!-- BEGIN elected_option -->
     
    111167
    112168        <td>
    113           <h3>{L_DOESNT_REPRESENT}</h3>
     169          <h3>{lang:Does not represent}</h3>
    114170          <select class="categoryList" name="cat_dismissed[]" multiple="multiple" size="30">
    115171            <!-- BEGIN dismissed_option -->
  • trunk/template/default/default.css

    r818 r825  
    425425  float: right;
    426426  margin-top: 5px;
     427}
     428
     429ul.categoryActions {
     430  margin: 5px;
     431  padding: 5px;
    427432}
    428433
     
    606611  font-style: italic;
    607612}
     613
     614div#adminMain img.thumbnail {
     615  border: 1px solid white;
     616  margin: 0 auto;
     617  display: block;
     618}
Note: See TracChangeset for help on using the changeset viewer.