Changeset 12818


Ignore:
Timestamp:
01/01/12 11:52:20 (8 years ago)
Author:
icy
Message:

Merge branch 'master' into svn

Location:
extensions/Icy_Picture_Modify
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Icy_Picture_Modify/README

    r11934 r12818  
    1313USAGE 
    1414 
    15   1. Install and enable the plugin "community" which allows users to upload pictures 
    16   2. Install and enable this extension 
     15  1. Install and enable the plugin "community" which allows users to 
     16     upload pictures to some albums. Please configure the plugin before 
     17     you install "icy_picture_modify". 
     18 
     19  2. Install and enable this plugin 
     20 
    1721  3. When users view a picture they uploaded, they will be provided a link 
    1822     to modify that picture's information. 
     
    2024FEATURES 
    2125 
    22   Users can modify the following information of a picture 
    23     * Author 
    24     * Description 
    25     * Picture's date 
    26     * Tags 
    27     * ACL 
    28     * Synchronize meta data 
    29     * Delete picture 
    30     * Associcate/Dissociated image to/from uploadable category 
    31     * Use image to represent for uploadable category 
     26  Users can delete image or modify image's properties (author, date, tags, 
     27  description, metada, associcate/aissociated/represented categories). 
    3228 
    3329KNOWN PROBLEMS 
    3430 
     31  * If an image is replaced by other version (using plugin 'Photo update') 
     32    the author of (new) image will be owned by administrator, not the 
     33    current user. Hence the image won't be editable anymore 
    3534  * This plugin doesn't support all known templates 
    36   * This plugin may not work smoothly without plugin 'community' 
     35  * This plugin may not work smoothly without the plugin 'community' 
    3736  * User can delete an image which is associated to some albums to which 
    38     the user doesn't have permission to write/access. When the plugin 
    39     'community' isn't installed, user can create image's link and/or 
    40     represents for any visible albums in the gallery. 
     37    the user doesn't have permission to write/access. This is true as the 
     38    plugin only checks owner of the image. 
    4139 
    4240AUTHOR 
     
    5149 
    5250  At Github.com:  https://github.com/icy/icy_picture_modify 
    53   At Piwigo.com:   http://piwigo.org/ext/extension_view.php?eid=563 
    54   SVN repository:  http://piwigo.org/svn/extensions/Icy_Picture_Modify/ 
     51  At Piwigo.com:  http://piwigo.org/ext/extension_view.php?eid=563 
     52  SVN repository: http://piwigo.org/svn/extensions/Icy_Picture_Modify/ 
  • 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.