mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 02:06:32 +02:00
[feature/avatars] Move avatar specific settings to drivers
PHPBB3-10018
This commit is contained in:
@@ -126,6 +126,14 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
public function prepare_form_acp()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
|
@@ -77,6 +77,16 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
public function prepare_form_acp()
|
||||
{
|
||||
return array(
|
||||
'allow_avatar_gravatar' => array('lang' => 'ALLOW_GRAVATAR', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
@@ -62,6 +62,13 @@ interface phpbb_avatar_driver_interface
|
||||
**/
|
||||
public function prepare_form($template, $row, &$error);
|
||||
|
||||
/**
|
||||
* Prepare form for changing the acp settings of this avatar
|
||||
*
|
||||
* @return array Return the array containing the acp settings
|
||||
**/
|
||||
public function prepare_form_acp();
|
||||
|
||||
/**
|
||||
* Process form data
|
||||
*
|
||||
|
@@ -109,6 +109,17 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
public function prepare_form_acp()
|
||||
{
|
||||
return array(
|
||||
'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
@@ -58,6 +58,16 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
public function prepare_form_acp()
|
||||
{
|
||||
return array(
|
||||
'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
@@ -122,6 +122,21 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
**/
|
||||
public function prepare_form_acp()
|
||||
{
|
||||
global $user;
|
||||
|
||||
return array(
|
||||
'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'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_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
Reference in New Issue
Block a user