Skip to content

Commit

Permalink
Plugin: enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
CatoTH committed Sep 16, 2023
1 parent 8e5c8e3 commit 8300910
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions plugins/egp/LayoutHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ public function getStdNavbarHeader(string $before): string
}
}

if ($consultation && $consultation->getSettings()->documentPage) {
$adminUrl = UrlHelper::createUrl(['/pages/documents']);
$adminTitle = \Yii::t('base', 'menu_documents');
$out .= '<li>' . Html::a($adminTitle, $adminUrl, ['id' => 'documentsLink', 'aria-label' => $adminTitle]) . '</li>';
}

if ($consultation && $consultation->getSettings()->hasSpeechLists && $consultation->getSettings()->speechPage) {
$adminUrl = UrlHelper::createUrl(['/consultation/speech']);
$adminTitle = \Yii::t('base', 'menu_speech_list');
$out .= '<li>' . Html::a($adminTitle, $adminUrl, ['id' => 'speechLink', 'aria-label' => $adminTitle]) . '</li>';
}

if ($consultation && $consultation->getSettings()->votingPage) {
$adminUrl = UrlHelper::createUrl(['/consultation/votings']);
$adminTitle = \Yii::t('base', 'menu_votings');
$out .= '<li>' . Html::a($adminTitle, $adminUrl, ['id' => 'votingsLink', 'aria-label' => $adminTitle]) . '</li>';
}

if (!User::getCurrentUser()) {
if (get_class($controller) === UserController::class) {
$backUrl = UrlHelper::createUrl('/consultation/index');
Expand Down Expand Up @@ -210,7 +228,7 @@ public function getStdNavbarHeader(string $before): string
public function getMotionViewData(array $motionData, Motion $motion): array
{
foreach ($motionData as $i => $data) {
if ($motionData[$i]['title'] === \Yii::t('motion', 'initiators_1') || $motionData[$i]['title'] === \Yii::t('motion', 'initiators_x')) {
if ($data['title'] === \Yii::t('motion', 'initiators_1') || $data['title'] === \Yii::t('motion', 'initiators_x')) {
$motionData[$i]['title'] = 'Party';
$initiators = $motion->getInitiators();
$motionData[$i]['content'] = '';
Expand All @@ -226,7 +244,7 @@ public function getMotionViewData(array $motionData, Motion $motion): array
public function getAmendmentViewData(array $amendmentData, Amendment $amendment): array
{
foreach ($amendmentData as $i => $data) {
if ($amendmentData[$i]['title'] === \Yii::t('motion', 'initiators_1') || $amendmentData[$i]['title'] === \Yii::t('motion', 'initiators_x')) {
if ($data['title'] === \Yii::t('motion', 'initiators_1') || $data['title'] === \Yii::t('motion', 'initiators_x')) {
$amendmentData[$i]['title'] = 'Party';
$initiators = $amendment->getInitiators();
$amendmentData[$i]['content'] = '';
Expand Down

0 comments on commit 8300910

Please sign in to comment.