mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/avatars] Pass phpbb_user object to prepare_form_acp()
The phpbb_user object might be used for language variables. Pass it as a function argument to prepare_form_acp() instead of using globals. PHPBB3-10018
This commit is contained in:
parent
8778c9c945
commit
9e001153d6
5 changed files with 7 additions and 7 deletions
|
@ -121,7 +121,7 @@ class acp_board
|
||||||
* might have.
|
* might have.
|
||||||
*/
|
*/
|
||||||
$avatar_vars += $phpbb_avatar_manager->get_avatar_settings($driver);
|
$avatar_vars += $phpbb_avatar_manager->get_avatar_settings($driver);
|
||||||
$avatar_vars += $driver->prepare_form_acp();
|
$avatar_vars += $driver->prepare_form_acp($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
$display_vars = array(
|
$display_vars = array(
|
||||||
|
|
|
@ -79,7 +79,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public function prepare_form_acp()
|
public function prepare_form_acp($user)
|
||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,11 +69,13 @@ interface phpbb_avatar_driver_interface
|
||||||
/**
|
/**
|
||||||
* Prepare form for changing the acp settings of this avatar
|
* Prepare form for changing the acp settings of this avatar
|
||||||
*
|
*
|
||||||
|
* @param phpbb_user $user phpBB user object
|
||||||
|
*
|
||||||
* @return array Array of configuration options as consumed by acp_board.
|
* @return array Array of configuration options as consumed by acp_board.
|
||||||
* The setting for enabling/disabling the avatar will be handled by
|
* The setting for enabling/disabling the avatar will be handled by
|
||||||
* the avatar manager.
|
* the avatar manager.
|
||||||
*/
|
*/
|
||||||
public function prepare_form_acp();
|
public function prepare_form_acp($user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process form data
|
* Process form data
|
||||||
|
|
|
@ -104,7 +104,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public function prepare_form_acp()
|
public function prepare_form_acp($user)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||||
|
|
|
@ -122,10 +122,8 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public function prepare_form_acp()
|
public function prepare_form_acp($user)
|
||||||
{
|
{
|
||||||
global $user;
|
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
|
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
|
||||||
|
|
Loading…
Add table
Reference in a new issue