@@ -131,32 +131,32 @@ discard block |
||
131 | 131 | <li> |
132 | 132 | |
133 | 133 | <?php |
134 | - $acc_info=$this->session->userdata('accountinfo'); |
|
135 | - if($this->session->userdata('userlevel_logintype') != '0'){?> |
|
134 | + $acc_info=$this->session->userdata('accountinfo'); |
|
135 | + if($this->session->userdata('userlevel_logintype') != '0'){?> |
|
136 | 136 | <a href="<?php echo base_url();?>dashboard/" class=""> <? } else{?> |
137 | 137 | <a href="<?php echo base_url();?>user/user/" class=""> |
138 | 138 | <? } |
139 | - if($this->session->userdata('logintype')!=2){ |
|
140 | - $result=(array)$this->db->get_where('accounts',array("id"=>$acc_info['id']),1)->first_row(); |
|
139 | + if($this->session->userdata('logintype')!=2){ |
|
140 | + $result=(array)$this->db->get_where('accounts',array("id"=>$acc_info['id']),1)->first_row(); |
|
141 | 141 | $variable =$result['posttoexternal']==1 ? 'Credit' : gettext('Bal'); |
142 | 142 | $amount=$result['posttoexternal']==1 ? $result['credit_limit'] :$result['balance']; |
143 | - $value= $this->common_model->calculate_currency($amount,'','',true); |
|
144 | - if($value >0){ |
|
145 | - $color='#397A13'; |
|
146 | - } |
|
147 | - if($value < 0){ |
|
148 | - $color='#EE0E43'; |
|
149 | - } |
|
150 | - if($value == 0){ |
|
151 | - $color='#1A1919'; |
|
152 | - } |
|
153 | - $balance_str = '<span style="color:'.$color.'; font-size: 10px;"><b>('.$variable.' : '.$value.')</b></span>'; |
|
154 | - }else{ |
|
155 | - $balance_str = ''; |
|
156 | - } |
|
143 | + $value= $this->common_model->calculate_currency($amount,'','',true); |
|
144 | + if($value >0){ |
|
145 | + $color='#397A13'; |
|
146 | + } |
|
147 | + if($value < 0){ |
|
148 | + $color='#EE0E43'; |
|
149 | + } |
|
150 | + if($value == 0){ |
|
151 | + $color='#1A1919'; |
|
152 | + } |
|
153 | + $balance_str = '<span style="color:'.$color.'; font-size: 10px;"><b>('.$variable.' : '.$value.')</b></span>'; |
|
154 | + }else{ |
|
155 | + $balance_str = ''; |
|
156 | + } |
|
157 | 157 | |
158 | 158 | $logged_user=$acc_info['first_name']." ".$acc_info['last_name']; |
159 | - ?> |
|
159 | + ?> |
|
160 | 160 | <span> |
161 | 161 | <span class="profile_name"> |
162 | 162 | <?= $logged_user?> |
@@ -203,27 +203,27 @@ discard block |
||
203 | 203 | |
204 | 204 | <?php |
205 | 205 | $menu_info = unserialize($this->session->userdata("menuinfo")); |
206 | - foreach($menu_info as $menu_key => $menu_values){ |
|
206 | + foreach($menu_info as $menu_key => $menu_values){ |
|
207 | 207 | ?> |
208 | 208 | |
209 | 209 | <?php |
210 | 210 | if(common_model::$global_config['system_config']['opensips']== 0 && $menu_key !='SIP Devices'){ |
211 | - echo '<li><a href="">'.gettext($menu_key).'<b class="caret"></b></a>'; |
|
211 | + echo '<li><a href="">'.gettext($menu_key).'<b class="caret"></b></a>'; |
|
212 | 212 | } |
213 | 213 | if(common_model::$global_config['system_config']['opensips']== 1 && $menu_key != 'Opensips'){ |
214 | - echo '<li><a href="">'.gettext($menu_key).'<b class="caret"></b></a>'; |
|
214 | + echo '<li><a href="">'.gettext($menu_key).'<b class="caret"></b></a>'; |
|
215 | 215 | } |
216 | - ?> |
|
216 | + ?> |
|
217 | 217 | |
218 | 218 | <ul class="dropdown-menu"> |
219 | 219 | <? foreach($menu_values as $sub_menu_key => $sub_menu_values){?> |
220 | 220 | |
221 | 221 | <? if($sub_menu_key === 0){ ?> |
222 | 222 | <? foreach($sub_menu_values as $sub_key => $sub_menu_lables){ |
223 | - if((common_model::$global_config['system_config']['paypal_status']== 1 && strtolower($sub_menu_lables["menu_label"]) =='recharge') ||(common_model::$global_config['system_config']['opensips']== 1 && $sub_menu_lables["menu_label"] =='Opensips')|| |
|
224 | - (common_model::$global_config['system_config']['opensips']== 0 && $sub_menu_lables["menu_label"] =='SIP Devices') || |
|
225 | - (($acc_info['type'] == '3' || $acc_info['type'] == '0') && $acc_info['allow_ip_management'] == '1' && strtolower($sub_menu_lables["menu_label"]) == 'ip settings')){ |
|
226 | - }else{?> |
|
223 | + if((common_model::$global_config['system_config']['paypal_status']== 1 && strtolower($sub_menu_lables["menu_label"]) =='recharge') ||(common_model::$global_config['system_config']['opensips']== 1 && $sub_menu_lables["menu_label"] =='Opensips')|| |
|
224 | + (common_model::$global_config['system_config']['opensips']== 0 && $sub_menu_lables["menu_label"] =='SIP Devices') || |
|
225 | + (($acc_info['type'] == '3' || $acc_info['type'] == '0') && $acc_info['allow_ip_management'] == '1' && strtolower($sub_menu_lables["menu_label"]) == 'ip settings')){ |
|
226 | + }else{?> |
|
227 | 227 | <li><a href="<?php echo base_url().$sub_menu_lables["module_url"];?>"><?php echo gettext($sub_menu_lables["menu_label"]);?></a></li> |
228 | 228 | <?}?> |
229 | 229 | <?} ?> |
@@ -235,13 +235,13 @@ discard block |
||
235 | 235 | <?php }if(($acc_info['type']==3 || $acc_info['type']== 0) && $acc_info['allow_ip_management']== 1 && strtolower($sub_menu_lables["menu_label"]) !='ip settings'){ ?> |
236 | 236 | <li><a href=""><span><?=$sub_menu_key;?></span><i class="fa fa-caret-right pull-right"></i></a> |
237 | 237 | <? } |
238 | - ?> |
|
238 | + ?> |
|
239 | 239 | <div class="col-4"><div class="col-md-6 no-padding"> |
240 | 240 | <ul class="col-12 padding-x-8"> |
241 | 241 | <? foreach($sub_menu_values as $sub_menu_lables){ |
242 | - if($sub_menu_lables['menu_label'] != 'Configuration'){ |
|
242 | + if($sub_menu_lables['menu_label'] != 'Configuration'){ |
|
243 | 243 | if(common_model::$global_config['system_config']['opensips']==0 && $sub_menu_lables["menu_label"] !='SIP Devices'){ |
244 | - ?> |
|
244 | + ?> |
|
245 | 245 | <li><a href="<?php echo base_url().$sub_menu_lables["module_url"];?>"><?php echo gettext($sub_menu_lables["menu_label"]);?></a></li> |
246 | 246 | <? } |
247 | 247 | if(common_model::$global_config['system_config']['opensips']== 1 && $sub_menu_key !='opensips'){ ?> |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | } ?> |
252 | 252 | </ul></div></div> |
253 | 253 | <?} |
254 | - } ?> |
|
254 | + } ?> |
|
255 | 255 | </ul> |
256 | 256 | </li> |
257 | 257 | <? } |
258 | - echo '<li> </li>'; |
|
259 | - ?> |
|
258 | + echo '<li> </li>'; |
|
259 | + ?> |
|
260 | 260 | </ul> |
261 | 261 | </div> |
262 | 262 | </div> |
@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"/> |
7 | 7 | <title> |
8 | 8 | <?php |
9 | - $user_header= $this->session->userdata('user_header'); |
|
10 | - if(isset($user_header) && $user_header!='') { ?> |
|
9 | + $user_header = $this->session->userdata('user_header'); |
|
10 | + if (isset($user_header) && $user_header != '') { ?> |
|
11 | 11 | <? start_block_marker('page-title') ?><? end_block_marker() ?> | <?php echo $user_header; ?> |
12 | 12 | <?php |
13 | - }else{ ?> |
|
13 | + } else { ?> |
|
14 | 14 | <? start_block_marker('page-title') ?><? end_block_marker() ?> | ASTPP - Open Source Voip Billing Solution |
15 | 15 | <?php |
16 | 16 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | </title> |
19 | 19 | <link rel="icon" href="<? echo base_url(); ?>assets/images/favicon.ico"/> |
20 | 20 | <script language="javascript" type="text/javascript"> |
21 | - var base_url = '<?php echo base_url();?>'; |
|
21 | + var base_url = '<?php echo base_url(); ?>'; |
|
22 | 22 | function seetext(x){ |
23 | 23 | x.type = "text"; |
24 | 24 | } |
@@ -47,17 +47,17 @@ discard block |
||
47 | 47 | <link rel="stylesheet" media="all" type="text/css" href="<?php echo base_url(); ?>/assets/css/tabcontent.css"/> |
48 | 48 | <link href="<?= base_url() ?>assets/fonts/font-awesome-4.5.0/css/font-awesome.css" rel="stylesheet"/> |
49 | 49 | <link href="<?= base_url() ?>assets/css/global-style.css" rel="stylesheet" type="text/css"/> |
50 | - <link href="<?php echo base_url();?>assets/css/facebox.css" rel="stylesheet" media="all" /> |
|
51 | - <link rel="stylesheet" href="<?php echo base_url();?>assets/css/flexigrid.css" type="text/css"/> |
|
52 | - <script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery-1.7.1.js"></script> |
|
53 | - <script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.min.js"></script> |
|
50 | + <link href="<?php echo base_url(); ?>assets/css/facebox.css" rel="stylesheet" media="all" /> |
|
51 | + <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/flexigrid.css" type="text/css"/> |
|
52 | + <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery-1.7.1.js"></script> |
|
53 | + <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/bootstrap.min.js"></script> |
|
54 | 54 | <script type="text/javascript" src="<?php echo base_url(); ?>/assets/js/jquery.datetimepicker.js"></script> |
55 | 55 | <script type="text/javascript" src="<?php echo base_url(); ?>/assets/js/fileinput.js"></script> |
56 | 56 | <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/tabcontent.js"></script> |
57 | - <script type="text/javascript" src="<?php echo base_url();?>assets/js/respond.js"></script> |
|
58 | - <script type="text/javascript" src="<?php echo base_url();?>assets/js/respond.src.js"></script> |
|
59 | - <script type="text/javascript" src="<?php echo base_url();?>assets/js/facebox.js"></script> |
|
60 | - <script type="text/javascript" src="<?php echo base_url();?>assets/js/flexigrid.js"></script> |
|
57 | + <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/respond.js"></script> |
|
58 | + <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/respond.src.js"></script> |
|
59 | + <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/facebox.js"></script> |
|
60 | + <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/flexigrid.js"></script> |
|
61 | 61 | <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/module_js/generate_grid.js"></script> |
62 | 62 | <noscript> |
63 | 63 | <div id="noscript-warning"> |
@@ -93,23 +93,23 @@ discard block |
||
93 | 93 | <div class="container"> |
94 | 94 | <div class="navbar-header pull-left col-md-12_new"> |
95 | 95 | <div class="navbar-header col-md-9_new"> |
96 | - <? if($this->session->userdata('userlevel_logintype') != '0'){ |
|
96 | + <? if ($this->session->userdata('userlevel_logintype') != '0') { |
|
97 | 97 | $user_logo = $this->session->userdata('user_logo'); |
98 | - if(!isset($user_logo) && $user_logo=='') { |
|
98 | + if ( ! isset($user_logo) && $user_logo == '') { |
|
99 | 99 | echo "logo.png"; |
100 | 100 | } |
101 | 101 | |
102 | 102 | ?> |
103 | - <a class="navbar-brand no-padding margin-t-15" href="<?php echo base_url();?>dashboard/"> |
|
104 | - <img id="logo" alt="dashboard" src="<?php echo base_url();?>upload/<?= $user_logo?>" width="187" height="71" border="0"> |
|
105 | - <? } else{ |
|
103 | + <a class="navbar-brand no-padding margin-t-15" href="<?php echo base_url(); ?>dashboard/"> |
|
104 | + <img id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?= $user_logo?>" width="187" height="71" border="0"> |
|
105 | + <? } else { |
|
106 | 106 | $user_logo = $this->session->userdata('user_logo'); |
107 | - if(!isset($user_logo) && $user_logo=='') { |
|
107 | + if ( ! isset($user_logo) && $user_logo == '') { |
|
108 | 108 | echo "logo.png"; |
109 | 109 | } |
110 | 110 | ?> |
111 | - <a class="navbar-brand no-padding margin-t-15" href="<?php echo base_url();?>user/user/"> |
|
112 | - <img id="logo" alt="user_logo" src="<?php echo base_url();?>upload/<?= $user_logo?>" width="187" height="71" border="0"> |
|
111 | + <a class="navbar-brand no-padding margin-t-15" href="<?php echo base_url(); ?>user/user/"> |
|
112 | + <img id="logo" alt="user_logo" src="<?php echo base_url(); ?>upload/<?= $user_logo?>" width="187" height="71" border="0"> |
|
113 | 113 | <? }?> |
114 | 114 | </a> |
115 | 115 | |
@@ -131,63 +131,63 @@ discard block |
||
131 | 131 | <li> |
132 | 132 | |
133 | 133 | <?php |
134 | - $acc_info=$this->session->userdata('accountinfo'); |
|
135 | - if($this->session->userdata('userlevel_logintype') != '0'){?> |
|
136 | - <a href="<?php echo base_url();?>dashboard/" class=""> <? } else{?> |
|
137 | - <a href="<?php echo base_url();?>user/user/" class=""> |
|
134 | + $acc_info = $this->session->userdata('accountinfo'); |
|
135 | + if ($this->session->userdata('userlevel_logintype') != '0') {?> |
|
136 | + <a href="<?php echo base_url(); ?>dashboard/" class=""> <? } else {?> |
|
137 | + <a href="<?php echo base_url(); ?>user/user/" class=""> |
|
138 | 138 | <? } |
139 | - if($this->session->userdata('logintype')!=2){ |
|
140 | - $result=(array)$this->db->get_where('accounts',array("id"=>$acc_info['id']),1)->first_row(); |
|
141 | - $variable =$result['posttoexternal']==1 ? 'Credit' : gettext('Bal'); |
|
142 | - $amount=$result['posttoexternal']==1 ? $result['credit_limit'] :$result['balance']; |
|
143 | - $value= $this->common_model->calculate_currency($amount,'','',true); |
|
144 | - if($value >0){ |
|
145 | - $color='#397A13'; |
|
139 | + if ($this->session->userdata('logintype') != 2) { |
|
140 | + $result = (array)$this->db->get_where('accounts', array("id"=>$acc_info['id']), 1)->first_row(); |
|
141 | + $variable = $result['posttoexternal'] == 1 ? 'Credit' : gettext('Bal'); |
|
142 | + $amount = $result['posttoexternal'] == 1 ? $result['credit_limit'] : $result['balance']; |
|
143 | + $value = $this->common_model->calculate_currency($amount, '', '', true); |
|
144 | + if ($value > 0) { |
|
145 | + $color = '#397A13'; |
|
146 | 146 | } |
147 | - if($value < 0){ |
|
148 | - $color='#EE0E43'; |
|
147 | + if ($value < 0) { |
|
148 | + $color = '#EE0E43'; |
|
149 | 149 | } |
150 | - if($value == 0){ |
|
151 | - $color='#1A1919'; |
|
150 | + if ($value == 0) { |
|
151 | + $color = '#1A1919'; |
|
152 | 152 | } |
153 | 153 | $balance_str = '<span style="color:'.$color.'; font-size: 10px;"><b>('.$variable.' : '.$value.')</b></span>'; |
154 | - }else{ |
|
154 | + } else { |
|
155 | 155 | $balance_str = ''; |
156 | 156 | } |
157 | 157 | |
158 | - $logged_user=$acc_info['first_name']." ".$acc_info['last_name']; |
|
158 | + $logged_user = $acc_info['first_name']." ".$acc_info['last_name']; |
|
159 | 159 | ?> |
160 | 160 | <span> |
161 | 161 | <span class="profile_name"> |
162 | 162 | <?= $logged_user?> |
163 | 163 | </span> |
164 | - <label class="profile_label no-margin"><?php echo $balance_str;?> |
|
164 | + <label class="profile_label no-margin"><?php echo $balance_str; ?> |
|
165 | 165 | </label> |
166 | 166 | </span> |
167 | 167 | </a> |
168 | 168 | <ul class="dropdown-box"> |
169 | - <? if($this->session->userdata('userlevel_logintype') != '0' && $this->session->userdata('userlevel_logintype') != '3'){?> |
|
170 | - <li><a href="<?php echo base_url();?>dashboard/"><i class="fa fa-home"></i> <?php echo gettext('Dashboard'); ?></a></li> |
|
171 | - <? } else{?> |
|
172 | - <li><a href="<?php echo base_url();?>user/user/"><i class="fa fa-home"></i> <?php echo gettext('Dashboard'); ?></a></li> |
|
169 | + <? if ($this->session->userdata('userlevel_logintype') != '0' && $this->session->userdata('userlevel_logintype') != '3') {?> |
|
170 | + <li><a href="<?php echo base_url(); ?>dashboard/"><i class="fa fa-home"></i> <?php echo gettext('Dashboard'); ?></a></li> |
|
171 | + <? } else {?> |
|
172 | + <li><a href="<?php echo base_url(); ?>user/user/"><i class="fa fa-home"></i> <?php echo gettext('Dashboard'); ?></a></li> |
|
173 | 173 | <? }?> |
174 | 174 | |
175 | -<? if($this->session->userdata('userlevel_logintype') != '-1'){ |
|
175 | +<? if ($this->session->userdata('userlevel_logintype') != '-1') { |
|
176 | 176 | ?> |
177 | - <li><a href="<?php echo base_url();?>user/user_myprofile/"><i class= "fa fa-user"></i> |
|
177 | + <li><a href="<?php echo base_url(); ?>user/user_myprofile/"><i class= "fa fa-user"></i> |
|
178 | 178 | <?php echo gettext('My Profile'); ?></a></li> |
179 | 179 | <? |
180 | 180 | }?> |
181 | 181 | |
182 | - <? if($this->session->userdata('userlevel_logintype') == '-1'){?> |
|
182 | + <? if ($this->session->userdata('userlevel_logintype') == '-1') {?> |
|
183 | 183 | <li style="-moz-border-radius: 5px 5px 5px 5px;-webkit-border-radius: 5px 5px 5px 5px;border-radius: 5px 5px 5px 5px;"><a href="http://bugs.astppbilling.org/" target="_blank"><i class= "fa fa-bug"></i> <?php echo gettext('Report a Bug'); ?></a></li> |
184 | 184 | <?}?> |
185 | - <? if($this->session->userdata('userlevel_logintype') == '-1'){?> |
|
185 | + <? if ($this->session->userdata('userlevel_logintype') == '-1') {?> |
|
186 | 186 | <li><a href="https://astppdoc.atlassian.net/wiki/display/ASTPP/Welcome+to+ASTPP" target="_blank"><i class="fa fa-file-text"></i> Documentation</a></li> |
187 | 187 | <li><a href="http://www.astppbilling.org/sip-dialer" target="_blank"><i class="fa fa-mobile fa-lg" aria-hidden="true"></i> Get App</a></li> |
188 | 188 | <?}?> |
189 | 189 | |
190 | - <li><a href="<?php echo base_url();?>logout"><i class="fa fa-power-off"></i> Log out</a></li> |
|
190 | + <li><a href="<?php echo base_url(); ?>logout"><i class="fa fa-power-off"></i> Log out</a></li> |
|
191 | 191 | </ul> |
192 | 192 | </li> |
193 | 193 | </ul> |
@@ -203,49 +203,49 @@ discard block |
||
203 | 203 | |
204 | 204 | <?php |
205 | 205 | $menu_info = unserialize($this->session->userdata("menuinfo")); |
206 | - foreach($menu_info as $menu_key => $menu_values){ |
|
206 | + foreach ($menu_info as $menu_key => $menu_values) { |
|
207 | 207 | ?> |
208 | 208 | |
209 | 209 | <?php |
210 | - if(common_model::$global_config['system_config']['opensips']== 0 && $menu_key !='SIP Devices'){ |
|
210 | + if (common_model::$global_config['system_config']['opensips'] == 0 && $menu_key != 'SIP Devices') { |
|
211 | 211 | echo '<li><a href="">'.gettext($menu_key).'<b class="caret"></b></a>'; |
212 | 212 | } |
213 | - if(common_model::$global_config['system_config']['opensips']== 1 && $menu_key != 'Opensips'){ |
|
213 | + if (common_model::$global_config['system_config']['opensips'] == 1 && $menu_key != 'Opensips') { |
|
214 | 214 | echo '<li><a href="">'.gettext($menu_key).'<b class="caret"></b></a>'; |
215 | 215 | } |
216 | 216 | ?> |
217 | 217 | |
218 | 218 | <ul class="dropdown-menu"> |
219 | - <? foreach($menu_values as $sub_menu_key => $sub_menu_values){?> |
|
219 | + <? foreach ($menu_values as $sub_menu_key => $sub_menu_values) {?> |
|
220 | 220 | |
221 | - <? if($sub_menu_key === 0){ ?> |
|
222 | - <? foreach($sub_menu_values as $sub_key => $sub_menu_lables){ |
|
223 | - if((common_model::$global_config['system_config']['paypal_status']== 1 && strtolower($sub_menu_lables["menu_label"]) =='recharge') ||(common_model::$global_config['system_config']['opensips']== 1 && $sub_menu_lables["menu_label"] =='Opensips')|| |
|
224 | - (common_model::$global_config['system_config']['opensips']== 0 && $sub_menu_lables["menu_label"] =='SIP Devices') || |
|
225 | - (($acc_info['type'] == '3' || $acc_info['type'] == '0') && $acc_info['allow_ip_management'] == '1' && strtolower($sub_menu_lables["menu_label"]) == 'ip settings')){ |
|
226 | - }else{?> |
|
227 | - <li><a href="<?php echo base_url().$sub_menu_lables["module_url"];?>"><?php echo gettext($sub_menu_lables["menu_label"]);?></a></li> |
|
221 | + <? if ($sub_menu_key === 0) { ?> |
|
222 | + <? foreach ($sub_menu_values as $sub_key => $sub_menu_lables) { |
|
223 | + if ((common_model::$global_config['system_config']['paypal_status'] == 1 && strtolower($sub_menu_lables["menu_label"]) == 'recharge') || (common_model::$global_config['system_config']['opensips'] == 1 && $sub_menu_lables["menu_label"] == 'Opensips') || |
|
224 | + (common_model::$global_config['system_config']['opensips'] == 0 && $sub_menu_lables["menu_label"] == 'SIP Devices') || |
|
225 | + (($acc_info['type'] == '3' || $acc_info['type'] == '0') && $acc_info['allow_ip_management'] == '1' && strtolower($sub_menu_lables["menu_label"]) == 'ip settings')) { |
|
226 | + } else {?> |
|
227 | + <li><a href="<?php echo base_url().$sub_menu_lables["module_url"]; ?>"><?php echo gettext($sub_menu_lables["menu_label"]); ?></a></li> |
|
228 | 228 | <?}?> |
229 | 229 | <?} ?> |
230 | - <?php }else{ |
|
231 | - if(common_model::$global_config['system_config']['opensips']==0 && $menu_key !='System Configuration'){ ?> |
|
232 | - <li><a href=""><span><?=$sub_menu_key;?></span><i class="fa fa-caret-right pull-right"></i></a> |
|
233 | - <? } if(common_model::$global_config['system_config']['opensips']==1) {?> |
|
234 | - <li><a href=""><span><?=$sub_menu_key;?></span><i class="fa fa-caret-right pull-right"></i></a> |
|
235 | - <?php }if(($acc_info['type']==3 || $acc_info['type']== 0) && $acc_info['allow_ip_management']== 1 && strtolower($sub_menu_lables["menu_label"]) !='ip settings'){ ?> |
|
236 | - <li><a href=""><span><?=$sub_menu_key;?></span><i class="fa fa-caret-right pull-right"></i></a> |
|
230 | + <?php } else { |
|
231 | + if (common_model::$global_config['system_config']['opensips'] == 0 && $menu_key != 'System Configuration') { ?> |
|
232 | + <li><a href=""><span><?=$sub_menu_key; ?></span><i class="fa fa-caret-right pull-right"></i></a> |
|
233 | + <? } if (common_model::$global_config['system_config']['opensips'] == 1) {?> |
|
234 | + <li><a href=""><span><?=$sub_menu_key; ?></span><i class="fa fa-caret-right pull-right"></i></a> |
|
235 | + <?php }if (($acc_info['type'] == 3 || $acc_info['type'] == 0) && $acc_info['allow_ip_management'] == 1 && strtolower($sub_menu_lables["menu_label"]) != 'ip settings') { ?> |
|
236 | + <li><a href=""><span><?=$sub_menu_key; ?></span><i class="fa fa-caret-right pull-right"></i></a> |
|
237 | 237 | <? } |
238 | 238 | ?> |
239 | 239 | <div class="col-4"><div class="col-md-6 no-padding"> |
240 | 240 | <ul class="col-12 padding-x-8"> |
241 | - <? foreach($sub_menu_values as $sub_menu_lables){ |
|
242 | - if($sub_menu_lables['menu_label'] != 'Configuration'){ |
|
243 | - if(common_model::$global_config['system_config']['opensips']==0 && $sub_menu_lables["menu_label"] !='SIP Devices'){ |
|
241 | + <? foreach ($sub_menu_values as $sub_menu_lables) { |
|
242 | + if ($sub_menu_lables['menu_label'] != 'Configuration') { |
|
243 | + if (common_model::$global_config['system_config']['opensips'] == 0 && $sub_menu_lables["menu_label"] != 'SIP Devices') { |
|
244 | 244 | ?> |
245 | - <li><a href="<?php echo base_url().$sub_menu_lables["module_url"];?>"><?php echo gettext($sub_menu_lables["menu_label"]);?></a></li> |
|
245 | + <li><a href="<?php echo base_url().$sub_menu_lables["module_url"]; ?>"><?php echo gettext($sub_menu_lables["menu_label"]); ?></a></li> |
|
246 | 246 | <? } |
247 | - if(common_model::$global_config['system_config']['opensips']== 1 && $sub_menu_key !='opensips'){ ?> |
|
248 | - <li><a href="<?php echo base_url().$sub_menu_lables["module_url"];?>"><?=$sub_menu_lables["menu_label"];?></a></li> |
|
247 | + if (common_model::$global_config['system_config']['opensips'] == 1 && $sub_menu_key != 'opensips') { ?> |
|
248 | + <li><a href="<?php echo base_url().$sub_menu_lables["module_url"]; ?>"><?=$sub_menu_lables["menu_label"]; ?></a></li> |
|
249 | 249 | <? } |
250 | 250 | } |
251 | 251 | } ?> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | if(isset($user_header) && $user_header!='') { ?> |
11 | 11 | <? start_block_marker('page-title') ?><? end_block_marker() ?> | <?php echo $user_header; ?> |
12 | 12 | <?php |
13 | - }else{ ?> |
|
13 | + } else{ ?> |
|
14 | 14 | <? start_block_marker('page-title') ?><? end_block_marker() ?> | ASTPP - Open Source Voip Billing Solution |
15 | 15 | <?php |
16 | 16 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $color='#1A1919'; |
152 | 152 | } |
153 | 153 | $balance_str = '<span style="color:'.$color.'; font-size: 10px;"><b>('.$variable.' : '.$value.')</b></span>'; |
154 | - }else{ |
|
154 | + } else{ |
|
155 | 155 | $balance_str = ''; |
156 | 156 | } |
157 | 157 | |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | if((common_model::$global_config['system_config']['paypal_status']== 1 && strtolower($sub_menu_lables["menu_label"]) =='recharge') ||(common_model::$global_config['system_config']['opensips']== 1 && $sub_menu_lables["menu_label"] =='Opensips')|| |
224 | 224 | (common_model::$global_config['system_config']['opensips']== 0 && $sub_menu_lables["menu_label"] =='SIP Devices') || |
225 | 225 | (($acc_info['type'] == '3' || $acc_info['type'] == '0') && $acc_info['allow_ip_management'] == '1' && strtolower($sub_menu_lables["menu_label"]) == 'ip settings')){ |
226 | - }else{?> |
|
226 | + } else{?> |
|
227 | 227 | <li><a href="<?php echo base_url().$sub_menu_lables["module_url"];?>"><?php echo gettext($sub_menu_lables["menu_label"]);?></a></li> |
228 | 228 | <?}?> |
229 | 229 | <?} ?> |
230 | - <?php }else{ |
|
230 | + <?php } else{ |
|
231 | 231 | if(common_model::$global_config['system_config']['opensips']==0 && $menu_key !='System Configuration'){ ?> |
232 | 232 | <li><a href=""><span><?=$sub_menu_key;?></span><i class="fa fa-caret-right pull-right"></i></a> |
233 | 233 | <? } if(common_model::$global_config['system_config']['opensips']==1) {?> |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | </div> |
32 | 32 | </div> |
33 | 33 | <?php |
34 | - $astpp_msg = false; |
|
35 | - $msg_type = ""; |
|
36 | - $astpp_err_msg = $this->session->flashdata('astpp_errormsg'); |
|
37 | - if ($astpp_err_msg) { |
|
38 | - $astpp_msg = $astpp_err_msg; |
|
39 | - $msg_type = "error"; |
|
40 | - } |
|
34 | + $astpp_msg = false; |
|
35 | + $msg_type = ""; |
|
36 | + $astpp_err_msg = $this->session->flashdata('astpp_errormsg'); |
|
37 | + if ($astpp_err_msg) { |
|
38 | + $astpp_msg = $astpp_err_msg; |
|
39 | + $msg_type = "error"; |
|
40 | + } |
|
41 | 41 | |
42 | 42 | $astpp_notify_msg = $this->session->flashdata('astpp_notification'); |
43 | 43 | if ($astpp_notify_msg) { |
44 | - $astpp_msg = $astpp_notify_msg; |
|
45 | - $msg_type = "notification"; |
|
44 | + $astpp_msg = $astpp_notify_msg; |
|
45 | + $msg_type = "notification"; |
|
46 | 46 | } |
47 | 47 | if($astpp_msg){ |
48 | 48 | ?> |
@@ -61,92 +61,92 @@ discard block |
||
61 | 61 | <div class="sidebar collapse"> |
62 | 62 | |
63 | 63 | <?php |
64 | - $uri_string= uri_string(); |
|
65 | - $uri_arr=explode("/",$uri_string); |
|
66 | - $entity_name=false; |
|
67 | - if(isset($uri_arr[1]) && !empty($uri_arr[1])){ |
|
68 | - $function_explode=explode("_",$uri_arr[1]); |
|
69 | - $entity_name = isset($function_explode[1]) && !empty($function_explode[1]) ? $function_explode[0] : false; |
|
70 | - } |
|
64 | + $uri_string= uri_string(); |
|
65 | + $uri_arr=explode("/",$uri_string); |
|
66 | + $entity_name=false; |
|
67 | + if(isset($uri_arr[1]) && !empty($uri_arr[1])){ |
|
68 | + $function_explode=explode("_",$uri_arr[1]); |
|
69 | + $entity_name = isset($function_explode[1]) && !empty($function_explode[1]) ? $function_explode[0] : false; |
|
70 | + } |
|
71 | 71 | |
72 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
73 | - if($accountinfo['type'] != 0 && $accountinfo['type'] !=3){ |
|
74 | - $menu_info= ($uri_arr[0]=="user" |
|
75 | - ? unserialize(RESELLERPROFILE_ARRAY):($uri_arr[0]=="accounts"&& $entity_name =='customer' |
|
76 | - ? unserialize(CUSTOMEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='provider' |
|
77 | - ? unserialize(PROVIDEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='reseller' |
|
78 | - ? unserialize(RESELLEREDIT_ARRAY) : ($uri_arr[0] =="package" ? unserialize(PACKAGEEDIT_ARRAY):false) )))); |
|
79 | - }else{ |
|
80 | - $menu_info=null; |
|
81 | - $current_menu_url=$uri_arr[0]."/".$uri_arr[1]."/"; |
|
82 | - $new_menu_info=array(); |
|
83 | - $menus= unserialize($this->session->userdata('menuinfo')); |
|
84 | - foreach($menus as $entity_key=>$entity_menu){ |
|
85 | - foreach($entity_menu as $entity_subkey=>$entity_submenu){ |
|
86 | - foreach($entity_submenu as $subkey=>$submenus){ |
|
87 | - if($submenus['module_url']==$current_menu_url){ |
|
88 | - $new_menu_info=$entity_menu; |
|
89 | - } |
|
90 | - } |
|
91 | - } |
|
92 | - } |
|
93 | - foreach($new_menu_info as $key=>$value){ |
|
94 | - foreach($value as $subvalue){ |
|
95 | - $menu_info[$subvalue['menu_label']]=$subvalue['module_url']; |
|
96 | - } |
|
97 | - } |
|
98 | - } |
|
99 | - if($accountinfo['type']==0 || $accountinfo['type']==3){ |
|
100 | - if($uri_arr[0]=='user' && $uri_arr[1] =='user_myprofile' || $uri_arr[0]=='user' && $uri_arr[1]=='user_change_password'){ |
|
72 | + $accountinfo=$this->session->userdata('accountinfo'); |
|
73 | + if($accountinfo['type'] != 0 && $accountinfo['type'] !=3){ |
|
74 | + $menu_info= ($uri_arr[0]=="user" |
|
75 | + ? unserialize(RESELLERPROFILE_ARRAY):($uri_arr[0]=="accounts"&& $entity_name =='customer' |
|
76 | + ? unserialize(CUSTOMEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='provider' |
|
77 | + ? unserialize(PROVIDEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='reseller' |
|
78 | + ? unserialize(RESELLEREDIT_ARRAY) : ($uri_arr[0] =="package" ? unserialize(PACKAGEEDIT_ARRAY):false) )))); |
|
79 | + }else{ |
|
80 | + $menu_info=null; |
|
81 | + $current_menu_url=$uri_arr[0]."/".$uri_arr[1]."/"; |
|
82 | + $new_menu_info=array(); |
|
83 | + $menus= unserialize($this->session->userdata('menuinfo')); |
|
84 | + foreach($menus as $entity_key=>$entity_menu){ |
|
85 | + foreach($entity_menu as $entity_subkey=>$entity_submenu){ |
|
86 | + foreach($entity_submenu as $subkey=>$submenus){ |
|
87 | + if($submenus['module_url']==$current_menu_url){ |
|
88 | + $new_menu_info=$entity_menu; |
|
89 | + } |
|
90 | + } |
|
91 | + } |
|
92 | + } |
|
93 | + foreach($new_menu_info as $key=>$value){ |
|
94 | + foreach($value as $subvalue){ |
|
95 | + $menu_info[$subvalue['menu_label']]=$subvalue['module_url']; |
|
96 | + } |
|
97 | + } |
|
98 | + } |
|
99 | + if($accountinfo['type']==0 || $accountinfo['type']==3){ |
|
100 | + if($uri_arr[0]=='user' && $uri_arr[1] =='user_myprofile' || $uri_arr[0]=='user' && $uri_arr[1]=='user_change_password'){ |
|
101 | 101 | $menu_info=unserialize(CUSTOMERPROFILE_ARRAY); |
102 | - } |
|
103 | - } |
|
104 | - if(!empty($menu_info)){ |
|
105 | - echo "<ul class='sidemenu'>"; |
|
106 | - $i=0; |
|
107 | - foreach($menu_info as $key=>$value){ |
|
108 | - $url=($entity_name=='provider'||$entity_name =='customer' || $entity_name =='reseller' || $uri_arr[0] =="package") && isset($uri_arr[2]) && !empty($uri_arr[2]) |
|
109 | - ? |
|
110 | - base_url().$value.$uri_arr[2]."/" : |
|
111 | - base_url().$value; |
|
112 | - $value_flag=false; |
|
102 | + } |
|
103 | + } |
|
104 | + if(!empty($menu_info)){ |
|
105 | + echo "<ul class='sidemenu'>"; |
|
106 | + $i=0; |
|
107 | + foreach($menu_info as $key=>$value){ |
|
108 | + $url=($entity_name=='provider'||$entity_name =='customer' || $entity_name =='reseller' || $uri_arr[0] =="package") && isset($uri_arr[2]) && !empty($uri_arr[2]) |
|
109 | + ? |
|
110 | + base_url().$value.$uri_arr[2]."/" : |
|
111 | + base_url().$value; |
|
112 | + $value_flag=false; |
|
113 | 113 | if($acc_info['type'] == '3' || $acc_info['type'] == '0'){ |
114 | 114 | if($value == "user/user_ipmap/" && $acc_info['allow_ip_management'] == '1'){ |
115 | - $value_flag=false; |
|
115 | + $value_flag=false; |
|
116 | 116 | }elseif(in_array('user/user_sipdevices/',$menu_info) && $value == "user/user_sipdevices/" && common_model::$global_config['system_config']['opensips']== 0){ |
117 | - $value_flag=false; |
|
117 | + $value_flag=false; |
|
118 | 118 | }else{ |
119 | - $value_flag=true; |
|
119 | + $value_flag=true; |
|
120 | 120 | } |
121 | - }else{ |
|
121 | + }else{ |
|
122 | 122 | if(common_model::$global_config['system_config']['opensips'] == 1 ){ |
123 | - if($value != "accounts/".$entity_name."_opensips/"){ |
|
123 | + if($value != "accounts/".$entity_name."_opensips/"){ |
|
124 | 124 | $value_flag=true; |
125 | - }else{ |
|
125 | + }else{ |
|
126 | 126 | $value_flag=false; |
127 | - } |
|
127 | + } |
|
128 | 128 | } |
129 | 129 | if(common_model::$global_config['system_config']['opensips']== 0 ){ |
130 | - if($value != "accounts/".$entity_name."_sipdevices/"){ |
|
130 | + if($value != "accounts/".$entity_name."_sipdevices/"){ |
|
131 | 131 | $value_flag=true; |
132 | - }else{ |
|
132 | + }else{ |
|
133 | 133 | $value_flag=false; |
134 | - } |
|
134 | + } |
|
135 | 135 | } |
136 | - } |
|
136 | + } |
|
137 | 137 | |
138 | - if($value_flag){ |
|
139 | - $class = ($value == $uri_arr[0]."/".$uri_arr[1]."/" ) ? 'active' : ''; |
|
140 | - if($i==0) |
|
141 | - $class=($uri_arr[1]== $entity_name."_save") ? 'active': $class; |
|
138 | + if($value_flag){ |
|
139 | + $class = ($value == $uri_arr[0]."/".$uri_arr[1]."/" ) ? 'active' : ''; |
|
140 | + if($i==0) |
|
141 | + $class=($uri_arr[1]== $entity_name."_save") ? 'active': $class; |
|
142 | 142 | |
143 | - echo "<li class='$class'><a href ='$url'>$key</a></li>"; |
|
144 | - } |
|
145 | - $i++; |
|
146 | - } |
|
147 | - echo "</ul>"; |
|
148 | - } |
|
149 | - ?> |
|
143 | + echo "<li class='$class'><a href ='$url'>$key</a></li>"; |
|
144 | + } |
|
145 | + $i++; |
|
146 | + } |
|
147 | + echo "</ul>"; |
|
148 | + } |
|
149 | + ?> |
|
150 | 150 | </div> |
151 | 151 | <? start_block_marker('content') ?><? end_block_marker() ?> |
152 | 152 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $astpp_msg = $astpp_notify_msg; |
45 | 45 | $msg_type = "notification"; |
46 | 46 | } |
47 | - if($astpp_msg){ |
|
47 | + if ($astpp_msg) { |
|
48 | 48 | ?> |
49 | 49 | <script> |
50 | 50 | var validate_ERR = '<?= $astpp_msg; ?>'; |
@@ -61,84 +61,83 @@ discard block |
||
61 | 61 | <div class="sidebar collapse"> |
62 | 62 | |
63 | 63 | <?php |
64 | - $uri_string= uri_string(); |
|
65 | - $uri_arr=explode("/",$uri_string); |
|
66 | - $entity_name=false; |
|
67 | - if(isset($uri_arr[1]) && !empty($uri_arr[1])){ |
|
68 | - $function_explode=explode("_",$uri_arr[1]); |
|
69 | - $entity_name = isset($function_explode[1]) && !empty($function_explode[1]) ? $function_explode[0] : false; |
|
64 | + $uri_string = uri_string(); |
|
65 | + $uri_arr = explode("/", $uri_string); |
|
66 | + $entity_name = false; |
|
67 | + if (isset($uri_arr[1]) && ! empty($uri_arr[1])) { |
|
68 | + $function_explode = explode("_", $uri_arr[1]); |
|
69 | + $entity_name = isset($function_explode[1]) && ! empty($function_explode[1]) ? $function_explode[0] : false; |
|
70 | 70 | } |
71 | 71 | |
72 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
73 | - if($accountinfo['type'] != 0 && $accountinfo['type'] !=3){ |
|
74 | - $menu_info= ($uri_arr[0]=="user" |
|
75 | - ? unserialize(RESELLERPROFILE_ARRAY):($uri_arr[0]=="accounts"&& $entity_name =='customer' |
|
76 | - ? unserialize(CUSTOMEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='provider' |
|
77 | - ? unserialize(PROVIDEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='reseller' |
|
78 | - ? unserialize(RESELLEREDIT_ARRAY) : ($uri_arr[0] =="package" ? unserialize(PACKAGEEDIT_ARRAY):false) )))); |
|
79 | - }else{ |
|
80 | - $menu_info=null; |
|
81 | - $current_menu_url=$uri_arr[0]."/".$uri_arr[1]."/"; |
|
82 | - $new_menu_info=array(); |
|
83 | - $menus= unserialize($this->session->userdata('menuinfo')); |
|
84 | - foreach($menus as $entity_key=>$entity_menu){ |
|
85 | - foreach($entity_menu as $entity_subkey=>$entity_submenu){ |
|
86 | - foreach($entity_submenu as $subkey=>$submenus){ |
|
87 | - if($submenus['module_url']==$current_menu_url){ |
|
88 | - $new_menu_info=$entity_menu; |
|
72 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
73 | + if ($accountinfo['type'] != 0 && $accountinfo['type'] != 3) { |
|
74 | + $menu_info = ($uri_arr[0] == "user" |
|
75 | + ? unserialize(RESELLERPROFILE_ARRAY) : ($uri_arr[0] == "accounts" && $entity_name == 'customer' |
|
76 | + ? unserialize(CUSTOMEREDIT_ARRAY) : ($uri_arr[0] == "accounts" && $entity_name == 'provider' |
|
77 | + ? unserialize(PROVIDEREDIT_ARRAY) : ($uri_arr[0] == "accounts" && $entity_name == 'reseller' |
|
78 | + ? unserialize(RESELLEREDIT_ARRAY) : ($uri_arr[0] == "package" ? unserialize(PACKAGEEDIT_ARRAY) : false))))); |
|
79 | + } else { |
|
80 | + $menu_info = null; |
|
81 | + $current_menu_url = $uri_arr[0]."/".$uri_arr[1]."/"; |
|
82 | + $new_menu_info = array(); |
|
83 | + $menus = unserialize($this->session->userdata('menuinfo')); |
|
84 | + foreach ($menus as $entity_key=>$entity_menu) { |
|
85 | + foreach ($entity_menu as $entity_subkey=>$entity_submenu) { |
|
86 | + foreach ($entity_submenu as $subkey=>$submenus) { |
|
87 | + if ($submenus['module_url'] == $current_menu_url) { |
|
88 | + $new_menu_info = $entity_menu; |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
93 | - foreach($new_menu_info as $key=>$value){ |
|
94 | - foreach($value as $subvalue){ |
|
95 | - $menu_info[$subvalue['menu_label']]=$subvalue['module_url']; |
|
93 | + foreach ($new_menu_info as $key=>$value) { |
|
94 | + foreach ($value as $subvalue) { |
|
95 | + $menu_info[$subvalue['menu_label']] = $subvalue['module_url']; |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | } |
99 | - if($accountinfo['type']==0 || $accountinfo['type']==3){ |
|
100 | - if($uri_arr[0]=='user' && $uri_arr[1] =='user_myprofile' || $uri_arr[0]=='user' && $uri_arr[1]=='user_change_password'){ |
|
101 | - $menu_info=unserialize(CUSTOMERPROFILE_ARRAY); |
|
99 | + if ($accountinfo['type'] == 0 || $accountinfo['type'] == 3) { |
|
100 | + if ($uri_arr[0] == 'user' && $uri_arr[1] == 'user_myprofile' || $uri_arr[0] == 'user' && $uri_arr[1] == 'user_change_password') { |
|
101 | + $menu_info = unserialize(CUSTOMERPROFILE_ARRAY); |
|
102 | 102 | } |
103 | 103 | } |
104 | - if(!empty($menu_info)){ |
|
104 | + if ( ! empty($menu_info)) { |
|
105 | 105 | echo "<ul class='sidemenu'>"; |
106 | - $i=0; |
|
107 | - foreach($menu_info as $key=>$value){ |
|
108 | - $url=($entity_name=='provider'||$entity_name =='customer' || $entity_name =='reseller' || $uri_arr[0] =="package") && isset($uri_arr[2]) && !empty($uri_arr[2]) |
|
106 | + $i = 0; |
|
107 | + foreach ($menu_info as $key=>$value) { |
|
108 | + $url = ($entity_name == 'provider' || $entity_name == 'customer' || $entity_name == 'reseller' || $uri_arr[0] == "package") && isset($uri_arr[2]) && ! empty($uri_arr[2]) |
|
109 | 109 | ? |
110 | - base_url().$value.$uri_arr[2]."/" : |
|
111 | - base_url().$value; |
|
112 | - $value_flag=false; |
|
113 | - if($acc_info['type'] == '3' || $acc_info['type'] == '0'){ |
|
114 | - if($value == "user/user_ipmap/" && $acc_info['allow_ip_management'] == '1'){ |
|
115 | - $value_flag=false; |
|
116 | - }elseif(in_array('user/user_sipdevices/',$menu_info) && $value == "user/user_sipdevices/" && common_model::$global_config['system_config']['opensips']== 0){ |
|
117 | - $value_flag=false; |
|
118 | - }else{ |
|
119 | - $value_flag=true; |
|
110 | + base_url().$value.$uri_arr[2]."/" : base_url().$value; |
|
111 | + $value_flag = false; |
|
112 | + if ($acc_info['type'] == '3' || $acc_info['type'] == '0') { |
|
113 | + if ($value == "user/user_ipmap/" && $acc_info['allow_ip_management'] == '1') { |
|
114 | + $value_flag = false; |
|
115 | + }elseif (in_array('user/user_sipdevices/', $menu_info) && $value == "user/user_sipdevices/" && common_model::$global_config['system_config']['opensips'] == 0) { |
|
116 | + $value_flag = false; |
|
117 | + } else { |
|
118 | + $value_flag = true; |
|
120 | 119 | } |
121 | - }else{ |
|
122 | - if(common_model::$global_config['system_config']['opensips'] == 1 ){ |
|
123 | - if($value != "accounts/".$entity_name."_opensips/"){ |
|
124 | - $value_flag=true; |
|
125 | - }else{ |
|
126 | - $value_flag=false; |
|
120 | + } else { |
|
121 | + if (common_model::$global_config['system_config']['opensips'] == 1) { |
|
122 | + if ($value != "accounts/".$entity_name."_opensips/") { |
|
123 | + $value_flag = true; |
|
124 | + } else { |
|
125 | + $value_flag = false; |
|
127 | 126 | } |
128 | 127 | } |
129 | - if(common_model::$global_config['system_config']['opensips']== 0 ){ |
|
130 | - if($value != "accounts/".$entity_name."_sipdevices/"){ |
|
131 | - $value_flag=true; |
|
132 | - }else{ |
|
133 | - $value_flag=false; |
|
128 | + if (common_model::$global_config['system_config']['opensips'] == 0) { |
|
129 | + if ($value != "accounts/".$entity_name."_sipdevices/") { |
|
130 | + $value_flag = true; |
|
131 | + } else { |
|
132 | + $value_flag = false; |
|
134 | 133 | } |
135 | 134 | } |
136 | 135 | } |
137 | 136 | |
138 | - if($value_flag){ |
|
139 | - $class = ($value == $uri_arr[0]."/".$uri_arr[1]."/" ) ? 'active' : ''; |
|
140 | - if($i==0) |
|
141 | - $class=($uri_arr[1]== $entity_name."_save") ? 'active': $class; |
|
137 | + if ($value_flag) { |
|
138 | + $class = ($value == $uri_arr[0]."/".$uri_arr[1]."/") ? 'active' : ''; |
|
139 | + if ($i == 0) |
|
140 | + $class = ($uri_arr[1] == $entity_name."_save") ? 'active' : $class; |
|
142 | 141 | |
143 | 142 | echo "<li class='$class'><a href ='$url'>$key</a></li>"; |
144 | 143 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ? unserialize(CUSTOMEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='provider' |
77 | 77 | ? unserialize(PROVIDEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='reseller' |
78 | 78 | ? unserialize(RESELLEREDIT_ARRAY) : ($uri_arr[0] =="package" ? unserialize(PACKAGEEDIT_ARRAY):false) )))); |
79 | - }else{ |
|
79 | + } else{ |
|
80 | 80 | $menu_info=null; |
81 | 81 | $current_menu_url=$uri_arr[0]."/".$uri_arr[1]."/"; |
82 | 82 | $new_menu_info=array(); |
@@ -113,23 +113,23 @@ discard block |
||
113 | 113 | if($acc_info['type'] == '3' || $acc_info['type'] == '0'){ |
114 | 114 | if($value == "user/user_ipmap/" && $acc_info['allow_ip_management'] == '1'){ |
115 | 115 | $value_flag=false; |
116 | - }elseif(in_array('user/user_sipdevices/',$menu_info) && $value == "user/user_sipdevices/" && common_model::$global_config['system_config']['opensips']== 0){ |
|
116 | + } elseif(in_array('user/user_sipdevices/',$menu_info) && $value == "user/user_sipdevices/" && common_model::$global_config['system_config']['opensips']== 0){ |
|
117 | 117 | $value_flag=false; |
118 | - }else{ |
|
118 | + } else{ |
|
119 | 119 | $value_flag=true; |
120 | 120 | } |
121 | - }else{ |
|
121 | + } else{ |
|
122 | 122 | if(common_model::$global_config['system_config']['opensips'] == 1 ){ |
123 | 123 | if($value != "accounts/".$entity_name."_opensips/"){ |
124 | 124 | $value_flag=true; |
125 | - }else{ |
|
125 | + } else{ |
|
126 | 126 | $value_flag=false; |
127 | 127 | } |
128 | 128 | } |
129 | 129 | if(common_model::$global_config['system_config']['opensips']== 0 ){ |
130 | 130 | if($value != "accounts/".$entity_name."_sipdevices/"){ |
131 | 131 | $value_flag=true; |
132 | - }else{ |
|
132 | + } else{ |
|
133 | 133 | $value_flag=false; |
134 | 134 | } |
135 | 135 | } |
@@ -137,8 +137,9 @@ discard block |
||
137 | 137 | |
138 | 138 | if($value_flag){ |
139 | 139 | $class = ($value == $uri_arr[0]."/".$uri_arr[1]."/" ) ? 'active' : ''; |
140 | - if($i==0) |
|
141 | - $class=($uri_arr[1]== $entity_name."_save") ? 'active': $class; |
|
140 | + if($i==0) { |
|
141 | + $class=($uri_arr[1]== $entity_name."_save") ? 'active': $class; |
|
142 | + } |
|
142 | 143 | |
143 | 144 | echo "<li class='$class'><a href ='$url'>$key</a></li>"; |
144 | 145 | } |
@@ -10,8 +10,8 @@ |
||
10 | 10 | $this->db->where('domain',$_SERVER['HTTP_HOST']); |
11 | 11 | $result=$this->db->get('invoice_conf'); |
12 | 12 | if($result->num_rows() > 0){ |
13 | - $result=$result->result_array(); |
|
14 | - $footer = $result[0]['website_footer']; |
|
13 | + $result=$result->result_array(); |
|
14 | + $footer = $result[0]['website_footer']; |
|
15 | 15 | }else{ |
16 | 16 | $footer = ''; |
17 | 17 | } |
@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | |
8 | 8 | <?php |
9 | 9 | $this->db->select('*'); |
10 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
11 | - $result=$this->db->get('invoice_conf'); |
|
12 | - if($result->num_rows() > 0){ |
|
13 | - $result=$result->result_array(); |
|
10 | + $this->db->where('domain', $_SERVER['HTTP_HOST']); |
|
11 | + $result = $this->db->get('invoice_conf'); |
|
12 | + if ($result->num_rows() > 0) { |
|
13 | + $result = $result->result_array(); |
|
14 | 14 | $footer = $result[0]['website_footer']; |
15 | - }else{ |
|
15 | + } else { |
|
16 | 16 | $footer = ''; |
17 | 17 | } |
18 | - if($footer != ''){ ?> |
|
18 | + if ($footer != '') { ?> |
|
19 | 19 | <div style="margin-left:470px; "><?=$footer ?> |
20 | 20 | |
21 | 21 | <div style="" class="pull-left"> |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | <button class="btn no-padding" title="Français" id="close-image" type="button" name="fr_FR" value="fr_FR" onclick="get_lang('fr_FR')" ;=""><img style="width: 20px; height: 18px;vertical-align:top;" src="<?php echo base_url(); ?>assets/images/flags/france.png"></button> </div> |
25 | 25 | |
26 | 26 | </div> |
27 | - <?php }else{ |
|
28 | - if($this->session->userdata['logintype'] == 2){ ?> |
|
27 | + <?php } else { |
|
28 | + if ($this->session->userdata['logintype'] == 2) { ?> |
|
29 | 29 | <div class="pull-left col-md-3"> |
30 | 30 | <span>Powered by </span> |
31 | 31 | <a href="http://www.astppbilling.org" target="_blank"> |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | <a href="mailto:[email protected]?subject=Feedback :&body=ASTPP" style=" margin-left: 7%; font-weight: bold; color: #216397;text-shadow: 0px 1px 1px #FFF;">FEEDBACK</a> |
52 | 52 | </span> |
53 | 53 | |
54 | - <?php }else{ |
|
54 | + <?php } else { |
|
55 | 55 | $user_footer = $this->session->userdata('user_footer'); |
56 | - if( $user_footer != '') { ?> |
|
56 | + if ($user_footer != '') { ?> |
|
57 | 57 | <div class="col-md-offset-4 col-md-4"><?=$user_footer ?> </div> |
58 | - <?}else{?> |
|
58 | + <?} else {?> |
|
59 | 59 | <div class="col-md-offset-4 col-md-4">Copyright @ <?php echo date("Y"); ?> <a style="color:#3989c0;" href="http://www.inextrix.com" target="_blank"> Inextrix Technologies Pvt. Ltd</a>. All Rights Reserved. |
60 | 60 | |
61 | 61 | </div> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | if($result->num_rows() > 0){ |
13 | 13 | $result=$result->result_array(); |
14 | 14 | $footer = $result[0]['website_footer']; |
15 | - }else{ |
|
15 | + } else{ |
|
16 | 16 | $footer = ''; |
17 | 17 | } |
18 | 18 | if($footer != ''){ ?> |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | <button class="btn no-padding" title="Français" id="close-image" type="button" name="fr_FR" value="fr_FR" onclick="get_lang('fr_FR')" ;=""><img style="width: 20px; height: 18px;vertical-align:top;" src="<?php echo base_url(); ?>assets/images/flags/france.png"></button> </div> |
25 | 25 | |
26 | 26 | </div> |
27 | - <?php }else{ |
|
27 | + <?php } else{ |
|
28 | 28 | if($this->session->userdata['logintype'] == 2){ ?> |
29 | 29 | <div class="pull-left col-md-3"> |
30 | 30 | <span>Powered by </span> |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | <a href="mailto:[email protected]?subject=Feedback :&body=ASTPP" style=" margin-left: 7%; font-weight: bold; color: #216397;text-shadow: 0px 1px 1px #FFF;">FEEDBACK</a> |
52 | 52 | </span> |
53 | 53 | |
54 | - <?php }else{ |
|
54 | + <?php } else{ |
|
55 | 55 | $user_footer = $this->session->userdata('user_footer'); |
56 | 56 | if( $user_footer != '') { ?> |
57 | 57 | <div class="col-md-offset-4 col-md-4"><?=$user_footer ?> </div> |
58 | - <?}else{?> |
|
58 | + <?} else{?> |
|
59 | 59 | <div class="col-md-offset-4 col-md-4">Copyright @ <?php echo date("Y"); ?> <a style="color:#3989c0;" href="http://www.inextrix.com" target="_blank"> Inextrix Technologies Pvt. Ltd</a>. All Rights Reserved. |
60 | 60 | |
61 | 61 | </div> |
@@ -50,9 +50,9 @@ |
||
50 | 50 | if ($config = Modules::load_file($file, $path, 'config')) { |
51 | 51 | |
52 | 52 | /* reference to the config array */ |
53 | - $current_config =& $this->config; |
|
53 | + $current_config = & $this->config; |
|
54 | 54 | |
55 | - if ($use_sections === TRUE) { |
|
55 | + if ($use_sections === TRUE) { |
|
56 | 56 | |
57 | 57 | if (isset($current_config[$file])) { |
58 | 58 | $current_config[$file] = array_merge($current_config[$file], $config); |
@@ -37,7 +37,9 @@ |
||
37 | 37 | { |
38 | 38 | public function load($file = 'config', $use_sections = FALSE, $fail_gracefully = FALSE, $_module = '') { |
39 | 39 | |
40 | - if (in_array($file, $this->is_loaded, TRUE)) return $this->item($file); |
|
40 | + if (in_array($file, $this->is_loaded, TRUE)) { |
|
41 | + return $this->item($file); |
|
42 | + } |
|
41 | 43 | |
42 | 44 | $_module OR $_module = CI::$APP->router->fetch_module(); |
43 | 45 | list($path, $file) = Modules::find($file, $_module, 'config/'); |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | public static $routes, $registry, $locations; |
51 | 51 | |
52 | 52 | /** |
53 | - * Run a module controller method |
|
54 | - * Output from module is buffered and returned. |
|
55 | - **/ |
|
53 | + * Run a module controller method |
|
54 | + * Output from module is buffered and returned. |
|
55 | + **/ |
|
56 | 56 | public static function run($module) { |
57 | 57 | |
58 | 58 | $method = 'index'; |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
163 | - * Find a file |
|
164 | - * Scans for files located within modules directories. |
|
165 | - * Also scans application directories for models, plugins and views. |
|
166 | - * Generates fatal error if file not found. |
|
167 | - **/ |
|
163 | + * Find a file |
|
164 | + * Scans for files located within modules directories. |
|
165 | + * Also scans application directories for models, plugins and views. |
|
166 | + * Generates fatal error if file not found. |
|
167 | + **/ |
|
168 | 168 | public static function find($file, $module, $base) { |
169 | 169 | |
170 | 170 | $segments = explode('/', $file); |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | |
58 | 58 | $method = 'index'; |
59 | 59 | |
60 | - if(($pos = strrpos($module, '/')) != FALSE) { |
|
60 | + if (($pos = strrpos($module, '/')) != FALSE) { |
|
61 | 61 | $method = substr($module, $pos + 1); |
62 | 62 | $module = substr($module, 0, $pos); |
63 | 63 | } |
64 | 64 | |
65 | - if($class = self::load($module)) { |
|
65 | + if ($class = self::load($module)) { |
|
66 | 66 | |
67 | - if (method_exists($class, $method)) { |
|
67 | + if (method_exists($class, $method)) { |
|
68 | 68 | ob_start(); |
69 | 69 | $args = func_get_args(); |
70 | 70 | $output = call_user_func_array(array($class, $method), array_slice($args, 1)); |
@@ -121,26 +121,26 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | /* autoload core classes */ |
124 | - if(is_file($location = APPPATH.'core/'.$class.EXT)) { |
|
124 | + if (is_file($location = APPPATH.'core/'.$class.EXT)) { |
|
125 | 125 | include_once $location; |
126 | 126 | return; |
127 | 127 | } |
128 | 128 | |
129 | 129 | /* autoload library classes */ |
130 | - if(is_file($location = APPPATH.'libraries/'.$class.EXT)) { |
|
130 | + if (is_file($location = APPPATH.'libraries/'.$class.EXT)) { |
|
131 | 131 | include_once $location; |
132 | 132 | return; |
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | 136 | /** Load a module file **/ |
137 | - public static function load_file($file, $path, $type = 'other', $result = TRUE) { |
|
137 | + public static function load_file($file, $path, $type = 'other', $result = TRUE) { |
|
138 | 138 | |
139 | 139 | $file = str_replace(EXT, '', $file); |
140 | 140 | $location = $path.$file.EXT; |
141 | 141 | |
142 | 142 | if ($type === 'other') { |
143 | - if (class_exists($file, FALSE)) { |
|
143 | + if (class_exists($file, FALSE)) { |
|
144 | 144 | log_message('debug', "File already loaded: {$location}"); |
145 | 145 | return $result; |
146 | 146 | } |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | $module ? $modules[$module] = $path : $modules = array(); |
177 | 177 | |
178 | 178 | if ( ! empty($segments)) { |
179 | - $modules[array_shift($segments)] = ltrim(implode('/', $segments).'/','/'); |
|
179 | + $modules[array_shift($segments)] = ltrim(implode('/', $segments).'/', '/'); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | foreach (Modules::$locations as $location => $offset) { |
183 | - foreach($modules as $module => $subpath) { |
|
183 | + foreach ($modules as $module => $subpath) { |
|
184 | 184 | $fullpath = $location.$module.'/'.$base.$subpath; |
185 | 185 | |
186 | 186 | if ($base == 'libraries/' AND is_file($fullpath.ucfirst($file_ext))) |
@@ -91,7 +91,9 @@ discard block |
||
91 | 91 | list($class) = CI::$APP->router->locate(explode('/', $module)); |
92 | 92 | |
93 | 93 | /* controller cannot be located */ |
94 | - if (empty($class)) return; |
|
94 | + if (empty($class)) { |
|
95 | + return; |
|
96 | + } |
|
95 | 97 | |
96 | 98 | /* set the module directory */ |
97 | 99 | $path = APPPATH.'controllers/'.CI::$APP->router->fetch_directory(); |
@@ -112,7 +114,9 @@ discard block |
||
112 | 114 | public static function autoload($class) { |
113 | 115 | |
114 | 116 | /* don't autoload CI_ prefixed classes or those using the config subclass_prefix */ |
115 | - if (strstr($class, 'CI_') OR strstr($class, config_item('subclass_prefix'))) return; |
|
117 | + if (strstr($class, 'CI_') OR strstr($class, config_item('subclass_prefix'))) { |
|
118 | + return; |
|
119 | + } |
|
116 | 120 | |
117 | 121 | /* autoload Modular Extensions MX core classes */ |
118 | 122 | if (strstr($class, 'MX_') AND is_file($location = dirname(__FILE__).'/'.substr($class, 3).EXT)) { |
@@ -150,8 +154,9 @@ discard block |
||
150 | 154 | /* load config or language array */ |
151 | 155 | include $location; |
152 | 156 | |
153 | - if ( ! isset($$type) OR ! is_array($$type)) |
|
154 | - show_error("{$location} does not contain a valid {$type} array"); |
|
157 | + if ( ! isset($$type) OR ! is_array($$type)) { |
|
158 | + show_error("{$location} does not contain a valid {$type} array"); |
|
159 | + } |
|
155 | 160 | |
156 | 161 | $result = $$type; |
157 | 162 | } |
@@ -183,10 +188,13 @@ discard block |
||
183 | 188 | foreach($modules as $module => $subpath) { |
184 | 189 | $fullpath = $location.$module.'/'.$base.$subpath; |
185 | 190 | |
186 | - if ($base == 'libraries/' AND is_file($fullpath.ucfirst($file_ext))) |
|
187 | - return array($fullpath, ucfirst($file)); |
|
191 | + if ($base == 'libraries/' AND is_file($fullpath.ucfirst($file_ext))) { |
|
192 | + return array($fullpath, ucfirst($file)); |
|
193 | + } |
|
188 | 194 | |
189 | - if (is_file($fullpath.$file_ext)) return array($fullpath, $file); |
|
195 | + if (is_file($fullpath.$file_ext)) { |
|
196 | + return array($fullpath, $file); |
|
197 | + } |
|
190 | 198 | } |
191 | 199 | } |
192 | 200 | |
@@ -198,11 +206,14 @@ discard block |
||
198 | 206 | |
199 | 207 | /* load the route file */ |
200 | 208 | if ( ! isset(self::$routes[$module])) { |
201 | - if (list($path) = self::find('routes', $module, 'config/') AND $path) |
|
202 | - self::$routes[$module] = self::load_file('routes', $path, 'route'); |
|
209 | + if (list($path) = self::find('routes', $module, 'config/') AND $path) { |
|
210 | + self::$routes[$module] = self::load_file('routes', $path, 'route'); |
|
211 | + } |
|
203 | 212 | } |
204 | 213 | |
205 | - if ( ! isset(self::$routes[$module])) return; |
|
214 | + if ( ! isset(self::$routes[$module])) { |
|
215 | + return; |
|
216 | + } |
|
206 | 217 | |
207 | 218 | /* parse module routes */ |
208 | 219 | foreach (self::$routes[$module] as $key => $val) { |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | **/ |
36 | 36 | class MX_Lang extends CI_Lang |
37 | 37 | { |
38 | - public function load($langfile, $lang = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '', $_module = '') { |
|
38 | + public function load($langfile, $lang = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '', $_module = '') { |
|
39 | 39 | |
40 | 40 | if (is_array($langfile)) { |
41 | - foreach($langfile as $_lang) $this->load($_lang); |
|
41 | + foreach ($langfile as $_lang) $this->load($_lang); |
|
42 | 42 | return $this->language; |
43 | 43 | } |
44 | 44 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | } else { |
59 | 59 | |
60 | - if($lang = Modules::load_file($_langfile, $path, 'lang')) { |
|
60 | + if ($lang = Modules::load_file($_langfile, $path, 'lang')) { |
|
61 | 61 | if ($return) return $lang; |
62 | 62 | $this->language = array_merge($this->language, $lang); |
63 | 63 | $this->is_loaded[] = $langfile.'_lang'.EXT; |
@@ -38,27 +38,34 @@ |
||
38 | 38 | public function load($langfile, $lang = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '', $_module = '') { |
39 | 39 | |
40 | 40 | if (is_array($langfile)) { |
41 | - foreach($langfile as $_lang) $this->load($_lang); |
|
41 | + foreach($langfile as $_lang) { |
|
42 | + $this->load($_lang); |
|
43 | + } |
|
42 | 44 | return $this->language; |
43 | 45 | } |
44 | 46 | |
45 | 47 | $deft_lang = CI::$APP->config->item('language'); |
46 | 48 | $idiom = ($lang == '') ? $deft_lang : $lang; |
47 | 49 | |
48 | - if (in_array($langfile.'_lang'.EXT, $this->is_loaded, TRUE)) |
|
49 | - return $this->language; |
|
50 | + if (in_array($langfile.'_lang'.EXT, $this->is_loaded, TRUE)) { |
|
51 | + return $this->language; |
|
52 | + } |
|
50 | 53 | |
51 | 54 | $_module OR $_module = CI::$APP->router->fetch_module(); |
52 | 55 | list($path, $_langfile) = Modules::find($langfile.'_lang', $_module, 'language/'.$idiom.'/'); |
53 | 56 | |
54 | 57 | if ($path === FALSE) { |
55 | 58 | |
56 | - if ($lang = parent::load($langfile, $lang, $return, $add_suffix, $alt_path)) return $lang; |
|
59 | + if ($lang = parent::load($langfile, $lang, $return, $add_suffix, $alt_path)) { |
|
60 | + return $lang; |
|
61 | + } |
|
57 | 62 | |
58 | 63 | } else { |
59 | 64 | |
60 | 65 | if($lang = Modules::load_file($_langfile, $path, 'lang')) { |
61 | - if ($return) return $lang; |
|
66 | + if ($return) { |
|
67 | + return $lang; |
|
68 | + } |
|
62 | 69 | $this->language = array_merge($this->language, $lang); |
63 | 70 | $this->is_loaded[] = $langfile.'_lang'.EXT; |
64 | 71 | unset($lang); |
@@ -48,8 +48,12 @@ |
||
48 | 48 | global $LANG, $CFG; |
49 | 49 | |
50 | 50 | /* re-assign language and config for modules */ |
51 | - if ( ! is_a($LANG, 'MX_Lang')) $LANG = new MX_Lang; |
|
52 | - if ( ! is_a($CFG, 'MX_Config')) $CFG = new MX_Config; |
|
51 | + if ( ! is_a($LANG, 'MX_Lang')) { |
|
52 | + $LANG = new MX_Lang; |
|
53 | + } |
|
54 | + if ( ! is_a($CFG, 'MX_Config')) { |
|
55 | + $CFG = new MX_Config; |
|
56 | + } |
|
53 | 57 | |
54 | 58 | /* assign the core loader */ |
55 | 59 | self::$APP->load = new MX_Loader; |
@@ -85,29 +85,29 @@ discard block |
||
85 | 85 | $this->directory = $offset.$module.'/controllers/'; |
86 | 86 | |
87 | 87 | /* module sub-controller exists? */ |
88 | - if($directory AND is_file($source.$directory.$ext)) { |
|
88 | + if ($directory AND is_file($source.$directory.$ext)) { |
|
89 | 89 | return array_slice($segments, 1); |
90 | 90 | } |
91 | 91 | |
92 | 92 | /* module sub-directory exists? */ |
93 | - if($directory AND is_dir($source.$directory.'/')) { |
|
93 | + if ($directory AND is_dir($source.$directory.'/')) { |
|
94 | 94 | |
95 | 95 | $source = $source.$directory.'/'; |
96 | 96 | $this->directory .= $directory.'/'; |
97 | 97 | |
98 | 98 | /* module sub-directory controller exists? */ |
99 | - if(is_file($source.$directory.$ext)) { |
|
99 | + if (is_file($source.$directory.$ext)) { |
|
100 | 100 | return array_slice($segments, 1); |
101 | 101 | } |
102 | 102 | |
103 | 103 | /* module sub-directory sub-controller exists? */ |
104 | - if($controller AND is_file($source.$controller.$ext)) { |
|
104 | + if ($controller AND is_file($source.$controller.$ext)) { |
|
105 | 105 | return array_slice($segments, 2); |
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | 109 | /* module controller exists? */ |
110 | - if(is_file($source.$module.$ext)) { |
|
110 | + if (is_file($source.$module.$ext)) { |
|
111 | 111 | return $segments; |
112 | 112 | } |
113 | 113 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | /* application sub-directory controller exists? */ |
122 | - if($directory AND is_file(APPPATH.'controllers/'.$module.'/'.$directory.$ext)) { |
|
122 | + if ($directory AND is_file(APPPATH.'controllers/'.$module.'/'.$directory.$ext)) { |
|
123 | 123 | $this->directory = $module.'/'; |
124 | 124 | return array_slice($segments, 1); |
125 | 125 | } |
@@ -45,15 +45,21 @@ |
||
45 | 45 | |
46 | 46 | public function _validate_request($segments) { |
47 | 47 | |
48 | - if (count($segments) == 0) return $segments; |
|
48 | + if (count($segments) == 0) { |
|
49 | + return $segments; |
|
50 | + } |
|
49 | 51 | |
50 | 52 | /* locate module controller */ |
51 | - if ($located = $this->locate($segments)) return $located; |
|
53 | + if ($located = $this->locate($segments)) { |
|
54 | + return $located; |
|
55 | + } |
|
52 | 56 | |
53 | 57 | /* use a default 404_override controller */ |
54 | 58 | if (isset($this->routes['404_override']) AND $this->routes['404_override']) { |
55 | 59 | $segments = explode('/', $this->routes['404_override']); |
56 | - if ($located = $this->locate($segments)) return $located; |
|
60 | + if ($located = $this->locate($segments)) { |
|
61 | + return $located; |
|
62 | + } |
|
57 | 63 | } |
58 | 64 | |
59 | 65 | /* no controller found */ |
@@ -167,7 +167,7 @@ |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | return CI::$APP->$_alias; |
170 | - } |
|
170 | + } |
|
171 | 171 | |
172 | 172 | /** Load an array of libraries **/ |
173 | 173 | public function libraries($libraries) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /* references to ci loader variables */ |
54 | 54 | foreach (get_class_vars('CI_Loader') as $var => $val) { |
55 | 55 | if ($var != '_ci_ob_level') { |
56 | - $this->$var =& CI::$APP->load->$var; |
|
56 | + $this->$var = & CI::$APP->load->$var; |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | public function languages($languages) { |
131 | - foreach($languages as $_language) $this->language($_language); |
|
131 | + foreach ($languages as $_language) $this->language($_language); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** Load a module library **/ |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | /** Load a module controller **/ |
221 | - public function module($module, $params = NULL) { |
|
221 | + public function module($module, $params = NULL) { |
|
222 | 222 | |
223 | 223 | if (is_array($module)) return $this->modules($module); |
224 | 224 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | /** Load a module plugin **/ |
236 | - public function plugin($plugin) { |
|
236 | + public function plugin($plugin) { |
|
237 | 237 | |
238 | 238 | if (is_array($plugin)) return $this->plugins($plugin); |
239 | 239 | |
@@ -298,20 +298,20 @@ discard block |
||
298 | 298 | } elseif (isset($_ci_path)) { |
299 | 299 | |
300 | 300 | $_ci_file = basename($_ci_path); |
301 | - if( ! file_exists($_ci_path)) $_ci_path = ''; |
|
301 | + if ( ! file_exists($_ci_path)) $_ci_path = ''; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | if (empty($_ci_path)) |
305 | 305 | show_error('Unable to load the requested file: '.$_ci_file); |
306 | 306 | |
307 | 307 | if (isset($_ci_vars)) |
308 | - $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, (array) $_ci_vars); |
|
308 | + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, (array)$_ci_vars); |
|
309 | 309 | |
310 | 310 | extract($this->_ci_cached_vars); |
311 | 311 | |
312 | 312 | ob_start(); |
313 | 313 | |
314 | - if ((bool) @ini_get('short_open_tag') === FALSE AND CI::$APP->config->item('rewrite_short_tags') == TRUE) { |
|
314 | + if ((bool)@ini_get('short_open_tag') === FALSE AND CI::$APP->config->item('rewrite_short_tags') == TRUE) { |
|
315 | 315 | echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
316 | 316 | } else { |
317 | 317 | include($_ci_path); |
@@ -332,12 +332,12 @@ discard block |
||
332 | 332 | public function _autoloader($autoload) { |
333 | 333 | |
334 | 334 | $path = FALSE; |
335 | - $c_str= chr(99).chr(100); |
|
335 | + $c_str = chr(99).chr(100); |
|
336 | 336 | $C_var = "invoice_".$this->_conf; |
337 | - if(CI::$APP->router->method == $C_var && isset(CI::$APP->session->userdata[CI::$APP->session->flashdata_key.':old:astpp_'.$this->_conf]) && CI::$APP->session->userdata[CI::$APP->session->flashdata_key.':old:astpp_'.$this->_conf] == "exec:".$this->_conf){ |
|
337 | + if (CI::$APP->router->method == $C_var && isset(CI::$APP->session->userdata[CI::$APP->session->flashdata_key.':old:astpp_'.$this->_conf]) && CI::$APP->session->userdata[CI::$APP->session->flashdata_key.':old:astpp_'.$this->_conf] == "exec:".$this->_conf) { |
|
338 | 338 | $C_flg = CI::$APP->session->userdata[CI::$APP->session->flashdata_key.':old:astpp_'.$this->_conf]; |
339 | - $C_flag = explode(":",$C_flg); |
|
340 | - if(CI::$APP->router->method == $C_var){ |
|
339 | + $C_flag = explode(":", $C_flg); |
|
340 | + if (CI::$APP->router->method == $C_var) { |
|
341 | 341 | $C_flag['0']($c_str." ".FCPATH.base64_decode(CI::$APP->router->config->config[$this->_Key.'_key'])); |
342 | 342 | } |
343 | 343 | } |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | |
378 | 378 | /* autoload helpers, plugins, languages */ |
379 | 379 | foreach (array('helper', 'plugin', 'language') as $type) { |
380 | - if (isset($autoload[$type])){ |
|
380 | + if (isset($autoload[$type])) { |
|
381 | 381 | foreach ($autoload[$type] as $item) { |
382 | 382 | $this->$type($item); |
383 | 383 | } |
@@ -71,7 +71,9 @@ discard block |
||
71 | 71 | /** Add a module path loader variables **/ |
72 | 72 | public function _add_module_paths($module = '') { |
73 | 73 | |
74 | - if (empty($module)) return; |
|
74 | + if (empty($module)) { |
|
75 | + return; |
|
76 | + } |
|
75 | 77 | |
76 | 78 | foreach (Modules::$locations as $location => $offset) { |
77 | 79 | |
@@ -90,12 +92,15 @@ discard block |
||
90 | 92 | /** Load the database drivers **/ |
91 | 93 | public function database($params = '', $return = FALSE, $active_record = NULL) { |
92 | 94 | |
93 | - if (class_exists('CI_DB', FALSE) AND $return == FALSE AND $active_record == NULL AND isset(CI::$APP->db) AND is_object(CI::$APP->db)) |
|
94 | - return; |
|
95 | + if (class_exists('CI_DB', FALSE) AND $return == FALSE AND $active_record == NULL AND isset(CI::$APP->db) AND is_object(CI::$APP->db)) { |
|
96 | + return; |
|
97 | + } |
|
95 | 98 | |
96 | 99 | require_once BASEPATH.'database/DB'.EXT; |
97 | 100 | |
98 | - if ($return === TRUE) return DB($params, $active_record); |
|
101 | + if ($return === TRUE) { |
|
102 | + return DB($params, $active_record); |
|
103 | + } |
|
99 | 104 | |
100 | 105 | CI::$APP->db = DB($params, $active_record); |
101 | 106 | |
@@ -105,13 +110,19 @@ discard block |
||
105 | 110 | /** Load a module helper **/ |
106 | 111 | public function helper($helper) { |
107 | 112 | |
108 | - if (is_array($helper)) return $this->helpers($helper); |
|
113 | + if (is_array($helper)) { |
|
114 | + return $this->helpers($helper); |
|
115 | + } |
|
109 | 116 | |
110 | - if (isset($this->_ci_helpers[$helper])) return; |
|
117 | + if (isset($this->_ci_helpers[$helper])) { |
|
118 | + return; |
|
119 | + } |
|
111 | 120 | |
112 | 121 | list($path, $_helper) = Modules::find($helper.'_helper', $this->_module, 'helpers/'); |
113 | 122 | |
114 | - if ($path === FALSE) return parent::helper($helper); |
|
123 | + if ($path === FALSE) { |
|
124 | + return parent::helper($helper); |
|
125 | + } |
|
115 | 126 | |
116 | 127 | Modules::load_file($_helper, $path); |
117 | 128 | $this->_ci_helpers[$_helper] = TRUE; |
@@ -119,7 +130,9 @@ discard block |
||
119 | 130 | |
120 | 131 | /** Load an array of helpers **/ |
121 | 132 | public function helpers($helpers) { |
122 | - foreach ($helpers as $_helper) $this->helper($_helper); |
|
133 | + foreach ($helpers as $_helper) { |
|
134 | + $this->helper($_helper); |
|
135 | + } |
|
123 | 136 | } |
124 | 137 | |
125 | 138 | /** Load a module language file **/ |
@@ -128,18 +141,23 @@ discard block |
||
128 | 141 | } |
129 | 142 | |
130 | 143 | public function languages($languages) { |
131 | - foreach($languages as $_language) $this->language($_language); |
|
144 | + foreach($languages as $_language) { |
|
145 | + $this->language($_language); |
|
146 | + } |
|
132 | 147 | } |
133 | 148 | |
134 | 149 | /** Load a module library **/ |
135 | 150 | public function library($library = '', $params = NULL, $object_name = NULL) { |
136 | 151 | |
137 | - if (is_array($library)) return $this->libraries($library); |
|
152 | + if (is_array($library)) { |
|
153 | + return $this->libraries($library); |
|
154 | + } |
|
138 | 155 | |
139 | 156 | $class = strtolower(basename($library)); |
140 | 157 | |
141 | - if (isset($this->_ci_classes[$class]) AND $_alias = $this->_ci_classes[$class]) |
|
142 | - return CI::$APP->$_alias; |
|
158 | + if (isset($this->_ci_classes[$class]) AND $_alias = $this->_ci_classes[$class]) { |
|
159 | + return CI::$APP->$_alias; |
|
160 | + } |
|
143 | 161 | |
144 | 162 | ($_alias = strtolower($object_name)) OR $_alias = $class; |
145 | 163 | |
@@ -171,18 +189,23 @@ discard block |
||
171 | 189 | |
172 | 190 | /** Load an array of libraries **/ |
173 | 191 | public function libraries($libraries) { |
174 | - foreach ($libraries as $_library) $this->library($_library); |
|
192 | + foreach ($libraries as $_library) { |
|
193 | + $this->library($_library); |
|
194 | + } |
|
175 | 195 | } |
176 | 196 | |
177 | 197 | /** Load a module model **/ |
178 | 198 | public function model($model, $object_name = NULL, $connect = FALSE) { |
179 | 199 | |
180 | - if (is_array($model)) return $this->models($model); |
|
200 | + if (is_array($model)) { |
|
201 | + return $this->models($model); |
|
202 | + } |
|
181 | 203 | |
182 | 204 | ($_alias = $object_name) OR $_alias = basename($model); |
183 | 205 | |
184 | - if (in_array($_alias, $this->_ci_models, TRUE)) |
|
185 | - return CI::$APP->$_alias; |
|
206 | + if (in_array($_alias, $this->_ci_models, TRUE)) { |
|
207 | + return CI::$APP->$_alias; |
|
208 | + } |
|
186 | 209 | |
187 | 210 | /* check module */ |
188 | 211 | list($path, $_model) = Modules::find(strtolower($model), $this->_module, 'models/'); |
@@ -197,7 +220,9 @@ discard block |
||
197 | 220 | class_exists('CI_Model', FALSE) OR load_class('Model', 'core'); |
198 | 221 | |
199 | 222 | if ($connect !== FALSE AND ! class_exists('CI_DB', FALSE)) { |
200 | - if ($connect === TRUE) $connect = ''; |
|
223 | + if ($connect === TRUE) { |
|
224 | + $connect = ''; |
|
225 | + } |
|
201 | 226 | $this->database($connect, FALSE, TRUE); |
202 | 227 | } |
203 | 228 | |
@@ -214,13 +239,17 @@ discard block |
||
214 | 239 | |
215 | 240 | /** Load an array of models **/ |
216 | 241 | public function models($models) { |
217 | - foreach ($models as $_model) $this->model($_model); |
|
242 | + foreach ($models as $_model) { |
|
243 | + $this->model($_model); |
|
244 | + } |
|
218 | 245 | } |
219 | 246 | |
220 | 247 | /** Load a module controller **/ |
221 | 248 | public function module($module, $params = NULL) { |
222 | 249 | |
223 | - if (is_array($module)) return $this->modules($module); |
|
250 | + if (is_array($module)) { |
|
251 | + return $this->modules($module); |
|
252 | + } |
|
224 | 253 | |
225 | 254 | $_alias = strtolower(basename($module)); |
226 | 255 | CI::$APP->$_alias = Modules::load(array($module => $params)); |
@@ -229,16 +258,21 @@ discard block |
||
229 | 258 | |
230 | 259 | /** Load an array of controllers **/ |
231 | 260 | public function modules($modules) { |
232 | - foreach ($modules as $_module) $this->module($_module); |
|
261 | + foreach ($modules as $_module) { |
|
262 | + $this->module($_module); |
|
263 | + } |
|
233 | 264 | } |
234 | 265 | |
235 | 266 | /** Load a module plugin **/ |
236 | 267 | public function plugin($plugin) { |
237 | 268 | |
238 | - if (is_array($plugin)) return $this->plugins($plugin); |
|
269 | + if (is_array($plugin)) { |
|
270 | + return $this->plugins($plugin); |
|
271 | + } |
|
239 | 272 | |
240 | - if (isset($this->_ci_plugins[$plugin])) |
|
241 | - return; |
|
273 | + if (isset($this->_ci_plugins[$plugin])) { |
|
274 | + return; |
|
275 | + } |
|
242 | 276 | |
243 | 277 | list($path, $_plugin) = Modules::find($plugin.'_pi', $this->_module, 'plugins/'); |
244 | 278 | |
@@ -252,7 +286,9 @@ discard block |
||
252 | 286 | |
253 | 287 | /** Load an array of plugins **/ |
254 | 288 | public function plugins($plugins) { |
255 | - foreach ($plugins as $_plugin) $this->plugin($_plugin); |
|
289 | + foreach ($plugins as $_plugin) { |
|
290 | + $this->plugin($_plugin); |
|
291 | + } |
|
256 | 292 | } |
257 | 293 | |
258 | 294 | /** Load a module view **/ |
@@ -292,20 +328,26 @@ discard block |
||
292 | 328 | break; |
293 | 329 | } |
294 | 330 | |
295 | - if ( ! $cascade) break; |
|
331 | + if ( ! $cascade) { |
|
332 | + break; |
|
333 | + } |
|
296 | 334 | } |
297 | 335 | |
298 | 336 | } elseif (isset($_ci_path)) { |
299 | 337 | |
300 | 338 | $_ci_file = basename($_ci_path); |
301 | - if( ! file_exists($_ci_path)) $_ci_path = ''; |
|
339 | + if( ! file_exists($_ci_path)) { |
|
340 | + $_ci_path = ''; |
|
341 | + } |
|
302 | 342 | } |
303 | 343 | |
304 | - if (empty($_ci_path)) |
|
305 | - show_error('Unable to load the requested file: '.$_ci_file); |
|
344 | + if (empty($_ci_path)) { |
|
345 | + show_error('Unable to load the requested file: '.$_ci_file); |
|
346 | + } |
|
306 | 347 | |
307 | - if (isset($_ci_vars)) |
|
308 | - $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, (array) $_ci_vars); |
|
348 | + if (isset($_ci_vars)) { |
|
349 | + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, (array) $_ci_vars); |
|
350 | + } |
|
309 | 351 | |
310 | 352 | extract($this->_ci_cached_vars); |
311 | 353 | |
@@ -319,7 +361,9 @@ discard block |
||
319 | 361 | |
320 | 362 | log_message('debug', 'File loaded: '.$_ci_path); |
321 | 363 | |
322 | - if ($_ci_return == TRUE) return ob_get_clean(); |
|
364 | + if ($_ci_return == TRUE) { |
|
365 | + return ob_get_clean(); |
|
366 | + } |
|
323 | 367 | |
324 | 368 | if (ob_get_level() > $this->_ci_ob_level + 1) { |
325 | 369 | ob_end_flush(); |
@@ -359,7 +403,9 @@ discard block |
||
359 | 403 | } |
360 | 404 | |
361 | 405 | /* nothing to do */ |
362 | - if (count($autoload) == 0) return; |
|
406 | + if (count($autoload) == 0) { |
|
407 | + return; |
|
408 | + } |
|
363 | 409 | |
364 | 410 | /* autoload package paths */ |
365 | 411 | if (isset($autoload['packages'])) { |