| 1 | <?php |
|---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
|---|
| 3 | |
|---|
| 4 | /* ************************** */ |
|---|
| 5 | /* ** Constants ** */ |
|---|
| 6 | /* ************************** */ |
|---|
| 7 | |
|---|
| 8 | // Version |
|---|
| 9 | define('CF_VERSION', '1.1.7'); |
|---|
| 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_LANG_DEFAULT', 'default'); |
|---|
| 40 | // Config keys |
|---|
| 41 | if (isset($plugin)) { |
|---|
| 42 | define('CF_CFG_DB_KEY', $plugin['id']); |
|---|
| 43 | } |
|---|
| 44 | define('CF_CFG_DB_FACTORY', 'Factory settings for plugin %s [%s]'); |
|---|
| 45 | define('CF_CFG_DB_COMMENT', 'Configuration of plugin %s [%s]'); |
|---|
| 46 | define('CF_CFG_COMMENT', 'comment'); |
|---|
| 47 | define('CF_CFG_VERSION', 'version'); |
|---|
| 48 | |
|---|
| 49 | define('CF_CFG_MENU_LINK', 'cf_menu_link'); |
|---|
| 50 | define('CF_CFG_SUBJECT_PREFIX', 'cf_subject_prefix'); |
|---|
| 51 | define('CF_CFG_SEPARATOR_LEN', 'cf_separator_length'); |
|---|
| 52 | define('CF_CFG_SEPARATOR', 'cf_separator'); |
|---|
| 53 | define('CF_CFG_ALLOW_GUEST', 'cf_allow_guest'); |
|---|
| 54 | define('CF_CFG_MAIL_MANDATORY', 'cf_mandatory_mail'); |
|---|
| 55 | define('CF_CFG_NAME_MANDATORY', 'cf_mandatory_name'); |
|---|
| 56 | define('CF_CFG_REDIRECT_DELAY', 'cf_redirect_delay'); |
|---|
| 57 | define('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 |
|---|
| 67 | cf_require_class("CF_Log"); |
|---|
| 68 | cf_require_class("CF_Config_Lang"); |
|---|
| 69 | cf_require_class("CF_Config"); |
|---|
| 70 | cf_require_class("CF_Plugin"); |
|---|
| 71 | |
|---|
| 72 | /* ************************** */ |
|---|
| 73 | /* ** Variable definitions ** */ |
|---|
| 74 | /* ************************** */ |
|---|
| 75 | global $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(); |
|---|
| 87 | CF_Config::$default_config = $cf_config_default; |
|---|
| 88 | |
|---|
| 89 | $cf_config_lang_keys = array(); |
|---|
| 90 | $cf_config_lang_keys['contact_form_title'] = array( |
|---|
| 91 | CF_LANG_DEFAULT => l10n('contact_form_title'), |
|---|
| 92 | 'de_DE' => 'Kontaktformular', |
|---|
| 93 | 'en_UK' => 'Contact form', |
|---|
| 94 | 'es_ES' => 'Formulario de contacto', |
|---|
| 95 | 'fr_FR' => 'Formulaire de contact', |
|---|
| 96 | 'hu_HU' => 'Kapcsolati urlap', |
|---|
| 97 | 'it_IT' => 'Formulario di contatto', |
|---|
| 98 | 'nl_NL' => 'Contact formulier', |
|---|
| 99 | 'pl_PL' => 'Formularz kontaktu', |
|---|
| 100 | 'sk_SK' => 'Kontaktný formulár', |
|---|
| 101 | 'ru_RU' => 'Контактная информация', |
|---|
| 102 | 'tr_TR' => 'İletişim formu', |
|---|
| 103 | 'cs_CZ' => 'Kontaktní formulář', |
|---|
| 104 | 'lv_LV' => 'Kontaktforma', |
|---|
| 105 | 'sv_SE' => 'Kontakt formulär', |
|---|
| 106 | 'nl_NL' => 'Contact formulier' |
|---|
| 107 | ); |
|---|
| 108 | $cf_config_lang_keys['contact_form'] = array( |
|---|
| 109 | CF_LANG_DEFAULT => l10n('contact_form'), |
|---|
| 110 | 'de_DE' => 'Kontaktformular', |
|---|
| 111 | 'en_UK' => 'Contact', |
|---|
| 112 | 'es_ES' => 'Contactar', |
|---|
| 113 | 'fr_FR' => 'Formulaire de contact', |
|---|
| 114 | 'hu_HU' => 'Kapcsolat', |
|---|
| 115 | 'it_IT' => 'Contattare', |
|---|
| 116 | 'nl_NL' => 'Contact', |
|---|
| 117 | 'pl_PL' => 'Kontakt', |
|---|
| 118 | 'sk_SK' => 'Kontakt', |
|---|
| 119 | 'ru_RU' => 'Контакты', |
|---|
| 120 | 'tr_TR' => 'İletişim', |
|---|
| 121 | 'cs_CZ' => 'Kontakt', |
|---|
| 122 | 'lv_LV' => 'Kontaktēt', |
|---|
| 123 | 'sv_SE' => 'Kontakt', |
|---|
| 124 | 'nl_NL' => 'Contact' |
|---|
| 125 | ); |
|---|
| 126 | $cf_config_lang_keys['contact_form_link'] = array( |
|---|
| 127 | CF_LANG_DEFAULT => l10n('contact_form_link'), |
|---|
| 128 | 'de_DE' => 'Den Webmaster kontaktieren', |
|---|
| 129 | 'en_UK' => 'Contact webmaster', |
|---|
| 130 | 'es_ES' => 'Contactar webmestre', |
|---|
| 131 | 'fr_FR' => 'Contacter le webmestre', |
|---|
| 132 | 'hu_HU' => 'Webmester kapcsolat', |
|---|
| 133 | 'it_IT' => 'Contattare il webmaster', |
|---|
| 134 | 'nl_NL' => 'Contact webmaster', |
|---|
| 135 | 'pl_PL' => 'Kontakt do webmastera', |
|---|
| 136 | 'sk_SK' => 'Kontaktovanie webmastera', |
|---|
| 137 | 'ru_RU' => 'Contact webmaster', |
|---|
| 138 | 'tr_TR' => 'İletişim- Site yöneticisi', |
|---|
| 139 | 'cs_CZ' => 'Kontakt správce webu', |
|---|
| 140 | 'lv_LV' => 'Kontaktēt ar webmāsteru', |
|---|
| 141 | 'sv_SE' => 'Kontakta webmaster', |
|---|
| 142 | 'nl_NL' => 'Contact webmaster' |
|---|
| 143 | ); |
|---|
| 144 | CF_Config_Lang::$default_keys = $cf_config_lang_keys; |
|---|
| 145 | ?> |
|---|