Changeset 8652
- Timestamp:
- Jan 13, 2011, 9:51:57 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r6951 r8652 496 496 } 497 497 498 /**499 * returns the link of upload menu500 *501 * @param null502 * @return string or null503 */504 function get_upload_menu_link()505 {506 global $conf, $page, $user;507 508 $show_link = false;509 $arg_link = null;510 511 if (is_autorize_status($conf['upload_user_access']))512 {513 if (isset($page['category']) and $page['category']['uploadable'] )514 {515 // upload a picture in the category516 $show_link = true;517 $arg_link = 'cat='.$page['category']['id'];518 }519 else520 if ($conf['upload_link_everytime'])521 {522 // upload a picture in the category523 $query = '524 SELECT525 1526 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'527 ON id = cat_id and user_id = '.$user['id'].'528 WHERE529 uploadable = \'true\'530 '.get_sql_condition_FandF531 (532 array533 (534 'visible_categories' => 'id',535 ),536 'AND'537 ).'538 LIMIT 1';539 540 $show_link = pwg_db_num_rows(pwg_query($query)) <> 0;541 }542 }543 if ($show_link)544 {545 return get_root_url().'upload.php'.(empty($arg_link) ? '' : '?'.$arg_link);546 }547 else548 {549 return;550 }551 }552 553 498 ?> -
trunk/include/menubar.inc.php
r8223 r8652 106 106 'MENU_CATEGORIES' => get_categories_menu(), 107 107 'U_CATEGORIES' => make_index_url(array('section' => 'categories')), 108 'U_UPLOAD' => get_upload_menu_link()109 108 ); 110 109 $block->template = 'menubar_categories.tpl';
Note: See TracChangeset
for help on using the changeset viewer.