Skip to content

Commit

Permalink
New feature #11378: afterSurveyMenuLoad event to add survey specific …
Browse files Browse the repository at this point in the history
…menu items
  • Loading branch information
olleharstedt committed Jun 14, 2016
1 parent 75c465c commit 45cc543
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions application/core/Survey_Common_Action.php
Expand Up @@ -695,6 +695,16 @@ function _surveybar($iSurveyID, $gid=null)
$aData['iIconSize'] = Yii::app()->getConfig('adminthemeiconsize');
$aData['sImageURL'] = Yii::app()->getConfig('adminimageurl');

$event = new PluginEvent('afterSurveyMenuLoad', $this);
$event->set('menu', array());
$event->set('surveyId', $iSurveyID);
$result = App()->getPluginManager()->dispatchEvent($event);
$aData['menu'] = $result->get('menu');
if (empty($aData['menu']))
{
$aData['menu'] = array();
}

$this->getController()->renderPartial("/admin/survey/surveybar_view", $aData);
}

Expand Down
9 changes: 9 additions & 0 deletions application/views/admin/survey/surveybar_view.php
Expand Up @@ -263,6 +263,15 @@
<img src='<?php echo $sImageURL;?>tokens.png' alt='<?php eT("Token management");?>' width="<?php echo $iIconSize;?>" height="<?php echo $iIconSize;?>"/></a>
</li>
<?php } ?>

<?php foreach ($menu as $menuItem): ?>
<li>
<a href="<?php echo $menuItem['href']; ?>">
<img src="<?php echo $sImageURL; ?><?php echo $menuItem['image']; ?>" alt="<?php echo $menuItem['alt']; ?>"/>
</a>
</li>
<?php endforeach; ?>

</ul>

<div class='menubar-right'>
Expand Down

1 comment on commit 45cc543

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for MassAction ?

PS : for generated content in admin : we don't have a clean way to show it with survey menu, only with 'global menu"

Please sign in to comment.