|
@@ 99-115 (lines=17) @@
|
| 96 |
|
*/ |
| 97 |
|
public function parseShortVersion(IEvent $event) { |
| 98 |
|
|
| 99 |
|
if ($event->getSubject() === self::SUBJECT_ADDED) { |
| 100 |
|
$event->setParsedSubject($this->l->t('Added to favorites')); |
| 101 |
|
if ($this->activityManager->getRequirePNG()) { |
| 102 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png'))); |
| 103 |
|
} else { |
| 104 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); |
| 105 |
|
} |
| 106 |
|
} else if ($event->getSubject() === self::SUBJECT_REMOVED) { |
| 107 |
|
$event->setParsedSubject($this->l->t('Removed from favorites')); |
| 108 |
|
if ($this->activityManager->getRequirePNG()) { |
| 109 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png'))); |
| 110 |
|
} else { |
| 111 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg'))); |
| 112 |
|
} |
| 113 |
|
} else { |
| 114 |
|
throw new \InvalidArgumentException(); |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
return $event; |
| 118 |
|
} |
|
@@ 129-145 (lines=17) @@
|
| 126 |
|
*/ |
| 127 |
|
public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) { |
| 128 |
|
|
| 129 |
|
if ($event->getSubject() === self::SUBJECT_ADDED) { |
| 130 |
|
$subject = $this->l->t('You added {file} to your favorites'); |
| 131 |
|
if ($this->activityManager->getRequirePNG()) { |
| 132 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png'))); |
| 133 |
|
} else { |
| 134 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); |
| 135 |
|
} |
| 136 |
|
} else if ($event->getSubject() === self::SUBJECT_REMOVED) { |
| 137 |
|
$subject = $this->l->t('You removed {file} from your favorites'); |
| 138 |
|
if ($this->activityManager->getRequirePNG()) { |
| 139 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png'))); |
| 140 |
|
} else { |
| 141 |
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg'))); |
| 142 |
|
} |
| 143 |
|
} else { |
| 144 |
|
throw new \InvalidArgumentException(); |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
$this->setSubjects($event, $subject); |
| 148 |
|
$event = $this->eventMerger->mergeEvents('file', $event, $previousEvent); |