Skip to content

Commit

Permalink
Dev: working left sidemenu
Browse files Browse the repository at this point in the history
Removed glyphicons agains fontawesome
  • Loading branch information
lacrioque committed Jun 29, 2017
1 parent a1a1774 commit caa799c
Show file tree
Hide file tree
Showing 108 changed files with 1,978 additions and 1,924 deletions.
44 changes: 39 additions & 5 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -969,7 +969,6 @@ public function rendersidemenulink($iSurveyID, $subaction){
}

$templateData = array_merge($this->_getGeneralTemplateData($iSurveyID), $templateData);

$this->_registerScriptFiles();
Yii::app()->loadHelper("admin/htmleditor");

Expand Down Expand Up @@ -1020,15 +1019,15 @@ public function surveygeneralsettings($iSurveyID){
//This method creates the text edition and the general settings
$aData['panels'] = [];

$grplangs = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
$baselang = Survey::model()->findByPk($iSurveyID)->language;
array_unshift($grplangs, $baselang);
###
Yii::app()->loadHelper("admin/htmleditor");

$aData['scripts'] = PrepareEditorScript(false, $this->getController());
$aTabTitles = $aTabContents= array();

$aTabTitles = $aTabContents= array();
$grplangs = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
$baselang = Survey::model()->findByPk($iSurveyID)->language;
array_unshift($grplangs, $baselang);
foreach ($grplangs as $i => $sLang)
{
// this one is created to get the right default texts fo each language
Expand Down Expand Up @@ -1633,6 +1632,39 @@ private function _getGeneralTemplateData($iSurveyID){
}

private function _getTextEditData($iSurveyID, $esrow){
Yii::app()->loadHelper("admin/htmleditor");
$aTabTitles = $aTabContents= array();
$grplangs = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
$baselang = Survey::model()->findByPk($iSurveyID)->language;
array_unshift($grplangs, $baselang);

$aData['scripts'] = PrepareEditorScript(false, $this->getController());
foreach ($grplangs as $i => $sLang)
{
$aLanguageData = $this->_getGeneralTemplateData($iSurveyID);

// this one is created to get the right default texts fo each language
Yii::app()->loadHelper('database');
Yii::app()->loadHelper('surveytranslator');

$aSurveyLanguageSettings = SurveyLanguageSetting::model()->findByPk(array('surveyls_survey_id' => $iSurveyID, 'surveyls_language' => $sLang))->getAttributes();
$aTabTitles[$sLang] = getLanguageNameFromCode($aSurveyLanguageSettings['surveyls_language'], false);

if ($aSurveyLanguageSettings['surveyls_language'] == Survey::model()->findByPk($iSurveyID)->language)
{
$aTabTitles[$sLang] .= ' (' . gT("Base language") . ')';
}

$aLanguageData['aSurveyLanguageSettings'] = $aSurveyLanguageSettings;
$aLanguageData['action'] = "surveygeneralsettings";
$aLanguageData['i'] = $i;
$aLanguageData['dateformatdetails'] = getDateFormatData(Yii::app()->session['dateformat']);
$aTabContents[$sLang] = $this->getController()->renderPartial('/admin/survey/editLocalSettings_view', $aLanguageData, true);
}

$aData['aTabContents'] = $aTabContents;
$aData['aTabTitles'] = $aTabTitles;
return $aData;

}

Expand Down Expand Up @@ -1736,6 +1768,8 @@ private function _tabTokens($iSurveyID, $esrow)
private function _tabPanelIntegration($iSurveyID, $esrow)
{
$aData = array();
$oResult = Question::model()->getQuestionsWithSubQuestions($iSurveyID, $esrow['language'], "({{questions}}.type = 'T' OR {{questions}}.type = 'Q' OR {{questions}}.type = 'T' OR {{questions}}.type = 'S')");
$aData['questions'] = $oResult;
return $aData;
}

Expand Down
4 changes: 2 additions & 2 deletions application/controllers/admin/surveypermission.php
Expand Up @@ -122,7 +122,7 @@ public function index($iSurveyID)
if($PermissionRow['uid']!=Yii::app()->user->getId() || Permission::model()->hasGlobalPermission('superadmin','read')) // Can not update own security
{
$surveysecurity .= CHtml::form(array("admin/surveypermission/sa/set/surveyid/{$iSurveyID}"), 'post', array('style'=>"display:inline;"))
."<button type='submit' class='btn btn-default btn-xs'><span class='glyphicon glyphicon-pencil text-success' data-toggle='tooltip' title='".gT("Edit permissions")."'></span></button>";
."<button type='submit' class='btn btn-default btn-xs'><span class='fa fa-pencil text-success' data-toggle='tooltip' title='".gT("Edit permissions")."'></span></button>";
$surveysecurity .= \CHtml::hiddenField('action','setsurveysecurity');
$surveysecurity .= \CHtml::hiddenField('user',$PermissionRow['users_name']);
$surveysecurity .= \CHtml::hiddenField('uid',$PermissionRow['uid']);
Expand All @@ -138,7 +138,7 @@ public function index($iSurveyID)
));
$deleteConfirmMessage = gT("Are you sure you want to delete this entry?");
$surveysecurity .= "<a data-target='#confirmation-modal' data-toggle='modal' data-message='{$deleteConfirmMessage}' data-href='{$deleteUrl}' type='submit' class='btn-xs btn btn-default'>
<span class='glyphicon glyphicon-trash text-warning' data-toggle='tooltip' title='".gT("Delete")."'></span>
<span class='fa fa-trash text-warning' data-toggle='tooltip' title='".gT("Delete")."'></span>
</a>";
}

Expand Down
30 changes: 15 additions & 15 deletions application/core/plugins/QuickMenu/QuickMenu.php
Expand Up @@ -19,31 +19,31 @@ class QuickMenu extends \ls\pluginmanager\PluginBase
),
'activateSurvey' => array(
'type' => 'checkbox',
'label' => 'Activate survey&nbsp;<span class="glyphicon glyphicon-play"></span>',
'label' => 'Activate survey&nbsp;<span class="fa fa-play"></span>',
'default' => '0',
'help' => 'Needed permission: Survey activation - Update'
),
'deactivateSurvey' => array(
'type' => 'checkbox',
'label' => 'Deactivate survey&nbsp;<span class="glyphicon glyphicon-stop"></span>',
'label' => 'Deactivate survey&nbsp;<span class="fa fa-stop"></span>',
'default' => '0',
'help' => 'Needed permission: Survey activation - Update'
),
'testSurvey' => array(
'type' => 'checkbox',
'label' => 'Test or execute survey&nbsp;<span class="glyphicon glyphicon-cog"></span>',
'label' => 'Test or execute survey&nbsp;<span class="fa fa-cog"></span>',
'default' => '0',
'help' => 'Available for everyone. Uses survey base language.'
),
'listQuestions' => array(
'type' => 'checkbox',
'label' => 'List questions&nbsp;<span class="glyphicon glyphicon-list"></span>',
'label' => 'List questions&nbsp;<span class="fa fa-list"></span>',
'default' => '0',
'help' => 'Needed permission: Survey content - View'
),
'listQuestionGroups' => array(
'type' => 'checkbox',
'label' => 'List question groups&nbsp;<span class="glyphicon glyphicon-list"></span>',
'label' => 'List question groups&nbsp;<span class="fa fa-list"></span>',
'default' => '0',
'help' => 'Needed permission: Survey content - View'
),
Expand Down Expand Up @@ -85,7 +85,7 @@ class QuickMenu extends \ls\pluginmanager\PluginBase
),
'tokenManagement' => array(
'type' => 'checkbox',
'label' => 'Survey participants&nbsp;<span class="glyphicon glyphicon-user"></span>',
'label' => 'Survey participants&nbsp;<span class="fa fa-user"></span>',
'default' => '0',
'help' => 'Needed permission: Token - View'
),
Expand All @@ -103,7 +103,7 @@ class QuickMenu extends \ls\pluginmanager\PluginBase
),
'statistics' => array(
'type' => 'checkbox',
'label' => 'Statistics&nbsp;<span class="glyphicon glyphicon-stats"></span>',
'label' => 'Statistics&nbsp;<span class="fa fa-stats"></span>',
'default' => '0',
'help' => 'Needed permission: Statistics - View'
),
Expand Down Expand Up @@ -223,15 +223,15 @@ private function initialiseButtons(array $data)
'name' => 'activateSurvey',
'href' => Yii::app()->getController()->createUrl("admin/survey/sa/activate/surveyid/$surveyId"),
'tooltip' => gT('Activate survey'),
'iconClass' => 'glyphicon glyphicon-play navbar-brand',
'iconClass' => 'fa fa-play navbar-brand',
'showOnlyWhenSurveyIsDeactivated' => true,
'neededPermission' => array('surveyactivation', 'update')
)),
'deactivateSurvey' => new QuickMenuButton(array(
'name' => 'deactivateSurvey',
'href' => Yii::app()->getController()->createUrl("admin/survey/sa/deactivate/surveyid/$surveyId"),
'tooltip' => gT('Stop this survey'),
'iconClass' => 'glyphicon glyphicon-stop navbar-brand',
'iconClass' => 'fa fa-stop navbar-brand',
'showOnlyWhenSurveyIsActivated' => true,
'neededPermission' => array('surveyactivation', 'update')
)),
Expand All @@ -240,20 +240,20 @@ private function initialiseButtons(array $data)
'openInNewTab' => true,
'href' => Yii::app()->getController()->createUrl("survey/index",array('sid'=>$surveyId, 'newtest'=>"Y",'lang'=>$baselang)),
'tooltip' => $activated ? gT('Execute survey') : gT('Test survey'),
'iconClass' => 'glyphicon glyphicon-cog navbar-brand'
'iconClass' => 'fa fa-cog navbar-brand'
)),
'listQuestions' => new QuickMenuButton(array(
'name' => 'listQuestions',
'href' => Yii::app()->createUrl("admin/survey/sa/listquestions/surveyid/$surveyId"),
'tooltip' => gT('List questions'),
'iconClass' => 'glyphicon glyphicon-list navbar-brand',
'iconClass' => 'fa fa-list navbar-brand',
'neededPermission' => array('surveycontent', 'read')
)),
'listQuestionGroups' => new QuickMenuButton(array(
'name' => 'listQuestionGroups',
'href' => Yii::app()->createUrl("admin/survey/sa/listquestiongroups/surveyid/$surveyId"),
'tooltip' => gT('List question groups'),
'iconClass' => 'glyphicon glyphicon-list navbar-brand',
'iconClass' => 'fa fa-list navbar-brand',
'neededPermission' => array('surveycontent', 'read')
)),
'surveySettings' => new QuickMenuButton(array(
Expand Down Expand Up @@ -302,7 +302,7 @@ private function initialiseButtons(array $data)
'name' => 'tokenManagement',
'href' => Yii::app()->getController()->createUrl("admin/tokens/sa/index/surveyid/$surveyId"),
'tooltip' => gT('Survey participants'),
'iconClass' => 'glyphicon glyphicon-user navbar-brand',
'iconClass' => 'fa fa-user navbar-brand',
'neededPermission' => array('tokens', 'read')
)),
'cpdb' => new QuickMenuButton(array(
Expand All @@ -325,7 +325,7 @@ private function initialiseButtons(array $data)
'href' => Yii::app()->getController()->createUrl("admin/responses/sa/browse/surveyid/$surveyId/"),
'href' => Yii::app()->getController()->createUrl("admin/statistics/sa/index/surveyid/$surveyId"),
'tooltip' => gT('Statistics'),
'iconClass' => 'glyphicon glyphicon-stats navbar-brand',
'iconClass' => 'fa fa-stats navbar-brand',
'showOnlyWhenSurveyIsActivated' => true,
'neededPermission' => array('statistics', 'read')
)),
Expand All @@ -345,7 +345,7 @@ private function initialiseButtons(array $data)
'openInNewTab' => false,
'href' => Yii::app()->getController()->createUrl("admin/participants/sa/displayParticipants"),
'tooltip' => gT('Central participant database'),
'iconClass' => 'glyphicon TODO: Icon navbar-brand'
'iconClass' => 'fa TODO: Icon navbar-brand'
);
*/
}
Expand Down
2 changes: 1 addition & 1 deletion application/core/plugins/QuickMenu/QuickMenuButton.php
Expand Up @@ -26,7 +26,7 @@ class QuickMenuButton implements ArrayAccess {
public $tooltip = '';

/**
* @var string - Class with glyphicon
* @var string - Class with fa
*/
public $iconClass;

Expand Down
Expand Up @@ -21,7 +21,7 @@
'type' => 'action',
'action' => 'delete',
'url' => App()->createUrl('/admin/survey/sa/deleteMultiple/'),
'iconClasses' => 'text-danger glyphicon glyphicon-trash',
'iconClasses' => 'text-danger fa fa-trash',
'text' => gT('Delete'),
'grid-reload' => 'yes',

Expand Down

0 comments on commit caa799c

Please sign in to comment.