Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 640 | Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
 
3
use LeadersLinked\Library\Functions;
4
use LeadersLinked\Model\UserType;
5
 
6
$notify = '';
7
$messages = $this->flashMessenger()->getInfoMessages();
8
foreach ($messages as $message) {
9
  $notify .= "$.fn.showInfo('$message')";
10
}
11
 
12
$messages = $this->flashMessenger()->getSuccessMessages();
13
foreach ($messages as $message) {
14
  $notify .= "$.fn.showSuccess('$message')";
15
}
16
 
17
$messages = $this->flashMessenger()->getWarningMessages();
18
foreach ($messages as $message) {
19
  $notify .= " $.fn.showWarning('$message')";
20
}
21
 
22
$messages = $this->flashMessenger()->getErrorMessages();
23
foreach ($messages as $message) {
24
  $notify .= " $.fn.showError('$message')";
25
}
26
 
27
if ($notify) {
28
  $this->inlineScript()->captureStart();
29
  echo " jQuery( document ).ready(function( $ ) { $notify }); ";
30
  $this->inlineScript()->captureEnd();
31
}
32
 
33
$routeCheckSession = $this->url('check-session');
34
 
35
$currentUser    = $this->currentUserHelper();
36
if ($currentUser->hasIdentity()) {
37
  $this->inlineScript()->captureStart();
38
  echo <<<EOT
39
    jQuery( document ).ready(function( $ ) {
40
        $.fn.checkSession = function() {
41
            $.ajax({
42
                'dataType'  : 'json',
43
                'accept'    : 'application/json',
44
                'method'    : 'get',
45
                'url'       : '$routeCheckSession',
46
            }).done(function(response) {
47
                if(response['success']) {
48
                    if(parseInt(response['data']['total_messages']) > 0) {
49
                        $('#badge-inmail').html(response['data']['total_messages']);
50
                        $('#badge-inmail').show();
51
                    } else {
52
                        $('#badge-inmail').hide();
53
                    }
54
 
55
                    if(parseInt(response['data']['total_messages']) > 0) {
56
                        $('#badge-message').html(response['data']['total_messages']);
57
                        $('#badge-message').show();
58
                    } else {
59
                        $('#badge-message').hide();
60
                    }
61
 
62
                    if(parseInt(response['data']['total_notifications']) > 0) {
63
                        $('#badge-notification').html(response['data']['total_notifications']);
64
                        $('#badge-notification').show();
65
                    } else {
66
                        $('#badge-notification').hide();
67
                    }
68
 
69
 
70
    		    } else {
71
                    if(response['data']['url']) {
72
                        window.location.href = response['data']['url'];
73
                    } else {
74
                        $.fn.showError(response['data']['message'])
75
                    }
76
                }
77
            }).fail(function( jqXHR, textStatus, errorThrown) {
78
            }).always(function() {
79
 
80
                setTimeout(function() {
81
                    $.fn.checkSession();
82
                }, 3000);
83
            })
84
 
85
        }
86
 
87
        setTimeout(function() {
88
            $.fn.checkSession();
89
        }, 3000);
90
 
91
    });
92
EOT;
93
  $this->inlineScript()->captureEnd();
94
}
95
$acl = $this->viewModel()->getRoot()->getVariable('acl');
96
 
97
?>
98
 
99
<!DOCTYPE html>
100
<html>
101
 
102
<head>
103
  <?php
104
  echo $this->headTitle();
105
  echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
106
    ->appendHttpEquiv('expires', '0')
107
    ->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
108
    ->appendHttpEquiv('pragma', 'no-cache')
109
    ->appendHttpEquiv('Cache-Control', 'no-store')
110
    ->appendHttpEquiv('Cache-Control', 'max-age=0')
111
    ->appendHttpEquiv('Cache-Control', 'no-cache')
112
    ->appendHttpEquiv('charset', 'UTF-8')
113
    ->appendName('viewport', 'width=device-width, initial-scale=1.0');
114
  //->appendName('description', '')
115
  //->appendName('author', '{AUTHOR}')
116
  //->appendName('keywords', '{KEYWORDS}')
117
  //->appendName('copyright', '{COPYRIGHT}')
118
  //->appendName('google-signin-client_id', '{GOOGLE_CLIENT_ID');
119
  ?>
120
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/animate.css') ?>">
121
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/bootstrap.min.css') ?>">
122
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/line-awesome.css') ?>">
123
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/line-awesome-font-awesome.min.css') ?>">
124
 
125
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/fontawesome-free/css/all.min.css') ?>">
126
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/font-awesome/css/font-awesome.min.css') ?>">
127
  <!--
128
 
129
    	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/font-awesome.min.css') ?>">
130
    	<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/font-awesome/font-awesome.min.css') ?>">
131
    	-->
132
 
133
 
134
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('lib/slick/slick.css') ?>">
135
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('lib/slick/slick-theme.css') ?>">
136
 
137
 
138
 
139
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/style.css') ?>" />
140
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/style-cesa.css') ?>" />
141
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/responsive.css') ?>" />
142
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/responsive-cesa.css') ?>" />
143
 
144
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/jquery.mCustomScrollbar.min.css') ?>" />
145
 
146
  <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/nprogress/nprogress.css') ?>">
147
 
148
  <?php if ($currentUser->hasIdentity()) : ?>
149
 
150
    <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/icons.css') ?>" />
151
    <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/smiley/assets/sprites/emojione.sprites.css') ?>" />
152
    <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/uploader/jquery.ui.plupload/css/jquery-ui.css') ?>" />
153
    <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/uploader/jquery.ui.plupload/css/jquery.ui.plupload.css') ?>" />
154
    <link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/chat.css') ?>" />
155
  <?php endif; ?>
156
 
157
  <?php
158
  echo $this->headStyle();
159
  echo $this->headLink();
160
  echo $this->headScript();
161
  ?>
162
 
163
</head>
164
 
165
<body>
166
 
167
 
168
  <div class="wrapper">
169
    <?php echo $this->menuHelper($currentUser->getUserId()) ?>
170
 
171
    <div id="app" style="min-height: 92vh">
172
      <?php echo $this->content ?>
173
    </div>
174
 
175
 
176
 
177
    <footer>
178
      <div class="footy-sec mn no-margin">
179
        <div class="container">
180
          <?php echo $this->footerHelper() ?>
181
          <p><img src="<?php echo $this->basePath('images/copy-icon2.png') ?>" alt="">Copyright <?php echo date('Y') ?></p>
182
          <img class="fl-rgt" src="<?php echo $this->basePath('/images/logo-ll34x34.png')?>" alt="">
183
        </div>
184
      </div>
185
    </footer>
186
 
187
    <?php if ($currentUser->hasIdentity()) {
188
      $user = $currentUser->getUser();
189
      echo $this->chatHelper($user->id);
190
    }
191
    ?>
192
 
193
  </div>
194
  <!--theme-layout end-->
195
 
196
  <script type="text/javascript" src="<?php echo $this->basePath('js/jquery.min.js') ?>"></script>
197
  <script type="text/javascript" src="<?php echo $this->basePath('js/jquery-ui.min.js') ?>"></script>
198
 
199
  <script type="text/javascript" src="<?php echo $this->basePath('js/popper.js') ?>"></script>
200
  <script type="text/javascript" src="<?php echo $this->basePath('js/bootstrap.min.js') ?>"></script>
201
  <script type="text/javascript" src="<?php echo $this->basePath('lib/slick/slick.min.js') ?>"></script>
202
  <script type="text/javascript" src="<?php echo $this->basePath('js/script.js') ?>"></script>
203
  <script type="text/javascript" src="<?php echo $this->basePath('vendors/nprogress/nprogress.js') ?>"></script>
204
  <script type="text/javascript" src="<?php echo $this->basePath('vendors/jquery-validation/jquery.validate.min.js') ?>"></script>
205
  <script type="text/javascript" src="<?php echo $this->basePath('vendors/jquery-validation/additional-methods.min.js') ?>"></script>
206
  <script type="text/javascript" src="<?php echo $this->basePath('vendors/jquery-validation/localization/messages_es.min.js') ?>"></script>
207
  <script type="text/javascript" src="<?php echo $this->basePath('vendors/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
208
  <script type="text/javascript" src="<?php echo $this->basePath('vendors/cryptojs/cryptojs-aes.min.js') ?>"></script>
209
  <script type="text/javascript" src="<?php echo $this->basePath('js/jquery.mCustomScrollbar.js') ?>"></script>
210
 
211
 
212
  <?php if ($currentUser->hasIdentity()) : ?>
213
    <script type="text/javascript" src="<?php echo $this->basePath('vendors/uploader/plupload.full.min.js') ?>"></script>
214
    <script type="text/javascript" src="<?php echo $this->basePath('vendors/uploader/jquery.ui.plupload/jquery.ui.plupload.js') ?>"></script>
215
    <script type="text/javascript" src="<?php echo $this->basePath('vendors/smiley/js/emojione.min.js') ?>"></script>
216
    <script type="text/javascript" src="<?php echo $this->basePath('vendors/smiley/smiley.js') ?>"></script>
217
    <script type="text/javascript" src="<?php echo $this->basePath('js/lightbox.js') ?>"></script>
218
 
219
  <?php endif; ?>
220
 
221
  <script type="text/javascript" src="<?php echo $this->basePath('js/leaderslinked.js') ?>"></script>
222
 
223
  <?php
224
  echo $this->inlineScript();
225
  ?>
226
</body>
227
 
228
</html>