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

Split custom-menus and custom-pages into separate sub-pages, and added separate administrator perms for each.

This commit is contained in:
CaMer0n
2009-08-05 14:22:15 +00:00
parent 6b07315b2f
commit a7e312c388
5 changed files with 68 additions and 47 deletions

View File

@@ -9,8 +9,8 @@
* Admin Navigation
*
* $Source: /cvs_backup/e107_0.8/e107_admin/ad_links.php,v $
* $Revision: 1.12 $
* $Date: 2009-07-15 09:50:05 $
* $Revision: 1.13 $
* $Date: 2009-08-05 14:22:15 $
* $Author: e107coders $
*/
@@ -551,7 +551,7 @@ $array_functions = array(
2 => array(e_ADMIN.'banlist.php', ADLAN_34, ADLAN_35, '4', 2, E_16_BANLIST, E_32_BANLIST),
3 => array(e_ADMIN.'banner.php', ADLAN_54, ADLAN_55, 'D', 3, E_16_BANNER, E_32_BANNER),
4 => array(e_ADMIN.'cache.php', ADLAN_74, ADLAN_75, 'C', 1, E_16_CACHE, E_32_CACHE),
5 => array(e_ADMIN.'cpage.php', ADLAN_42, ADLAN_43, '5', 3, E_16_CUST, E_32_CUST),
5 => array(e_ADMIN.'cpage.php', ADLAN_42, ADLAN_43, '5|J', 3, E_16_CUST, E_32_CUST),
6 => array(e_ADMIN.'db.php', ADLAN_44, ADLAN_45, '0', 4, E_16_DATAB, E_32_DATAB),
7 => array(e_ADMIN.'download.php', ADLAN_24, ADLAN_25, 'R', 3, E_16_DOWNL, E_32_DOWNL),
8 => array(e_ADMIN.'emoticon.php', ADLAN_58, ADLAN_59, 'F', 1, E_16_EMOTE, E_32_EMOTE),

View File

@@ -9,8 +9,8 @@
* Administrators Management
*
* $Source: /cvs_backup/e107_0.8/e107_admin/administrator.php,v $
* $Revision: 1.12 $
* $Date: 2009-07-23 15:21:41 $
* $Revision: 1.13 $
* $Date: 2009-08-05 14:22:15 $
* $Author: e107coders $
*
*/
@@ -239,7 +239,8 @@ function edit_administrator($row)
$text .= checkb("2", $a_perms, ADMSLAN_20); // Alter Menus
$text .= checkb("3", $a_perms, ADMSLAN_21); // Modify administrator permissions
$text .= checkb("4", $a_perms, ADMSLAN_22); // Moderate users/bans etc
$text .= checkb("5", $a_perms, ADMSLAN_23); // create/edit custom pages/menus
$text .= checkb("5", $a_perms, ADMSLAN_23); // create/edit custom pages
$text .= checkb("J", $a_perms, ADMSLAN_41); // create/edit custom menus
$text .= checkb("Q", $a_perms, ADMSLAN_24); // Manage download categories
$text .= checkb("6", $a_perms, ADMSLAN_25); // Upload /manage files
$text .= checkb("Y", $a_perms, ADMSLAN_67); // file inspector
@@ -262,7 +263,7 @@ function edit_administrator($row)
$text .= checkb("B", $a_perms, ADMSLAN_37); // Moderate comments
$text .= checkb("H", $a_perms, ADMSLAN_39); // Post news
$text .= checkb("I", $a_perms, ADMSLAN_40); // Post links
// $text .= checkb("J", $a_perms, ADMSLAN_41); // Post articles - NOW PLUGIN
// $text .= checkb("K", $a_perms, ADMSLAN_42); // Post reviews - NOW PLUGIN
$text .= checkb("L", $a_perms, ADMSLAN_43); // Configure URLs
$text .= checkb("R", $a_perms, ADMSLAN_44); // Post downloads
@@ -376,7 +377,9 @@ function renderperms($perm, $id)
$pt["2"] = ADMSLAN_20;
$pt["3"] = ADMSLAN_21;
$pt["4"] = ADMSLAN_22; // Moderate users/bans etc
$pt["5"] = ADMSLAN_23; // create/edit custom pages/menus
$pt["5"] = ADMSLAN_23; // create/edit custom pages
$pt["J"] = ADMSLAN_41; // create/edit custom menus
$pt["Q"] = ADMSLAN_24; // Manage download categories
$pt["6"] = ADMSLAN_25; // Upload /manage files
$pt["Y"] = ADMSLAN_67; // file inspector

View File

@@ -9,15 +9,15 @@
* Custom Menus/Pages Administration
*
* $Source: /cvs_backup/e107_0.8/e107_admin/cpage.php,v $
* $Revision: 1.19 $
* $Date: 2009-08-03 18:36:24 $
* $Author: marj_nl_fr $
* $Revision: 1.20 $
* $Date: 2009-08-05 14:22:15 $
* $Author: e107coders $
*
*/
require_once("../class2.php");
if (!getperms("5")) { header("location:".e_BASE."index.php"); exit; }
if (!getperms("5|J")) { header("location:".e_BASE."index.php"); exit; }
$e_sub_cat = 'custom';
@@ -82,7 +82,15 @@ if (isset($_POST['saveOptions']))
if(!e_QUERY)
{
$page->showExistingPages();
if(getperms("5"))
{
$page->showExistingPages();
}
else
{
$page->showExistingPages('menus');
}
}
else
{
@@ -130,33 +138,19 @@ class page
// --------------------------------------------------------------------------
function showExistingPages()
function menusPage()
{
if(!getperms("J")){ return; }
return $this->showExistingPages('menus');
}
// --------------------------------------------------------------------------
function showExistingPages($mode=FALSE)
{
global $sql, $e107, $emessage, $frm, $pref;
/* $text = "
<form action='".e_SELF."' id='newsform' method='post'>
<fieldset id='core-cpage-list'>
<legend class='e-hideme'>".CUSLAN_5."</legend>
<table cellpadding='0' cellspacing='0' class='adminlist'>
<colgroup span='4'>
<col style='width: 5%'></col>
<col style='width: 60%'></col>
<col style='width: 15%'></col>
<col style='width: 20%'></col>
</colgroup>
<thead>
<tr>
<th>".ID."</th>
<th>".CUSLAN_1."</th>
<th>".CUSLAN_2."</th>
<th class='center last'>".CUSLAN_3."</th>
</tr>
</thead>
<tbody>
";*/
$text .= "<form method='post' action='".e_SELF."?".e_QUERY."'>
$text = "<form method='post' action='".e_SELF."?".e_QUERY."'>
<fieldset id='core-cpage-list'>
<legend class='e-hideme'>".CUSLAN_5."</legend>
<table cellpadding='0' cellspacing='0' class='adminlist'>".
@@ -165,7 +159,19 @@ class page
"<tbody>";
if(!$sql->db_Select("page", "*", "ORDER BY page_datestamp DESC", "nowhere"))
if($mode=='menus')
{
$qry = "page_theme !='' ";
$caption = CUSLAN_50;
}
else
{
if(!getperms("5")){ return; }
$qry = "page_theme ='' ";
$caption = CUSLAN_5;
}
if(!$sql->db_Select("page", "*", $qry." ORDER BY page_datestamp DESC"))
{
$text .= "
<tr>
@@ -214,7 +220,7 @@ class page
</form>
";
$e107->ns->tablerender(CUSLAN_5, $emessage->render().$text);
$e107->ns->tablerender($caption, $emessage->render().$text);
}
@@ -591,19 +597,27 @@ class page
{
if ($action == "")
{
$action = "main";
$action = (getperms('5')) ? "pages" : "menus";
}
$var['main']['text'] = CUSLAN_11;
$var['main']['link'] = e_SELF;
$var['pages']['text'] = CUSLAN_48;
$var['pages']['link'] = e_SELF;
$var['pages']['perm'] = 5;
$var['menus']['text'] = CUSLAN_49;
$var['menus']['link'] = e_SELF."?menus";
$var['menus']['perm'] = "J";
$var['create']['text'] = CUSLAN_12;
$var['create']['link'] = e_SELF."?create";
$var['create']['perm'] = 5;
$var['createm']['text'] = CUSLAN_31;
$var['createm']['link'] = e_SELF."?createm";
$var['createm']['perm'] = "J";
$var['options']['text'] = LAN_OPTIONS;
$var['options']['link'] = e_SELF."?options";
$var['options']['perm'] = "0";
e_admin_menu(CUSLAN_33, $action, $var);
}

View File

@@ -9,8 +9,8 @@
* Admin Language File
*
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_administrator.php,v $
* $Revision: 1.7 $
* $Date: 2009-07-07 22:55:13 $
* $Revision: 1.8 $
* $Date: 2009-08-05 14:22:15 $
* $Author: e107coders $
*/
//define("ADMSLAN_0", "New user/admin entry created for"); - no references found
@@ -31,7 +31,7 @@ define("ADMSLAN_19", "Alter site preferences");
define("ADMSLAN_20", "Alter Menus");
define("ADMSLAN_21", "Modify administrator permissions");
define("ADMSLAN_22", "Moderate users/bans etc");
define("ADMSLAN_23", "Create/edit custom pages/menus");
define("ADMSLAN_23", "Create/edit custom pages");
define("ADMSLAN_24", "Manage download categories");
define("ADMSLAN_25", "Upload /manage files");
define("ADMSLAN_26", "Oversee news categories");
@@ -49,7 +49,7 @@ define("ADMSLAN_37", "Moderate comments");
// define("ADMSLAN_38", "Moderate/configure chatbox");
define("ADMSLAN_39", "Post news");
define("ADMSLAN_40", "Post links");
//define("ADMSLAN_41", "Post articles"); - NOW PLUGIN
define("ADMSLAN_41", "Create/edit custom menus");
//define("ADMSLAN_42", "Post reviews"); - NOW PLUGIN
define("ADMSLAN_43", "Configure URLs");
define("ADMSLAN_44", "Post downloads");

View File

@@ -1,7 +1,7 @@
<?php
/*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: lan_cpage.php,v 1.6 2009-07-08 10:31:53 e107coders Exp $
* $Id: lan_cpage.php,v 1.7 2009-08-05 14:22:15 e107coders Exp $
*
* Admin Language File
*
@@ -53,4 +53,8 @@ define('CUSLAN_44', 'untitled page');
define('CUSLAN_45', 'Settings saved');
define('CUSLAN_46', 'Nothing changed - not saved');
define('CUSLAN_47', 'General Information');
define('CUSLAN_48', "Pages");
define('CUSLAN_49', "Menus");
define('CUSLAN_50', "Existing Menus");
?>