Ignore:
Timestamp:
May 2, 2008, 11:56:21 PM (16 years ago)
Author:
rub
Message:

Resolved issue 0000823: Enhance upload functionalities

First commit, others will be follow.
Not hesitate to change my translations.

Add upload configuration tabsheet (move and add configuration)
Change and add define for access level
Can show upload link every time
Can restrict access upload.class.php
Can choice category on upload page
Add upload class not use for the moment
Review quickly and temporary style of upload.tpl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_category.inc.php

    r2299 r2325  
    453453}
    454454
     455/**
     456 * returns the link of upload menu
     457 *
     458 * @param null
     459 * @return string or null
     460 */
     461function get_upload_menu_link()
     462{
     463  global $conf, $page, $user;
     464
     465  $show_link = false;
     466  $arg_link = null;
     467
     468  if (is_autorize_status($conf['upload_user_access']))
     469  {
     470    if (isset($page['category']) and $page['category']['uploadable'] )
     471    {
     472      // upload a picture in the category
     473      $show_link = true;
     474      $arg_link = 'cat='.$page['category']['id'];
     475    }
     476    else
     477    if ($conf['upload_link_everytime'])
     478    {
     479      // upload a picture in the category
     480      $query = '
     481SELECT
     482  1
     483FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
     484  ON id = cat_id and user_id = '.$user['id'].'
     485WHERE
     486  uploadable = \'true\'
     487  '.get_sql_condition_FandF
     488    (
     489      array
     490        (
     491          'visible_categories' => 'id',
     492        ),
     493      'AND'
     494    ).'
     495LIMIT 1';
     496
     497      $show_link = mysql_num_rows(pwg_query($query)) <> 0;
     498    }
     499  }
     500  if ($show_link)
     501  {
     502    return get_root_url().'upload.php'.(empty($arg_link) ? '' : '?'.$arg_link);
     503  }
     504  else
     505  {
     506    return;
     507  }
     508}
     509
    455510?>
Note: See TracChangeset for help on using the changeset viewer.