mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
More user-extended-fields clean-up
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/users_extended.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/users_extended.php,v $
|
||||||
| $Revision: 1.16 $
|
| $Revision: 1.17 $
|
||||||
| $Date: 2009-08-06 21:26:48 $
|
| $Date: 2009-08-07 13:47:31 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -42,6 +42,9 @@ require_once("auth.php");
|
|||||||
require_once(e_HANDLER.'user_extended_class.php');
|
require_once(e_HANDLER.'user_extended_class.php');
|
||||||
require_once(e_HANDLER.'userclass_class.php');
|
require_once(e_HANDLER.'userclass_class.php');
|
||||||
|
|
||||||
|
require_once(e_HANDLER.'form_handler.php');
|
||||||
|
$frm = new e_form;
|
||||||
|
|
||||||
$ue = new e107_user_extended;
|
$ue = new e107_user_extended;
|
||||||
$message = '';
|
$message = '';
|
||||||
|
|
||||||
@@ -122,7 +125,7 @@ if (isset($_POST['add_field']))
|
|||||||
{
|
{
|
||||||
$_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']);
|
$_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']);
|
||||||
}
|
}
|
||||||
$new_values = make_delimited($_POST['user_values']);
|
$new_values = $user->make_delimited($_POST['user_values']);
|
||||||
$new_parms = $tp->toDB($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']);
|
$new_parms = $tp->toDB($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']);
|
||||||
|
|
||||||
// Check to see if its a reserved field name before adding to database
|
// Check to see if its a reserved field name before adding to database
|
||||||
@@ -156,7 +159,7 @@ if (isset($_POST['update_field']))
|
|||||||
{
|
{
|
||||||
$_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']);
|
$_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']);
|
||||||
}
|
}
|
||||||
$upd_values = make_delimited($_POST['user_values']);
|
$upd_values = $user->make_delimited($_POST['user_values']);
|
||||||
$upd_parms = $tp->toDB($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']);
|
$upd_parms = $tp->toDB($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']);
|
||||||
admin_update($ue->user_extended_modify($sub_action, $tp->toDB($_POST['user_field']), $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $upd_parms, $upd_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), intval($_POST['user_parent'])), 'update', EXTLAN_29);
|
admin_update($ue->user_extended_modify($sub_action, $tp->toDB($_POST['user_field']), $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $upd_parms, $upd_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), intval($_POST['user_parent'])), 'update', EXTLAN_29);
|
||||||
$admin_log->log_event('EUF_06',$tp->toDB($_POST['user_field']).'[!br!]'.$tp->toDB($_POST['user_text']).'[!br!]'.intval($_POST['user_type']),E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('EUF_06',$tp->toDB($_POST['user_field']).'[!br!]'.$tp->toDB($_POST['user_text']).'[!br!]'.intval($_POST['user_type']),E_LOG_INFORMATIVE,'');
|
||||||
@@ -206,12 +209,12 @@ if (varset($_POST['eu_action'],'') == "delcat")
|
|||||||
|
|
||||||
if(isset($_POST['activate']))
|
if(isset($_POST['activate']))
|
||||||
{
|
{
|
||||||
$message .= field_activate();
|
$message .= $user->field_activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['deactivate']))
|
if(isset($_POST['deactivate']))
|
||||||
{
|
{
|
||||||
$message .= field_deactivate();
|
$message .= $user->field_deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -237,7 +240,9 @@ if($sql->db_Select("user_extended_struct","DISTINCT(user_extended_struct_parent)
|
|||||||
|
|
||||||
if($message)
|
if($message)
|
||||||
{
|
{
|
||||||
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
|
$emessage = eMessage::getInstance();
|
||||||
|
$emessage->add($message, E_MESSAGE_SUCCESS);
|
||||||
|
// $ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -274,7 +279,7 @@ if ($action == "editext")
|
|||||||
|
|
||||||
if($action == 'pre')
|
if($action == 'pre')
|
||||||
{
|
{
|
||||||
show_predefined();
|
$user->show_predefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($action == 'cat')
|
if($action == 'cat')
|
||||||
@@ -296,7 +301,7 @@ class users_ext
|
|||||||
|
|
||||||
function show_extended($current = '')
|
function show_extended($current = '')
|
||||||
{
|
{
|
||||||
global $sql, $ns, $ue, $curtype, $tp, $mySQLdefaultdb, $action, $sub_action;
|
global $sql, $ns, $ue, $curtype, $tp, $mySQLdefaultdb, $action, $sub_action,$frm;
|
||||||
|
|
||||||
$catList = $ue->user_extended_get_categories();
|
$catList = $ue->user_extended_get_categories();
|
||||||
$catList[0][0] = array('user_extended_struct_name' => EXTLAN_36);
|
$catList[0][0] = array('user_extended_struct_name' => EXTLAN_36);
|
||||||
@@ -312,6 +317,8 @@ class users_ext
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>".EXTLAN_1."</th>
|
<th>".EXTLAN_1."</th>
|
||||||
|
<th>".EXTLAN_79."</th>
|
||||||
|
|
||||||
<th>".EXTLAN_2."</th>
|
<th>".EXTLAN_2."</th>
|
||||||
<th>".EXTLAN_4."</th>
|
<th>".EXTLAN_4."</th>
|
||||||
<th>".EXTLAN_5."</th>
|
<th>".EXTLAN_5."</th>
|
||||||
@@ -341,7 +348,8 @@ class users_ext
|
|||||||
$uVal = str_replace(chr(1), "", $ext['user_extended_struct_default']); // Is this right?
|
$uVal = str_replace(chr(1), "", $ext['user_extended_struct_default']); // Is this right?
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$ext['user_extended_struct_name']}<br />[".$tp->toHTML($ext['user_extended_struct_text'], FALSE, "defs")."]</td>
|
<td>{$ext['user_extended_struct_name']}</td>
|
||||||
|
<td>".$tp->toHTML($ext['user_extended_struct_text'], FALSE, "defs")."</td>
|
||||||
<td class='left'>".$ue->user_extended_edit($ext,$uVal)."</td>
|
<td class='left'>".$ue->user_extended_edit($ext,$uVal)."</td>
|
||||||
<td>".($ext['user_extended_struct_required'] == 1 ? LAN_YES : LAN_NO)."</td>
|
<td>".($ext['user_extended_struct_required'] == 1 ? LAN_YES : LAN_NO)."</td>
|
||||||
<td>".r_userclass_name($ext['user_extended_struct_applicable'])."</td>
|
<td>".r_userclass_name($ext['user_extended_struct_applicable'])."</td>
|
||||||
@@ -433,7 +441,7 @@ class users_ext
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
<br /><span class='smalltext'>".EXTLAN_11."</span>
|
<br /><span class='field-help'>".EXTLAN_11."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -441,7 +449,7 @@ class users_ext
|
|||||||
<td>".EXTLAN_12.":</td>
|
<td>".EXTLAN_12.":</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
<input class='tbox' type='text' name='user_text' size='40' value='".$current['user_extended_struct_text']."' maxlength='50' /><br />
|
<input class='tbox' type='text' name='user_text' size='40' value='".$current['user_extended_struct_text']."' maxlength='50' /><br />
|
||||||
<span class='smalltext'>".EXTLAN_13."</span>
|
<span class='field-help'>".EXTLAN_13."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
@@ -491,7 +499,7 @@ class users_ext
|
|||||||
$text .= "
|
$text .= "
|
||||||
</div>
|
</div>
|
||||||
<input type='button' class='button' value='".EXTLAN_48."' onclick=\"duplicateHTML('value_line','value_container');\" />
|
<input type='button' class='button' value='".EXTLAN_48."' onclick=\"duplicateHTML('value_line','value_container');\" />
|
||||||
<br /><span class='smalltext'>".EXTLAN_17."</span></div>";
|
<br /><span class='field-help'>".EXTLAN_17."</span></div>";
|
||||||
// End of Values. --------------------------------------
|
// End of Values. --------------------------------------
|
||||||
$db_hide = ($current['user_extended_struct_type'] == 4) ? "visible" : "none";
|
$db_hide = ($current['user_extended_struct_type'] == 4) ? "visible" : "none";
|
||||||
|
|
||||||
@@ -567,7 +575,7 @@ class users_ext
|
|||||||
<td>".EXTLAN_15."</td>
|
<td>".EXTLAN_15."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
<textarea class='tbox' name='user_include' cols='60' rows='2'>{$current_include}</textarea><br />
|
<textarea class='tbox' name='user_include' cols='60' rows='2'>{$current_include}</textarea><br />
|
||||||
<span class='smalltext'>".EXTLAN_51."</span><br />
|
<span class='field-help'>".EXTLAN_51."</span><br />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -575,7 +583,7 @@ class users_ext
|
|||||||
<td>".EXTLAN_52."</td>
|
<td>".EXTLAN_52."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
<input class='tbox' type='text' name='user_regex' size='30' value='{$current_regex}' /><br />
|
<input class='tbox' type='text' name='user_regex' size='30' value='{$current_regex}' /><br />
|
||||||
<span class='smalltext'>".EXTLAN_53."</span><br />
|
<span class='field-help'>".EXTLAN_53."</span><br />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -583,7 +591,7 @@ class users_ext
|
|||||||
<td >".EXTLAN_54."</td>
|
<td >".EXTLAN_54."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
<input class='tbox' type='text' name='user_regexfail' size='40' value='{$current_regexfail}' /><br />
|
<input class='tbox' type='text' name='user_regexfail' size='40' value='{$current_regexfail}' /><br />
|
||||||
<span class='smalltext'>".EXTLAN_55."</span><br />
|
<span class='field-help'>".EXTLAN_55."</span><br />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -616,28 +624,28 @@ class users_ext
|
|||||||
$text .= "
|
$text .= "
|
||||||
</select>
|
</select>
|
||||||
<br />
|
<br />
|
||||||
<span class='smalltext'>".EXTLAN_19."</span>
|
<span class='field-help'>".EXTLAN_19."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td >".EXTLAN_5."</td>
|
<td >".EXTLAN_5."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
".r_userclass("user_applicable", $current['user_extended_struct_applicable'], 'off', 'member, admin, classes, nobody')."<br /><span class='smalltext'>".EXTLAN_20."</span>
|
".r_userclass("user_applicable", $current['user_extended_struct_applicable'], 'off', 'member, admin, classes, nobody')."<br /><span class='field-help'>".EXTLAN_20."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>".EXTLAN_6."</td>
|
<td>".EXTLAN_6."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
".r_userclass("user_read", $current['user_extended_struct_read'], 'off', 'public, member, admin, readonly, classes')."<br /><span class='smalltext'>".EXTLAN_22."</span>
|
".r_userclass("user_read", $current['user_extended_struct_read'], 'off', 'public, member, admin, readonly, classes')."<br /><span class='field-help'>".EXTLAN_22."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>".EXTLAN_7."</td>
|
<td>".EXTLAN_7."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
".r_userclass("user_write", $current['user_extended_struct_write'], 'off', 'member, admin, classes')."<br /><span class='smalltext'>".EXTLAN_21."</span>
|
".r_userclass("user_write", $current['user_extended_struct_write'], 'off', 'member, admin, classes')."<br /><span class='field-help'>".EXTLAN_21."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -661,12 +669,12 @@ class users_ext
|
|||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
</select>
|
</select>
|
||||||
<br /><span class='smalltext'>".EXTLAN_50."</span>
|
<br /><span class='field-help'>".EXTLAN_50."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$text .= "<tr>
|
$text .= "
|
||||||
</table>
|
</table>
|
||||||
<div class='buttons-bar center'>
|
<div class='buttons-bar center'>
|
||||||
";
|
";
|
||||||
@@ -674,16 +682,12 @@ class users_ext
|
|||||||
// if ((!is_array($current) || $action == "continue") && $sub_action == "")
|
// if ((!is_array($current) || $action == "continue") && $sub_action == "")
|
||||||
if ((($mode == 'new') || $action == "continue") && $sub_action == "")
|
if ((($mode == 'new') || $action == "continue") && $sub_action == "")
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= $frm->admin_button('add_field', EXTLAN_23);
|
||||||
<input class='button' type='submit' name='add_field' value='".EXTLAN_23."' />
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= $frm->admin_button('update_field', EXTLAN_24,'update').
|
||||||
<input class='button' type='submit' name='update_field' value='".EXTLAN_24."' />
|
$frm->admin_button('cancel', EXTLAN_33);
|
||||||
<input class='button' type='submit' name='cancel' value='".EXTLAN_33."' />
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -692,17 +696,19 @@ class users_ext
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
// $text .= "</div>";
|
// $text .= "</div>";
|
||||||
$ns->tablerender(EXTLAN_9, $text);
|
$emessage = eMessage::getInstance();
|
||||||
|
$ns->tablerender(EXTLAN_9,$emessage->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function show_categories($current)
|
function show_categories($current)
|
||||||
{
|
{
|
||||||
global $sql, $ns, $ue;
|
global $sql, $ns, $ue, $frm;
|
||||||
|
|
||||||
$text = "<div style='text-align:center'>";
|
$text = "<div style='text-align:center'>";
|
||||||
$text .= "
|
$text .= "
|
||||||
<table style='".ADMIN_WIDTH."' class='fborder'>
|
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class='fcaption'>".EXTLAN_1."</td>
|
<td class='fcaption'>".EXTLAN_1."</td>
|
||||||
<td class='fcaption'>".EXTLAN_5."</td>
|
<td class='fcaption'>".EXTLAN_5."</td>
|
||||||
@@ -776,60 +782,59 @@ class users_ext
|
|||||||
</table>
|
</table>
|
||||||
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
||||||
";
|
";
|
||||||
$text .= "<div><br /></div><table style='".ADMIN_WIDTH."' class='fborder'> ";
|
$text .= "<div><br /></div>
|
||||||
|
<table cellpadding='0' cellspacing='0' class='adminform'>
|
||||||
|
<colgroup span='2'>
|
||||||
|
<col class='col-label' />
|
||||||
|
<col class='col-control' />
|
||||||
|
</colgroup>";
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>".EXTLAN_38.":</td>
|
<td>".EXTLAN_38.":</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
<input class='tbox' type='text' name='user_field' size='40' value='".$current['user_extended_struct_name']."' maxlength='50' />
|
<input class='tbox' type='text' name='user_field' size='40' value='".$current['user_extended_struct_name']."' maxlength='50' />
|
||||||
<br /><span class='smalltext'>".EXTLAN_11."</span>
|
<br /><span class='field-help'>".EXTLAN_11."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>".EXTLAN_5."</td>
|
<td>".EXTLAN_5."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
".r_userclass("user_applicable", $current['user_extended_struct_applicable'], 'off', 'member, admin, classes')."<br /><span class='smalltext'>".EXTLAN_20."</span>
|
".r_userclass("user_applicable", $current['user_extended_struct_applicable'], 'off', 'member, admin, classes')."<br /><span class='field-help'>".EXTLAN_20."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>".EXTLAN_6."</td>
|
<td>".EXTLAN_6."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
".r_userclass("user_read", $current['user_extended_struct_read'], 'off', 'public, member, admin, classes, readonly')."<br /><span class='smalltext'>".EXTLAN_22."</span>
|
".r_userclass("user_read", $current['user_extended_struct_read'], 'off', 'public, member, admin, classes, readonly')."<br /><span class='field-help'>".EXTLAN_22."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td >".EXTLAN_7."</td>
|
<td >".EXTLAN_7."</td>
|
||||||
<td colspan='3'>
|
<td colspan='3'>
|
||||||
".r_userclass("user_write", $current['user_extended_struct_write'], 'off', 'member, admin, classes')."<br /><span class='smalltext'>".EXTLAN_21."</span>
|
".r_userclass("user_write", $current['user_extended_struct_write'], 'off', 'member, admin, classes')."<br /><span class='field-help'>".EXTLAN_21."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>";
|
</tr>
|
||||||
|
</table>";
|
||||||
|
|
||||||
|
|
||||||
$text .= "<tr>
|
$text .= "<div class='buttons-bar center'>";
|
||||||
<td colspan='4' style='text-align:center' class='forumheader'>";
|
|
||||||
|
|
||||||
if (!is_array($current))
|
if (!is_array($current))
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= $frm->admin_button('add_category', EXTLAN_39);
|
||||||
<input class='button' type='submit' name='add_category' value='".EXTLAN_39."' />
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= $frm->admin_button('update_category', EXTLAN_42,'update').
|
||||||
<input class='button' type='submit' name='update_category' value='".EXTLAN_42."' />
|
$frm->admin_button('cancel', EXTLAN_33);
|
||||||
<input class='button' type='submit' name='cancel_cat' value='".EXTLAN_33."' />
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
// ======= end added by Cam.
|
// ======= end added by Cam.
|
||||||
$text .= "</td>
|
$text .= "</div></form></div>";
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table></form></div>";
|
|
||||||
$ns->tablerender(EXTLAN_9, $text);
|
$ns->tablerender(EXTLAN_9, $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -854,22 +859,14 @@ class users_ext
|
|||||||
|
|
||||||
show_admin_menu(EXTLAN_9, $action, $var);
|
show_admin_menu(EXTLAN_9, $action, $var);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function users_extended_adminmenu() {
|
|
||||||
global $user, $action, $ns, $curtype, $action;
|
|
||||||
$user->show_options($action);
|
|
||||||
if($action == 'editext' || $action == 'continue')
|
|
||||||
|
function make_delimited($var)
|
||||||
{
|
{
|
||||||
$ns->tablerender(EXTLAN_46." - <span id='ue_type'> </span>", "<div id='ue_help'> </div>");
|
|
||||||
echo "<script type='text/javascript'>changeHelp('{$curtype}');</script>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function make_delimited($var)
|
|
||||||
{
|
|
||||||
global $tp;
|
global $tp;
|
||||||
foreach($var as $k => $v)
|
foreach($var as $k => $v)
|
||||||
{
|
{
|
||||||
@@ -882,12 +879,12 @@ function make_delimited($var)
|
|||||||
}
|
}
|
||||||
$ret = implode(",", $var);
|
$ret = implode(",", $var);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function show_predefined()
|
function show_predefined()
|
||||||
{
|
{
|
||||||
global $tp, $ns, $ue, $sql;
|
global $tp, $ns, $ue, $sql, $frm;
|
||||||
|
|
||||||
// Get list of current extended fields
|
// Get list of current extended fields
|
||||||
$curList = $ue->user_extended_get_fieldlist();
|
$curList = $ue->user_extended_get_fieldlist();
|
||||||
@@ -896,103 +893,97 @@ function show_predefined()
|
|||||||
$curNames[] = $c['user_extended_struct_name'];
|
$curNames[] = $c['user_extended_struct_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get list of predefined fields, determine which are already activated.
|
//Get list of predefined fields.
|
||||||
$preList = $ue->parse_extended_xml('getfile');
|
$preList = $ue->parse_extended_xml('getfile');
|
||||||
ksort($preList);
|
ksort($preList);
|
||||||
$active = array();
|
|
||||||
foreach($preList as $k => $v)
|
|
||||||
{
|
|
||||||
if($k != 'version')
|
|
||||||
{
|
|
||||||
if(in_array($v['name'], $curNames))
|
|
||||||
{
|
|
||||||
$active[] = $v;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$inactive[] = $v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$txt = "
|
$txt = "
|
||||||
<form method='post' action='".e_SELF."?pre'>
|
<form method='post' action='".e_SELF."?pre'>
|
||||||
<table class='fborder' style='".ADMIN_WIDTH."'>
|
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
||||||
|
<colgroup span='6'>
|
||||||
|
<col />
|
||||||
|
<col />
|
||||||
|
<col />
|
||||||
|
<col />
|
||||||
|
<col />
|
||||||
|
<col />
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='fcaption' colspan='4'>".EXTLAN_57."</td>
|
<th>".UE_LAN_21."</th>
|
||||||
|
<th>".EXTLAN_79."</th>
|
||||||
|
<th>".EXTLAN_2."</th>
|
||||||
|
<th>".UE_LAN_22."</th>
|
||||||
|
<th class='center' >".EXTLAN_57."</th>
|
||||||
|
<th class='center last' >".LAN_OPTIONS."</th>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
</thead>
|
||||||
if(count($active))
|
<tbody>";
|
||||||
|
|
||||||
|
foreach($preList as $k=>$a)
|
||||||
{
|
{
|
||||||
foreach($active as $a)
|
if($k !='version') // don't know why this is appearing in the array.
|
||||||
{
|
{
|
||||||
$txt .= show_field($a, 'deactivate');
|
$active = (in_array($a['name'], $curNames)) ? TRUE : FALSE;
|
||||||
|
$txt .= $this->show_predefined_field($a,$active);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$txt .= "<tr><td class='forumheader3' colspan='4'>".EXTLAN_61."</td></tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$txt .= "
|
$txt .= "</tbody></table></form>";
|
||||||
<tr>
|
|
||||||
<td class='fcaption' colspan='4'>".EXTLAN_58."</td>
|
$emessage = eMessage::getInstance();
|
||||||
</tr>
|
$ns->tablerender(EXTLAN_56,$emessage->render(). $txt);
|
||||||
";
|
|
||||||
foreach($inactive as $a)
|
|
||||||
{
|
|
||||||
$txt .= show_field($a);
|
|
||||||
}
|
|
||||||
$txt .= "</table></form>";
|
|
||||||
$ns->tablerender(EXTLAN_56, $txt);
|
|
||||||
require_once('footer.php');
|
require_once('footer.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function show_field($var, $type='activate')
|
function show_predefined_field($var, $active)
|
||||||
{
|
{
|
||||||
global $tp;
|
global $tp,$ue, $frm;
|
||||||
static $head_shown;
|
static $head_shown;
|
||||||
$txt = "";
|
$txt = "";
|
||||||
// $showlist = array('type','text', 'values', 'include_text', 'regex');
|
|
||||||
if($head_shown != 1)
|
|
||||||
|
foreach($var as $key=>$val) // convert predefined xml to default array format
|
||||||
{
|
{
|
||||||
$txt .= "
|
$var['user_extended_struct_'.$key] = $val;
|
||||||
<tr>
|
|
||||||
<td class='forumheader'>".UE_LAN_21."</td>
|
|
||||||
<td class='forumheader'>".UE_LAN_22."</td>
|
|
||||||
<td class='forumheader'>".UE_LAN_23."</td>
|
|
||||||
<td class='forumheader' style='width: 5%'> </td>
|
|
||||||
</tr>
|
|
||||||
";
|
|
||||||
$head_shown = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$var['user_extended_struct_type'] = $ue->typeArray[$var['user_extended_struct_type']];
|
||||||
|
$var['user_extended_struct_parms'] = $var['include_text'];
|
||||||
|
|
||||||
$txt .= "
|
$txt .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3'>{$var['name']}</td>
|
<td>{$var['user_extended_struct_name']}</td>
|
||||||
<td class='forumheader3'>".$tp->toHTML($var['type'], false, 'defs')."</td>
|
<td>".constant(strtoupper($var['user_extended_struct_text'])."_DESC")."</td>
|
||||||
<td class='forumheader3'>".constant(strtoupper($var['text'])."_DESC")."</td>
|
<td>".$ue->user_extended_edit($var,$uVal)."</td>
|
||||||
|
<td>".$tp->toHTML($var['type'], false, 'defs')."</td>
|
||||||
|
<td class='center'>".($active ? ADMIN_TRUE_ICON : " ")."</td>
|
||||||
";
|
";
|
||||||
// $txt .= constant("UE_LAN_".strtoupper($var['text'])."DESC")."<br />";
|
// $txt .= constant("UE_LAN_".strtoupper($var['text'])."DESC")."<br />";
|
||||||
// foreach($showlist as $f)
|
// foreach($showlist as $f)
|
||||||
// {
|
// {
|
||||||
// if($var[$f] != "" && $f != 'type' && $f !='text')
|
// if($var[$f] != "" && $f != 'type' && $f !='text')
|
||||||
// {
|
// {
|
||||||
// $txt .= "<strong>{$f}: </strong>".$tp->toHTML($var[$f], false, 'defs')."<br />";
|
// $txt .= "<strong>{$f}: </strong>".$tp->toHTML($var[$f], false, 'defs')."<br />";
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
$val = ('activate' == $type) ? EXTLAN_59 : EXTLAN_60;
|
$val = (!$active) ? EXTLAN_59 : EXTLAN_60;
|
||||||
|
$type = (!$active) ? 'activate' : 'deactivate';
|
||||||
|
;
|
||||||
$txt .= "
|
$txt .= "
|
||||||
<td class='forumheader3' style='text-align: center'><input class='button' type='submit' name='{$type}[{$var['name']}]' value='{$val}' /></td>
|
<td class='center last'>";
|
||||||
|
$txt .= $frm->admin_button($type."[".$var['user_extended_struct_name']."]", $val);
|
||||||
|
$txt .= "</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
return $txt;
|
return $txt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function field_activate()
|
function field_activate()
|
||||||
{
|
{
|
||||||
global $ue, $ns, $tp;
|
global $ue, $ns, $tp, $admin_log;
|
||||||
$ret = "";
|
$ret = "";
|
||||||
$preList = $ue->parse_extended_xml('getfile');
|
$preList = $ue->parse_extended_xml('getfile');
|
||||||
$tmp = $preList;
|
$tmp = $preList;
|
||||||
@@ -1024,11 +1015,11 @@ function field_activate()
|
|||||||
}
|
}
|
||||||
$admin_log->log_event('EUF_11',implode(', ',$_POST['activate']),E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('EUF_11',implode(', ',$_POST['activate']),E_LOG_INFORMATIVE,'');
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function field_deactivate()
|
function field_deactivate()
|
||||||
{
|
{
|
||||||
global $ue, $ns, $tp, $sql, $admin_log;
|
global $ue, $ns, $tp, $sql, $admin_log;
|
||||||
$ret = "";
|
$ret = "";
|
||||||
foreach(array_keys($_POST['deactivate']) as $f)
|
foreach(array_keys($_POST['deactivate']) as $f)
|
||||||
@@ -1047,11 +1038,11 @@ function field_deactivate()
|
|||||||
}
|
}
|
||||||
$admin_log->log_event('EUF_12',implode(', ',$_POST['deactivate']),E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('EUF_12',implode(', ',$_POST['deactivate']),E_LOG_INFORMATIVE,'');
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function process_sql($f)
|
function process_sql($f)
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
$filename = e_ADMIN."sql/extended_".$f.".php";
|
$filename = e_ADMIN."sql/extended_".$f.".php";
|
||||||
$fd = fopen ($filename, "r");
|
$fd = fopen ($filename, "r");
|
||||||
@@ -1079,10 +1070,21 @@ function process_sql($f)
|
|||||||
|
|
||||||
return ($error) ? FALSE : TRUE;
|
return ($error) ? FALSE : TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}// end class
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function users_extended_adminmenu() {
|
||||||
|
global $user, $action, $ns, $curtype, $action;
|
||||||
|
$user->show_options($action);
|
||||||
|
if($action == 'editext' || $action == 'continue')
|
||||||
|
{
|
||||||
|
$ns->tablerender(EXTLAN_46." - <span id='ue_type'> </span>", "<div id='ue_help'> </div>");
|
||||||
|
echo "<script type='text/javascript'>changeHelp('{$curtype}');</script>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function headerjs()
|
function headerjs()
|
||||||
{
|
{
|
||||||
include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php");
|
include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php");
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
| e107 website system - Language File.
|
| e107 website system - Language File.
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_users_extended.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_users_extended.php,v $
|
||||||
| $Revision: 1.7 $
|
| $Revision: 1.8 $
|
||||||
| $Date: 2008-08-30 20:22:31 $
|
| $Date: 2009-08-07 13:47:33 $
|
||||||
| $Author: e107steved $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
define("EXTLAN_1", "Name");
|
define("EXTLAN_1", "Name");
|
||||||
@@ -92,6 +92,8 @@ define("EXTLAN_76", "Invalid characters in field name - only A-Z, a-z, 0-9, '_'
|
|||||||
define("EXTLAN_77", "Category not deleted - must delete fields in category first: ");
|
define("EXTLAN_77", "Category not deleted - must delete fields in category first: ");
|
||||||
define('EXTLAN_78', 'Cannot find file --FILE-- needed to create data table');
|
define('EXTLAN_78', 'Cannot find file --FILE-- needed to create data table');
|
||||||
|
|
||||||
|
define('EXTLAN_79', 'Label');
|
||||||
|
|
||||||
|
|
||||||
//textbox
|
//textbox
|
||||||
define("EXTLAN_HELP_1", "<b><i>Parameters:</i></b><br />size - size of field<br />maxlength - max length of field<br /><br />class - css class of field<br />style - css style string<br /><br />regex - regex validation code<br />regexfail - validation fail text");
|
define("EXTLAN_HELP_1", "<b><i>Parameters:</i></b><br />size - size of field<br />maxlength - max length of field<br /><br />class - css class of field<br />style - css style string<br /><br />regex - regex validation code<br />regexfail - validation fail text");
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
| e107 website system - Language File.
|
| e107 website system - Language File.
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_user_extended.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_user_extended.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2008-01-15 21:57:46 $
|
| $Date: 2009-08-07 13:47:35 $
|
||||||
| $Author: e107steved $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
// The LAN numbers correspond directly to the field types
|
// The LAN numbers correspond directly to the field types
|
||||||
@@ -19,6 +19,7 @@ define("UE_LAN_6", "Integer");
|
|||||||
define("UE_LAN_7", "Date");
|
define("UE_LAN_7", "Date");
|
||||||
define("UE_LAN_8", "Language");
|
define("UE_LAN_8", "Language");
|
||||||
define('UE_LAN_9', 'Predefined list');
|
define('UE_LAN_9', 'Predefined list');
|
||||||
|
define('UE_LAN_10', 'Checkboxes');
|
||||||
// Leave a gap to allow for more field types
|
// Leave a gap to allow for more field types
|
||||||
define("UE_LAN_21", "Name");
|
define("UE_LAN_21", "Name");
|
||||||
define("UE_LAN_22", "Type");
|
define("UE_LAN_22", "Type");
|
||||||
|
Reference in New Issue
Block a user