mirror of
https://github.com/e107inc/e107.git
synced 2025-08-29 09:10:23 +02:00
eURL and news administration cleanup, server caching added to various news related places, blog calendar fixes
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
* URL Management
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/eurl.php,v $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2009-08-28 16:11:00 $
|
||||
* $Author: marj_nl_fr $
|
||||
* $Revision: 1.10 $
|
||||
* $Date: 2009-09-25 20:20:23 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
|
||||
require_once('../class2.php');
|
||||
@@ -21,24 +21,19 @@ if (!getperms('L'))
|
||||
exit;
|
||||
}
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
||||
|
||||
$e_sub_cat = 'eurl';
|
||||
require_once(e_ADMIN.'auth.php');
|
||||
require_once(e_HANDLER."form_handler.php");
|
||||
require_once(e_HANDLER."form_handler.php");
|
||||
require_once(e_HANDLER."message_handler.php");
|
||||
|
||||
$frm = new e_form(); //new form handler
|
||||
$emessage = &eMessage::getInstance();
|
||||
$urlc = new admin_url_config();
|
||||
$urlc = new admin_eurl_config();
|
||||
|
||||
if (isset($_POST['update']))
|
||||
{
|
||||
//$res = $urlc->update();
|
||||
admin_update($urlc->update(), 'update', false, false, false);
|
||||
//$plug_message = $res ? LAN_UPDATED : ($res === 0 ? LAN_NO_CHANGE : LAN_UPDATED_FAILED);
|
||||
//$plug_message = "<div class='center clear'>".$plug_message."</div><br />";
|
||||
if($urlc->update())
|
||||
{
|
||||
e107::getAdminLog()->logArrayDiffs(e107::getConfig('core')->getPref('url_config'), e107::getConfig('core_backup')->getPref('url_config'), 'EURL_01');
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($pref['url_config'], $e107->url->getUrl('pm', 'main', array('f'=>'box', 'box'=>2)));
|
||||
@@ -46,28 +41,39 @@ if (isset($_POST['update']))
|
||||
$urlc->renderPage();
|
||||
require_once(e_ADMIN.'footer.php');
|
||||
|
||||
class admin_url_config {
|
||||
class admin_eurl_config {
|
||||
|
||||
var $_frm;
|
||||
var $_plug;
|
||||
var $_api;
|
||||
/**
|
||||
* @var e_form
|
||||
*/
|
||||
protected $_frm;
|
||||
|
||||
/**
|
||||
* @var e107plugin
|
||||
*/
|
||||
protected $_plug;
|
||||
|
||||
/**
|
||||
* @var e_file
|
||||
*/
|
||||
protected $_fl;
|
||||
|
||||
/**
|
||||
* @var e107
|
||||
*/
|
||||
protected $_api;
|
||||
|
||||
function admin_url_config()
|
||||
function __construct()
|
||||
{
|
||||
global $e107;
|
||||
require_once(e_HANDLER.'plugin_class.php');
|
||||
require_once(e_HANDLER.'file_class.php');
|
||||
require_once(e_HANDLER."form_handler.php");
|
||||
|
||||
$this->_frm = new e_form();
|
||||
$this->_plug = new e107plugin();
|
||||
$this->_fl = new e_file();
|
||||
$this->_api = &$e107;
|
||||
$this->_api = e107::getInstance();
|
||||
$this->_frm = e107::getObject('e_form');
|
||||
$this->_plug = e107::getObject('e107Plugin');
|
||||
$this->_fl = e107::getFile();
|
||||
}
|
||||
|
||||
function renderPage()
|
||||
{
|
||||
global $emessage;
|
||||
$emessage = e107::getMessageHandler();
|
||||
$empty = "
|
||||
<tr>
|
||||
<td colspan='2'>".LAN_EURL_EMPTY."</td>
|
||||
@@ -119,7 +125,7 @@ class admin_url_config {
|
||||
</form>
|
||||
";
|
||||
|
||||
$this->_api->ns->tablerender(PAGE_NAME, $emessage->render().$text);
|
||||
e107::getRender()->tablerender(PAGE_NAME, $emessage->render().$text);
|
||||
}
|
||||
|
||||
function render_sections($id)
|
||||
@@ -165,7 +171,7 @@ class admin_url_config {
|
||||
{
|
||||
global $pref;
|
||||
//DEFAULT
|
||||
$checked_def = varset($pref['url_config'][$section['path']]) ? '' : ' checked="checked"';
|
||||
$checked_def = e107::findPref('url_config/'.$section['path']) ? '' : ' checked="checked"';
|
||||
$def = "
|
||||
<div class='field-spacer'>
|
||||
<input type='radio' class='radio' id='{$section['path']}-default' name='cprofile[{$section['path']}]' value='0'{$checked_def} /><label for='{$section['path']}-default'>".LAN_EURL_DEFAULT."</label>
|
||||
@@ -261,12 +267,12 @@ class admin_url_config {
|
||||
|
||||
function render_shutdown($save)
|
||||
{
|
||||
global $pref, $emessage;
|
||||
global $pref;
|
||||
if($save && !isset($_POST['update']))
|
||||
{
|
||||
if(save_prefs())
|
||||
{
|
||||
$emessage->add(LAN_EURL_AUTOSAVE);
|
||||
e107::getMessageHandler()->add(LAN_EURL_AUTOSAVE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -296,9 +302,9 @@ class admin_url_config {
|
||||
|
||||
function update()
|
||||
{
|
||||
global $pref;
|
||||
$pref['url_config'] = $_POST['cprofile'];
|
||||
return save_prefs();
|
||||
$core = e107::getConfig();
|
||||
$core->setPosted('url_config', $_POST['cprofile']);
|
||||
return $core->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* News Administration
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $
|
||||
* $Revision: 1.54 $
|
||||
* $Date: 2009-09-19 15:27:25 $
|
||||
* $Revision: 1.55 $
|
||||
* $Date: 2009-09-25 20:20:23 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
require_once("../class2.php");
|
||||
@@ -351,9 +351,14 @@ class admin_newspost
|
||||
function clear_cache()
|
||||
{
|
||||
$ecache = e107::getCache();
|
||||
$ecache->clear("news.php");
|
||||
$ecache->clear("othernews");
|
||||
$ecache->clear("othernews2");
|
||||
$ecache->clear("news.php"); //TODO change it to 'news_*' everywhere
|
||||
|
||||
$ecache->clear("news_", false, true); //NEW global news cache prefix
|
||||
//$ecache->clear("nq_news_"); - supported by cache::clear() now
|
||||
//$ecache->clear("nomd5_news_"); supported by cache::clear() now
|
||||
|
||||
$ecache->clear("othernews"); //TODO change it to 'news_othernews' everywhere
|
||||
$ecache->clear("othernews2"); //TODO change it to 'news_othernews2' everywhere
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -502,7 +507,7 @@ class admin_newspost
|
||||
$this->clear_cache();
|
||||
|
||||
$data = array('method'=>'delete', 'table'=>'news', 'id'=>$del_id, 'plugin'=>'news', 'function'=>'delete');
|
||||
$this->show_message($e107->e_event->triggerHook($data), E_MESSAGE_WARNING);
|
||||
$this->show_message(e107::getEvent()->triggerHook($data), E_MESSAGE_WARNING);
|
||||
|
||||
admin_purge_related("news", $del_id);
|
||||
}
|
||||
@@ -1655,7 +1660,7 @@ class admin_newspost
|
||||
}
|
||||
//triggerHook
|
||||
$data = array('method'=>'form', 'table'=>'news', 'id'=>$id, 'plugin'=>'news', 'function'=>'create_item');
|
||||
$hooks = $e107->e_event->triggerHook($data);
|
||||
$hooks = e107::getEvent()->triggerHook($data);
|
||||
if(!empty($hooks))
|
||||
{
|
||||
$text .= "
|
||||
|
@@ -9,9 +9,9 @@
|
||||
* Core SQL
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
||||
* $Revision: 1.27 $
|
||||
* $Date: 2009-09-17 14:25:09 $
|
||||
* $Author: e107coders $
|
||||
* $Revision: 1.28 $
|
||||
* $Date: 2009-09-25 20:20:23 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
|
||||
header("location:../index.php");
|
||||
@@ -224,7 +224,7 @@ CREATE TABLE news (
|
||||
KEY news_datestamp (news_datestamp),
|
||||
KEY news_sticky (news_sticky),
|
||||
KEY news_render_type (news_render_type),
|
||||
FULLTEXT KEY news_class (news_class)
|
||||
KEY news_class (news_class)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user