aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/avatar
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-04 15:12:04 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-04 15:12:04 +0100
commitfb139a88203fb5475712c2bc39e653996cd9103f (patch)
tree3e26453bf8ba32c73c62bbc2e12b3e23f978d444 /phpBB/includes/avatar
parent8aaa3e055fdc50faeea6f590408a7bcbb03a8d92 (diff)
downloadforums-fb139a88203fb5475712c2bc39e653996cd9103f.tar
forums-fb139a88203fb5475712c2bc39e653996cd9103f.tar.gz
forums-fb139a88203fb5475712c2bc39e653996cd9103f.tar.bz2
forums-fb139a88203fb5475712c2bc39e653996cd9103f.tar.xz
forums-fb139a88203fb5475712c2bc39e653996cd9103f.zip
[feature/avatars] Fix behavior of avatar manager and variables
The $force_all variable was only partially removed and the behavior was not consistent in all files. PHPBB3-10018
Diffstat (limited to 'phpBB/includes/avatar')
-rw-r--r--phpBB/includes/avatar/manager.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/includes/avatar/manager.php b/phpBB/includes/avatar/manager.php
index 81a135b46f..2789158de5 100644
--- a/phpBB/includes/avatar/manager.php
+++ b/phpBB/includes/avatar/manager.php
@@ -47,17 +47,19 @@ class phpbb_avatar_manager
* Get the driver object specified by the avatar type
*
* @param string $avatar_type Avatar type; by default an avatar's service container name
- * @param bool $force_all Grab all avatar drivers, no matter if enabled or not
+ * @param bool $load_valid Load only valid avatars
*
* @return object Avatar driver object
*/
- public function get_driver($avatar_type, $force_all = false)
+ public function get_driver($avatar_type, $load_valid = true)
{
- if (self::$valid_drivers === false || $force_all)
+ if (self::$valid_drivers === false)
{
- $this->load_valid_drivers($force_all);
+ $this->load_valid_drivers();
}
+ $avatar_drivers = ($load_valid) ? self::$valid_drivers : $this->get_all_drivers();
+
// Legacy stuff...
switch ($avatar_type)
{
@@ -72,7 +74,7 @@ class phpbb_avatar_manager
break;
}
- if (!isset(self::$valid_drivers[$avatar_type]))
+ if (!isset($avatar_drivers[$avatar_type]))
{
return null;
}
@@ -89,17 +91,15 @@ class phpbb_avatar_manager
/**
* Load the list of valid drivers
* This is executed once and fills self::$valid_drivers
- *
- * @param bool $force_all Force showing all avatar drivers
*/
- protected function load_valid_drivers($force_all = false)
+ protected function load_valid_drivers()
{
if (!empty($this->avatar_drivers))
{
self::$valid_drivers = array();
foreach ($this->avatar_drivers as $driver)
{
- if ($force_all || $this->is_enabled($driver))
+ if ($this->is_enabled($driver))
{
self::$valid_drivers[$driver->get_name()] = $driver->get_name();
}
@@ -138,7 +138,7 @@ class phpbb_avatar_manager
{
if (self::$valid_drivers === false)
{
- $this->load_valid_drivers($force_all);
+ $this->load_valid_drivers();
}
return self::$valid_drivers;