From e700fbdff137a6311f2149ebecc730a019ff21b2 Mon Sep 17 00:00:00 2001 From: icy Date: Sat, 23 Mar 2013 14:17:35 +0700 Subject: [PATCH] Add language support. The plugin now has its own language directory copied from the plugin photo_update bc the fuction of photo_update can be replaced by the alternative function in our plugin. anyway, if the plugin photo_update is enabled, its language support will be loaded to our plugin. We also load language support from the plugin "community". --- add_photos.php | 7 ++++++- icy_picture_modify.php | 11 +++++++++++ language/en_UK/description.txt | 1 + language/en_UK/plugin.lang.php | 5 +++++ language/vi_VN/description.txt | 1 + language/vi_VN/plugin.lang.php | 5 +++++ main.inc.php | 5 ++--- 7 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 language/en_UK/description.txt create mode 100644 language/en_UK/plugin.lang.php create mode 100644 language/vi_VN/description.txt create mode 100644 language/vi_VN/plugin.lang.php diff --git a/add_photos.php b/add_photos.php index 4e2fe24..67d379d 100644 --- a/add_photos.php +++ b/add_photos.php @@ -14,12 +14,17 @@ * user about this. FIXME: How to know if a method is in black-list?) */ -if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); +if (!defined('ICY_PICTURE_MODIFY_PATH')) die('Hacking attempt!'); global $template, $conf, $user; include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php'); + +if (!icy_plugin_enabled("community")) { + die('Something wrong happended. The plugin "community" must be enabled to use this function.'); +} + include_once(COMMUNITY_PATH.'include/functions_community.inc.php'); if (!defined('PHOTOS_ADD_BASE_URL')) { diff --git a/icy_picture_modify.php b/icy_picture_modify.php index 991dc0e..148023e 100644 --- a/icy_picture_modify.php +++ b/icy_picture_modify.php @@ -12,6 +12,17 @@ require_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); require_once(ICY_PICTURE_MODIFY_PATH.'include/functions_icy_picture_modify.inc.php'); +/* Language support */ +load_language('plugin.lang', ICY_PICTURE_MODIFY_PATH . '/'); + +if (icy_plugin_enabled("photo_update")) { + load_language('plugin.lang', PHPWG_PLUGINS_PATH . '/photo_update/'); +} + +if (icy_plugin_enabled("community")) { + load_language('plugin.lang', PHPWG_PLUGINS_PATH . '/community/'); +} + // if (is_admin()) { diff --git a/language/en_UK/description.txt b/language/en_UK/description.txt new file mode 100644 index 0000000..d2be3ba --- /dev/null +++ b/language/en_UK/description.txt @@ -0,0 +1 @@ +Allow normal users to upload images and/or edit information of any set of images. This plugin provides advanced ACL for your gallery. diff --git a/language/en_UK/plugin.lang.php b/language/en_UK/plugin.lang.php new file mode 100644 index 0000000..f1730a4 --- /dev/null +++ b/language/en_UK/plugin.lang.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/language/vi_VN/description.txt b/language/vi_VN/description.txt new file mode 100644 index 0000000..03d5b8b --- /dev/null +++ b/language/vi_VN/description.txt @@ -0,0 +1 @@ +Cho phép thành viên tải hình ảnh lên gallery, đổi hoặc chỉnh sửa thông tin của hình trong bất kỳ album nào diff --git a/language/vi_VN/plugin.lang.php b/language/vi_VN/plugin.lang.php new file mode 100644 index 0000000..ae6e177 --- /dev/null +++ b/language/vi_VN/plugin.lang.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/main.inc.php b/main.inc.php index 8592c79..910b131 100644 --- a/main.inc.php +++ b/main.inc.php @@ -9,12 +9,11 @@ License: GPL2 */ -if (!defined('PHPWG_ROOT_PATH')) -{ +if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } -define('ICY_PICTURE_MODIFY_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); +define('ICY_PICTURE_MODIFY_PATH' , PHPWG_PLUGINS_PATH .'icy_picture_modify/'); require_once(ICY_PICTURE_MODIFY_PATH.'include/functions_icy_picture_modify.inc.php'); # Variable declarations ################################################