Ignore:
Timestamp:
Jan 1, 2012, 11:52:20 AM (12 years ago)
Author:
icy
Message:

Merge branch 'master' into svn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Icy_Picture_Modify/icy_picture_modify.php

    r12034 r12818  
    9595
    9696// * Purpose: Find all categories that are reachable for the current user.
    97 // * FIXME:   This query will include all readable categories, those ones
    98 //            use can't write to them.
     97// * FIXME:   This query will include all readable categories, included
     98//            the ones user can't write to them.
    9999
    100100$my_categories = array();
    101101$my_permissions = null;
     102$has_plugin_community = false;
    102103
    103104// <community support>
     
    105106{
    106107  include_once(PHPWG_PLUGINS_PATH.'community/include/functions_community.inc.php');
     108  $has_plugin_community = true;
     109
    107110  $user_permissions = community_get_user_permissions($user['id']);
    108111  $my_categories = $user_permissions['upload_categories'];
     
    110113// </community support>
    111114
    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'])
     115if (($has_plugin_community == false) or $user_permissions['create_whole_gallery'])
    116116{
    117117  $query = '
     
    120120  ;';
    121121
    122   // list of categories to which the user can access
     122  // list of categories to which the user can read
    123123  $my_categories = array_diff(
    124124    array_from_query($query, 'category_id'),
     
    270270//
    271271if (isset($_POST['associate'])
     272    and ($has_plugin_community == true)
    272273    and isset($_POST['cat_dissociated'])
    273274    and count($_POST['cat_dissociated']) > 0
     
    283284// dissociate the element from categories (but not from its storage category)
    284285if (isset($_POST['dissociate'])
     286    and ($has_plugin_community == true)
    285287    and isset($_POST['cat_associated'])
    286288    and count($_POST['cat_associated']) > 0
     
    297299  update_category($arr_dissociate);
    298300}
     301
     302// +-----------------------------------------------------------------------+
     303// |                              representation                           |
     304// +-----------------------------------------------------------------------+
     305
    299306// select the element to represent the given categories
    300307if (isset($_POST['elect'])
     308    and ($has_plugin_community == true)
    301309    and isset($_POST['cat_dismissed'])
    302310    and count($_POST['cat_dismissed']) > 0
     
    318326  }
    319327}
     328
    320329// dismiss the element as representant of the given categories
    321330if (isset($_POST['dismiss'])
     331    and ($has_plugin_community == true)
    322332    and isset($_POST['cat_elected'])
    323333    and count($_POST['cat_elected']) > 0
     
    331341}
    332342
    333 // tags
     343// +-----------------------------------------------------------------------+
     344// |                             tagging support                           |
     345// +-----------------------------------------------------------------------+
     346
    334347if (version_compare(PHPWG_VERSION, '2.2.5', '<')) {
    335348  $q_tag_selection = "tag_id, name AS tag_name";
     
    594607display_select_cat_wrapper($query, array(), 'dissociated_options');
    595608
    596 // representing
     609// display list of categories for representing
    597610$query = '
    598611SELECT id,name,uppercats,global_rank
Note: See TracChangeset for help on using the changeset viewer.