Merge remote-tracking branch 'Marc/ticket/11859' into develop

* Marc/ticket/11859:
  [ticket/11859] Add missing get_template_name method to test drivers
  [ticket/11859] Make avatar drivers return template filename
This commit is contained in:
Joas Schilling 2013-12-12 10:21:36 +01:00
commit 4816446c4a
7 changed files with 42 additions and 11 deletions

View file

@ -109,17 +109,6 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
return true; return true;
} }
/**
* @inheritdoc
*/
public function get_template_name()
{
$driver = preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this));
$template = "ucp_avatar_options_$driver.html";
return $template;
}
/** /**
* @inheritdoc * @inheritdoc
*/ */

View file

@ -146,6 +146,14 @@ class gravatar extends \phpbb\avatar\driver\driver
); );
} }
/**
* @inheritdoc
*/
public function get_template_name()
{
return 'ucp_avatar_options_gravatar.html';
}
/** /**
* Build gravatar URL for output on page * Build gravatar URL for output on page
* *

View file

@ -134,6 +134,14 @@ class local extends \phpbb\avatar\driver\driver
); );
} }
/**
* @inheritdoc
*/
public function get_template_name()
{
return 'ucp_avatar_options_local.html';
}
/** /**
* Get a list of avatars that are locally available * Get a list of avatars that are locally available
* Results get cached for 24 hours (86400 seconds) * Results get cached for 24 hours (86400 seconds)

View file

@ -186,4 +186,12 @@ class remote extends \phpbb\avatar\driver\driver
'avatar_height' => $height, 'avatar_height' => $height,
); );
} }
/**
* @inheritdoc
*/
public function get_template_name()
{
return 'ucp_avatar_options_remote.html';
}
} }

View file

@ -167,6 +167,14 @@ class upload extends \phpbb\avatar\driver\driver
return true; return true;
} }
/**
* @inheritdoc
*/
public function get_template_name()
{
return 'ucp_avatar_options_upload.html';
}
/** /**
* Check if user is able to upload an avatar * Check if user is able to upload an avatar
* *

View file

@ -18,4 +18,9 @@ class barfoo extends \phpbb\avatar\driver\driver
{ {
return false; return false;
} }
public function get_template_name()
{
return 'barfoo.html';
}
} }

View file

@ -18,4 +18,9 @@ class foobar extends \phpbb\avatar\driver\driver
{ {
return false; return false;
} }
public function get_template_name()
{
return 'foobar.html';
}
} }