1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/* jshint -W041 */
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console */
angular.module('zmApp.controllers').controller('MenuController', ['$scope','$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory','$state', 'ZMDataModel', '$rootScope', '$ionicPopup', '$translate', function ($scope,$ionicSideMenuDelegate,zm, $stateParams, $ionicHistory, $state, ZMDataModel, $rootScope, $ionicPopup, $translate) {
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
};
//----------------------------------------------------------------
// This controller sits along with the main app to bring up
// the language menu from the main menu
//----------------------------------------------------------------
$scope.switchLang = function()
{
$scope.lang = ZMDataModel.getLanguages();
$scope.myopt = {lang:""};
$rootScope.zmPopup = $ionicPopup.show({
scope: $scope,
template: '<ion-radio-fix ng-repeat="item in lang" ng-value="item.value" ng-model="myopt.lang"> {{item.text}} </ion-radio-fix>',
title: $translate.instant('kSelectLanguage'),
buttons: [
{
text: $translate.instant('kButtonCancel'),
onTap: function (e) {
//return "CANCEL";
}
},
{
text: $translate.instant('kButtonOk'),
onTap: function (e) {
ZMDataModel.zmLog("Language selected:"+$scope.myopt.lang);
ZMDataModel.setDefaultLanguage($scope.myopt.lang, true);
//return "OK";
}
}
]
});
};
}]);
|