Order methods to by grouped by their task
This commit is contained in:
parent
be63e18b0a
commit
6c349c00bb
|
@ -121,28 +121,6 @@ class ActivityManager implements IManager {
|
||||||
return $notificationTypes;
|
return $notificationTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $types
|
|
||||||
* @param string $filter
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function filterNotificationTypes($types, $filter) {
|
|
||||||
if (!$this->isFilterValid($filter)) {
|
|
||||||
return $types;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($this->extensions as $extension) {
|
|
||||||
$c = $extension();
|
|
||||||
if ($c instanceof IExtension) {
|
|
||||||
$result = $c->filterNotificationTypes($types, $filter);
|
|
||||||
if (is_array($result)) {
|
|
||||||
$types = $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $types;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -161,6 +139,30 @@ class ActivityManager implements IManager {
|
||||||
return $defaultTypes;
|
return $defaultTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $type
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getTypeIcon($type) {
|
||||||
|
if (isset($this->typeIcons[$type])) {
|
||||||
|
return $this->typeIcons[$type];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($this->extensions as $extension) {
|
||||||
|
$c = $extension();
|
||||||
|
if ($c instanceof IExtension) {
|
||||||
|
$icon = $c->getTypeIcon($type);
|
||||||
|
if (is_string($icon)) {
|
||||||
|
$this->typeIcons[$type] = $icon;
|
||||||
|
return $icon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->typeIcons[$type] = '';
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $app
|
* @param string $app
|
||||||
* @param string $text
|
* @param string $text
|
||||||
|
@ -213,30 +215,6 @@ class ActivityManager implements IManager {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $type
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function getTypeIcon($type) {
|
|
||||||
if (isset($this->typeIcons[$type])) {
|
|
||||||
return $this->typeIcons[$type];
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($this->extensions as $extension) {
|
|
||||||
$c = $extension();
|
|
||||||
if ($c instanceof IExtension) {
|
|
||||||
$icon = $c->getTypeIcon($type);
|
|
||||||
if (is_string($icon)) {
|
|
||||||
$this->typeIcons[$type] = $icon;
|
|
||||||
return $icon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->typeIcons[$type] = '';
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $activity
|
* @param array $activity
|
||||||
* @return integer|false
|
* @return integer|false
|
||||||
|
@ -300,6 +278,28 @@ class ActivityManager implements IManager {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $types
|
||||||
|
* @param string $filter
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function filterNotificationTypes($types, $filter) {
|
||||||
|
if (!$this->isFilterValid($filter)) {
|
||||||
|
return $types;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($this->extensions as $extension) {
|
||||||
|
$c = $extension();
|
||||||
|
if ($c instanceof IExtension) {
|
||||||
|
$result = $c->filterNotificationTypes($types, $filter);
|
||||||
|
if (is_array($result)) {
|
||||||
|
$types = $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $types;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $filter
|
* @param string $filter
|
||||||
* @return array
|
* @return array
|
||||||
|
|
|
@ -46,16 +46,6 @@ interface IExtension {
|
||||||
*/
|
*/
|
||||||
public function getNotificationTypes($languageCode);
|
public function getNotificationTypes($languageCode);
|
||||||
|
|
||||||
/**
|
|
||||||
* The extension can filter the types based on the filter if required.
|
|
||||||
* In case no filter is to be applied false is to be returned unchanged.
|
|
||||||
*
|
|
||||||
* @param array $types
|
|
||||||
* @param string $filter
|
|
||||||
* @return array|false
|
|
||||||
*/
|
|
||||||
public function filterNotificationTypes($types, $filter);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For a given method additional types to be displayed in the settings can be returned.
|
* For a given method additional types to be displayed in the settings can be returned.
|
||||||
* In case no additional types are to be added false is to be returned.
|
* In case no additional types are to be added false is to be returned.
|
||||||
|
@ -65,6 +55,15 @@ interface IExtension {
|
||||||
*/
|
*/
|
||||||
public function getDefaultTypes($method);
|
public function getDefaultTypes($method);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A string naming the css class for the icon to be used can be returned.
|
||||||
|
* If no icon is known for the given type false is to be returned.
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @return string|false
|
||||||
|
*/
|
||||||
|
public function getTypeIcon($type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The extension can translate a given message to the requested languages.
|
* The extension can translate a given message to the requested languages.
|
||||||
* If no translation is available false is to be returned.
|
* If no translation is available false is to be returned.
|
||||||
|
@ -92,15 +91,6 @@ interface IExtension {
|
||||||
*/
|
*/
|
||||||
function getSpecialParameterList($app, $text);
|
function getSpecialParameterList($app, $text);
|
||||||
|
|
||||||
/**
|
|
||||||
* A string naming the css class for the icon to be used can be returned.
|
|
||||||
* If no icon is known for the given type false is to be returned.
|
|
||||||
*
|
|
||||||
* @param string $type
|
|
||||||
* @return string|false
|
|
||||||
*/
|
|
||||||
public function getTypeIcon($type);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The extension can define the parameter grouping by returning the index as integer.
|
* The extension can define the parameter grouping by returning the index as integer.
|
||||||
* In case no grouping is required false is to be returned.
|
* In case no grouping is required false is to be returned.
|
||||||
|
@ -127,6 +117,16 @@ interface IExtension {
|
||||||
*/
|
*/
|
||||||
public function isFilterValid($filterValue);
|
public function isFilterValid($filterValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The extension can filter the types based on the filter if required.
|
||||||
|
* In case no filter is to be applied false is to be returned unchanged.
|
||||||
|
*
|
||||||
|
* @param array $types
|
||||||
|
* @param string $filter
|
||||||
|
* @return array|false
|
||||||
|
*/
|
||||||
|
public function filterNotificationTypes($types, $filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For a given filter the extension can specify the sql query conditions including parameters for that query.
|
* For a given filter the extension can specify the sql query conditions including parameters for that query.
|
||||||
* In case the extension does not know the filter false is to be returned.
|
* In case the extension does not know the filter false is to be returned.
|
||||||
|
|
|
@ -75,19 +75,18 @@ interface IManager {
|
||||||
*/
|
*/
|
||||||
function getNotificationTypes($languageCode);
|
function getNotificationTypes($languageCode);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $types
|
|
||||||
* @param string $filter
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function filterNotificationTypes($types, $filter);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getDefaultTypes($method);
|
function getDefaultTypes($method);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $type
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getTypeIcon($type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $app
|
* @param string $app
|
||||||
* @param string $text
|
* @param string $text
|
||||||
|
@ -106,12 +105,6 @@ interface IManager {
|
||||||
*/
|
*/
|
||||||
function getSpecialParameterList($app, $text);
|
function getSpecialParameterList($app, $text);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $type
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function getTypeIcon($type);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $activity
|
* @param array $activity
|
||||||
* @return integer|false
|
* @return integer|false
|
||||||
|
@ -129,6 +122,13 @@ interface IManager {
|
||||||
*/
|
*/
|
||||||
function isFilterValid($filterValue);
|
function isFilterValid($filterValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $types
|
||||||
|
* @param string $filter
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function filterNotificationTypes($types, $filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $filter
|
* @param string $filter
|
||||||
* @return array
|
* @return array
|
||||||
|
|
Loading…
Reference in New Issue