mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 05:02:02 +02:00
admin-> custom pages and admin->users. More work on column selection.
This commit is contained in:
parent
6cc3681262
commit
6c0bd1e16a
@ -9,9 +9,9 @@
|
||||
* Custom Menus/Pages Administration
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/cpage.php,v $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2009-03-22 21:17:41 $
|
||||
* $Author: e107steved $
|
||||
* $Revision: 1.14 $
|
||||
* $Date: 2009-07-08 10:31:52 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -97,11 +97,47 @@ require_once(e_ADMIN."footer.php");
|
||||
|
||||
class page
|
||||
{
|
||||
var $fields;
|
||||
|
||||
|
||||
function page()
|
||||
{
|
||||
|
||||
global $pref,$user_pref, $admin_log;
|
||||
if(isset($_POST['submit-e-columns']))
|
||||
{
|
||||
$user_pref['admin_cpage_columns'] = $_POST['e-columns'];
|
||||
save_prefs('user');
|
||||
}
|
||||
$this->fieldpref = (varset($user_pref['admin_cpage_columns'])) ? $user_pref['admin_cpage_columns'] : array("page_id","page_title","page_theme"); ;
|
||||
|
||||
$this->fields = array(
|
||||
'page_id' => array('title'=> ID, 'width'=>'5%', 'forced'=> TRUE),
|
||||
'page_title' => array('title'=> CUSLAN_1, 'width'=>'auto'),
|
||||
'page_theme' => array('title'=> CUSLAN_2, 'type' => 'text', 'width' => 'auto'),
|
||||
'page_author' => array('title'=> LAN_AUTHOR, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), // Display name
|
||||
'page_datestamp' => array('title'=> LAN_DATE, 'type' => 'text', 'width' => 'auto'), // User name
|
||||
'page_class' => array('title'=> LAN_USERCLASS, 'type' => 'text', 'width' => 'auto'), // Photo
|
||||
'page_rating_flag' => array('title'=> LAN_RATING, 'type' => 'text', 'width' => '10%', 'thclass' => 'center' ), // Real name (no real vetting)
|
||||
'page_comment_flag' => array('title'=> ADLAN_114, 'type' => 'text', 'width' => '10%', 'thclass' => 'center' ), // No real vetting
|
||||
// 'page_password' => array('title'=> LAN_USER_05, 'type' => 'text', 'width' => 'auto'),
|
||||
|
||||
// 'page_ip_restrict' => array('title'=> LAN_USER_07, 'type' => 'text', 'width' => 'auto'), // Avatar
|
||||
|
||||
'options' => array('title'=> LAN_OPTIONS, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last')
|
||||
);
|
||||
|
||||
// $this->fieldpref = array("page_id","page_title","page_author","page_class");
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
function showExistingPages()
|
||||
{
|
||||
global $sql, $e107, $emessage;
|
||||
global $sql, $e107, $emessage, $frm, $pref;
|
||||
|
||||
$text = "
|
||||
/* $text = "
|
||||
<form action='".e_SELF."' id='newsform' method='post'>
|
||||
<fieldset id='core-cpage-list'>
|
||||
<legend class='e-hideme'>".CUSLAN_5."</legend>
|
||||
@ -121,7 +157,17 @@ class page
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
";
|
||||
";*/
|
||||
|
||||
$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'>
|
||||
<colgroup span='".count($this->fieldpref)."'>".$frm->colGroup($this->fields,$this->fieldpref)."</colgroup>
|
||||
<thead>
|
||||
<tr>".$frm->thead($this->fields,$this->fieldpref)."</tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
|
||||
if(!$sql->db_Select("page", "*", "ORDER BY page_datestamp DESC", "nowhere"))
|
||||
{
|
||||
@ -141,12 +187,22 @@ class page
|
||||
{
|
||||
//title='".LAN_DELETE."'
|
||||
$title_text = $pge['page_title'] ? $pge['page_title'] : ($pge['page_theme'] ? CUSLAN_43.$pge['page_theme'] : CUSLAN_44);
|
||||
$author = get_user_data($pge['page_author']);
|
||||
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>{$pge['page_id']}</td>
|
||||
<td><a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e_BASE."page.php?{$pge['page_id']}" )."'>{$title_text}</a></td>
|
||||
<td>".($pge['page_theme'] ? "menu" : "page")."</td>
|
||||
<td class='center'>
|
||||
<td>{$pge['page_id']}</td>";
|
||||
|
||||
$text .= (in_array("page_title",$this->fieldpref)) ? "<td><a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e_BASE."page.php?{$pge['page_id']}" )."'>{$title_text}</a></td>" : "";
|
||||
$text .= (in_array("page_theme",$this->fieldpref)) ? "<td>".($pge['page_theme'] ? "menu" : "page")."</td>" : "";
|
||||
$text .= (in_array("page_author",$this->fieldpref)) ? "<td>".($author['user_name'])."</td>" : "";
|
||||
$text .= (in_array("page_datestamp",$this->fieldpref)) ? "<td>".strftime($pref['shortdate'],$pge['page_datestamp'])."</td>" : "";
|
||||
$text .= (in_array("page_class",$this->fieldpref)) ? "<td>".(r_userclass_name($pge['page_class']))."</td>" : "";
|
||||
$text .= (in_array("page_rating_flag",$this->fieldpref)) ? "<td class='center'>".($pge['page_rating_flag'] ? ADMIN_TRUE_ICON : " ")."</td>" : "";
|
||||
$text .= (in_array("page_comment_flag",$this->fieldpref)) ? "<td class='center'>".($pge['page_comment_flag'] ? ADMIN_TRUE_ICON : " ")."</td>" : "";
|
||||
|
||||
$text .= "<td class='center'>
|
||||
<a class='action edit' href='".e_SELF."?".($pge['page_theme'] ? "createm": "create").".edit.{$pge['page_id']}'>".ADMIN_EDIT_ICON."</a>
|
||||
<input type='image' class='action delete' name='delete[{$pge['page_id']}]' src='".ADMIN_DELETE_ICON_PATH."' title='".CUSLAN_4." [ ID: {$pge['page_id']} ]' />
|
||||
</td>
|
||||
|
@ -9,8 +9,8 @@
|
||||
* Administration Area - Users
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
|
||||
* $Revision: 1.38 $
|
||||
* $Date: 2009-07-08 07:00:26 $
|
||||
* $Revision: 1.39 $
|
||||
* $Date: 2009-07-08 10:31:52 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
@ -38,6 +38,8 @@ if(varset($_POST['useraction']))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_POST['useraction']) && $_POST['useraction'] == 'userinfo')
|
||||
{
|
||||
header('location:'.e_ADMIN."userinfo.php?".$e107->tp->toDB($_POST['userip']));
|
||||
@ -101,6 +103,7 @@ $userMethods = new UserHandler;
|
||||
$user_data = array();
|
||||
|
||||
$frm = new e_form;
|
||||
$rs = new form;
|
||||
|
||||
if (e_QUERY)
|
||||
{
|
||||
@ -766,15 +769,13 @@ class users
|
||||
// $user_total = db_Count($table, $fields = '(*)',
|
||||
$qry_insert = 'SELECT u.*, ue.* FROM `#user` AS u LEFT JOIN `#user_extended` AS ue ON ue.user_extended_id = u.user_id ';
|
||||
|
||||
$field_count = count($this->fieldpref);
|
||||
|
||||
if ($user_total = $sql->db_Select_gen($qry_insert. $query))
|
||||
{
|
||||
$text .= "<form method='post' action='".e_SELF."?".e_QUERY."'>
|
||||
<fieldset id='core-users-list'>
|
||||
<legend class='e-hideme'>".NWSLAN_4."</legend>
|
||||
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
||||
<colgroup span='".$field_count."'>".$frm->colGroup($this->fields,$this->fieldpref)."</colgroup>
|
||||
<colgroup span='".count($this->fieldpref)."'>".$frm->colGroup($this->fields,$this->fieldpref)."</colgroup>
|
||||
<thead>
|
||||
<tr>".$frm->thead($this->fields,$this->fieldpref)."</tr>
|
||||
</thead>
|
||||
@ -1221,49 +1222,49 @@ class users
|
||||
// Add a new user - may be passed existing data if there was an entry error on first pass
|
||||
function add_user($user_data)
|
||||
{
|
||||
global $frm, $ns, $pref, $e_userclass;
|
||||
global $rs, $ns, $pref, $e_userclass;
|
||||
if (!is_object($e_userclass)) $e_userclass = new user_class;
|
||||
$text = "<div style='text-align:center'>". $frm->form_open("post", e_SELF.(e_QUERY ? '?'.e_QUERY : ''), "adduserform")."
|
||||
$text = "<div style='text-align:center'>". $rs->form_open("post", e_SELF.(e_QUERY ? '?'.e_QUERY : ''), "adduserform")."
|
||||
<table class='adminlist'>
|
||||
<tr>
|
||||
<td style='width:30%'>".USRLAN_61."</td>
|
||||
<td style='width:70%'>
|
||||
".$frm->form_text('username', 40, varset($user_data['user_name'],""), varset($pref['displayname_maxlength'],15))."
|
||||
".$rs->form_text('username', 40, varset($user_data['user_name'],""), varset($pref['displayname_maxlength'],15))."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style='width:30%'>".USRLAN_128."</td>
|
||||
<td style='width:70%'>
|
||||
".$frm->form_text('loginname', 40, varset($user_data['user_loginname'],""), varset($pref['loginname_maxlength'],30))."
|
||||
".$frm->form_checkbox('generateloginname',1,varset($pref['predefinedLoginName'],FALSE)).USRLAN_170."
|
||||
".$rs->form_text('loginname', 40, varset($user_data['user_loginname'],""), varset($pref['loginname_maxlength'],30))."
|
||||
".$rs->form_checkbox('generateloginname',1,varset($pref['predefinedLoginName'],FALSE)).USRLAN_170."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style='width:30%'>".USRLAN_129."</td>
|
||||
<td style='width:70%'>
|
||||
".$frm->form_text("realname", 40, varset($user_data['user_login'],""), 30)."
|
||||
".$rs->form_text("realname", 40, varset($user_data['user_login'],""), 30)."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style='width:30%'>".USRLAN_62."</td>
|
||||
<td style='width:70%'>
|
||||
".$frm->form_password("password1", 40, "", 20)."
|
||||
".$frm->form_checkbox('generatepassword',1,FALSE).USRLAN_171."
|
||||
".$rs->form_password("password1", 40, "", 20)."
|
||||
".$rs->form_checkbox('generatepassword',1,FALSE).USRLAN_171."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='width:30%'>".USRLAN_63."</td>
|
||||
<td style='width:70%'>
|
||||
".$frm->form_password("password2", 40, "", 20)."
|
||||
".$rs->form_password("password2", 40, "", 20)."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='width:30%'>".USRLAN_64."</td>
|
||||
<td style='width:70%'>
|
||||
".$frm->form_text("email", 60, varset($user_data['user_email'],""), 100)."
|
||||
".$rs->form_text("email", 60, varset($user_data['user_email'],""), 100)."
|
||||
</td>
|
||||
</tr>\n";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: lan_admin.php,v 1.16 2009-01-09 17:25:50 secretr Exp $
|
||||
* $Id: lan_admin.php,v 1.17 2009-07-08 10:31:53 e107coders Exp $
|
||||
*
|
||||
* Admin Language File
|
||||
*/
|
||||
@ -284,4 +284,8 @@ define("LAN_NEWVERSION","New Version Available");
|
||||
|
||||
define("LAN_CHECKALL", 'Check All');
|
||||
define("LAN_UNCHECKALL", 'Uncheck All');
|
||||
|
||||
define("LAN_USERCLASS", "Userclass");
|
||||
define("LAN_AUTHOR", "Author");
|
||||
|
||||
?>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: lan_cpage.php,v 1.5 2008-12-30 13:51:41 secretr Exp $
|
||||
* $Id: lan_cpage.php,v 1.6 2009-07-08 10:31:53 e107coders Exp $
|
||||
*
|
||||
* Admin Language File
|
||||
*
|
||||
*/
|
||||
define("CUSLAN_1", "Title");
|
||||
define("CUSLAN_2", "Type");
|
||||
define("CUSLAN_3", "Options");
|
||||
// define("CUSLAN_3", "Options");
|
||||
define("CUSLAN_4", "Delete this item?");
|
||||
define("CUSLAN_5", "Existing Pages");
|
||||
define("CUSLAN_7", "Menu Name");
|
||||
|
Loading…
x
Reference in New Issue
Block a user