Changeset 635 for trunk


Ignore:
Timestamp:
Dec 5, 2004, 10:28:40 PM (20 years ago)
Author:
plg
Message:
  • on picture.php, related categories under the element are displayed in global_rank order
  • when adding a new virtual category, initializes its global_rank
  • bug fixed : in admin/cat_list, false next rank
  • in admin/cat_modify, complete directory is calculated only if category is not virtual
  • admin/picture_modify rewritten : graphically nearer to admin/cat_modify, virtual associations are back
  • update_category partially rewritten : take an array of categories in parameter, becomes optionnaly recursive, use the set_random_representant function, set a random representant for categories with elements and no representant
  • bug fixed : on a search results screen, elements belonging to more than 1 category were shown more than once
  • bug fixed : in admin/cat_modify, changing a value in a textefield and hitting enter was setting a new random representant
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_list.php

    r632 r635  
    6363    // As we don't create a virtual category every day, let's do (far) too
    6464    // much queries
    65     if ($parent_id != 'NULL')
    66     {
    67       $query = '
    68 SELECT uppercats
    69   FROM '.CATEGORIES_TABLE.'
    70   WHERE id = '.$parent_id.'
    71 ;';
    72       $parent_uppercats = array_pop(mysql_fetch_array(pwg_query($query)));
    73     }
    74        
     65   
    7566    // we have then to add the virtual category
    7667    $query = '
     
    8879;';
    8980    $my_id = array_pop(mysql_fetch_array(pwg_query($query)));
    90 
    91     $query = '
    92 UPDATE '.CATEGORIES_TABLE.'
    93   SET uppercats = \'';
     81   
     82    if ($parent_id != 'NULL')
     83    {
     84      $query = '
     85SELECT uppercats, global_rank
     86  FROM '.CATEGORIES_TABLE.'
     87  WHERE id = '.$parent_id.'
     88;';
     89      $result = pwg_query($query);
     90      $row = mysql_fetch_array($result);
     91     
     92      $parent_uppercats = $row['uppercats'];
     93      $parent_global_rank = $row['global_rank'];
     94    }
     95
     96    $query = '
     97UPDATE '.CATEGORIES_TABLE.'
     98';
    9499    if (!empty($parent_uppercats))
    95100    {
    96       $query.= $parent_uppercats.',';
    97     }
    98     $query.= $my_id;
    99     $query.= '\'
     101      $query.= "  SET uppercats = CONCAT('".$parent_uppercats."',',',id)";
     102    }
     103    else
     104    {
     105      $query.= '  SET uppercats = id';
     106    }
     107    if (!empty($parent_global_rank))
     108    {
     109      $query.= "  , global_rank = CONCAT('".$parent_global_rank."','.',rank)";
     110    }
     111    else
     112    {
     113      $query.= '  , uppercats = id';
     114    }
     115    $query.= '
    100116  WHERE id = '.$my_id.'
    101117;';
     
    277293$template->set_filenames(array('categories'=>'admin/cat_list.tpl'));
    278294
     295$form_action = PHPWG_ROOT_PATH.'admin.php?page=cat_list';
     296if (isset($_GET['parent_id']))
     297{
     298  $form_action.= '&parent_id='.$_GET['parent_id'];
     299}
     300
    279301$template->assign_vars(array(
    280302  'CATEGORIES_NAV'=>$navigation,
    281   'NEXT_RANK'=>count($categories)+1,
     303  'NEXT_RANK'=>max(array_keys($categories))+1,
     304  'F_ACTION'=>$form_action,
    282305 
    283306  'L_ADD_VIRTUAL'=>$lang['cat_add'],
  • trunk/admin/cat_modify.php

    r633 r635  
    102102
    103103// Navigation path
    104 $current_category = get_cat_info($_GET['cat_id']);
    105104$url = PHPWG_ROOT_PATH.'admin.php?page=cat_list&parent_id=';
    106105$navigation = '<a class="" href="'.add_session_id(PHPWG_ROOT_PATH.'admin.php?page=cat_list').'">';
    107106$navigation.= $lang['home'].'</a> <span style="font-size:15px">&rarr;</span>';
    108 $navigation.= get_cat_display_name(
    109   $current_category['name'],
     107
     108$navigation.= get_cat_display_name_cache(
     109  $category['uppercats'],
    110110  ' <span style="font-size:15px">&rarr;</span>',
    111111  $url);
     
    137137  'CAT_NAME'=>$category['name'],
    138138  'CAT_COMMENT'=>$category['comment'],
    139   'CATEGORY_DIR'=>preg_replace('/\/$/', '', get_complete_dir($category['id'])),
    140139 
    141140  $status=>'checked="checked"',
     
    185184if (!empty($category['dir']))
    186185{
    187   $template->assign_block_vars('storage' ,array());
     186  $template->assign_block_vars(
     187    'storage',
     188    array('CATEGORY_DIR'=>preg_replace('/\/$/',
     189                                       '',
     190                                       get_complete_dir($category['id']))));
    188191  $template->assign_block_vars('upload' ,array());
    189192}
  • trunk/admin/include/functions.php

    r633 r635  
    442442
    443443/**
    444  * updates calculated informations about a category : date_last and
     444 * updates calculated informations about a set of categories : date_last and
    445445 * nb_images. It also verifies that the representative picture is really
    446  * linked to the category. Recursive.
     446 * linked to the category. Optionnaly recursive.
    447447 *
    448448 * @param mixed category id
     449 * @param boolean recursive
    449450 * @returns void
    450451 */
    451 function update_category($id = 'all')
    452 {
     452function update_category($ids = 'all', $recursive = false)
     453{
     454  // retrieving all categories to update
    453455  $cat_ids = array();
    454456 
     457  $query = '
     458SELECT id
     459  FROM '.CATEGORIES_TABLE;
     460  if (is_array($ids))
     461  {
     462    if ($recursive)
     463    {
     464      foreach ($ids as $num => $id)
     465      {
     466        if ($num == 0)
     467        {
     468          $query.= '
     469  WHERE ';
     470        }
     471        else
     472        {
     473          $query.= '
     474  OR    ';
     475        }
     476        $query.= 'uppercats REGEXP \'(^|,)'.$id.'(,|$)\'';
     477      }
     478    }
     479    else
     480    {
     481      $query.= '
     482  WHERE id IN ('.implode(',', $ids).')';
     483    }
     484  }
     485  $query.= '
     486;';
     487  $result = pwg_query( $query );
     488  while ( $row = mysql_fetch_array( $result ) )
     489  {
     490    array_push($cat_ids, $row['id']);
     491  }
     492  $cat_ids = array_unique($cat_ids);
     493
     494  if (count($cat_ids) == 0)
     495  {
     496    return false;
     497  }
     498 
     499  // calculate informations about categories retrieved
    455500  $query = '
    456501SELECT category_id,
    457502       COUNT(image_id) AS nb_images,
    458503       MAX(date_available) AS date_last
    459   FROM '.IMAGES_TABLE.'
    460     INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id';
    461   if (is_numeric($id))
    462   {
    463     $query.= '
    464   WHERE uppercats REGEXP \'(^|,)'.$id.'(,|$)\'';
    465   }
    466   $query.= '
     504  FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
     505  WHERE category_id IN ('.implode(',', $cat_ids).')
    467506  GROUP BY category_id
    468 ;';
    469   $result = pwg_query( $query );
     507';
     508  $result = pwg_query($query);
    470509  $datas = array();
    471510  while ( $row = mysql_fetch_array( $result ) )
    472511  {
    473     array_push($cat_ids, $row['category_id']);
    474512    array_push($datas, array('id' => $row['category_id'],
    475513                             'date_last' => $row['date_last'],
     
    480518  mass_updates(CATEGORIES_TABLE, $fields, $datas);
    481519
     520  $query = '
     521UPDATE '.CATEGORIES_TABLE.'
     522  SET representative_picture_id = NULL
     523  WHERE nb_images = 0
     524;';
     525  pwg_query($query);
     526 
    482527  if (count($cat_ids) > 0)
    483528  {
     529    $categories = array();
    484530    // find all categories where the setted representative is not possible
    485531    $query = '
     
    494540    while ($row = mysql_fetch_array($result))
    495541    {
    496       // set a new representative element for this category
    497       $query = '
    498 SELECT image_id
    499   FROM '.IMAGE_CATEGORY_TABLE.'
    500   WHERE category_id = '.$row['id'].'
    501   ORDER BY RAND()
    502   LIMIT 0,1
    503 ;';
    504       $sub_result = pwg_query($query);
    505       if (mysql_num_rows($sub_result) > 0)
    506       {
    507         list($representative) = mysql_fetch_array($sub_result);
    508         $query = '
    509 UPDATE '.CATEGORIES_TABLE.'
    510   SET representative_picture_id = '.$representative.'
    511   WHERE id = '.$row['id'].'
    512 ;';
    513         pwg_query($query);
    514       }
    515       else
    516       {
    517         $query = '
    518 UPDATE '.CATEGORIES_TABLE.'
    519   SET representative_picture_id = NULL
    520   WHERE id = '.$row['id'].'
    521 ;';
    522         pwg_query($query);
    523       }
    524     }
     542      array_push($categories, $row['id']);
     543    }
     544    // find categories with elements and with no representant
     545    $query = '
     546SELECT id
     547  FROM '.CATEGORIES_TABLE.'
     548  WHERE representative_picture_id IS NULL
     549    AND nb_images != 0
     550;';
     551    $result = pwg_query($query);
     552    while ($row = mysql_fetch_array($result))
     553    {
     554      array_push($categories, $row['id']);
     555    }
     556
     557    $categories = array_unique($categories);
     558    set_random_representant($categories);
    525559  }
    526560}
  • trunk/admin/picture_modify.php

    r606 r635  
    8484  $query.= ';';
    8585  pwg_query($query);
    86   // make the picture representative of a category ?
     86}
     87// associate the element to other categories than its storage category
     88if (isset($_POST['associate'])
     89    and isset($_POST['cat_dissociated'])
     90    and count($_POST['cat_dissociated']) > 0)
     91{
     92  $datas = array();
     93  foreach ($_POST['cat_dissociated'] as $category_id)
     94  {
     95    array_push($datas, array('image_id' => $_GET['image_id'],
     96                             'category_id' => $category_id));
     97  }
     98  mass_inserts(IMAGE_CATEGORY_TABLE, array('image_id', 'category_id'), $datas);
     99
     100  update_category($_POST['cat_dissociated']);
     101}
     102// dissociate the element from categories (but not from its storage category)
     103if (isset($_POST['dissociate'])
     104    and isset($_POST['cat_associated'])
     105    and count($_POST['cat_associated']) > 0)
     106{
    87107  $query = '
    88 SELECT DISTINCT(category_id) as category_id,representative_picture_id
    89   FROM '.IMAGE_CATEGORY_TABLE.' AS ic, '.CATEGORIES_TABLE.' AS c
    90   WHERE c.id = ic.category_id
    91     AND image_id = '.$_GET['image_id'].'
    92 ;';
    93   $result = pwg_query($query);
    94   while ($row = mysql_fetch_array($result))
    95   {
    96     // if the user ask the picture to be the representative picture of its
    97     // category, the category is updated in the database (without wondering
    98     // if this picture was already the representative one)
    99     if (isset($_POST['representative-'.$row['category_id']]))
    100     {
    101       $query = 'UPDATE '.CATEGORIES_TABLE;
    102       $query.= ' SET representative_picture_id = '.$_GET['image_id'];
    103       $query.= ' WHERE id = '.$row['category_id'];
    104       $query.= ';';
    105       pwg_query($query);
    106     }
    107     // if the user ask this picture to be not any more the representative,
    108     // we have to set the representative_picture_id of this category to NULL
    109     else if (isset($row['representative_picture_id'])
    110              and $row['representative_picture_id'] == $_GET['image_id'])
    111     {
    112       $query = '
    113 UPDATE '.CATEGORIES_TABLE.'
    114   SET representative_picture_id = NULL
    115   WHERE id = '.$row['category_id'].'
    116 ;';
    117       pwg_query($query);
    118     }
    119   }
    120   $associate_or_dissociate = false;
    121   // associate with a new category ?
    122   if ($_POST['associate'] != '-1' and $_POST['associate'] != '')
    123   {
    124     // does the uppercat id exists in the database ?
    125     if (!is_numeric($_POST['associate']))
    126     {
    127       array_push($errors, $lang['cat_unknown_id']);
    128     }
    129     else
    130     {
    131       $query = '
    132 SELECT id
    133   FROM '.CATEGORIES_TABLE.'
    134   WHERE id = '.$_POST['associate'].'
    135 ;';
    136       if (mysql_num_rows(pwg_query($query)) == 0)
    137         array_push($errors, $lang['cat_unknown_id']);
    138     }
    139   }
    140   if ($_POST['associate'] != '-1'
    141        and $_POST['associate'] != ''
    142        and count($errors) == 0)
    143   {
    144     $query = '
    145 INSERT INTO '.IMAGE_CATEGORY_TABLE.'
    146   (category_id,image_id)
    147   VALUES
    148   ('.$_POST['associate'].','.$_GET['image_id'].')
    149 ;';
    150     pwg_query($query);
    151     $associate_or_dissociate = true;
    152     update_category($_POST['associate']);
    153   }
    154   // dissociate any category ?
    155   // retrieving all the linked categories
    156   $query = '
    157 SELECT DISTINCT(category_id) as category_id
    158   FROM '.IMAGE_CATEGORY_TABLE.'
    159   WHERE image_id = '.$_GET['image_id'].'
    160 ;';
    161   $result = pwg_query($query);
    162   while ($row = mysql_fetch_array($result))
    163   {
    164     if (isset($_POST['dissociate-'.$row['category_id']]))
    165     {
    166       $query = '
    167108DELETE FROM '.IMAGE_CATEGORY_TABLE.'
    168109  WHERE image_id = '.$_GET['image_id'].'
    169   AND category_id = '.$row['category_id'].'
    170 ;';
    171       pwg_query($query);
    172       $associate_or_dissociate = true;
    173       update_category($row['category_id']);
    174     }
    175   }
    176   if ($associate_or_dissociate)
    177   {
    178     synchronize_all_users();
    179   }
     110    AND category_id IN ('.implode(',',$_POST['cat_associated'] ).')
     111';
     112  pwg_query($query);
     113  update_category($_POST['cat_associated']);
    180114}
    181115
    182116// retrieving direct information about picture
    183117$query = '
    184 SELECT *
    185   FROM '.IMAGES_TABLE.'
    186   WHERE id = '.$_GET['image_id'].'
     118SELECT i.*, c.uppercats
     119  FROM '.IMAGES_TABLE.' AS i
     120   INNER JOIN '.CATEGORIES_TABLE.' AS c ON i.storage_category_id = c.id
     121  WHERE i.id = '.$_GET['image_id'].'
    187122;';
    188123$row = mysql_fetch_array(pwg_query($query));
    189124
     125$storage_category_id = $row['storage_category_id'];
     126
    190127if (empty($row['name']))
    191128{
     
    197134}
    198135// Navigation path
    199 $current_category = get_cat_info($row['storage_category_id']);
    200 $dir_path = get_cat_display_name($current_category['name'], '-&gt;', '');
    201 
    202136$thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']);
    203137
     
    205139$url_img .= '&amp;cat='.$row['storage_category_id'];
    206140$date = isset($_POST['date_creation']) && empty($errors)
    207           ?$_POST['date_creation']:date_convert_back(@$row['date_creation']);
    208 
    209 // retrieving all the linked categories
    210 $query = '
    211 SELECT DISTINCT(category_id) AS category_id,status,visible
    212        ,representative_picture_id
    213   FROM '.IMAGE_CATEGORY_TABLE.','.CATEGORIES_TABLE.'
    214   WHERE image_id = '.$_GET['image_id'].'
    215     AND category_id = id
    216 ;';
    217 $result = pwg_query($query);
    218 $categories = '';
    219 while ($cat_row = mysql_fetch_array($result))
    220 {
    221   $cat_infos = get_cat_info($cat_row['category_id']);
    222   $cat_name = get_cat_display_name($cat_infos['name'], ' &gt; ', '');
    223   $categories.='<option value="'.$cat_row['category_id'].'">'.$cat_name.'</option>';
    224 }
    225 
     141?$_POST['date_creation']:date_convert_back(@$row['date_creation']);
     142         
     143$storage_category = get_cat_display_name_cache($row['uppercats'],
     144                                               ' &rarr; ',
     145                                               '',
     146                                               false);
    226147//----------------------------------------------------- template initialization
    227148$template->set_filenames(array('picture_modify'=>'admin/picture_modify.tpl'));
    228149$template->assign_vars(array(
    229150  'TITLE_IMG'=>$title,
    230   'DIR_IMG'=>$dir_path,
     151  'STORAGE_CATEGORY_IMG'=>$storage_category,
     152  'PATH_IMG'=>$row['path'],
    231153  'FILE_IMG'=>$row['file'],
    232154  'TN_URL_IMG'=>$thumbnail_url,
     
    242164  'KEYWORDS_IMG'=>isset($_POST['keywords'])?$_POST['keywords']:@$row['keywords'],
    243165  'COMMENT_IMG'=>isset($_POST['comment'])?$_POST['comment']:@$row['comment'],
    244   'ASSOCIATED_CATEGORIES'=>$categories,
    245166 
    246167  'L_UPLOAD_NAME'=>$lang['upload_name'],
     
    258179  'L_INFOIMAGE_ASSOCIATE'=>$lang['infoimage_associate'],
    259180  'L_SUBMIT'=>$lang['submit'],
     181  'L_RESET'=>$lang['reset'],
     182  'L_CAT_ASSOCIATED'=>$lang['cat_associated'],
     183  'L_CAT_DISSOCIATED'=>$lang['cat_dissociated'],
     184  'L_PATH'=>$lang['path'],
     185  'L_STORAGE_CATEGORY'=>$lang['storage_category'],
    260186 
    261187  'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?'.$_SERVER['QUERY_STRING'])
     
    263189 
    264190//-------------------------------------------------------------- errors display
    265 if (sizeof($errors) != 0)
     191if (count($errors) != 0)
    266192{
    267193  $template->assign_block_vars('errors',array());
    268   for ($i = 0; $i < sizeof($errors); $i++)
    269   {
    270     $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i]));
    271   }
    272 }
    273 
    274 // if there are linked category other than the storage category, we show
    275 // propose the dissociate text
    276 if (mysql_num_rows($result) > 0)
    277 {
    278   //$vtp->addSession($sub, 'dissociate');
    279   //$vtp->closeSession($sub, 'dissociate');
    280 }
     194  foreach ($errors as $error)
     195  {
     196    $template->assign_block_vars('errors.error',array('ERROR'=>$error));
     197  }
     198}
     199
    281200// associate to another category ?
    282 //
    283 // We only show a List Of Values if the number of categories is less than
    284 // $conf['max_LOV_categories']
    285 $query = 'SELECT COUNT(id) AS nb_total_categories';
    286 $query.= ' FROM '.CATEGORIES_TABLE.';';
    287 $row = mysql_fetch_array(pwg_query($query));
    288 if ($row['nb_total_categories'] < $conf['max_LOV_categories'])
    289 {
    290   $template->assign_block_vars('associate_LOV',array());
    291   $template->assign_block_vars('associate_LOV.associate_cat',array(
    292         ));
    293   /*$vtp->addSession($sub, 'associate_LOV');
    294   $vtp->addSession($sub, 'associate_cat');
    295   $vtp->setVar($sub, 'associate_cat.value', '-1');
    296   $vtp->setVar($sub, 'associate_cat.content', '');
    297   $vtp->closeSession($sub, 'associate_cat');
    298   $page['plain_structure'] = get_plain_structure(true);
    299   $structure = create_structure('', array());
    300   display_categories($structure, '&nbsp;');
    301   $vtp->closeSession($sub, 'associate_LOV');*/
    302 }
    303 
     201$query = '
     202SELECT id,name,uppercats,global_rank
     203  FROM '.CATEGORIES_TABLE.'
     204    INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = category_id
     205  WHERE image_id = '.$_GET['image_id'].'
     206    AND id != '.$storage_category_id.'
     207;';
     208display_select_cat_wrapper($query,array(),'associated_option');
     209
     210$result = pwg_query($query);
     211$associateds = array($storage_category_id);
     212while ($row = mysql_fetch_array($result))
     213{
     214  array_push($associateds, $row['id']);
     215}
     216$query = '
     217SELECT id,name,uppercats,global_rank
     218  FROM '.CATEGORIES_TABLE.'
     219  WHERE id NOT IN ('.implode(',', $associateds).')
     220;';
     221display_select_cat_wrapper($query,array(),'dissociated_option');
    304222//----------------------------------------------------------- sending html code
    305223$template->assign_var_from_handle('ADMIN_CONTENT', 'picture_modify');
  • trunk/include/category_default.inc.php

    r621 r635  
    3939 
    4040$query = '
    41 SELECT DISTINCT(id),path,file,date_available,category_id
     41SELECT DISTINCT(id),path,file,date_available
    4242       ,tn_ext,name,filesize,storage_category_id,average_rate
    4343  FROM '.IMAGES_TABLE.' AS i
     
    9090  }
    9191  // url link on picture.php page
    92   $url_link = PHPWG_ROOT_PATH.'picture.php?';
    93   if ($page['cat'] == 'random')
    94   {
    95     $url_link.= 'cat='.$row['category_id'];
    96   }
    97   else
    98   {
    99    $url_link.= 'cat='.$page['cat'];
    100   }
     92  $url_link = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'];
    10193  $url_link.= '&amp;image_id='.$row['id'];
    10294  if ($page['cat'] == 'search')
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r633 r635  
    5454$lang['up'] = 'Move up';
    5555$lang['down'] = 'Move down';
     56$lang['path'] = 'path';
    5657
    5758// Specific words
     
    346347$lang['cat_list_virtual_category_deleted'] = 'virtual category deleted';
    347348$lang['set_random_representant'] = 'set new random representant';
     349$lang['cat_associated'] = 'virtually associated to';
     350$lang['cat_dissociated'] = 'dissociated from';
     351$lang['storage_category'] = 'storage category';
    348352?>
  • trunk/picture.php

    r613 r635  
    739739// related categories
    740740$query = '
    741 SELECT category_id
     741SELECT category_id,uppercats,commentable,global_rank
    742742  FROM '.IMAGE_CATEGORY_TABLE.'
     743    INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id
    743744  WHERE image_id = '.$_GET['image_id'];
    744745if ($user['forbidden_categories'] != '')
     
    750751;';
    751752$result = pwg_query($query);
    752 $categories = '';
     753$cat_array = array();
     754while ($row = mysql_fetch_array($result))
     755{
     756  array_push($cat_array, $row);
     757}
     758usort($cat_array, 'global_rank_compare');
     759
     760$cat_output = '';
    753761$page['show_comments'] = false;
    754 while ($row = mysql_fetch_array($result))
    755 {
    756   if ($categories != '')
    757   {
    758     $categories.= '<br />';
    759   }
    760   $cat_info = get_cat_info($row['category_id']);
    761   $categories .= get_cat_display_name($cat_info['name'], ' &gt;');
     762foreach ($cat_array as $category)
     763{
     764  if ($cat_output != '')
     765  {
     766    $cat_output.= '<br />';
     767  }
     768 
     769  if (count($cat_array) > 3)
     770  {
     771    $cat_output .= get_cat_display_name_cache($category['uppercats'],
     772                                              ' &rarr; ');
     773  }
     774  else
     775  {
     776    $cat_info = get_cat_info($category['category_id']);
     777    $cat_output .= get_cat_display_name($cat_info['name'], ' &rarr; ');
     778  }
    762779  // the picture is commentable if it belongs at least to one category which
    763780  // is commentable
    764   if ($cat_info['commentable'])
     781  if ($category['commentable'])
    765782  {
    766783    $page['show_comments'] = true;
     
    771788  array(
    772789    'INFO'  => $lang['categories'],
    773     'VALUE' => $categories
     790    'VALUE' => $cat_output
    774791    ));
    775792// metadata
  • trunk/template/default/admin/cat_list.tpl

    r589 r635  
    5353<!-- END category -->
    5454</table>
    55 <form action="" method="post">
     55<form action="{F_ACTION}" method="post">
    5656  {L_ADD_VIRTUAL} : <input type="text" name="virtual_name" />
    5757  <input type="hidden" name="rank" value="{NEXT_RANK}"/>
  • trunk/template/default/admin/cat_modify.tpl

    r633 r635  
    1414    </tr>
    1515    <!-- END representant -->
     16  </table>
     17</form>
     18<form action="{F_ACTION}" method="POST">
     19<table style="width:100%;">
    1620    <!-- BEGIN server -->
    1721    <tr>
     
    2933        <tr>
    3034      <td><strong>{L_STORAGE}</strong></td>
    31       <td class="row1">{CATEGORY_DIR}</td>
     35      <td class="row1">{storage.CATEGORY_DIR}</td>
    3236    </tr>
    3337        <!-- END storage -->
  • trunk/template/default/admin/picture_modify.tpl

    r509 r635  
    88</div>
    99<!-- END errors -->
    10 <div class="admin">{TITLE_IMG} [ {DIR_IMG} &gt; {FILE_IMG} ]</div>
    11 <form method="post" action="{F_ACTION}">
     10<div class="admin">{TITLE_IMG}</div>
     11<form action="{F_ACTION}" method="POST">
    1212  <table style="width:100%;">
    13     <tr valign="top">
    14       <td style="width:1px;">
    15           <a href="{URL_IMG}" class="thumbnail"><img src="{TN_URL_IMG}" alt="" class="miniature" /></a>
    16           </td>
    17       <td>
    18         <table>
    19           <tr>
    20             <td>{L_UPLOAD_NAME} :</td>
    21             <td><input type="text" name="name" value="{NAME_IMG}" /> [ {L_DEFAULT} : {DEFAULT_NAME_IMG} ]</td>
    22           </tr>
    23           <tr>
    24             <td>{L_FILE} :</td>
    25             <td>{FILE_IMG}</td>
    26           </tr>
    27           <tr>
    28             <td>{L_SIZE} :</td>
    29             <td>{SIZE_IMG}</td>
    30           </tr>
    31           <tr>
    32             <td>{L_FILESIZE} :</td>
    33             <td>{FILESIZE_IMG}</td>
    34           </tr>
    35           <tr>
    36             <td>{L_REGISTRATION_DATE} :</td>
    37             <td>{REGISTRATION_DATE_IMG}</td>
    38           </tr>
    39           <tr>
    40             <td>{L_AUTHOR} :</td>
    41             <td><input type="text" name="author" value="{AUTHOR_IMG}" /></td>
    42           </tr>
    43           <tr>
    44             <td>{L_CREATION_DATE} :</td>
    45             <td><input type="text" name="date_creation" value="{CREATION_DATE_IMG}" /></td>
    46           </tr>
    47           <tr>
    48             <td>{L_KEYWORDS} :</td>
    49             <td><input type="text" name="keywords" value="{KEYWORDS_IMG}" size="50" /></td>
    50           </tr>
    51           <tr>
    52             <td>{L_COMMENT} :</td>
    53             <td><textarea name="comment" rows="5" cols="50" style="overflow:auto">{COMMENT_IMG}</textarea></td>
    54           </tr>
    55           <tr>
    56             <td valign="top">{L_CATEGORIES} :</td>
    57             <td>
    58               <select style="width:280px" name="cat_data[]" multiple="multiple" size="5">
    59                                   {ASSOCIATED_CATEGORIES}
    60                           </select>
    61                         </td>
    62                   </tr>
    63           <tr><td colspan="2">&nbsp;</td></tr>
    64                 <tr>
    65                   <td>{L_INFOIMAGE_ASSOCIATE}</td>
    66                                   <td>
    67                     <!-- BEGIN associate_LOV -->
    68                     <select name="associate">
    69                       <!-- BEGIN associate_cat -->
    70                       <option value="{associate_LOV.associate_cat.VALUE_CAT}">{associate_LOV.associate_cat.VALUE_CONTENT}</option>
    71                       <!-- END associate_cat -->
    72                     </select>
    73                     <!-- END associate_LOV -->
    74                     <!-- BEGIN associate_text -->
    75                     <input type="text" name="associate" />
    76                     <!-- END associate_text -->
    77                     </select>
    78                   </td>
    79                 </tr>
    80               </table>
    81       </td>
     13    <tr>
     14      <td colspan="2" align="center"><a href="{URL_IMG}" class="thumbnail"><img src="{TN_URL_IMG}" alt="" class="miniature" /></a></td>
     15    </tr>
     16    <tr>
     17      <td style="width:50%;"><strong>{L_UPLOAD_NAME}</strong></td>
     18      <td class="row1"><input type="text" name="name" value="{NAME_IMG}" /> [ {L_DEFAULT} : {DEFAULT_NAME_IMG} ]</td>
     19    </tr>
     20    <tr>
     21      <td style="width:50%;"><strong>{L_FILE}</strong></td>
     22      <td class="row1">{FILE_IMG}</td>
     23    </tr>
     24    <tr>
     25      <td style="width:50%;"><strong>{L_SIZE}</strong></td>
     26      <td class="row1">{SIZE_IMG}</td>
     27    </tr>
     28    <tr>
     29      <td style="width:50%;"><strong>{L_FILESIZE}</strong></td>
     30      <td class="row1">{FILESIZE_IMG}</td>
     31    </tr>
     32    <tr>
     33      <td style="width:50%;"><strong>{L_REGISTRATION_DATE}</strong></td>
     34      <td class="row1">{REGISTRATION_DATE_IMG}</td>
     35    </tr>
     36    <tr>
     37      <td style="width:50%;"><strong>{L_PATH}</strong></td>
     38      <td class="row1">{PATH_IMG}</td>
     39    </tr>
     40    <tr>
     41      <td style="width:50%;"><strong>{L_STORAGE_CATEGORY}</strong></td>
     42      <td class="row1">{STORAGE_CATEGORY_IMG}</td>
     43    </tr>
     44    <tr>
     45      <td style="width:50%;"><strong>{L_AUTHOR}</strong></td>
     46      <td class="row1"><input type="text" name="author" value="{AUTHOR_IMG}" /></td>
     47    </tr>
     48    <tr>
     49      <td style="width:50%;"><strong>{L_CREATION_DATE}</strong></td>
     50      <td class="row1"><input type="text" name="date_creation" value="{CREATION_DATE_IMG}" /></td>
     51    </tr>
     52    <tr>
     53      <td style="width:50%;"><strong>{L_KEYWORDS}</strong></td>
     54      <td class="row1"><input type="text" name="keywords" value="{KEYWORDS_IMG}" size="50" /></td>
     55    </tr>
     56    <tr>
     57      <td style="width:50%;"><strong>{L_COMMENT}</strong></td>
     58      <td class="row1"><textarea name="comment" rows="5" cols="50" style="overflow:auto">{COMMENT_IMG}</textarea></td>
    8259    </tr>
    8360    <tr>
     
    8764      <td colspan="2" align="center">
    8865        <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" />
     66        <input type="reset" name="reset" value="{L_RESET}" class="bouton" />
    8967      </td>
    9068    </tr>
    9169  </table>
    9270</form>
     71
     72<form name="form1" method="post" action="{F_ACTION}" style="text-align:center;width:800px;">
     73
     74  <div style="clear:both;"></div>
     75
     76  <div style="height:auto;">
     77
     78    <div style="float:left;padding:10px;width:300px;">
     79      <span class="titreMenu">{L_CAT_ASSOCIATED}</span><br />
     80      <select style="height:auto;width:280px" name="cat_associated[]" multiple="multiple" size="10">
     81        <!-- BEGIN associated_option -->
     82        <option class="{associated_option.CLASS}" {associated_option.SELECTED} value="{associated_option.VALUE}">{associated_option.OPTION}</option>
     83        <!-- END associated_option -->
     84      </select>
     85    </div>
     86
     87    <div style="float:left;padding-top:80px;padding-bottom:80px;text-align:center;width:160px;" >
     88      <input type="submit" value="&larr;" name="associate" style="font-size:15px;" class="bouton" /><br/>
     89      <input type="submit" value="&rarr;" name="dissociate" style="font-size:15px;" class="bouton" />
     90    </div>
     91
     92    <div style="float:right;padding:10px;width:300px;">
     93      <span class="titreMenu">{L_CAT_DISSOCIATED}</span><br />
     94      <select style="width:280px" name="cat_dissociated[]" multiple="multiple" size="10">
     95        <!-- BEGIN dissociated_option -->
     96        <option class="{dissociated_option.CLASS}" {dissociated_option.SELECTED} value="{dissociated_option.VALUE}">{dissociated_option.OPTION}</option>
     97        <!-- END dissociated_option -->
     98      </select>
     99    </div>
     100
     101  </div>
     102
     103  <div style="clear:both;"></div>
     104
     105  <input type="reset" name="reset" value="{L_RESET}" class="bouton" />
     106
     107</form>
Note: See TracChangeset for help on using the changeset viewer.