source: extensions/ContactForm/include/cf_common.inc.php @ 7197

Last change on this file since 7197 was 7197, checked in by plg, 14 years ago

feature 1897 added: the core "Contact Webmaster" link in footer is replaced by
a link to the ContactForm page. It works with a smarty prefilter, so it should
work with all themes.

The configurable template variable name was removed. It is hard coded as
$ContactFormLink. I've seen no example using another variable name. It was
hard to understand for users in the administration panel and not very useful.
The corresponding language keys were removed from all languages.

bug 1916 fixed: apply the same rule for link display in footer as in menu. If
the administrator has allowed the ContactForm page for guests, let's display
it in the menu + footer.

File size: 3.8 KB
RevLine 
[6547]1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4/* ************************** */
5/* ** Constants            ** */
6/* ************************** */
7
8// Version
[7136]9define('CF_VERSION',            '1.1.2');
[6547]10define('CF_TITLE',              'cf_plugin_name');
11
12// Directories
13define('CF_INCLUDE_DIR',        'include/');
14define('CF_CLASSES_DIR',        'classes/');
15define('CF_IMAGES_DIR',         'images/');
16define('CF_TEMPLATE_DIR',       'themes/');
17define('CF_ADMIN_DIR',          'admin/');
18define('CF_LANGUAGE_DIR',       'language/');
19// Path
20define('CF_CLASSES',            CF_PATH.CF_CLASSES_DIR);
21define('CF_INCLUDE',            CF_PATH.CF_INCLUDE_DIR);
22define('CF_TEMPLATE',           CF_PATH.CF_TEMPLATE_DIR);
23define('CF_LANGUAGE',           CF_PATH.CF_LANGUAGE_DIR);
24define('CF_ADMIN',              CF_PATH.CF_ADMIN_DIR);
25define('CF_AMDIN_TPL',          CF_PATH.CF_ADMIN_DIR.CF_TEMPLATE_DIR);
26// Files
27define('CF_OBSOLETE',           'obsolete.list');
28define('CF_CHANGELOG',          'CHANGELOG');
29// Constants
30define('CF_DEBUG_ACTIVE',       false);
31define('CF_MENUBAR_KEY',        'contact_form');
32define('CF_URL_PARAMETER',      'contact');
33define('CF_SEPARATOR_PATTERN',  '||SEPARATOR HERE||');
34define('CF_CHECKED',            'checked="checked"');
35define('CF_SEPARATOR',          '=');
36define('CF_SEPARATOR_LENGTH',   20);
37define('CF_DEFAULT_PREFIX',     'Piwigo ContactForm');
38define('CF_REDIRECT_DELAY',     5);
39define('CF_LANG_DEFAULT',       'default');
40// Config keys
41if (isset($plugin)) {
42  define('CF_CFG_DB_KEY',       $plugin['id']);
43}
44define('CF_CFG_DB_FACTORY',     'Factory settings for plugin %s [%s]');
45define('CF_CFG_DB_COMMENT',     'Configuration of plugin %s [%s]');
46define('CF_CFG_COMMENT',        'comment');
47define('CF_CFG_VERSION',        'version');
48
49define('CF_CFG_MENU_LINK',      'cf_menu_link');
50define('CF_CFG_SUBJECT_PREFIX', 'cf_subject_prefix');
51define('CF_CFG_SEPARATOR_LEN',  'cf_separator_length');
52define('CF_CFG_SEPARATOR',      'cf_separator');
53define('CF_CFG_ALLOW_GUEST',    'cf_allow_guest');
54define('CF_CFG_MAIL_MANDATORY', 'cf_mandatory_mail');
55define('CF_CFG_NAME_MANDATORY', 'cf_mandatory_name');
56define('CF_CFG_REDIRECT_DELAY', 'cf_redirect_delay');
57define('CF_CFG_ADMIN_MAILS',    'cf_admin_mails');
58
59/* ************************** */
60/* ** Includes             ** */
61/* ************************** */
62
63// Include plugin functions
64@include_once(CF_INCLUDE.'cf_functions.inc.php');
65
66// Load class files
67cf_require_class("CF_Log");
68cf_require_class("CF_Config_Lang");
69cf_require_class("CF_Config");
70cf_require_class("CF_Plugin");
71
72/* ************************** */
73/* ** Variable definitions ** */
74/* ************************** */
75global $conf;
76$cf_config_default = array();
77$cf_config_default[CF_CFG_MENU_LINK] = true;
78$cf_config_default[CF_CFG_SUBJECT_PREFIX] = CF_DEFAULT_PREFIX;
79$cf_config_default[CF_CFG_SEPARATOR_LEN] = CF_SEPARATOR_LENGTH;
80$cf_config_default[CF_CFG_SEPARATOR] = CF_SEPARATOR;
81$cf_config_default[CF_CFG_ALLOW_GUEST] = true;
82$cf_config_default[CF_CFG_MAIL_MANDATORY] = true;
83$cf_config_default[CF_CFG_NAME_MANDATORY] = true;
84$cf_config_default[CF_CFG_REDIRECT_DELAY] = CF_REDIRECT_DELAY;
85$cf_config_default[CF_CFG_ADMIN_MAILS] = cf_get_admins_contacts();
86$cf_config_default[CF_CFG_ADMIN_MAILS] = array();
87CF_Config::$default_config = $cf_config_default;
88
89$cf_config_lang_keys = array();
90$cf_config_lang_keys['contact_form_title'] = array(
[6554]91    CF_LANG_DEFAULT => l10n('contact_form'),
[6547]92);
93$cf_config_lang_keys['contact_form'] = array(
94    CF_LANG_DEFAULT => l10n('contact_form'),
[6554]95    'fr_FR' => 'Formulaire de contact',
96    'en_UK' => 'Contact form',
[6547]97    'it_IT' => '',
98);
99$cf_config_lang_keys['contact_form_link'] = array(
100    CF_LANG_DEFAULT => l10n('contact_form_link'),
101    'fr_FR' => 'Contacter le webmestre',
102    'en_UK' => 'Contact webmaster',
103    'it_IT' => 'Contattare il webmaster',
104);
105CF_Config_Lang::$default_keys = $cf_config_lang_keys;
[7197]106?>
Note: See TracBrowser for help on using the repository browser.