Skip to content

Commit

Permalink
Dev: fixes to the general loading of js and small fixes to the person…
Browse files Browse the repository at this point in the history
…al settings
  • Loading branch information
lacrioque committed Oct 12, 2017
1 parent 70dbfa4 commit 5c8dbc2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
20 changes: 11 additions & 9 deletions application/controllers/admin/useraction.php
Expand Up @@ -693,12 +693,12 @@ public function personalsettings()
}
}

$oUserModel->setAttributes($aData);
$oUserModel->setAttributes($aData,false);
$uresult = $oUserModel->save();

if (Yii::app()->request->getPost('lang')=='auto')
{
$sLanguage= getBrowserLanguage();
$sLanguage = getBrowserLanguage();
}
else
{
Expand All @@ -722,17 +722,19 @@ public function personalsettings()
}

// Get user lang
$user = User::model()->findByPk(Yii::app()->session['loginID']);
unset($oUser);
$oUser = User::model()->findByPk(Yii::app()->session['loginID']);

$aLanguageData=array('auto'=>gT("(Autodetect)"));
foreach (getLanguageData(true, Yii::app()->session['adminlang']) as $langkey => $languagekind)
{
$aLanguageData[$langkey]=html_entity_decode($languagekind['nativedescription'].' - '.$languagekind['description'],ENT_COMPAT,'utf-8');
}
$aData['aLanguageData'] = $aLanguageData;
$aData['sSavedLanguage'] = $user->lang;
$aData['sUsername'] = $user->users_name;
$aData['sFullname'] = $user->full_name;
$aData['sEmailAdress'] = $user->email;
$aData['sSavedLanguage'] = $oUser->lang;
$aData['sUsername'] = $oUser->users_name;
$aData['sFullname'] = $oUser->full_name;
$aData['sEmailAdress'] = $oUser->email;

$aData['fullpagebar']['savebutton']['form'] = 'personalsettings';
$aData['fullpagebar']['saveandclosebutton']['form'] = 'personalsettings';
Expand All @@ -741,9 +743,9 @@ public function personalsettings()

//Get data for personal menues
$oSurveymenu = Surveymenu::model();
$oSurveymenu->user_id = $user->uid;
$oSurveymenu->user_id = $oUser->uid;
$oSurveymenuEntries = SurveymenuEntries::model();
$oSurveymenuEntries->user_id = $user->uid;
$oSurveymenuEntries->user_id = $oUser->uid;
$aData['surveymenu_data']['model'] = $oSurveymenu;
$aData['surveymenuentry_data']['model'] = $oSurveymenuEntries;
// Render personal settings view
Expand Down
Expand Up @@ -104,7 +104,7 @@ public function registerClientScript()
/* initialize plugin */
$selector = '#' . TbArray::getValue('id', $this->htmlOptions, $this->getId());
$this->pluginOptions['theme']='bootstrap';
$this->getApi()->registerPlugin('select2', $selector, $this->pluginOptions, LSYii_ClientScript::POS_BEGIN);
$this->getApi()->registerEvents($selector, $this->events, LSYii_ClientScript::POS_BEGIN);
$this->getApi()->registerPlugin('select2', $selector, $this->pluginOptions, LSYii_ClientScript::POS_END);
$this->getApi()->registerEvents($selector, $this->events, LSYii_ClientScript::POS_END);
}
}
4 changes: 3 additions & 1 deletion application/views/admin/super/footer.php
Expand Up @@ -30,7 +30,9 @@
</div>
</div>
</footer>

<div id="bottomScripts">
<###end###>
</div>
<!-- Modal for confirmation -->
<?php
/**
Expand Down
20 changes: 13 additions & 7 deletions application/views/admin/user/personalsettings.php
Expand Up @@ -93,20 +93,26 @@
<!-- Interface language -->
<div class="form-group">
<?php echo CHtml::label(gT("Interface language:"), 'lang', array('class'=>" control-label")); ?>
<div class="">
<div class="selector_contain_select2">
<?php
$this->widget('yiiwheels.widgets.select2.WhSelect2', array(
'asDropDownList' => true,
'name' => 'lang',
'data' => $aLanguageData,
'pluginOptions' => array(
'buttonWidth' => '100%',
'htmlOptions' => array(
'id' => 'lang',
'class'=> "form-control"
)
),
'value' => $sSavedLanguage
));
'id' => 'lang',
'style'=> "widht:100%;"
)
),
'value' => $sSavedLanguage,
'htmlOptions' => array(
'class'=> "form-control",
'style'=> "widht:100%;",
'data-width' => '100%'
)
));

?>
</div>
Expand Down

0 comments on commit 5c8dbc2

Please sign in to comment.