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