Skip to content

Commit

Permalink
Dev: Show info about template editor for new users
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Oct 11, 2017
1 parent f7100f4 commit ca5c2d0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions application/controllers/admin/templates.php
Expand Up @@ -1092,6 +1092,8 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma
$aData['relativePathEditfile'] = $editfile;
$aViewUrls['templateeditorbar_view'][] = $aData;

$this->showIntroNotification();

if ($showsummary)
{
Yii::app()->clientScript->registerPackage( $oEditedTemplate->sPackageName );
Expand All @@ -1103,6 +1105,28 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma
return $aViewUrls;
}

/**
* First time user visits template editor on 3.0, show
* a notification about manual and forum.
* @return void
*/
protected function showIntroNotification()
{
$user = User::model()->findByPk(Yii::app()->session['loginID']);
$not = new UniqueNotification(array(
'user_id' => $user->uid,
'title' => gT('LimeSurvey 3.0 template editor'),
'markAsNew' => false,
'importance' => Notification::HIGH_IMPORTANCE,
'message' => sprintf(
gT('Welcome to the new template editor of LimeSurvey 3.0. To get an overview of new functionality and possibilities, please visit the <a target="_blank" href="%s">LimeSurvey manual</a>. For further questions and information, feel free to post your questions on the <a target="_blank" href="%s">LimeSurvey forum</a>.', 'unescaped'),
'http://manual.limesurvey.org/Templating',
'https://www.limesurvey.org/community/forums'
)
));
$not->save();
}

/**
* Renders template(s) wrapped in header and footer
*
Expand Down

0 comments on commit ca5c2d0

Please sign in to comment.