Changeset 12818 for extensions/Icy_Picture_Modify/icy_picture_modify.php
- Timestamp:
- Jan 1, 2012, 11:52:20 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Icy_Picture_Modify/icy_picture_modify.php
r12034 r12818 95 95 96 96 // * Purpose: Find all categories that are reachable for the current user. 97 // * FIXME: This query will include all readable categories, those ones98 // usecan't write to them.97 // * FIXME: This query will include all readable categories, included 98 // the ones user can't write to them. 99 99 100 100 $my_categories = array(); 101 101 $my_permissions = null; 102 $has_plugin_community = false; 102 103 103 104 // <community support> … … 105 106 { 106 107 include_once(PHPWG_PLUGINS_PATH.'community/include/functions_community.inc.php'); 108 $has_plugin_community = true; 109 107 110 $user_permissions = community_get_user_permissions($user['id']); 108 111 $my_categories = $user_permissions['upload_categories']; … … 110 113 // </community support> 111 114 112 // FIXME: what happens if both of the following conditions are true 113 // FIXME: * true == $user_permissions['create_whole_gallery'] 114 // FIXME: * 0 < count($my_categories) 115 if (empty($user_permissions) or $user_permissions['create_whole_gallery']) 115 if (($has_plugin_community == false) or $user_permissions['create_whole_gallery']) 116 116 { 117 117 $query = ' … … 120 120 ;'; 121 121 122 // list of categories to which the user can access122 // list of categories to which the user can read 123 123 $my_categories = array_diff( 124 124 array_from_query($query, 'category_id'), … … 270 270 // 271 271 if (isset($_POST['associate']) 272 and ($has_plugin_community == true) 272 273 and isset($_POST['cat_dissociated']) 273 274 and count($_POST['cat_dissociated']) > 0 … … 283 284 // dissociate the element from categories (but not from its storage category) 284 285 if (isset($_POST['dissociate']) 286 and ($has_plugin_community == true) 285 287 and isset($_POST['cat_associated']) 286 288 and count($_POST['cat_associated']) > 0 … … 297 299 update_category($arr_dissociate); 298 300 } 301 302 // +-----------------------------------------------------------------------+ 303 // | representation | 304 // +-----------------------------------------------------------------------+ 305 299 306 // select the element to represent the given categories 300 307 if (isset($_POST['elect']) 308 and ($has_plugin_community == true) 301 309 and isset($_POST['cat_dismissed']) 302 310 and count($_POST['cat_dismissed']) > 0 … … 318 326 } 319 327 } 328 320 329 // dismiss the element as representant of the given categories 321 330 if (isset($_POST['dismiss']) 331 and ($has_plugin_community == true) 322 332 and isset($_POST['cat_elected']) 323 333 and count($_POST['cat_elected']) > 0 … … 331 341 } 332 342 333 // tags 343 // +-----------------------------------------------------------------------+ 344 // | tagging support | 345 // +-----------------------------------------------------------------------+ 346 334 347 if (version_compare(PHPWG_VERSION, '2.2.5', '<')) { 335 348 $q_tag_selection = "tag_id, name AS tag_name"; … … 594 607 display_select_cat_wrapper($query, array(), 'dissociated_options'); 595 608 596 // representing609 // display list of categories for representing 597 610 $query = ' 598 611 SELECT id,name,uppercats,global_rank
Note: See TracChangeset
for help on using the changeset viewer.