mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
EONE-62 (New Feature): More work, getting data should work fine now, still work in progress
This commit is contained in:
@@ -3547,7 +3547,7 @@ class e_admin_ui extends e_admin_controller_ui
|
|||||||
$this->_model->setModelTable($this->table)
|
$this->_model->setModelTable($this->table)
|
||||||
->setFieldIdName($this->pid)
|
->setFieldIdName($this->pid)
|
||||||
->setValidationRules($this->validationRules)
|
->setValidationRules($this->validationRules)
|
||||||
->setFieldTypes($this->fieldTypes)
|
->setDbTypes($this->fieldTypes)
|
||||||
->setDataFields($this->dataFields)
|
->setDataFields($this->dataFields)
|
||||||
->setMessageStackName('admin_ui_model_'.$this->table)
|
->setMessageStackName('admin_ui_model_'.$this->table)
|
||||||
->setParam('db_query', $this->editQry);
|
->setParam('db_query', $this->editQry);
|
||||||
|
@@ -610,7 +610,7 @@ class e107
|
|||||||
*/
|
*/
|
||||||
public static function getSingleton($class_name, $path = true, $regpath = '')
|
public static function getSingleton($class_name, $path = true, $regpath = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
$id = 'core/e107/singleton/'.$class_name.$regpath;
|
$id = 'core/e107/singleton/'.$class_name.$regpath;
|
||||||
|
|
||||||
//singleton object found - overload not possible
|
//singleton object found - overload not possible
|
||||||
@@ -859,23 +859,23 @@ class e107
|
|||||||
{
|
{
|
||||||
return self::getSingleton('e_parse_shortcode', true);
|
return self::getSingleton('e_parse_shortcode', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve registered sc object (batch) by class name
|
* Retrieve registered sc object (batch) by class name
|
||||||
* Note - '_shortcodes' part of the class/override is added by the method
|
* Note - '_shortcodes' part of the class/override is added by the method
|
||||||
* Override is possible only if class is not already instantiated by shortcode parser
|
* Override is possible only if class is not already instantiated by shortcode parser
|
||||||
*
|
*
|
||||||
* <code><?php
|
* <code><?php
|
||||||
* // core news shortcodes
|
* // core news shortcodes
|
||||||
* e107::getScObject('news');
|
* e107::getScObject('news');
|
||||||
* // object of plugin_myplugin_my_shortcodes class -> myplugin/core/shortcodes/batch/my_shortcodes.php
|
* // object of plugin_myplugin_my_shortcodes class -> myplugin/core/shortcodes/batch/my_shortcodes.php
|
||||||
* e107::getScObject('my', 'myplugin');
|
* e107::getScObject('my', 'myplugin');
|
||||||
* // news override - plugin_myplugin_news_shortcodes extends news_shortcodes -> myplugin/core/shortcodes/batch/news_shortcodes.php
|
* // news override - plugin_myplugin_news_shortcodes extends news_shortcodes -> myplugin/core/shortcodes/batch/news_shortcodes.php
|
||||||
* e107::getScObject('news', 'myplugin', true);
|
* e107::getScObject('news', 'myplugin', true);
|
||||||
* // news override - plugin_myplugin_mynews_shortcodes extends news_shortcodes -> myplugin/core/shortcodes/batch/mynews_shortcodes.php
|
* // news override - plugin_myplugin_mynews_shortcodes extends news_shortcodes -> myplugin/core/shortcodes/batch/mynews_shortcodes.php
|
||||||
* e107::getScObject('news', 'myplugin', 'mynews');
|
* e107::getScObject('news', 'myplugin', 'mynews');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $className
|
* @param string $className
|
||||||
* @param string $pluginName
|
* @param string $pluginName
|
||||||
* @param string|true $overrideClass
|
* @param string|true $overrideClass
|
||||||
@@ -1089,19 +1089,25 @@ class e107
|
|||||||
* Retrieve user model object.
|
* Retrieve user model object.
|
||||||
*
|
*
|
||||||
* @param integer $user_id target user
|
* @param integer $user_id target user
|
||||||
|
* @param boolean $checkIfCurrent if tru user_id will be compared to current user, if there is a match
|
||||||
|
* current user object will be returned
|
||||||
* @return e_system_user
|
* @return e_system_user
|
||||||
*/
|
*/
|
||||||
public static function getSystemUser($user_id)
|
public static function getSystemUser($user_id, $checkIfCurrent = true)
|
||||||
{
|
{
|
||||||
|
if($checkIfCurrent && $user_id && $user_id === self::getUser()->getId())
|
||||||
|
{
|
||||||
|
return self::getUser();
|
||||||
|
}
|
||||||
$user = self::getRegistry('targets/core/user/'.$user_id);
|
$user = self::getRegistry('targets/core/user/'.$user_id);
|
||||||
if(null === $user)
|
if(null === $user)
|
||||||
{
|
{
|
||||||
$user = self::getObject('e_system_user');
|
$user = self::getObject('e_system_user');
|
||||||
if($user_id) $user->load($user_id); // self registered on load
|
if($user_id) $user->load($user_id); // self registered on load
|
||||||
}
|
}
|
||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve current user model object.
|
* Retrieve current user model object.
|
||||||
*
|
*
|
||||||
@@ -1111,7 +1117,7 @@ class e107
|
|||||||
{
|
{
|
||||||
return self::getSingleton('e_user', true, 'targets/core/current_user');
|
return self::getSingleton('e_user', true, 'targets/core/current_user');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve user model object.
|
* Retrieve user model object.
|
||||||
*
|
*
|
||||||
@@ -1131,7 +1137,7 @@ class e107
|
|||||||
{
|
{
|
||||||
return self::getSingleton('e107_user_extended', true);
|
return self::getSingleton('e107_user_extended', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve User Perms (admin perms) handler singleton object
|
* Retrieve User Perms (admin perms) handler singleton object
|
||||||
* @return comment
|
* @return comment
|
||||||
@@ -2121,8 +2127,8 @@ class e107
|
|||||||
$e_QUERY = $_SERVER['QUERY_STRING'];
|
$e_QUERY = $_SERVER['QUERY_STRING'];
|
||||||
define('e_LANCODE', '');
|
define('e_LANCODE', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$e_QUERY = str_replace("&","&", self::getParser()->post_toForm($e_QUERY));
|
$e_QUERY = str_replace("&","&", self::getParser()->post_toForm($e_QUERY));
|
||||||
define('e_QUERY', $e_QUERY);
|
define('e_QUERY', $e_QUERY);
|
||||||
|
|
||||||
define('e_TBQS', $_SERVER['QUERY_STRING']);
|
define('e_TBQS', $_SERVER['QUERY_STRING']);
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -655,14 +655,6 @@ class e_validator
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if('varchar' == $type && !varset($tmp[1])) $tmp[1] = 255;
|
|
||||||
|
|
||||||
if(is_numeric(varset($tmp[1])) && (integer) $tmp[1] < $length)
|
|
||||||
{
|
|
||||||
$this->addValidateResult($name, self::ERR_TOO_LONG);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!($value[0] && $value[1] && $value[0] == $value[1]))
|
if(!($value[0] && $value[1] && $value[0] == $value[1]))
|
||||||
{
|
{
|
||||||
$this->addValidateResult($name, self::ERR_FIELDS_MATCH);
|
$this->addValidateResult($name, self::ERR_FIELDS_MATCH);
|
||||||
|
@@ -117,6 +117,7 @@ define('LAN_USER_86', 'Maximum avatar size is --WIDTH-- x --HEIGHT-- pixels');
|
|||||||
|
|
||||||
|
|
||||||
// Error messages for when user data is missing. Done this way so that other code can override the default messages
|
// Error messages for when user data is missing. Done this way so that other code can override the default messages
|
||||||
|
// FIXME - do we need this?
|
||||||
if (!defined('USER_ERR_01')) { define('USER_ERR_01','Missing value'); }
|
if (!defined('USER_ERR_01')) { define('USER_ERR_01','Missing value'); }
|
||||||
if (!defined('USER_ERR_02')) { define('USER_ERR_02','Unexpected value'); }
|
if (!defined('USER_ERR_02')) { define('USER_ERR_02','Unexpected value'); }
|
||||||
if (!defined('USER_ERR_03')) { define('USER_ERR_03','Value contains invalid characters'); }
|
if (!defined('USER_ERR_03')) { define('USER_ERR_03','Value contains invalid characters'); }
|
||||||
|
Reference in New Issue
Block a user