Ignore:
Timestamp:
Aug 9, 2012, 12:10:04 PM (12 years ago)
Author:
mistic100
Message:

entirely rewrite the plugin

  • send mail in html format (configurable to plain)
  • fully configurable email list
  • more...
File:
1 edited

Legend:

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

    r16549 r17483  
    55Description: Add a "Contact" item in the Menu block to offer a contact form to users
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=304
    7 Author: Criss, Gotcha
    8 Author URI: http://piwigo.org/
     7Author: Piwigo Team
     8Author URI: http://piwigo.org
    99*/
    1010
    1111if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1212
    13 define('CF_PATH',     PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    14 define('CF_ROOT',     dirname(__FILE__).'/');
    15 include_once(CF_PATH . 'include/cf_common.inc.php');
     13define('CONTACT_FORM_PATH',  PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
     14define('CONTACT_FORM_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
    1615
    17 $cf_plugin = new CF_Plugin($plugin['id']);
    18 add_event_handler('loc_begin_index',             
    19                   array(&$cf_plugin, 'loc_begin_index'));
    20 add_event_handler('loc_begin_page_tail',             
    21                   array(&$cf_plugin, 'loc_begin_page_header'));
    22 add_event_handler('blockmanager_apply',             
    23                   array(&$cf_plugin, 'blockmanager_apply'),
    24                   EVENT_HANDLER_PRIORITY_NEUTRAL+10);
    25 add_event_handler('loc_end_index',             
    26                   array(&$cf_plugin, 'loc_end_index'));
    27 add_event_handler('loc_end_page_tail',
    28                   array(&$cf_plugin, 'loc_end_page_tail'));
    29 if(defined('IN_ADMIN')) {
    30   add_event_handler('get_admin_plugin_menu_links',
    31                     array(&$cf_plugin, 'get_admin_plugin_menu_links'));
     16
     17add_event_handler('init', 'contact_form_init');
     18add_event_handler('loc_end_section_init', 'contact_form_section_init');
     19add_event_handler('loc_end_index', 'contact_form_page');
     20add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
     21if (defined('IN_ADMIN'))
     22{
     23  add_event_handler('get_admin_plugin_menu_links', 'contact_form_admin_menu');
    3224}
    33 set_plugin_data($plugin['id'], $cf_plugin);
     25
     26include(CONTACT_FORM_PATH . 'include/functions.inc.php');
     27
     28
     29function contact_form_init()
     30{
     31  global $conf;
     32  $conf['ContactForm'] = unserialize($conf['ContactForm']);
     33 
     34  load_language('plugin.lang', CONTACT_FORM_PATH);
     35 
     36  if ($conf['ContactForm']['cf_must_initialize'])
     37  {
     38    contact_form_initialize_emails();
     39  }
     40}
     41
    3442?>
Note: See TracChangeset for help on using the changeset viewer.