Allow identifying whether the current item is the filtered one

This commit is contained in:
Joas Schilling 2015-10-02 09:53:39 +02:00
parent 3dec30d0e0
commit 7707bbe648
2 changed files with 37 additions and 0 deletions

View File

@ -44,6 +44,12 @@ class ActivityManager implements IManager {
/** @var IConfig */
protected $config;
/** @var string */
protected $formattingObjectType;
/** @var int */
protected $formattingObjectId;
/**
* constructor of the controller
*
@ -303,6 +309,24 @@ class ActivityManager implements IManager {
return '';
}
/**
* @param string $type
* @param int $id
*/
public function setFormattingObject($type, $id) {
$this->formattingObjectType = $type;
$this->formattingObjectId = $id;
}
/**
* @return bool
*/
public function isFormattingFilteredObject() {
return 'filter' === $this->request->getParam('filter')
&& $this->formattingObjectType === $this->request->getParam('objecttype')
&& $this->formattingObjectId === $this->request->getParam('objectid');
}
/**
* @param string $app
* @param string $text

View File

@ -137,6 +137,19 @@ interface IManager {
*/
public function getTypeIcon($type);
/**
* @param string $type
* @param int $id
* @since 8.2.0
*/
public function setFormattingObject($type, $id);
/**
* @return bool
* @since 8.2.0
*/
public function isFormattingFilteredObject();
/**
* @param string $app
* @param string $text