mirror of
https://github.com/brmlab/brmbiolab_sklad.git
synced 2025-06-09 13:44:00 +02:00
Initial commit
This commit is contained in:
commit
3b93da31de
1004 changed files with 265840 additions and 0 deletions
91
lib/Cake/View/ScaffoldView.php
Normal file
91
lib/Cake/View/ScaffoldView.php
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
/**
|
||||
* Scaffold.
|
||||
*
|
||||
* Automatic forms and actions generation for rapid web application development.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.View
|
||||
* @since Cake v 0.10.0.1076
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('View', 'View');
|
||||
|
||||
/**
|
||||
* ScaffoldView provides specific view file loading features for scaffolded views.
|
||||
*
|
||||
* @package Cake.View
|
||||
* @deprecated Dynamic scaffolding will be removed and replaced in 3.0
|
||||
*/
|
||||
class ScaffoldView extends View {
|
||||
|
||||
/**
|
||||
* Override _getViewFileName Appends special scaffolding views in.
|
||||
*
|
||||
* @param string $name name of the view file to get.
|
||||
* @return string action
|
||||
* @throws MissingViewException
|
||||
*/
|
||||
protected function _getViewFileName($name = null) {
|
||||
if ($name === null) {
|
||||
$name = $this->action;
|
||||
}
|
||||
$name = Inflector::underscore($name);
|
||||
$prefixes = Configure::read('Routing.prefixes');
|
||||
|
||||
if (!empty($prefixes)) {
|
||||
foreach ($prefixes as $prefix) {
|
||||
if (strpos($name, $prefix . '_') !== false) {
|
||||
$name = substr($name, strlen($prefix) + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($name === 'add' || $name === 'edit') {
|
||||
$name = 'form';
|
||||
}
|
||||
|
||||
$scaffoldAction = 'scaffold.' . $name;
|
||||
|
||||
if ($this->subDir !== null) {
|
||||
$subDir = strtolower($this->subDir) . DS;
|
||||
} else {
|
||||
$subDir = null;
|
||||
}
|
||||
|
||||
$names[] = $this->viewPath . DS . $subDir . $scaffoldAction;
|
||||
$names[] = 'Scaffolds' . DS . $subDir . $name;
|
||||
|
||||
$paths = $this->_paths($this->plugin);
|
||||
$exts = array($this->ext);
|
||||
if ($this->ext !== '.ctp') {
|
||||
$exts[] = '.ctp';
|
||||
}
|
||||
foreach ($exts as $ext) {
|
||||
foreach ($paths as $path) {
|
||||
foreach ($names as $name) {
|
||||
if (file_exists($path . $name . $ext)) {
|
||||
return $path . $name . $ext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($name === 'Scaffolds' . DS . $subDir . 'error') {
|
||||
return CAKE . 'View' . DS . 'Errors' . DS . 'scaffold_error.ctp';
|
||||
}
|
||||
|
||||
throw new MissingViewException($paths[0] . $name . $this->ext);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue