| @@ -59,239 +59,239 @@ | ||
| 59 | 59 | |
| 60 | 60 | global $jsArray; | 
| 61 | 61 | $jsArray = array( | 
| 62 | - JS_JQUERY => array( | |
| 63 | - 'no' => array( | |
| 64 | - 'no' => '/js/common/jquery.js', | |
| 65 | - 'min' => '/js/common/jquery.min.js' | |
| 66 | - ), | |
| 67 | - 'cdn' => array( | |
| 68 | - 'no' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.js', | |
| 69 | - 'min' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' | |
| 70 | - ) | |
| 71 | - ), | |
| 72 | - JS_JQUERY_UI => array( | |
| 73 | - 'no' => array( | |
| 74 | - 'no' => '/js/common/jquery-ui.js', | |
| 75 | - 'min' => '/js/common/jquery-ui.min.js' | |
| 76 | - ), | |
| 77 | - 'cdn' => array( | |
| 78 | - 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js', | |
| 79 | - 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js' | |
| 80 | - ) | |
| 81 | - ), | |
| 82 | - JS_BOOTSTRAP => array( | |
| 83 | - 'no' => array( | |
| 84 | - 'no' => '/js/common/bootstrap.js', | |
| 85 | - 'min' => '/js/common/bootstrap.min.js' | |
| 86 | - ), | |
| 87 | - 'cdn' => array( | |
| 88 | - 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js', | |
| 89 | - 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js' | |
| 90 | - ) | |
| 91 | - ), | |
| 92 | - JQUERY_VALIDATE => array( | |
| 93 | - 'no' => array( | |
| 94 | - 'no' => '/js/common/jquery.validate.js', | |
| 95 | - 'min' => '/js/common/jquery.validate.min.js' | |
| 96 | - ), | |
| 97 | - 'cdn' => array( | |
| 98 | - 'no' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.js', | |
| 99 | - 'min' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js' | |
| 100 | - ) | |
| 101 | - ), | |
| 102 | - JQUERY_TOUCH => array( | |
| 103 | - 'no' => array( | |
| 104 | - 'no' => '/js/common/jquery.ui.touch-punch.min.js', | |
| 105 | - 'min' => '/js/common/jquery.ui.touch-punch.min.js' | |
| 106 | - ), | |
| 107 | - 'cdn' => array( | |
| 108 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js', | |
| 109 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js' | |
| 110 | - ) | |
| 111 | - ), | |
| 112 | - JS_TINYNAV => array( | |
| 113 | - 'no' => array( | |
| 114 | - 'no' => '/js/common/tinynav.js', | |
| 115 | - 'min' => '/js/common/tinynav.min.js' | |
| 116 | - ), | |
| 117 | - 'cdn' => array( | |
| 118 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.js', | |
| 119 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.min.js' | |
| 120 | - ) | |
| 121 | - ), | |
| 122 | - JS_BOOTSTRAP_FH => array( | |
| 123 | - 'no' => array( | |
| 124 | - 'no' => '/js/common/bootstrap-formhelpers.js', | |
| 125 | - 'min' => '/js/common/bootstrap-formhelpers.min.js' | |
| 126 | - ), | |
| 127 | - 'cdn' => array( | |
| 128 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.js', | |
| 129 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.min.js' | |
| 130 | - ) | |
| 131 | - ), | |
| 132 | - JS_BOOTSTRAP_SW => array( | |
| 133 | - 'no' => array( | |
| 134 | - 'no' => '/js/common/bootstrap-switch.js', | |
| 135 | - 'min' => '/js/common/bootstrap-switch.min.js' | |
| 136 | - ), | |
| 137 | - 'cdn' => array( | |
| 138 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.js', | |
| 139 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.min.js' | |
| 140 | - ) | |
| 141 | - ), | |
| 142 | - JS_DATATABLE => array( | |
| 143 | - 'no' => array( | |
| 144 | - 'no' => '/js/common/jquery.dataTables.js', | |
| 145 | - 'min' => '/js/common/jquery.dataTables.min.js' | |
| 146 | - ), | |
| 147 | - 'cdn' => array( | |
| 148 | - 'no' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.js', | |
| 149 | - 'min' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js' | |
| 150 | - ) | |
| 151 | - ), | |
| 152 | - JS_CHART => array( | |
| 153 | - 'no' => array( | |
| 154 | - 'no' => '/js/common/Chart.js', | |
| 155 | - 'min' => '/js/common/Chart.min.js' | |
| 156 | - ), | |
| 157 | - 'cdn' => array( | |
| 158 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js', | |
| 159 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js' | |
| 160 | - ) | |
| 161 | - ), | |
| 162 | - JS_METISMENU => array( | |
| 163 | - 'no' => array( | |
| 164 | - 'no' => '/js/common/metisMenu.js', | |
| 165 | - 'min' => '/js/common/metisMenu.min.js' | |
| 166 | - ), | |
| 167 | - 'cdn' => array( | |
| 168 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.js', | |
| 169 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.min.js' | |
| 170 | - ) | |
| 171 | - ), | |
| 172 | - JS_BOOTBOX => array( | |
| 173 | - 'no' => array( | |
| 174 | - 'no' => '/js/common/bootbox.js', | |
| 175 | - 'min' => '/js/common/bootbox.min.js' | |
| 176 | - ), | |
| 177 | - 'cdn' => array( | |
| 178 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.js', | |
| 179 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.min.js' | |
| 180 | - ) | |
| 181 | - ), | |
| 182 | - JS_DATATABLE_ODATA => array( | |
| 183 | - 'no' => array( | |
| 184 | - 'no' => '/js/common/jquery.dataTables.odata.js', | |
| 185 | - 'min' => '/js/common/jquery.dataTables.odata.js', | |
| 186 | - ), | |
| 187 | - 'cdn' => array( | |
| 188 | - 'no' => '/js/common/jquery.dataTables.odata.js', | |
| 189 | - 'min' => '/js/common/jquery.dataTables.odata.js', | |
| 190 | - ) | |
| 191 | - ), | |
| 192 | - JS_CRYPTO_MD5_JS => array( | |
| 193 | - 'no' => array( | |
| 194 | - 'no' => '/js/common/md5.js', | |
| 195 | - 'min' => '/js/common/md5.js', | |
| 196 | - ), | |
| 197 | - 'cdn' => array( | |
| 198 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', | |
| 199 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', | |
| 200 | - ) | |
| 201 | - ), | |
| 202 | - JS_JCROP => array( | |
| 203 | - 'no' => array( | |
| 204 | - 'no' => '/js/common/jquery.Jcrop.min.js', | |
| 205 | - 'min' => '/js/common/jquery.Jcrop.min.js' | |
| 206 | - ), | |
| 207 | - 'cdn' => array( | |
| 208 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js', | |
| 209 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js' | |
| 210 | - ) | |
| 211 | - ), | |
| 212 | - JS_TYPEAHEAD => array( | |
| 213 | - 'no' => array( | |
| 214 | - 'no' => '/js/common/typeahead.bundle.js', | |
| 215 | - 'min' => '/js/common/typeahead.bundle.min.js' | |
| 216 | - ), | |
| 217 | - 'cdn' => array( | |
| 218 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.js', | |
| 219 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js' | |
| 220 | - ) | |
| 221 | - ), | |
| 222 | - JS_FLIPSIDE => array( | |
| 223 | - 'no' => array( | |
| 224 | - 'no' => '/js/common/flipside.js', | |
| 225 | - 'min' => '/js/common/flipside.min.js' | |
| 226 | - ), | |
| 227 | - 'cdn' => array( | |
| 228 | - 'no' => '/js/common/flipside.js', | |
| 229 | - 'min' => '/js/common/flipside.min.js' | |
| 230 | - ) | |
| 231 | - ), | |
| 232 | - JS_LOGIN => array( | |
| 233 | - 'no' => array( | |
| 234 | - 'no' => '/js/common/login.js', | |
| 235 | - 'min' => '/js/common/login.min.js' | |
| 236 | - ), | |
| 237 | - 'cdn' => array( | |
| 238 | - 'no' => '/js/common/login.js', | |
| 239 | - 'min' => '/js/common/login.min.js' | |
| 240 | - ) | |
| 241 | - ) | |
| 62 | + JS_JQUERY => array( | |
| 63 | + 'no' => array( | |
| 64 | + 'no' => '/js/common/jquery.js', | |
| 65 | + 'min' => '/js/common/jquery.min.js' | |
| 66 | + ), | |
| 67 | + 'cdn' => array( | |
| 68 | + 'no' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.js', | |
| 69 | + 'min' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' | |
| 70 | + ) | |
| 71 | + ), | |
| 72 | + JS_JQUERY_UI => array( | |
| 73 | + 'no' => array( | |
| 74 | + 'no' => '/js/common/jquery-ui.js', | |
| 75 | + 'min' => '/js/common/jquery-ui.min.js' | |
| 76 | + ), | |
| 77 | + 'cdn' => array( | |
| 78 | + 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js', | |
| 79 | + 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js' | |
| 80 | + ) | |
| 81 | + ), | |
| 82 | + JS_BOOTSTRAP => array( | |
| 83 | + 'no' => array( | |
| 84 | + 'no' => '/js/common/bootstrap.js', | |
| 85 | + 'min' => '/js/common/bootstrap.min.js' | |
| 86 | + ), | |
| 87 | + 'cdn' => array( | |
| 88 | + 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js', | |
| 89 | + 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js' | |
| 90 | + ) | |
| 91 | + ), | |
| 92 | + JQUERY_VALIDATE => array( | |
| 93 | + 'no' => array( | |
| 94 | + 'no' => '/js/common/jquery.validate.js', | |
| 95 | + 'min' => '/js/common/jquery.validate.min.js' | |
| 96 | + ), | |
| 97 | + 'cdn' => array( | |
| 98 | + 'no' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.js', | |
| 99 | + 'min' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js' | |
| 100 | + ) | |
| 101 | + ), | |
| 102 | + JQUERY_TOUCH => array( | |
| 103 | + 'no' => array( | |
| 104 | + 'no' => '/js/common/jquery.ui.touch-punch.min.js', | |
| 105 | + 'min' => '/js/common/jquery.ui.touch-punch.min.js' | |
| 106 | + ), | |
| 107 | + 'cdn' => array( | |
| 108 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js', | |
| 109 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js' | |
| 110 | + ) | |
| 111 | + ), | |
| 112 | + JS_TINYNAV => array( | |
| 113 | + 'no' => array( | |
| 114 | + 'no' => '/js/common/tinynav.js', | |
| 115 | + 'min' => '/js/common/tinynav.min.js' | |
| 116 | + ), | |
| 117 | + 'cdn' => array( | |
| 118 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.js', | |
| 119 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.min.js' | |
| 120 | + ) | |
| 121 | + ), | |
| 122 | + JS_BOOTSTRAP_FH => array( | |
| 123 | + 'no' => array( | |
| 124 | + 'no' => '/js/common/bootstrap-formhelpers.js', | |
| 125 | + 'min' => '/js/common/bootstrap-formhelpers.min.js' | |
| 126 | + ), | |
| 127 | + 'cdn' => array( | |
| 128 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.js', | |
| 129 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.min.js' | |
| 130 | + ) | |
| 131 | + ), | |
| 132 | + JS_BOOTSTRAP_SW => array( | |
| 133 | + 'no' => array( | |
| 134 | + 'no' => '/js/common/bootstrap-switch.js', | |
| 135 | + 'min' => '/js/common/bootstrap-switch.min.js' | |
| 136 | + ), | |
| 137 | + 'cdn' => array( | |
| 138 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.js', | |
| 139 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.min.js' | |
| 140 | + ) | |
| 141 | + ), | |
| 142 | + JS_DATATABLE => array( | |
| 143 | + 'no' => array( | |
| 144 | + 'no' => '/js/common/jquery.dataTables.js', | |
| 145 | + 'min' => '/js/common/jquery.dataTables.min.js' | |
| 146 | + ), | |
| 147 | + 'cdn' => array( | |
| 148 | + 'no' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.js', | |
| 149 | + 'min' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js' | |
| 150 | + ) | |
| 151 | + ), | |
| 152 | + JS_CHART => array( | |
| 153 | + 'no' => array( | |
| 154 | + 'no' => '/js/common/Chart.js', | |
| 155 | + 'min' => '/js/common/Chart.min.js' | |
| 156 | + ), | |
| 157 | + 'cdn' => array( | |
| 158 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js', | |
| 159 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js' | |
| 160 | + ) | |
| 161 | + ), | |
| 162 | + JS_METISMENU => array( | |
| 163 | + 'no' => array( | |
| 164 | + 'no' => '/js/common/metisMenu.js', | |
| 165 | + 'min' => '/js/common/metisMenu.min.js' | |
| 166 | + ), | |
| 167 | + 'cdn' => array( | |
| 168 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.js', | |
| 169 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.min.js' | |
| 170 | + ) | |
| 171 | + ), | |
| 172 | + JS_BOOTBOX => array( | |
| 173 | + 'no' => array( | |
| 174 | + 'no' => '/js/common/bootbox.js', | |
| 175 | + 'min' => '/js/common/bootbox.min.js' | |
| 176 | + ), | |
| 177 | + 'cdn' => array( | |
| 178 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.js', | |
| 179 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.min.js' | |
| 180 | + ) | |
| 181 | + ), | |
| 182 | + JS_DATATABLE_ODATA => array( | |
| 183 | + 'no' => array( | |
| 184 | + 'no' => '/js/common/jquery.dataTables.odata.js', | |
| 185 | + 'min' => '/js/common/jquery.dataTables.odata.js', | |
| 186 | + ), | |
| 187 | + 'cdn' => array( | |
| 188 | + 'no' => '/js/common/jquery.dataTables.odata.js', | |
| 189 | + 'min' => '/js/common/jquery.dataTables.odata.js', | |
| 190 | + ) | |
| 191 | + ), | |
| 192 | + JS_CRYPTO_MD5_JS => array( | |
| 193 | + 'no' => array( | |
| 194 | + 'no' => '/js/common/md5.js', | |
| 195 | + 'min' => '/js/common/md5.js', | |
| 196 | + ), | |
| 197 | + 'cdn' => array( | |
| 198 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', | |
| 199 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', | |
| 200 | + ) | |
| 201 | + ), | |
| 202 | + JS_JCROP => array( | |
| 203 | + 'no' => array( | |
| 204 | + 'no' => '/js/common/jquery.Jcrop.min.js', | |
| 205 | + 'min' => '/js/common/jquery.Jcrop.min.js' | |
| 206 | + ), | |
| 207 | + 'cdn' => array( | |
| 208 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js', | |
| 209 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js' | |
| 210 | + ) | |
| 211 | + ), | |
| 212 | + JS_TYPEAHEAD => array( | |
| 213 | + 'no' => array( | |
| 214 | + 'no' => '/js/common/typeahead.bundle.js', | |
| 215 | + 'min' => '/js/common/typeahead.bundle.min.js' | |
| 216 | + ), | |
| 217 | + 'cdn' => array( | |
| 218 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.js', | |
| 219 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js' | |
| 220 | + ) | |
| 221 | + ), | |
| 222 | + JS_FLIPSIDE => array( | |
| 223 | + 'no' => array( | |
| 224 | + 'no' => '/js/common/flipside.js', | |
| 225 | + 'min' => '/js/common/flipside.min.js' | |
| 226 | + ), | |
| 227 | + 'cdn' => array( | |
| 228 | + 'no' => '/js/common/flipside.js', | |
| 229 | + 'min' => '/js/common/flipside.min.js' | |
| 230 | + ) | |
| 231 | + ), | |
| 232 | + JS_LOGIN => array( | |
| 233 | + 'no' => array( | |
| 234 | + 'no' => '/js/common/login.js', | |
| 235 | + 'min' => '/js/common/login.min.js' | |
| 236 | + ), | |
| 237 | + 'cdn' => array( | |
| 238 | + 'no' => '/js/common/login.js', | |
| 239 | + 'min' => '/js/common/login.min.js' | |
| 240 | + ) | |
| 241 | + ) | |
| 242 | 242 | ); | 
| 243 | 243 | |
| 244 | 244 | global $cssArray; | 
| 245 | 245 | $cssArray = array( | 
| 246 | 246 | CSS_JQUERY_UI => array( | 
| 247 | 247 | 'no' => array( | 
| 248 | - 'no' => '/css/common/jquery-ui.css', | |
| 249 | - 'min' => '/css/common/jquery-ui.min.css' | |
| 250 | - ), | |
| 251 | - 'cdn' => array( | |
| 252 | - 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css', | |
| 253 | - 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css' | |
| 254 | - ) | |
| 248 | + 'no' => '/css/common/jquery-ui.css', | |
| 249 | + 'min' => '/css/common/jquery-ui.min.css' | |
| 250 | + ), | |
| 251 | + 'cdn' => array( | |
| 252 | + 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css', | |
| 253 | + 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css' | |
| 254 | + ) | |
| 255 | 255 | ), | 
| 256 | 256 | CSS_BOOTSTRAP => array( | 
| 257 | - 'no' => array( | |
| 258 | - 'no' => '/css/common/bootstrap.css', | |
| 259 | - 'min' => '/css/common/bootstrap.min.css' | |
| 260 | - ), | |
| 261 | - 'cdn' => array( | |
| 262 | - 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css', | |
| 263 | - 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' | |
| 264 | - ) | |
| 257 | + 'no' => array( | |
| 258 | + 'no' => '/css/common/bootstrap.css', | |
| 259 | + 'min' => '/css/common/bootstrap.min.css' | |
| 260 | + ), | |
| 261 | + 'cdn' => array( | |
| 262 | + 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css', | |
| 263 | + 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' | |
| 264 | + ) | |
| 265 | 265 | ), | 
| 266 | 266 | CSS_BOOTSTRAP_FH => array( | 
| 267 | 267 | 'no' => array( | 
| 268 | - 'no' => '/css/common/bootstrap-formhelpers.css', | |
| 269 | - 'min' => '/css/common/bootstrap-formhelpers.min.css' | |
| 270 | - ), | |
| 271 | - 'cdn' => array( | |
| 272 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.css', | |
| 273 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.min.css' | |
| 274 | - ) | |
| 268 | + 'no' => '/css/common/bootstrap-formhelpers.css', | |
| 269 | + 'min' => '/css/common/bootstrap-formhelpers.min.css' | |
| 270 | + ), | |
| 271 | + 'cdn' => array( | |
| 272 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.css', | |
| 273 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.min.css' | |
| 274 | + ) | |
| 275 | 275 | ), | 
| 276 | 276 | CSS_BOOTSTRAP_SW => array( | 
| 277 | - 'no' => array( | |
| 278 | - 'no' => '/css/common/bootstrap-switch.css', | |
| 279 | - 'min' => '/css/common/bootstrap-switch.min.css' | |
| 280 | - ), | |
| 281 | - 'cdn' => array( | |
| 282 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.css', | |
| 283 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.min.css' | |
| 284 | - ) | |
| 277 | + 'no' => array( | |
| 278 | + 'no' => '/css/common/bootstrap-switch.css', | |
| 279 | + 'min' => '/css/common/bootstrap-switch.min.css' | |
| 280 | + ), | |
| 281 | + 'cdn' => array( | |
| 282 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.css', | |
| 283 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.min.css' | |
| 284 | + ) | |
| 285 | 285 | ), | 
| 286 | 286 | CSS_DATATABLE => array( | 
| 287 | 287 | 'no' => array( | 
| 288 | - 'no' => '/css/common/jquery.dataTables.css', | |
| 289 | - 'min' => '/css/common/jquery.dataTables.min.css' | |
| 290 | - ), | |
| 291 | - 'cdn' => array( | |
| 292 | - 'no' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.css', | |
| 293 | - 'min' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css' | |
| 294 | - ) | |
| 288 | + 'no' => '/css/common/jquery.dataTables.css', | |
| 289 | + 'min' => '/css/common/jquery.dataTables.min.css' | |
| 290 | + ), | |
| 291 | + 'cdn' => array( | |
| 292 | + 'no' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.css', | |
| 293 | + 'min' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css' | |
| 294 | + ) | |
| 295 | 295 | ), | 
| 296 | 296 | CSS_JCROP => array( | 
| 297 | 297 | 'no' => array( | 
| @@ -1,24 +1,24 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | namespace Auth; | 
| 3 | 3 | |
| 4 | -class NullAuthenticator extends Authenticator | |
| 5 | -{
 | |
| 6 | - public function login($username, $password) | |
| 7 | -    {
 | |
| 4 | +class NullAuthenticator extends Authenticator | |
| 5 | +{ | |
| 6 | + public function login($username, $password) | |
| 7 | +    { | |
| 8 | 8 |          return array('res'=>true, 'extended'=>null);
 | 
| 9 | 9 | } | 
| 10 | 10 | |
| 11 | - public function isLoggedIn($data) | |
| 12 | -    {
 | |
| 13 | - if(isset($data['res'])) | |
| 14 | -        {
 | |
| 11 | + public function isLoggedIn($data) | |
| 12 | +    { | |
| 13 | + if(isset($data['res'])) | |
| 14 | +        { | |
| 15 | 15 | return $data['res']; | 
| 16 | 16 | } | 
| 17 | 17 | return false; | 
| 18 | 18 | } | 
| 19 | 19 | |
| 20 | - public function getUser($data) | |
| 21 | -    {
 | |
| 20 | + public function getUser($data) | |
| 21 | +    { | |
| 22 | 22 | return null; | 
| 23 | 23 | } | 
| 24 | 24 | } | 
| @@ -183,7 +183,10 @@ | ||
| 183 | 183 | $count = count($this->children); | 
| 184 | 184 | for($i = 0; $i < $count; $i++) | 
| 185 | 185 |          { | 
| 186 | - if(!is_object($this->children[$i])) continue; | |
| 186 | + if(!is_object($this->children[$i])) | |
| 187 | +            { | |
| 188 | + continue; | |
| 189 | + } | |
| 187 | 190 | if(strstr($this->children[$i]->var1, $substr) !== false || | 
| 188 | 191 | strstr($this->children[$i]->var2, $substr) !== false) | 
| 189 | 192 |              { | 
| @@ -2,20 +2,20 @@ discard block | ||
| 2 | 2 | namespace Auth; | 
| 3 | 3 | require dirname(__FILE__).'/../libs/google/src/Google/autoload.php'; | 
| 4 | 4 | |
| 5 | -class GoogleAuthenticator extends Authenticator | |
| 6 | -{
 | |
| 5 | +class GoogleAuthenticator extends Authenticator | |
| 6 | +{ | |
| 7 | 7 | protected $client; | 
| 8 | 8 | protected $token = null; | 
| 9 | 9 | |
| 10 | - public function __construct($params) | |
| 11 | -    {
 | |
| 10 | + public function __construct($params) | |
| 11 | +    { | |
| 12 | 12 | parent::__construct($params); | 
| 13 | - if(!isset($params['client_secrets_path'])) | |
| 14 | -        {
 | |
| 13 | + if(!isset($params['client_secrets_path'])) | |
| 14 | +        { | |
| 15 | 15 |              throw new \Exception('Missing required parameter client_secrets_path!');
 | 
| 16 | 16 | } | 
| 17 | - if(!isset($params['redirect_url'])) | |
| 18 | -        {
 | |
| 17 | + if(!isset($params['redirect_url'])) | |
| 18 | +        { | |
| 19 | 19 | $params['redirect_url'] = 'https://'.$_SERVER['HTTP_HOST'].'/oauth2callback.php?src=google'; | 
| 20 | 20 | } | 
| 21 | 21 |          $this->token = \FlipSession::getVar('GoogleToken', null);
 | 
| @@ -30,64 +30,64 @@ discard block | ||
| 30 | 30 | * | 
| 31 | 31 | * @return string The link to login using this method | 
| 32 | 32 | */ | 
| 33 | - public function getSupplementLink() | |
| 34 | -    {
 | |
| 33 | + public function getSupplementLink() | |
| 34 | +    { | |
| 35 | 35 | $authUrl = $this->client->createAuthUrl(); | 
| 36 | 36 | return '<a href="'.filter_var($authUrl, FILTER_SANITIZE_URL).'"><img src="/img/common/google_sign_in.png" style="width: 2em;"/></a>'; | 
| 37 | 37 | } | 
| 38 | 38 | |
| 39 | - public function authenticate($code, &$currentUser = false) | |
| 40 | -    {
 | |
| 39 | + public function authenticate($code, &$currentUser = false) | |
| 40 | +    { | |
| 41 | 41 | $googleUser = false; | 
| 42 | - try | |
| 43 | -        {
 | |
| 42 | + try | |
| 43 | +        { | |
| 44 | 44 | $this->client->authenticate($code); | 
| 45 | 45 | $this->token = $this->client->getAccessToken(); | 
| 46 | 46 |              \FlipSession::setVar('GoogleToken', $this->token);
 | 
| 47 | 47 | $oauth2Service = new \Google_Service_Oauth2($this->client); | 
| 48 | 48 | $googleUser = $oauth2Service->userinfo->get(); | 
| 49 | - } | |
| 50 | - catch(\Exception $ex) | |
| 51 | -        {
 | |
| 49 | + } | |
| 50 | + catch(\Exception $ex) | |
| 51 | +        { | |
| 52 | 52 | return self::LOGIN_FAILED; | 
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | $auth = \AuthProvider::getInstance(); | 
| 56 | 56 |          $localUsers = $auth->getUsersByFilter(new \Data\Filter('mail eq '.$googleUser->email));
 | 
| 57 | - if($localUsers !== false && isset($localUsers[0])) | |
| 58 | -        {
 | |
| 59 | -            if($localUsers[0]->canLoginWith('google.com'))
 | |
| 60 | -            {
 | |
| 57 | + if($localUsers !== false && isset($localUsers[0])) | |
| 58 | +        { | |
| 59 | +            if($localUsers[0]->canLoginWith('google.com')) | |
| 60 | +            { | |
| 61 | 61 | $auth->impersonateUser($localUsers[0]); | 
| 62 | 62 | return self::SUCCESS; | 
| 63 | 63 | } | 
| 64 | 64 | $currentUser = $localUsers[0]; | 
| 65 | 65 | return self::ALREADY_PRESENT; | 
| 66 | - } | |
| 67 | - else | |
| 68 | -        {
 | |
| 66 | + } | |
| 67 | + else | |
| 68 | +        { | |
| 69 | 69 | $user = new PendingUser(); | 
| 70 | 70 | $user->setEmail($googleUser->email); | 
| 71 | 71 | $user->setGivenName($googleUser->givenName); | 
| 72 | 72 | $user->setLastName($googleUser->familyName); | 
| 73 | 73 |              $user->addLoginProvider('google.com');
 | 
| 74 | 74 | $ret = $auth->activatePendingUser($user); | 
| 75 | - if($ret === false) | |
| 76 | -            {
 | |
| 75 | + if($ret === false) | |
| 76 | +            { | |
| 77 | 77 |                  throw new \Exception('Unable to create user! '.$res);
 | 
| 78 | 78 | } | 
| 79 | 79 | return self::SUCCESS; | 
| 80 | 80 | } | 
| 81 | 81 | } | 
| 82 | 82 | |
| 83 | - public function getUser($data = false) | |
| 84 | -    {
 | |
| 85 | - if($data === false) | |
| 86 | -        {
 | |
| 83 | + public function getUser($data = false) | |
| 84 | +    { | |
| 85 | + if($data === false) | |
| 86 | +        { | |
| 87 | 87 | $data = $this->token; | 
| 88 | 88 | } | 
| 89 | - try | |
| 90 | -        {
 | |
| 89 | + try | |
| 90 | +        { | |
| 91 | 91 | $this->client->setAccessToken($data); | 
| 92 | 92 | $oauth2Service = new \Google_Service_Oauth2($this->client); | 
| 93 | 93 | $googleUser = $oauth2Service->userinfo->get(); | 
| @@ -98,9 +98,9 @@ discard block | ||
| 98 | 98 | $profileUser['displayName'] = $googleUser->name; | 
| 99 | 99 | $profileUser['jpegPhoto'] = base64_encode(file_get_contents($googleUser->picture)); | 
| 100 | 100 | return $profileUser; | 
| 101 | - } | |
| 102 | - catch(\Exception $e) | |
| 103 | -        {
 | |
| 101 | + } | |
| 102 | + catch(\Exception $e) | |
| 103 | +        { | |
| 104 | 104 | return false; | 
| 105 | 105 | } | 
| 106 | 106 | } |