Skip to content

Commit

Permalink
Fix Plugin URI (to support update option; thanks to ddtddt. Clean up …
Browse files Browse the repository at this point in the history
…the code
  • Loading branch information
icy committed Jul 3, 2011
1 parent 03015a2 commit 2b11d91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion icy_picture_modify.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

global $template, $conf, $user, $page, $lang, $cache;

// redirect users to the index page if 'image_id' isn't provided
// redirect users to the index page or category page if 'image_id' isn't provided
if (!isset($_GET['image_id']))
{
if (isset($_GET['cat_id']))
Expand Down
12 changes: 9 additions & 3 deletions main.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Icy Modify Picture
Version: 1.0.0
Description: Allow users to modify users they uploaded
Plugin URI: https://github.com/icy/icy_picture_modify
Plugin URI: http://piwigo.org/ext/extension_view.php?eid=563
Author: icy
Author URI: http://metakyanh.sarovar.org/
*/
Expand All @@ -17,7 +17,14 @@
define('ICY_PICTURE_MODIFY_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
include_once(ICY_PICTURE_MODIFY_PATH.'include/functions_icy_picture_modify.inc.php');

# Hooks declaration

add_event_handler('loc_end_section_init', 'icy_picture_modify_section_init');
add_event_handler('loc_end_index', 'icy_picture_modify_index');
add_event_handler('loc_begin_picture', 'icy_picture_modify_loc_begin_picture');

# Hooks definitions

function icy_picture_modify_section_init()
{
global $tokens, $page;
Expand All @@ -28,7 +35,6 @@ function icy_picture_modify_section_init()
}
}

add_event_handler('loc_end_index', 'icy_picture_modify_index');
function icy_picture_modify_index()
{
global $page;
Expand All @@ -40,7 +46,7 @@ function icy_picture_modify_index()
}

// provide the link to modify the picture
add_event_handler('loc_begin_picture', 'icy_picture_modify_loc_begin_picture');
// FIXME: Why use $page['image_id'] instead of $_GET['image_id']
function icy_picture_modify_loc_begin_picture()
{
global $conf, $template, $page, $user;
Expand Down

0 comments on commit 2b11d91

Please sign in to comment.