mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/13713] Introduce priorities for groups
PHPBB3-13713
This commit is contained in:
@@ -107,6 +107,15 @@ abstract class base_group implements source_interface
|
||||
*/
|
||||
abstract protected function query($keyword, $topic_id);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_priority($row)
|
||||
{
|
||||
// By default every result from the source increases the priority by a fixed value
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -141,6 +150,7 @@ abstract class base_group implements source_interface
|
||||
'img' => phpbb_get_group_avatar($groups[$group_id]),
|
||||
],
|
||||
'rank' => $group_rank['title'],
|
||||
'priority' => $this->get_priority($groups[$group_id]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -60,13 +60,11 @@ abstract class base_user implements source_interface
|
||||
abstract protected function query($keyword, $topic_id);
|
||||
|
||||
/**
|
||||
* Returns the priority of the currently selected name
|
||||
*
|
||||
* @param array $row Array of fetched user data
|
||||
* @return int Priority (defaults to 1)
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_priority($row)
|
||||
{
|
||||
// By default every result from the source increases the priority by a fixed value
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -24,4 +24,12 @@ interface source_interface
|
||||
* @param int $topic_id Current topic ID
|
||||
*/
|
||||
public function get(array &$names, $keyword, $topic_id);
|
||||
|
||||
/**
|
||||
* Returns the priority of the currently selected name
|
||||
*
|
||||
* @param array $row Array of fetched data for the name type (e.g. user row)
|
||||
* @return int Priority (defaults to 1)
|
||||
*/
|
||||
public function get_priority($row);
|
||||
}
|
||||
|
Reference in New Issue
Block a user