@@ -32,8 +32,8 @@ |
||
| 32 | 32 | <p>Required PHP version : <b>PHP >= <?php echo TNH_MIN_PHP_VERSION; ?>, PHP < <?php echo TNH_MAX_PHP_VERSION; ?></b></p> |
| 33 | 33 | <p>Release date : <b><?php echo TNH_RELEASE_DATE; ?></b></p> |
| 34 | 34 | <hr /> |
| 35 | - <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php';?></b> |
|
| 36 | - <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php';?></b> |
|
| 35 | + <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php'; ?></b> |
|
| 36 | + <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php'; ?></b> |
|
| 37 | 37 | </div> |
| 38 | 38 | </div> |
| 39 | 39 | </div> |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * SOFTWARE. |
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | - class Url extends BaseClass{ |
|
| 31 | + class Url extends BaseClass { |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Construct new instance |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @return string the final path after add suffix if configured |
| 152 | 152 | * otherwise the same value will be returned |
| 153 | 153 | */ |
| 154 | - protected function addSuffixInPath($path){ |
|
| 154 | + protected function addSuffixInPath($path) { |
|
| 155 | 155 | $suffix = get_config('url_suffix'); |
| 156 | 156 | if ($suffix && $path) { |
| 157 | 157 | if (strpos($path, '?') !== false) { |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | * |
| 824 | 824 | * @return string|boolean |
| 825 | 825 | */ |
| 826 | - protected function getReturnType(){ |
|
| 826 | + protected function getReturnType() { |
|
| 827 | 827 | $type = false; |
| 828 | 828 | if ($this->temporaryReturnRecordType == 'array') { |
| 829 | 829 | $type = 'array'; |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | * Check if soft delete is enable setting the condition |
| 836 | 836 | * @return object the current instance |
| 837 | 837 | */ |
| 838 | - protected function checkForSoftDelete(){ |
|
| 838 | + protected function checkForSoftDelete() { |
|
| 839 | 839 | if ($this->softDeleteStatus && $this->returnRecordWithDeleted !== true) { |
| 840 | 840 | $this->getQueryBuilder()->where( |
| 841 | 841 | $this->softDeleteTableColumn, |
@@ -855,11 +855,11 @@ discard block |
||
| 855 | 855 | * |
| 856 | 856 | * @return array|object the final row values |
| 857 | 857 | */ |
| 858 | - protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type){ |
|
| 858 | + protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type) { |
|
| 859 | 859 | if (in_array($relationship, $this->withs)) { |
| 860 | 860 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
| 861 | 861 | $model = get_instance()->{$relationship . '_model'}; |
| 862 | - if($type == 'manyToOne'){ |
|
| 862 | + if ($type == 'manyToOne') { |
|
| 863 | 863 | if (is_object($row)) { |
| 864 | 864 | $row->{$relationship} = $model->getSingleRecord($row->{$options['primary_key']}); |
| 865 | 865 | } else { |
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | } else { |
| 970 | 970 | if (is_int($field)) { |
| 971 | 971 | //Condition like xxxx->getListRecordCond(array('id')); |
| 972 | - $this->getQueryBuilder()->where($value); // WHERE id = '' |
|
| 972 | + $this->getQueryBuilder()->where($value); // WHERE id = '' |
|
| 973 | 973 | } else { |
| 974 | 974 | //Condition like xxxx->getListRecordCond(array('status' => 0)); |
| 975 | 975 | $this->getQueryBuilder()->where($field, $value); // WHERE status = 0 |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $cacheInfo = $cache->getInfo($pageCacheKey); |
| 250 | 250 | if ($cacheInfo) { |
| 251 | 251 | $status = $this->sendCacheNotYetExpireInfoToBrowser($cacheInfo); |
| 252 | - if($status === false) { |
|
| 252 | + if ($status === false) { |
|
| 253 | 253 | return $this->sendCachePageContentToBrowser($cache); |
| 254 | 254 | } |
| 255 | 255 | return true; |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | public function sendError(array $data = array()) { |
| 325 | 325 | $path = CORE_VIEWS_PATH . 'errors.php'; |
| 326 | - if(file_exists($path)){ |
|
| 326 | + if (file_exists($path)) { |
|
| 327 | 327 | //compress the output if is available |
| 328 | 328 | $compressOutputHandler = $this->getCompressOutputHandler(); |
| 329 | 329 | ob_start($compressOutputHandler); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | echo $content; |
| 336 | 336 | } |
| 337 | 337 | //@codeCoverageIgnoreStart |
| 338 | - else{ |
|
| 338 | + else { |
|
| 339 | 339 | //can't use show_error() at this time because |
| 340 | 340 | //some dependencies not yet loaded |
| 341 | 341 | set_http_status_header(503); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | * |
| 390 | 390 | * @return string|null the full file path |
| 391 | 391 | */ |
| 392 | - protected function getDefaultFilePathForView($file){ |
|
| 392 | + protected function getDefaultFilePathForView($file) { |
|
| 393 | 393 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 394 | 394 | $fullFilePath = null; |
| 395 | 395 | foreach ($searchDir as $dir) { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | static $cfg; |
| 148 | 148 | if (empty($cfg)) { |
| 149 | 149 | $cfg[0] = & load_configurations(); |
| 150 | - if(! is_array($cfg[0])){ |
|
| 150 | + if (!is_array($cfg[0])) { |
|
| 151 | 151 | $cfg[0] = array(); |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | set_http_status_header(500); |
| 198 | 198 | } |
| 199 | 199 | $errorType = 'Error'; |
| 200 | - $errorsType = array ( |
|
| 200 | + $errorsType = array( |
|
| 201 | 201 | E_ERROR => 'Error', |
| 202 | 202 | E_WARNING => 'Warning', |
| 203 | 203 | E_PARSE => 'Parsing Error', |
@@ -443,10 +443,10 @@ discard block |
||
| 443 | 443 | * @return object the current instance |
| 444 | 444 | */ |
| 445 | 445 | protected function filterValidationData() { |
| 446 | - foreach ($this->data as $key => $value ) { |
|
| 446 | + foreach ($this->data as $key => $value) { |
|
| 447 | 447 | if (is_string($value)) { |
| 448 | 448 | $this->data[$key] = trim($value); |
| 449 | - } else if(is_array($value)) { |
|
| 449 | + } else if (is_array($value)) { |
|
| 450 | 450 | $this->data[$key] = array_map('trim', $value); |
| 451 | 451 | } |
| 452 | 452 | } |
@@ -1161,7 +1161,7 @@ discard block |
||
| 1161 | 1161 | $rule, |
| 1162 | 1162 | $paramValue |
| 1163 | 1163 | ); |
| 1164 | - } else{ |
|
| 1164 | + } else { |
|
| 1165 | 1165 | $this->forceError = true; |
| 1166 | 1166 | show_error('The callback validation function/method "' . $paramValue . '" does not exist'); |
| 1167 | 1167 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * Reset all properties |
| 145 | 145 | */ |
| 146 | 146 | public function reset() { |
| 147 | - $this->agent = get_instance()->globalvar->server('HTTP_USER_AGENT'); |
|
| 147 | + $this->agent = get_instance()->globalvar->server('HTTP_USER_AGENT'); |
|
| 148 | 148 | $this->browserName = 'unknown'; |
| 149 | 149 | $this->version = 'unknown'; |
| 150 | 150 | $this->platform = 'unknown'; |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | protected function checkPlatform() { |
| 252 | 252 | foreach ($this->platforms as $regex => $value) { |
| 253 | - if (preg_match($regex, $this->agent) ) { |
|
| 253 | + if (preg_match($regex, $this->agent)) { |
|
| 254 | 254 | $this->platform = $value; |
| 255 | 255 | break; |
| 256 | 256 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | protected function checkBrowser() { |
| 264 | 264 | foreach ($this->browsers as $regex => $value) { |
| 265 | - if (preg_match($regex, $this->agent ) ) { |
|
| 265 | + if (preg_match($regex, $this->agent)) { |
|
| 266 | 266 | $this->browserName = $value; |
| 267 | 267 | break; |
| 268 | 268 | } |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | /** |
| 273 | 273 | * Routine to determine the browser version |
| 274 | 274 | */ |
| 275 | - protected function checkBrowserVersion(){ |
|
| 275 | + protected function checkBrowserVersion() { |
|
| 276 | 276 | $detected = $this->getBrowser(); |
| 277 | 277 | $detect = array_search($detected, $this->browsers); |
| 278 | - $browser = str_replace(array('/i','/'), '', $detect); |
|
| 278 | + $browser = str_replace(array('/i', '/'), '', $detect); |
|
| 279 | 279 | $regex = "/(?<browser>version|{$browser})[\/]+(?<version>[0-9.|a-zA-Z.]*)/i"; |
| 280 | 280 | if (preg_match_all($regex, $this->agent, $matches)) { |
| 281 | 281 | $found = array_search($browser, $matches['browser']); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | protected function checkMobile() { |
| 290 | 290 | if (preg_match('/(android|avantgo|blackberry|bolt|boost|cricket' |
| 291 | - . '|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->agent) ) { |
|
| 291 | + . '|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->agent)) { |
|
| 292 | 292 | $this->isMobile = true; |
| 293 | 293 | } |
| 294 | 294 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | * Determine if the browser is Tablet or not |
| 298 | 298 | */ |
| 299 | 299 | protected function checkTablet() { |
| 300 | - if (preg_match('/tablet|ipad/i', $this->agent) ) { |
|
| 300 | + if (preg_match('/tablet|ipad/i', $this->agent)) { |
|
| 301 | 301 | $this->isTablet = true; |
| 302 | 302 | } |
| 303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * Determine if the browser is Robot or not |
| 307 | 307 | */ |
| 308 | 308 | protected function checkBot() { |
| 309 | - if (preg_match('/bot/i', $this->agent) ) { |
|
| 309 | + if (preg_match('/bot/i', $this->agent)) { |
|
| 310 | 310 | $this->isRobot = true; |
| 311 | 311 | } |
| 312 | 312 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | if (stristr($this->agent, 'FacebookExternalHit')) { |
| 319 | 319 | $this->isRobot = true; |
| 320 | 320 | $this->isFacebook = true; |
| 321 | - } else if (stristr($this->agent, 'FBIOS')) { |
|
| 321 | + } else if (stristr($this->agent, 'FBIOS')) { |
|
| 322 | 322 | $this->isFacebook = true; |
| 323 | 323 | } |
| 324 | 324 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * @param string $appLang the application language, only if type = "language" |
| 336 | 336 | * @return string|null the full file path |
| 337 | 337 | */ |
| 338 | - protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null){ |
|
| 338 | + protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null) { |
|
| 339 | 339 | //Default to "function" |
| 340 | 340 | $searchDir = array(FUNCTIONS_PATH, CORE_FUNCTIONS_PATH); |
| 341 | 341 | if ($type == 'language') { |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | * @param string|null $module the module if is not null will return it |
| 360 | 360 | * @return string|null |
| 361 | 361 | */ |
| 362 | - protected function getModuleFromSuperController($module){ |
|
| 362 | + protected function getModuleFromSuperController($module) { |
|
| 363 | 363 | $obj = & get_instance(); |
| 364 | 364 | if (!$module && !empty($obj->moduleName)) { |
| 365 | 365 | $module = $obj->moduleName; |
@@ -318,7 +318,7 @@ |
||
| 318 | 318 | * Get some parameters need like ip address, hostname, browser info, etc. |
| 319 | 319 | * @return array |
| 320 | 320 | */ |
| 321 | - protected function getSessionDataParams(){ |
|
| 321 | + protected function getSessionDataParams() { |
|
| 322 | 322 | $this->OBJ->loader->functions('user_agent'); |
| 323 | 323 | $this->OBJ->loader->library('Browser'); |
| 324 | 324 | |