mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Renaming file extensions of scaffolding templates to ctp
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4988 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
9b18367fcc
commit
9ac249631b
4 changed files with 24 additions and 9 deletions
|
@ -373,16 +373,21 @@ class Scaffold extends Object {
|
|||
* @return error
|
||||
*/
|
||||
function __scaffoldError() {
|
||||
if (file_exists(APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS. 'scaffold.error.thtml')) {
|
||||
return $this->controller->render($this->action, $this->layout,
|
||||
APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS . 'scaffold.error.thtml');
|
||||
$pathToViewFile = '';
|
||||
|
||||
if (file_exists(APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS. 'scaffold.error.ctp')) {
|
||||
$pathToViewFile = APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS . 'scaffold.error.ctp';
|
||||
} elseif (file_exists(APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS. 'scaffold.error.thtml')) {
|
||||
$pathToViewFile = APP . 'views' . DS . $this->viewPath . DS . 'scaffolds' . DS . 'scaffold.error.thtml';
|
||||
} elseif (file_exists(APP . 'views' . DS . 'scaffold' . DS . 'scaffold.error.ctp')) {
|
||||
$pathToViewFile = APP . 'views' . DS . 'scaffold' . DS . 'scaffold.error.ctp';
|
||||
} elseif (file_exists(APP . 'views' . DS . 'scaffold' . DS . 'scaffold.error.thtml')) {
|
||||
return $this->controller->render($this->action, $this->layout,
|
||||
APP . 'views' . DS . 'scaffold' . DS . 'scaffold.error.thtml');
|
||||
$pathToViewFile = APP . 'views' . DS . 'scaffold' . DS . 'scaffold.error.thtml';
|
||||
} else {
|
||||
return $this->controller->render($this->action, $this->layout,
|
||||
LIBS . 'view' . DS . 'templates' . DS . 'errors' . DS . 'scaffold_error.thtml');
|
||||
$pathToViewFile = LIBS . 'view' . DS . 'templates' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
||||
}
|
||||
|
||||
return $this->controller->render($this->action, $this->layout, $pathToViewFile);
|
||||
}
|
||||
/**
|
||||
* When forms are submited the arrays need to be rebuilt if
|
||||
|
@ -494,10 +499,16 @@ class Scaffold extends Object {
|
|||
return APP . 'views' . DS . 'plugins' . DS . $this->plugin . DS . $this->subDir . $type . $scaffoldAction . $this->ext;
|
||||
} elseif (file_exists(APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . $this->viewPath . DS . $scaffoldAction . $this->ext)) {
|
||||
return APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . $this->viewPath . DS . $scaffoldAction . $this->ext;
|
||||
} elseif (file_exists(APP . 'views' . DS . 'plugins' . DS . $this->plugin . DS . $this->subDir . $type . $scaffoldAction . '.ctp')) {
|
||||
return APP . 'views' . DS . 'plugins' . DS . $this->plugin . DS . $this->subDir . $type . $scaffoldAction . '.ctp';
|
||||
} elseif (file_exists(APP . 'views' . DS . 'plugins' . DS . $this->plugin . DS . $this->subDir . $type . $scaffoldAction . '.thtml')) {
|
||||
return APP . 'views' . DS . 'plugins' . DS . $this->plugin . DS . $this->subDir . $type . $scaffoldAction . '.thtml';
|
||||
} elseif (file_exists(APP . 'views' . DS . 'plugins' . DS . 'scaffold'. DS . $this->subDir . $type . $scaffoldAction . '.ctp')) {
|
||||
return APP . 'views' . DS . 'plugins' . DS . 'scaffold'. DS . $this->subDir . $type . $scaffoldAction . '.ctp';
|
||||
} elseif (file_exists(APP . 'views' . DS . 'plugins' . DS . 'scaffold'. DS . $this->subDir . $type . $scaffoldAction . '.thtml')) {
|
||||
return APP . 'views' . DS . 'plugins' . DS . 'scaffold'. DS . $this->subDir . $type . $scaffoldAction . '.thtml';
|
||||
} elseif (file_exists(APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . $this->viewPath . DS . $scaffoldAction . '.ctp')) {
|
||||
return APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . $this->viewPath . DS . $scaffoldAction . '.ctp';
|
||||
} elseif (file_exists(APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . $this->viewPath . DS . $scaffoldAction . '.thtml')) {
|
||||
return APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . $this->viewPath . DS . $scaffoldAction . '.thtml';
|
||||
}
|
||||
|
@ -508,13 +519,17 @@ class Scaffold extends Object {
|
|||
return $path . $this->viewPath . DS . $this->subDir . $type . $scaffoldAction . $this->ext;
|
||||
} elseif (file_exists($path . $this->viewPath . DS . 'scaffold' . DS . $this->subDir . $type . $scaffoldAction . $this->ext)) {
|
||||
return $path . $this->viewPath . DS . 'scaffold' . DS . $this->subDir . $type . $scaffoldAction . $this->ext;
|
||||
} elseif (file_exists($path . $this->viewPath . DS . $this->subDir . $type . $scaffoldAction . '.thtml')) {
|
||||
} elseif (file_exists($path . $this->viewPath . DS . $this->subDir . $type . $scaffoldAction . '.ctp')) {
|
||||
return $path . $this->viewPath . DS . $this->subDir . $type . $scaffoldAction . '.ctp';
|
||||
} elseif (file_exists($path . $this->viewPath . DS . $this->subDir . $type . $scaffoldAction . '.thtml')) {
|
||||
return $path . $this->viewPath . DS . $this->subDir . $type . $scaffoldAction . '.thtml';
|
||||
} elseif (file_exists($path . $this->viewPath . DS . 'scaffold' . DS . $this->subDir . $type . $scaffoldAction . '.ctp')) {
|
||||
return $path . $this->viewPath . DS . 'scaffold' . DS . $this->subDir . $type . $scaffoldAction . '.ctp';
|
||||
} elseif (file_exists($path . $this->viewPath . DS . 'scaffold' . DS . $this->subDir . $type . $scaffoldAction . '.thtml')) {
|
||||
return $path . $this->viewPath . DS . 'scaffold' . DS . $this->subDir . $type . $scaffoldAction . '.thtml';
|
||||
}
|
||||
}
|
||||
return LIBS . 'view' . DS . 'templates' . DS . 'scaffolds' . DS . $action . '.thtml';
|
||||
return LIBS . 'view' . DS . 'templates' . DS . 'scaffolds' . DS . $action . '.ctp';
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue