1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Only display presets to main admins (per Cameron), don't include news item date in preset (caused confusion)

This commit is contained in:
e107steved
2007-02-07 21:22:19 +00:00
parent 94b3fceb1d
commit e0a2c65e21
4 changed files with 38 additions and 26 deletions

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_admin/header.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/header.php,v $
| $Revision: 1.8 $ | $Revision: 1.9 $
| $Date: 2007-01-23 22:44:47 $ | $Date: 2007-02-07 21:22:09 $
| $Author: e107coders $ | $Author: e107steved $
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
@@ -147,7 +147,8 @@ if (isset($eplug_js) && $eplug_js) {
if (isset($htmlarea_js) && $htmlarea_js) { if (isset($htmlarea_js) && $htmlarea_js) {
echo $htmlarea_js; echo $htmlarea_js;
} }
if (strpos(e_SELF, 'fileinspector.php') === FALSE) { if ((strpos(e_SELF, 'fileinspector.php') === FALSE) && getperms("0"))
{
echo "<script type='text/javascript'> echo "<script type='text/javascript'>
<!-- <!--
function savepreset(ps,pid){ function savepreset(ps,pid){

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $
| $Revision: 1.5 $ | $Revision: 1.6 $
| $Date: 2007-02-07 18:48:27 $ | $Date: 2007-02-07 21:22:09 $
| $Author: e107coders $ | $Author: e107steved $
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
@@ -44,7 +44,7 @@ $pst->id = "admin_newspost";
$newspost = new newspost; $newspost = new newspost;
require_once("auth.php"); require_once("auth.php");
$pst->save_preset(); // save and render result using unique name $pst->save_preset('news_datestamp'); // save and render result using unique name. Don't save item datestamp
require_once(e_HANDLER."userclass_class.php"); require_once(e_HANDLER."userclass_class.php");
require_once(e_HANDLER."news_class.php"); require_once(e_HANDLER."news_class.php");

View File

@@ -1,4 +1,5 @@
if(ADMIN){ if(ADMIN && getperms("0"))
{
global $sql,$pst,$ns,$tp,$e_wysiwyg,$pref; global $sql,$pst,$ns,$tp,$e_wysiwyg,$pref;
if(isset($pst) && $pst->form && $pst->page){ if(isset($pst) && $pst->form && $pst->page){
$thispage = urlencode(e_SELF."?".e_QUERY); $thispage = urlencode(e_SELF."?".e_QUERY);

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/preset_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/preset_class.php,v $
| $Revision: 1.1.1.1 $ | $Revision: 1.2 $
| $Date: 2006-12-02 04:33:56 $ | $Date: 2007-02-07 21:22:09 $
| $Author: mcfly_e107 $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -25,25 +25,35 @@ class e_preset {
var $page; var $page;
var $id; var $id;
function save_preset(){ function save_preset($exclude_fields = '') // Comma separated list of fields not to save
{
global $sql,$tp,$ns; global $sql,$tp,$ns;
$qry = explode(".",e_QUERY); $qry = explode(".",e_QUERY);
$unique_id = is_array($this->id) ? $this->id : array($this->id); $unique_id = is_array($this->id) ? $this->id : array($this->id);
$uid = $qry[1]; $uid = $qry[1];
if($_POST && $qry[0] =="savepreset"){ if($_POST && $qry[0] =="savepreset")
foreach($_POST as $key => $value){ {
$exclude_array = explode(',',$exclude_fields);
foreach($_POST as $key => $value)
{
if (!in_array($key,$exclude_array))
{
$value = $tp->toDB($value); $value = $tp->toDB($value);
if ($sql -> db_Update("preset", "preset_value='$value' WHERE preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' ")){ if ($sql -> db_Update("preset", "preset_value='$value' WHERE preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' "))
{
} elseif ($value !="" && !$sql -> db_Select("preset","*","preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' ")){ }
elseif ($value !="" && !$sql -> db_Select("preset","*","preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' "))
{
$sql -> db_Insert("preset", "0, '".$unique_id[$uid]."', '$key', '$value' "); $sql -> db_Insert("preset", "0, '".$unique_id[$uid]."', '$key', '$value' ");
} }
if($value == ""){ if($value == "")
{
$sql -> db_Delete("preset", "preset_field ='".$key."' "); $sql -> db_Delete("preset", "preset_field ='".$key."' ");
} }
}
} }
$ns -> tablerender(LAN_SAVED, LAN_PRESET_SAVED); $ns -> tablerender(LAN_SAVED, LAN_PRESET_SAVED);
} }