1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-15 11:04:18 +02:00

More flexibility for plugins - now able to create full set of predefined extended user fields on installation runtime.

This commit is contained in:
secretr
2011-11-25 17:35:12 +00:00
parent 04121af240
commit 4908a3fe37
2 changed files with 280 additions and 20 deletions

View File

@@ -54,6 +54,7 @@ class e107_user_extended
public function __construct()
{
define('EUF_CATEGORY', 0);
define('EUF_TEXT',1);
define('EUF_RADIO',2);
define('EUF_DROPDOWN',3);
@@ -62,8 +63,9 @@ class e107_user_extended
define('EUF_INTEGER',6);
define('EUF_DATE',7);
define('EUF_LANGUAGE',8);
define('EUF_PREDEFINED',9);
define('EUF_PREDEFINED',9); // should be EUF_LIST IMO
define('EUF_CHECKBOX',10);
define('EUF_PREFIELD',11); // should be EUF_PREDEFINED, useful when creating fields from e.g. plugin XML
$this->typeArray = array(
'text' => 1,
@@ -75,7 +77,8 @@ class e107_user_extended
'date' => 7,
'language' => 8,
'list' => 9,
'checkbox' => 10
'checkbox' => 10,
'predefined' => 11, // DON'T USE IT IN PREDEFINED FIELD XML!!! Used in plugin installation routine.
);
$this->user_extended_types = array(
@@ -506,7 +509,7 @@ class e107_user_extended
function user_extended_remove($id, $name)
{
global $sql, $tp;
$this->clear_cache();
$this->clear_cache();
if ($this->user_extended_field_exist($name))
{
$sql->db_Select_gen("ALTER TABLE #user_extended DROP user_".$tp -> toDB($name, true));