Ignore:
Timestamp:
Jun 26, 2009, 11:52:25 AM (15 years ago)
Author:
Criss
Message:

Display edit block on picture page if request comes from this page
Add simple administration configuration management
Add and remove default configuration from databaseon plugin install / uninstall

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/CommentEditor/main.inc.php

    r3443 r3462  
    11<?php
    2 /* $Id: main.inc.php,v 1.9 2009/06/22 22:18:14 Criss Exp $ */
     2/* $Id: main.inc.php,v 1.13 2009/06/26 09:49:12 Criss Exp $ */
    33/*
    44 Plugin Name: Comment Editor
    5  Version: 1.0.g
     5 Version: 1.0.h
    66 Description: Allow to edit comment
    77 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=296
     
    1212/** History **
    1313
    14     2009-06-22 1.0.g
    15                         Deactivate anti-flood on update
    16                         Adviser can edit only its comments
    17                         Language file converted in UTF-8
    18                         Add home link in edit and message block title bar
     14  2009-06-?? 1.0.h
     15                    Display edit block on picture page if request comes
     16                    from this page
     17                    Add simple administration configuration management
     18                    Add and remove default configuration from database
     19                    on plugin install / uninstall
    1920
    20     2009-06-22 1.0.f
    21                         Add edit link for author even if he's not an admin
    22                         Code cleanup
     21  2009-06-22 1.0.g
     22                    Deactivate anti-flood on update
     23                    Adviser can edit only its comments
     24                    Language file converted in UTF-8
     25                    Add home link in edit and message block title bar
    2326
    24     2009-06-18 1.0.e
    25                         Check existence of function update_user_comment()
     27  2009-06-22 1.0.f
     28                    Add edit link for author even if he's not an admin
     29                    Code cleanup
    2630
    27     2009-06-18 1.0.d
    28                         Improve sanity checking
     31  2009-06-18 1.0.e
     32                    Check existence of function update_user_comment()
    2933
    30     2009-06-18 1.0.c
    31                         Add maintain.inc.php file
    32                         Fix bug in CE_Comment::validateAuthor()
     34  2009-06-18 1.0.d
     35                    Improve sanity checking
    3336
    34     2009-06-18 1.0.b
    35                         Fix plugin URI to be available in plugin update
    36                         check page.
    37                         Reduce code line size.
     37  2009-06-18 1.0.c
     38                    Add maintain.inc.php file
     39                    Fix bug in CE_Comment::validateAuthor()
     40
     41  2009-06-18 1.0.b
     42                    Fix plugin URI to be available in plugin update
     43                    check page.
     44                    Reduce code line size.
    3845
    3946*/
    4047if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    4148
    42 define('CE_VERSION',       '1.0.g');
    43 define('CE_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    44 define('CE_ROOT', dirname(__FILE__).'/');
     49define('CE_VERSION',  '1.0.h');
     50define('CE_PATH',     PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
     51define('CE_ROOT',     dirname(__FILE__).'/');
    4552include_once(CE_PATH . 'include/ce_common.inc.php');
    4653
     54$ce_config = new CE_Config($ce_config_default);
     55$ce_plugin = new CE_Plugin($plugin['id'], $ce_config);
    4756
    48 $ce_plugin = new CE_Plugin();
    49 add_event_handler(  'render_comment_content',
    50                     array(&$ce_plugin, 'render_comment_content'));
    51 add_event_handler(  'loc_begin_page_header',
    52                     array(&$ce_plugin, 'loc_begin_page_header'));
    53 add_event_handler(  'loc_begin_index',
    54                     array(&$ce_plugin, 'loc_begin_index'), 1);
    55 
     57add_event_handler('get_admin_plugin_menu_links',
     58                  array(&$ce_plugin, 'get_admin_plugin_menu_links'));
     59add_event_handler('render_comment_content',
     60                  array(&$ce_plugin, 'render_comment_content'));
     61add_event_handler('loc_begin_page_header',
     62                  array(&$ce_plugin, 'loc_begin_page_header'));
     63switch (script_basename()) {
     64  case 'index':
     65    add_event_handler('loc_begin_index',
     66                      array(&$ce_plugin, 'loc_begin_index'), 1);
     67    break;
     68  case 'picture':
     69    add_event_handler('loc_begin_picture',
     70                      array(&$ce_plugin, 'loc_begin_picture'), 1);
     71    break;
     72  default:
     73}
    5674set_plugin_data($plugin['id'], $ce_plugin);
    5775
Note: See TracChangeset for help on using the changeset viewer.