| @@ -70,16 +70,10 @@ | ||
| 70 | 70 | * put your comment there... |
| 71 | 71 | * |
| 72 | 72 | * @var mixed |
| 73 | 73 | */ |
| 74 | - protected $onloadtemplate = array | |
| 75 | - ( | |
| 76 | - 'parameters' => array | |
| 77 | - ( | |
| 78 | - 'content', | |
| 79 | - 'file', | |
| 80 | - 'dir', | |
| 81 | - ), | |
| 74 | + protected $onloadtemplate = array( | |
| 75 | + 'parameters' => array('content', 'file'), | |
| 82 | 76 | ); |
| 83 | 77 | |
| 84 | 78 | /** |
| 85 | 79 | * put your comment there... |
| @@ -208,9 +202,9 @@ | ||
| 208 | 202 | * |
| 209 | 203 | * @param mixed $destination |
| 210 | 204 | */ |
| 211 | 205 | public function getPath($destination) { |
| 212 | - return self::getViewPath($this->viewInfo['name'], $destination, $this->viewInfo['viewsPath']); | |
| 206 | + return self::getViewPath($this->viewInfo['name'], $destination); | |
| 213 | 207 | } |
| 214 | 208 | |
| 215 | 209 | /** |
| 216 | 210 | * put your comment there... |
| @@ -241,16 +235,16 @@ | ||
| 241 | 235 | $extension = '.html.tmpl'; |
| 242 | 236 | } |
| 243 | 237 | // filter parameters. |
| 244 | 238 | $params = $this->ontemplateparameters($params, $name, $dir, $extension); |
| 239 | + // Get template content into variable. | |
| 240 | + ob_start(); | |
| 245 | 241 | // Push params into the local scope. |
| 246 | 242 | extract($params); |
| 247 | 243 | // Templates collected under the view/tmpl directory. |
| 248 | 244 | $templateFile = $this->getPath("{$dir}/{$name}{$extension}"); |
| 249 | - // Get template content into variable. | |
| 250 | - ob_start(); | |
| 251 | 245 | require $this->onimporttemplate($templateFile); |
| 252 | - $template = $this->onloadtemplate( ob_get_clean(), $name, "{$dir}/{$name}" ); | |
| 246 | + $template = $this->onloadtemplate(ob_get_clean(), $name); | |
| 253 | 247 | return $template; |
| 254 | 248 | } |
| 255 | 249 | |
| 256 | 250 | /** |
| @@ -257,9 +251,9 @@ | ||
| 257 | 251 | * put your comment there... |
| 258 | 252 | * |
| 259 | 253 | */ |
| 260 | 254 | public function getURI($destination) { |
| 261 | - return self::getViewURI($this->viewInfo['name'], $destination, $this->viewInfo['viewsUrl']); | |
| 255 | + return self::getViewURI($this->viewInfo['name'], $destination); | |
| 262 | 256 | } |
| 263 | 257 | |
| 264 | 258 | /** |
| 265 | 259 | * put your comment there... |
| @@ -266,14 +260,10 @@ | ||
| 266 | 260 | * |
| 267 | 261 | * @param mixed $view |
| 268 | 262 | * @param mixed $destination |
| 269 | 263 | */ |
| 270 | - public static function getViewPath($view, $destination, $overrideViewPath = null) { | |
| 271 | - # Use passed view path or use CJT constants if not passed | |
| 272 | - if (!$overrideViewPath) { | |
| 273 | - $overrideViewPath = CJTOOLBOX_VIEWS_PATH; | |
| 274 | - } | |
| 275 | - $viewPath = $overrideViewPath . DIRECTORY_SEPARATOR . $view; | |
| 264 | + public static function getViewPath($view, $destination) { | |
| 265 | + $viewPath = CJTOOLBOX_VIEWS_PATH . "/{$view}"; | |
| 276 | 266 | $destination = $destination ? "/{$destination}" : ''; |
| 277 | 267 | return "{$viewPath}{$destination}"; |
| 278 | 268 | } |
| 279 | 269 | |
| @@ -279,17 +269,12 @@ | ||
| 279 | 269 | |
| 280 | 270 | /** |
| 281 | 271 | * put your comment there... |
| 282 | 272 | * |
| 283 | - * @param mixed $view | |
| 284 | - * @param mixed $destination | |
| 285 | - * @param mixed $overrideViewUrl | |
| 273 | + * @param mixed $file | |
| 286 | 274 | */ |
| 287 | - public static function getViewURI($view, $destination, $overrideViewUrl = null) { | |
| 288 | - if (!$overrideViewUrl) { | |
| 289 | - $overrideViewUrl = CJTOOLBOX_VIEWS_URL; | |
| 290 | - } | |
| 291 | - $viewURI = "{$overrideViewUrl}/{$view}/public"; | |
| 275 | + public static function getViewURI($view, $destination) { | |
| 276 | + $viewURI = CJTOOLBOX_VIEWS_URL . "/{$view}/public"; | |
| 292 | 277 | return "{$viewURI}/{$destination}"; |
| 293 | 278 | } |
| 294 | 279 | |
| 295 | 280 | /** |
| @@ -412,8 +397,9 @@ | ||
| 412 | 397 | // This object caryy other informations so that the other |
| 413 | 398 | // Plugin parts/components can use it to know how script file work. |
| 414 | 399 | $stack[$name]->cjt = (object) $stack[$name]->cjt; |
| 415 | 400 | } |
| 401 | + | |
| 416 | 402 | // If localization file exists localize JS. |
| 417 | 403 | if (file_exists($localizationFile)) { |
| 418 | 404 | // Get localization text array. |
| 419 | 405 | $localization = require $localizationFile; |