diff options
-rw-r--r-- | phpBB/includes/groupposition/exception.php | 23 | ||||
-rw-r--r-- | phpBB/includes/groupposition/legend.php | 27 | ||||
-rw-r--r-- | phpBB/includes/groupposition/teampage.php | 33 |
3 files changed, 28 insertions, 55 deletions
diff --git a/phpBB/includes/groupposition/exception.php b/phpBB/includes/groupposition/exception.php new file mode 100644 index 0000000000..e4ff09c703 --- /dev/null +++ b/phpBB/includes/groupposition/exception.php @@ -0,0 +1,23 @@ +<?php +/** +* +* @package groupposition +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* @package groupposition +*/ +class phpbb_groupposition_exception extends \Exception +{ +} diff --git a/phpBB/includes/groupposition/legend.php b/phpBB/includes/groupposition/legend.php index 8f115a8b1e..7fddadde99 100644 --- a/phpBB/includes/groupposition/legend.php +++ b/phpBB/includes/groupposition/legend.php @@ -43,11 +43,6 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface protected $user; /** - * URI for the adm_back_link when there was an error. - */ - protected $adm_back_link = ''; - - /** * Constructor * * @param phpbb_db_driver $db Database object @@ -60,16 +55,6 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface } /** - * Set the back link for error messages - * - * @param string $adm_back_link Return URL to use after an error occured - */ - public function set_admin_back_link($adm_back_link) - { - $this->adm_back_link = $adm_back_link; - } - - /** * Returns the group_legend for a given group, if the group exists. * * {@inheritDoc} @@ -86,7 +71,7 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface if ($current_value === false) { // Group not found. - $this->error('NO_GROUP'); + throw new phpbb_groupposition_exception('NO_GROUP'); } return (int) $current_value; @@ -242,16 +227,6 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface } /** - * Error - * - * {@inheritDoc} - */ - private function error($message) - { - trigger_error($this->user->lang[$message] . (($this->adm_back_link) ? adm_back_link($this->adm_back_link) : ''), E_USER_WARNING); - } - - /** * Get group type language var * * @param int $group_type group_type from the groups-table diff --git a/phpBB/includes/groupposition/teampage.php b/phpBB/includes/groupposition/teampage.php index 3be8ef2774..7c758199e7 100644 --- a/phpBB/includes/groupposition/teampage.php +++ b/phpBB/includes/groupposition/teampage.php @@ -53,11 +53,6 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface protected $cache; /** - * URI for the adm_back_link when there was an error. - */ - protected $adm_back_link = ''; - - /** * Constructor * * @param phpbb_db_driver $db Database object @@ -72,16 +67,6 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface } /** - * Set the back link for error messages - * - * @param string $adm_back_link Return URL to use after an error occured - */ - public function set_admin_back_link($adm_back_link) - { - $this->adm_back_link = $adm_back_link; - } - - /** * Returns the teampage position for a given group, if the group exists. * * {@inheritDoc} @@ -101,7 +86,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface if ($row === false) { // Group not found. - $this->error('NO_GROUP'); + throw new phpbb_groupposition_exception('NO_GROUP'); } return (int) $row['teampage_position']; @@ -128,7 +113,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface if ($row === false) { // Group not found. - $this->error('NO_GROUP'); + throw new phpbb_groupposition_exception('NO_GROUP'); } return $row; @@ -152,7 +137,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface if ($current_value === false) { // Group not found. - $this->error('NO_GROUP'); + throw new phpbb_groupposition_exception('NO_GROUP'); } return (int) $current_value; @@ -176,7 +161,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface if ($row === false) { // Group not found. - $this->error('NO_GROUP'); + throw new phpbb_groupposition_exception('NO_GROUP'); } return $row; @@ -595,16 +580,6 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface } /** - * Error - * - * {@inheritDoc} - */ - private function error($message) - { - trigger_error($this->user->lang[$message] . (($this->adm_back_link) ? adm_back_link($this->adm_back_link) : ''), E_USER_WARNING); - } - - /** * Get group type language var * * @param int $group_type group_type from the groups-table |