mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Extended fields added for Skype and Gender. Also GUI cleanup.
This commit is contained in:
@@ -483,10 +483,10 @@ class users_ext
|
|||||||
}
|
}
|
||||||
$text .= "
|
$text .= "
|
||||||
</td>
|
</td>
|
||||||
<td class='center' style='width:10%'>
|
<td class='center' style='width:10%;white-space:nowrap'>
|
||||||
|
|
||||||
<a style='text-decoration:none' href='".e_SELF."?editext.".$id."'>".ADMIN_EDIT_ICON."</a>
|
<a class='btn btn-large' style='text-decoration:none' href='".e_SELF."?editext.".$id."'>".ADMIN_EDIT_ICON."</a>
|
||||||
<input type='image' title='".LAN_DELETE."' name='eudel[".$name."]' src='".ADMIN_DELETE_ICON_PATH."' value='".$id."' onclick='return confirm(\"".EXTLAN_27."\")' />
|
<input class='btn btn-large' type='image' title='".LAN_DELETE."' name='eudel[".$name."]' src='".ADMIN_DELETE_ICON_PATH."' value='".$id."' onclick='return confirm(\"".EXTLAN_27."\")' />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
@@ -990,15 +990,17 @@ class users_ext
|
|||||||
}
|
}
|
||||||
$var['main']['text'] = EXTLAN_34;
|
$var['main']['text'] = EXTLAN_34;
|
||||||
$var['main']['link'] = e_SELF;
|
$var['main']['link'] = e_SELF;
|
||||||
|
|
||||||
|
$var['pre']['text'] = EXTLAN_45;
|
||||||
|
$var['pre']['link'] = e_SELF."?pre";
|
||||||
|
|
||||||
$var['editext']['text'] = EXTLAN_45;
|
$var['editext']['text'] = "Add Custom Field";
|
||||||
$var['editext']['link'] = e_SELF."?editext";
|
$var['editext']['link'] = e_SELF."?editext";
|
||||||
|
|
||||||
$var['cat']['text'] = EXTLAN_35;
|
$var['cat']['text'] = EXTLAN_35;
|
||||||
$var['cat']['link'] = e_SELF."?cat";
|
$var['cat']['link'] = e_SELF."?cat";
|
||||||
|
|
||||||
$var['pre']['text'] = EXTLAN_56;
|
|
||||||
$var['pre']['link'] = e_SELF."?pre";
|
|
||||||
|
|
||||||
show_admin_menu(EXTLAN_9, $action, $var);
|
show_admin_menu(EXTLAN_9, $action, $var);
|
||||||
}
|
}
|
||||||
|
@@ -50,6 +50,20 @@
|
|||||||
<read>253</read>
|
<read>253</read>
|
||||||
<write>253</write>
|
<write>253</write>
|
||||||
</item>
|
</item>
|
||||||
|
<item name="skype">
|
||||||
|
<type>text</type>
|
||||||
|
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||||
|
<applicable>253</applicable>
|
||||||
|
<read>253</read>
|
||||||
|
<write>253</write>
|
||||||
|
</item>
|
||||||
|
<item name="gender">
|
||||||
|
<type>radio</type>
|
||||||
|
<values>M => UE_LAN_MALE,F => UE_LAN_FEMALE</values>
|
||||||
|
<applicable>253</applicable>
|
||||||
|
<read>253</read>
|
||||||
|
<write>253</write>
|
||||||
|
</item>
|
||||||
<item name="homepage">
|
<item name="homepage">
|
||||||
<type>text</type>
|
<type>text</type>
|
||||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||||
|
@@ -628,66 +628,113 @@ class e107_user_extended
|
|||||||
|
|
||||||
function user_extended_edit($struct, $curval)
|
function user_extended_edit($struct, $curval)
|
||||||
{
|
{
|
||||||
global $tp;
|
$tp = e107::getParser();
|
||||||
if(trim($curval) == "" && $struct['user_extended_struct_default'] != "")
|
$frm = e107::getForm();
|
||||||
{
|
|
||||||
$curval = $struct['user_extended_struct_default'];
|
if(trim($curval) == "" && $struct['user_extended_struct_default'] != "")
|
||||||
}
|
{
|
||||||
$choices = explode(",",$struct['user_extended_struct_values']);
|
$curval = $struct['user_extended_struct_default'];
|
||||||
foreach($choices as $k => $v)
|
}
|
||||||
{
|
|
||||||
$choices[$k] = str_replace("[E_COMMA]", ",", $choices[$k]);
|
$choices = explode(",",$struct['user_extended_struct_values']);
|
||||||
}
|
|
||||||
$parms = explode("^,^",$struct['user_extended_struct_parms']);
|
foreach($choices as $k => $v)
|
||||||
$include = preg_replace("/\n/", " ", $tp->toHtml($parms[0]));
|
{
|
||||||
$regex = $tp->toText($parms[1]);
|
$choices[$k] = str_replace("[E_COMMA]", ",", $v);
|
||||||
$regexfail = $tp->toText($parms[2]);
|
}
|
||||||
$fname = "ue[user_".$struct['user_extended_struct_name']."]";
|
|
||||||
if(strpos($include, 'class') === FALSE)
|
$parms = explode("^,^",$struct['user_extended_struct_parms']);
|
||||||
{
|
$include = preg_replace("/\n/", " ", $tp->toHtml($parms[0]));
|
||||||
$include .= " class='tbox' ";
|
$regex = $tp->toText($parms[1]);
|
||||||
}
|
$regexfail = $tp->toText($parms[2]);
|
||||||
|
$fname = "ue[user_".$struct['user_extended_struct_name']."]";
|
||||||
|
|
||||||
|
if(strpos($include, 'class') === FALSE)
|
||||||
|
{
|
||||||
|
$include .= " class='tbox' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch($struct['user_extended_struct_type'])
|
switch($struct['user_extended_struct_type'])
|
||||||
{
|
{
|
||||||
case EUF_TEXT : //textbox
|
case EUF_TEXT : //textbox
|
||||||
case EUF_INTEGER : //integer
|
case EUF_INTEGER : //integer
|
||||||
$ret = "<input name='{$fname}' value='{$curval}' {$include} />";
|
$ret = "<input name='{$fname}' value='{$curval}' {$include} />";
|
||||||
return $ret;
|
return $ret;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EUF_RADIO : //radio
|
case EUF_RADIO : //radio
|
||||||
$ret = '';
|
|
||||||
foreach($choices as $choice)
|
$ret = '';
|
||||||
{
|
|
||||||
$choice = trim($choice);
|
foreach($choices as $choice)
|
||||||
$choice = deftrue($choice, $choice);
|
{
|
||||||
$chk = ($curval == $choice)? " checked='checked' " : "";
|
$choice = trim($choice);
|
||||||
$ret .= "<input {$include} type='radio' name='{$fname}' value='{$choice}' {$chk} /> {$choice}";
|
if(strpos($choice,"|")!==FALSE)
|
||||||
}
|
{
|
||||||
return $ret;
|
list($val,$label) = explode("|",$choice);
|
||||||
|
}
|
||||||
|
elseif(strpos($choice," => ")!==FALSE) // new in v2.x
|
||||||
|
{
|
||||||
|
list($val,$label) = explode(" => ",$choice);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$val = $choice;
|
||||||
|
$label = $choice;
|
||||||
|
}
|
||||||
|
|
||||||
|
$label = deftrue($label, $label);
|
||||||
|
|
||||||
|
if(deftrue('e_BOOTSTRAP'))
|
||||||
|
{
|
||||||
|
$ret .= $frm->radio($fname,$val,($curval == $val),array('label'=>$label));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$chk = ($curval == $val)? " checked='checked' " : "";
|
||||||
|
$ret .= "<input {$include} type='radio' name='{$fname}' value='{$val}' {$chk} /> {$label}";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EUF_CHECKBOX : //checkboxes
|
case EUF_CHECKBOX : //checkboxes
|
||||||
foreach($choices as $choice)
|
foreach($choices as $choice)
|
||||||
{
|
|
||||||
$choice = trim($choice);
|
|
||||||
if(strpos($choice,"|")!==FALSE)
|
|
||||||
{
|
{
|
||||||
list($val,$label) = explode("|",$choice);
|
$choice = trim($choice);
|
||||||
|
|
||||||
|
if(strpos($choice,"|")!==FALSE)
|
||||||
|
{
|
||||||
|
list($val,$label) = explode("|",$choice);
|
||||||
|
}
|
||||||
|
elseif(strpos($choice," => ")!==FALSE) // new in v2.x
|
||||||
|
{
|
||||||
|
list($val,$label) = explode(" => ",$choice);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$val = $choice;
|
||||||
|
$label = $choice;
|
||||||
|
}
|
||||||
|
$label = deftrue($label, $label);
|
||||||
|
|
||||||
|
if(deftrue('e_BOOTSTRAP'))
|
||||||
|
{
|
||||||
|
$ret .= $frm->checkbox($fname,$val,($curval == $val),array('label'=>$label));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$chk = ($curval == $val)? " checked='checked' " : "";
|
||||||
|
$ret .= "<input {$include} type='checkbox' name='{$fname}[]' value='{$val}' {$chk} /> {$label}<br />";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return $ret;
|
||||||
$val = $choice;
|
break;
|
||||||
$label = $choice;
|
|
||||||
}
|
|
||||||
$label = deftrue($label, $label);
|
|
||||||
$chk = ($curval == $val)? " checked='checked' " : "";
|
|
||||||
$ret .= "<input {$include} type='checkbox' name='{$fname}[]' value='{$val}' {$chk} /> {$label}<br />";
|
|
||||||
}
|
|
||||||
return $ret;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EUF_DROPDOWN : //dropdown
|
case EUF_DROPDOWN : //dropdown
|
||||||
$ret = "<select {$include} name='{$fname}'>\n";
|
$ret = "<select {$include} name='{$fname}'>\n";
|
||||||
|
@@ -50,4 +50,13 @@ define('UE_LAN_TIMEZONE_DESC', 'User Timezone (from predefined list)');
|
|||||||
|
|
||||||
define("LAN_UE_FAIL_HOMEPAGE", "Invalid entry for home page setting");
|
define("LAN_UE_FAIL_HOMEPAGE", "Invalid entry for home page setting");
|
||||||
|
|
||||||
|
define("UE_LAN_SKYPE","Skype");
|
||||||
|
define("UE_LAN_SKYPE_DESC","Skype Address");
|
||||||
|
define("UE_LAN_GENDER","Gender");
|
||||||
|
define("UE_LAN_GENDER_DESC","Gender");
|
||||||
|
define("UE_LAN_MALE","Male");
|
||||||
|
define("UE_LAN_FEMALE","Female");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user