aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/avatar/driver
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/avatar/driver')
-rw-r--r--phpBB/includes/avatar/driver/driver.php4
-rw-r--r--phpBB/includes/avatar/driver/gravatar.php25
-rw-r--r--phpBB/includes/avatar/driver/interface.php16
-rw-r--r--phpBB/includes/avatar/driver/local.php23
-rw-r--r--phpBB/includes/avatar/driver/remote.php23
5 files changed, 28 insertions, 63 deletions
diff --git a/phpBB/includes/avatar/driver/driver.php b/phpBB/includes/avatar/driver/driver.php
index cde4fd95a6..317fe91b83 100644
--- a/phpBB/includes/avatar/driver/driver.php
+++ b/phpBB/includes/avatar/driver/driver.php
@@ -78,7 +78,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/**
* @inheritdoc
*/
- public function get_data($row, $ignore_config = false)
+ public function get_data($row)
{
return array(
'src' => '',
@@ -90,7 +90,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/**
* @inheritdoc
*/
- public function get_custom_html($row, $ignore_config = false, $alt = '')
+ public function get_custom_html($row, $alt = '')
{
return '';
}
diff --git a/phpBB/includes/avatar/driver/gravatar.php b/phpBB/includes/avatar/driver/gravatar.php
index 6ceac1a149..001a741c3f 100644
--- a/phpBB/includes/avatar/driver/gravatar.php
+++ b/phpBB/includes/avatar/driver/gravatar.php
@@ -29,30 +29,19 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
/**
* @inheritdoc
*/
- public function get_data($row, $ignore_config = false)
+ public function get_data($row)
{
- if ($ignore_config || $this->config['allow_avatar_gravatar'])
- {
- return array(
- 'src' => $row['avatar'],
- 'width' => $row['avatar_width'],
- 'height' => $row['avatar_height'],
- );
- }
- else
- {
- return array(
- 'src' => '',
- 'width' => 0,
- 'height' => 0,
- );
- }
+ return array(
+ 'src' => $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
}
/**
* @inheritdoc
*/
- public function get_custom_html($row, $ignore_config = false, $alt = '')
+ public function get_custom_html($row, $alt = '')
{
return '<img src="' . $this->get_gravatar_url($row) . '" ' .
($row['avatar_width'] ? ('width="' . $row['avatar_width'] . '" ') : '') .
diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php
index 7a58a40b0c..bba4bd102e 100644
--- a/phpBB/includes/avatar/driver/interface.php
+++ b/phpBB/includes/avatar/driver/interface.php
@@ -31,23 +31,21 @@ interface phpbb_avatar_driver_interface
/**
* Get the avatar url and dimensions
*
- * @param $ignore_config Whether this function should respect the users prefs
- * and board configuration configuration option, or should just render
- * the avatar anyways. Useful for the ACP.
+ * @param array $row User data or group data that has been cleaned with
+ * phpbb_avatar_manager::clean_row
* @return array Avatar data, must have keys src, width and height, e.g.
- * ['src' => '', 'width' => 0, 'height' => 0]
+ * ['src' => '', 'width' => 0, 'height' => 0]
*/
- public function get_data($row, $ignore_config = false);
+ public function get_data($row);
/**
* Returns custom html if it is needed for displaying this avatar
*
- * @param bool $ignore_config Whether this function should respect the users prefs
- * and board configuration configuration option, or should just render
- * the avatar anyways. Useful for the ACP.
+ * @param string $alt Alternate text for avatar image
+ *
* @return string HTML
*/
- public function get_custom_html($row, $ignore_config = false, $alt = '');
+ public function get_custom_html($row, $alt = '');
/**
* Prepare form for changing the settings of this avatar
diff --git a/phpBB/includes/avatar/driver/local.php b/phpBB/includes/avatar/driver/local.php
index d46ac79d11..479ee3712a 100644
--- a/phpBB/includes/avatar/driver/local.php
+++ b/phpBB/includes/avatar/driver/local.php
@@ -24,24 +24,13 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
/**
* @inheritdoc
*/
- public function get_data($row, $ignore_config = false)
+ public function get_data($row)
{
- if ($ignore_config || $this->config['allow_avatar_local'])
- {
- return array(
- 'src' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $row['avatar'],
- 'width' => $row['avatar_width'],
- 'height' => $row['avatar_height'],
- );
- }
- else
- {
- return array(
- 'src' => '',
- 'width' => 0,
- 'height' => 0,
- );
- }
+ return array(
+ 'src' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
}
/**
diff --git a/phpBB/includes/avatar/driver/remote.php b/phpBB/includes/avatar/driver/remote.php
index 1da5fc16e8..344275a251 100644
--- a/phpBB/includes/avatar/driver/remote.php
+++ b/phpBB/includes/avatar/driver/remote.php
@@ -24,24 +24,13 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
/**
* @inheritdoc
*/
- public function get_data($row, $ignore_config = false)
+ public function get_data($row)
{
- if ($ignore_config || $this->config['allow_avatar_remote'])
- {
- return array(
- 'src' => $row['avatar'],
- 'width' => $row['avatar_width'],
- 'height' => $row['avatar_height'],
- );
- }
- else
- {
- return array(
- 'src' => '',
- 'width' => 0,
- 'height' => 0,
- );
- }
+ return array(
+ 'src' => $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
}
/**