1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

eURL - introducing profile.xml

This commit is contained in:
secretr
2008-12-02 12:27:10 +00:00
parent c7e1f248d5
commit 8cb32d9402
3 changed files with 42 additions and 13 deletions

View File

@@ -9,8 +9,8 @@
* URL Management * URL Management
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/eurl.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/eurl.php,v $
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Date: 2008-12-02 11:03:02 $ * $Date: 2008-12-02 12:27:10 $
* $Author: secretr $ * $Author: secretr $
*/ */
@@ -194,7 +194,7 @@ class admin_url_config {
//Search for custom url config released with the plugin //Search for custom url config released with the plugin
if($config_profiles_array) 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; $profile_id = $id.'-profile:'.$config_profile;
$checked_profile = $pref['url_config'][$section['path']] == $profile_id ? ' checked="checked"' : ''; $checked_profile = $pref['url_config'][$section['path']] == $profile_id ? ' checked="checked"' : '';
if($custom) $checked_profile = ' disabled="disabled"'; if($custom) $checked_profile = ' disabled="disabled"';
@@ -202,12 +202,13 @@ class admin_url_config {
<div class='clear'><!-- --></div> <div class='clear'><!-- --></div>
<input type='radio' id='{$section['path']}-profile-{$config_profile}' name='cprofile[{$section['path']}]' value='{$profile_id}'{$checked_profile} /> <input type='radio' id='{$section['path']}-profile-{$config_profile}' name='cprofile[{$section['path']}]' value='{$profile_id}'{$checked_profile} />
<label for='{$section['path']}-profile-{$config_profile}'> <label for='{$section['path']}-profile-{$config_profile}'>
".LAN_EURL_PROFILE." [{$config_profile}] ".LAN_EURL_PROFILE." [".varsettrue($profile_info['title'], $config_profile)."]
</label> </label>
<a href='#{$section['path']}-profile-{$config_profile}-info' class='e-expandit' title='".LAN_EURL_INFOALT."'><img src='".e_IMAGE_ABS."admin_images/docs_16.png' alt='' /></a> <a href='#{$section['path']}-profile-{$config_profile}-info' class='e-expandit' title='".LAN_EURL_INFOALT."'><img src='".e_IMAGE_ABS."admin_images/docs_16.png' alt='' /></a>
<div class='e-hideme' id='{$section['path']}-profile-{$config_profile}-info'> <div class='e-hideme' id='{$section['path']}-profile-{$config_profile}-info'>
<div class='indent'> <div class='indent'>
".LAN_EURL_PROFILE_INFO."<br /> ".(varsettrue($profile_info['title']) ? '<strong>'.$profile_info['title'].'</strong><br /><br />' : '')."
".varsettrue($profile_info['description'], LAN_EURL_PROFILE_INFO)."<br /><br />
<strong>".LAN_EURL_LOCATION."</strong> ".str_replace(array(e_PLUGIN, e_FILE), array(e_PLUGIN_ABS, e_FILE_ABS), $profile_path)."{$config_profile}/ <strong>".LAN_EURL_LOCATION."</strong> ".str_replace(array(e_PLUGIN, e_FILE), array(e_PLUGIN_ABS, e_FILE_ABS), $profile_path)."{$config_profile}/
</div> </div>
</div> </div>
@@ -223,14 +224,32 @@ class admin_url_config {
function get_plug_profiles($path) 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; 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; global $pref;
if($now && !isset($_POST['update'])) if($save && !isset($_POST['update']))
{ {
save_prefs(); save_prefs();
} }

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<urlprofile>
<title>{LAN_EURL_MODREWR_TITLE}</title>
<description>{LAN_EURL_MODREWR_DESCR}</description>
<!-- <adminLan>{e_LANGUAGEDIR}{e_LANGUAGE}/admin/lan_newspost.php</adminLan> -->
</urlprofile>

View File

@@ -9,8 +9,8 @@
* Administration Language File * Administration Language File
* *
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_eurl.php,v $ * $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_eurl.php,v $
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Date: 2008-12-02 11:03:02 $ * $Date: 2008-12-02 12:27:10 $
* $Author: secretr $ * $Author: secretr $
*/ */
if (!defined("PAGE_NAME")) { define("PAGE_NAME", "Manage Site URLs"); } 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_UDEFINED", "User Defined Config");
define("LAN_EURL_INFOALT", "Info"); 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_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_PROFILE_INFO", "Profile info not available (missing profile.xml)");
define("LAN_EURL_LOCATION", "Location:"); define("LAN_EURL_LOCATION", "Profile Location:");
define("LAN_EURL_CORE_NEWS", "News"); 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_", "");
//define("LAN_EURL_", ""); //define("LAN_EURL_", "");