From 8cb32d94021ada10f52a1bc900e37db0c3104231 Mon Sep 17 00:00:00 2001 From: secretr Date: Tue, 2 Dec 2008 12:27:10 +0000 Subject: [PATCH] eURL - introducing profile.xml --- e107_admin/eurl.php | 35 ++++++++++++++----- .../core/news/apache_mod_rewrite/profile.xml | 6 ++++ e107_languages/English/admin/lan_eurl.php | 14 +++++--- 3 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 e107_files/e_url/core/news/apache_mod_rewrite/profile.xml diff --git a/e107_admin/eurl.php b/e107_admin/eurl.php index c69bd41cc..c9d559f6b 100644 --- a/e107_admin/eurl.php +++ b/e107_admin/eurl.php @@ -9,8 +9,8 @@ * URL Management * * $Source: /cvs_backup/e107_0.8/e107_admin/eurl.php,v $ - * $Revision: 1.3 $ - * $Date: 2008-12-02 11:03:02 $ + * $Revision: 1.4 $ + * $Date: 2008-12-02 12:27:10 $ * $Author: secretr $ */ @@ -194,7 +194,7 @@ class admin_url_config { //Search for custom url config released with the plugin if($config_profiles_array) { - foreach ($config_profiles_array as $config_profile) { + foreach ($config_profiles_array as $config_profile => $profile_info) { $profile_id = $id.'-profile:'.$config_profile; $checked_profile = $pref['url_config'][$section['path']] == $profile_id ? ' checked="checked"' : ''; if($custom) $checked_profile = ' disabled="disabled"'; @@ -202,12 +202,13 @@ class admin_url_config {
- ".LAN_EURL_PROFILE_INFO."
+ ".(varsettrue($profile_info['title']) ? ''.$profile_info['title'].'

' : '')." + ".varsettrue($profile_info['description'], LAN_EURL_PROFILE_INFO)."

".LAN_EURL_LOCATION." ".str_replace(array(e_PLUGIN, e_FILE), array(e_PLUGIN_ABS, e_FILE_ABS), $profile_path)."{$config_profile}/
@@ -223,14 +224,32 @@ class admin_url_config { function get_plug_profiles($path) { - $ret = $this->_fl->get_dirs($path, '', array('CVS', '.svn')); + $tmp = $this->_fl->get_dirs($path, '', array('CVS', '.svn')); + $ret = array(); + foreach ($tmp as $s) { + $ret[$s] = $this->parse_config_xml($path.$s.'/profile.xml'); + } + return $ret; } - function render_shutdown($now) + function parse_config_xml($path) + { + require_once(e_HANDLER.'xml_class.php'); + $xml = new xmlClass; + $parsed = $xml->loadXMLfile($path, true, true); + + //Load Lan file if required + if($parsed && varsettrue($parsed['adminLan'])) { + include_lan($parsed['adminLan']); + } + return $parsed; + } + + function render_shutdown($save) { global $pref; - if($now && !isset($_POST['update'])) + if($save && !isset($_POST['update'])) { save_prefs(); } diff --git a/e107_files/e_url/core/news/apache_mod_rewrite/profile.xml b/e107_files/e_url/core/news/apache_mod_rewrite/profile.xml new file mode 100644 index 000000000..47a65fc4b --- /dev/null +++ b/e107_files/e_url/core/news/apache_mod_rewrite/profile.xml @@ -0,0 +1,6 @@ + + + {LAN_EURL_MODREWR_TITLE} + {LAN_EURL_MODREWR_DESCR} + + diff --git a/e107_languages/English/admin/lan_eurl.php b/e107_languages/English/admin/lan_eurl.php index 6b04a0b8a..40ff92fd3 100644 --- a/e107_languages/English/admin/lan_eurl.php +++ b/e107_languages/English/admin/lan_eurl.php @@ -9,8 +9,8 @@ * Administration Language File * * $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_eurl.php,v $ - * $Revision: 1.1 $ - * $Date: 2008-12-02 11:03:02 $ + * $Revision: 1.2 $ + * $Date: 2008-12-02 12:27:10 $ * $Author: secretr $ */ if (!defined("PAGE_NAME")) { define("PAGE_NAME", "Manage Site URLs"); } @@ -23,11 +23,15 @@ define("LAN_EURL_PROFILE", "Config Profile"); define("LAN_EURL_UDEFINED", "User Defined Config"); define("LAN_EURL_INFOALT", "Info"); define("LAN_EURL_UDEFINED_INFO", "User defined URL configuration - overrides (disables) all custom configuration profiles. Remove the User defined configuration folder to enable the custom configuration profiles."); -define("LAN_EURL_PROFILE_INFO", "Under Construction - profile.xml"); -define("LAN_EURL_LOCATION", "Location:"); +define("LAN_EURL_PROFILE_INFO", "Profile info not available (missing profile.xml)"); +define("LAN_EURL_LOCATION", "Profile Location:"); + define("LAN_EURL_CORE_NEWS", "News"); -define("LAN_EURL_CORE_DOWNLOADS", "Downloads"); +define("LAN_EURL_CORE_DOWNLOADS", "News"); +define("LAN_EURL_MODREWR_TITLE", "SEF URLs"); +define("LAN_EURL_MODREWR_DESCR", "You'll need mod_rewrite isntalled and running on your server (Apache Web Server). After enabling this profile go to your site root folder, rename htaccess.txt to .htaccess and uncomment the corresponding line."); +define("LAN_EURL_COREPR_DOWNLOADS", "Downloads SEF URLs"); //define("LAN_EURL_", ""); //define("LAN_EURL_", "");