mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
[1188]
Author: phpnut Date: 2:44:40 AM, Monday, October 24, 2005 Message: Should complete work on new look for scaffold [1187] Author: phpnut Date: 1:59:09 AM, Monday, October 24, 2005 Message: More work on scaffold to get all changes done in the last few days correctly displaying. Fix for Ticket #89 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1189 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
dd6024b1c4
commit
2acd3acbf6
13 changed files with 190 additions and 180 deletions
|
@ -34,8 +34,9 @@
|
||||||
/**
|
/**
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*/
|
*/
|
||||||
require(ROOT.'config'.DS.'paths.php');
|
require_once(CONFIGS.'paths.php');
|
||||||
require(LIBS.'basics.php');
|
require_once(CAKE.'basics.php');
|
||||||
|
require_once(LIBS.'folder.php');
|
||||||
require(LIBS.'file.php');
|
require(LIBS.'file.php');
|
||||||
require(LIBS.'legacy.php');
|
require(LIBS.'legacy.php');
|
||||||
|
|
||||||
|
|
|
@ -77,47 +77,44 @@ p
|
||||||
#header
|
#header
|
||||||
{
|
{
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
height: 112px;
|
height: 114px;
|
||||||
background: #fff url("../img/cake.bg.header.gif") repeat-x;
|
background: #fff url("../img/cake.bg.header.gif") repeat-x;
|
||||||
border-bottom: 1px solid #D2D7D8;
|
border-bottom: 1px solid #D2D7D8;
|
||||||
vertical-align: bottom;
|
margin-bottom: 30px;
|
||||||
white-space: normal;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
#header img
|
||||||
#headerLogo
|
|
||||||
{
|
{
|
||||||
float: left;
|
float: left;
|
||||||
|
vertical-align: middle;
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
#headerLogo img
|
.headerNav
|
||||||
{
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
#headerNav
|
|
||||||
{
|
{
|
||||||
float: right;
|
float: right;
|
||||||
margin-top: 56px;
|
margin-top: 3px;
|
||||||
margin-right: 30px;
|
padding-right: 30px;
|
||||||
margin-bottom: 12px;
|
font-size: 13px;
|
||||||
font-size: 15px;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #71300F;
|
color: #71300F;
|
||||||
}
|
}
|
||||||
|
|
||||||
#headerNav a {
|
.headerNav a {
|
||||||
padding: 4px 10px;
|
padding: 4px 10px;
|
||||||
}
|
}
|
||||||
#headerNav a:hover {
|
.headerNav a:hover {
|
||||||
padding: 4px 10px;
|
padding: 4px 10px;
|
||||||
background-color: #D2D7D8;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
#headerNav .active {
|
.headerNav .active {
|
||||||
padding: 4px 10px;
|
padding: 4px 10px;
|
||||||
background-color: #D2D7D8;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
#pageNav {
|
#pageNav {
|
||||||
margin-top: 20px;
|
clear: both;
|
||||||
|
margin-top: 0px;
|
||||||
margin-right: 30px;
|
margin-right: 30px;
|
||||||
|
margin-left: 30px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -148,7 +145,7 @@ p
|
||||||
{
|
{
|
||||||
clear: both;
|
clear: both;
|
||||||
margin: 2px 20px 20px 20px;
|
margin: 2px 20px 20px 20px;
|
||||||
padding: 6px 28px 40px 22px;
|
padding: 20px 28px 40px 22px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-top: 1px solid #D2D7D8;
|
border-top: 1px solid #D2D7D8;
|
||||||
border-left: 1px solid #D2D7D8;
|
border-left: 1px solid #D2D7D8;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
/* form.css */
|
/* form.css */
|
||||||
|
|
||||||
form {
|
form {
|
||||||
font-size: 100%;
|
margin: 0 4px;
|
||||||
min-width: 560px;
|
font-size: 120%;
|
||||||
max-width: 620px;
|
border-width: 0px 0px 0px 0px;
|
||||||
width: 590px;
|
border-style: solid;
|
||||||
|
border-color: #71300F;
|
||||||
}
|
}
|
||||||
|
|
||||||
form fieldset {
|
form fieldset {
|
||||||
|
@ -23,7 +24,7 @@ form fieldset legend {
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
font-size: 100%;
|
font-size: 150%;
|
||||||
}
|
}
|
||||||
|
|
||||||
label u {
|
label u {
|
||||||
|
@ -44,7 +45,6 @@ textarea {
|
||||||
form div {
|
form div {
|
||||||
clear: left;
|
clear: left;
|
||||||
display: block;
|
display: block;
|
||||||
width: 354px;
|
|
||||||
height: expression('1%');
|
height: expression('1%');
|
||||||
margin: 5px 0px 0px 0px;
|
margin: 5px 0px 0px 0px;
|
||||||
padding: 1px 3px;
|
padding: 1px 3px;
|
||||||
|
@ -85,12 +85,11 @@ form fieldset div.notes p.last {
|
||||||
|
|
||||||
form div fieldset {
|
form div fieldset {
|
||||||
clear: none;
|
clear: none;
|
||||||
border-width: 1px;
|
border-width: 0px 1px 0px 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: #666;
|
border-color: #666;
|
||||||
margin: 0px 0px 0px 142px;
|
margin: 0px 0px 0px 142px;
|
||||||
padding: 0px 5px 5px 5px;
|
padding: 0px 5px 5px 5px;
|
||||||
width: 197px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
form div fieldset legend {
|
form div fieldset legend {
|
||||||
|
@ -105,7 +104,9 @@ form div.required fieldset legend {
|
||||||
form div label {
|
form div label {
|
||||||
display: block;
|
display: block;
|
||||||
float: left;
|
float: left;
|
||||||
width: 130px;
|
width: 200px;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
font-size: 16px;
|
||||||
padding: 3px 5px;
|
padding: 3px 5px;
|
||||||
margin: 0px 0px 5px 0px;
|
margin: 0px 0px 5px 0px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
@ -122,7 +123,6 @@ form div.required label, label.required {
|
||||||
form div label.labelCheckbox, form div label.labelRadio {
|
form div label.labelCheckbox, form div label.labelRadio {
|
||||||
float: none;
|
float: none;
|
||||||
display: block;
|
display: block;
|
||||||
width: 200px;
|
|
||||||
height: expression('1%');
|
height: expression('1%');
|
||||||
margin: 0px 0px 5px 142px;
|
margin: 0px 0px 5px 142px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
@ -130,43 +130,14 @@ form div label.labelCheckbox, form div label.labelRadio {
|
||||||
|
|
||||||
form div fieldset label.labelCheckbox, form div fieldset label.labelRadio {
|
form div fieldset label.labelCheckbox, form div fieldset label.labelRadio {
|
||||||
margin: 0px 0px 5px 0px;
|
margin: 0px 0px 5px 0px;
|
||||||
width: 170px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p.error {
|
p.error {
|
||||||
background-color: #f00;
|
color: #71300F;
|
||||||
background-image: url(/images/icon_error.gif);
|
background-color: #DBA941;
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: 3px 3px;
|
|
||||||
color: #ffffff;
|
|
||||||
padding: 3px 3px 5px 27px;
|
|
||||||
border: 1px solid #000;
|
|
||||||
margin: auto 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
form div.error {
|
|
||||||
background-color: #ffffe1;
|
|
||||||
background-image: url(/images/required_bg.gif);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: top left;
|
|
||||||
color: #666;
|
|
||||||
border: 1px solid #f00;
|
|
||||||
}
|
|
||||||
|
|
||||||
form div.error p.error {
|
|
||||||
background-image: url(/images/icon_error.gif);
|
|
||||||
background-position: top left;
|
|
||||||
background-color: transparent;
|
|
||||||
border-style: none;
|
|
||||||
font-size: 88%;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 0px 0px 0px 118px;
|
|
||||||
width: 200px;
|
|
||||||
color: #f00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
form div input, form div select, form div textarea {
|
form div input, form div select, form div textarea {
|
||||||
width: 200px;
|
background-color: #f4f4f4;
|
||||||
padding: 1px 3px;
|
padding: 1px 3px;
|
||||||
margin: 0px 0px 0px 0px;
|
margin: 0px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
@ -189,38 +160,34 @@ form div input.inputCheckbox, form div input.inputRadio, input.inputCheckbox, in
|
||||||
}
|
}
|
||||||
|
|
||||||
form div.submit {
|
form div.submit {
|
||||||
width: 214px;
|
|
||||||
padding: 0px 0px 0px 140px;
|
padding: 0px 0px 0px 140px;
|
||||||
clear:both;
|
clear:both;
|
||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.submit input {
|
div.submit input {
|
||||||
text-align:center;
|
padding: 2px 12px;
|
||||||
font-weight: bold;
|
color: #71300F;
|
||||||
color: #fff;
|
background-color:#ccc;
|
||||||
background-color:#3297FC;
|
text-decoration: none;
|
||||||
display:block;
|
border: 1px solid #666;
|
||||||
float:left;
|
font-size: 14px;
|
||||||
text-decoration: none;
|
font-weight: bold;
|
||||||
border: 1px;
|
text-align:center;
|
||||||
width: 215px;
|
text-decoration: none;
|
||||||
padding:6px;
|
|
||||||
margin: 5px;
|
|
||||||
|
|
||||||
}
|
|
||||||
form div.submit div {
|
|
||||||
display: inline;
|
|
||||||
float: left;
|
|
||||||
text-align: left;
|
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
div.submit input:hover {
|
||||||
form div input.inputSubmit, form div input.inputButton, input.inputSubmit, input.inputButton {
|
padding: 2px 12px;
|
||||||
background-color: #cccccc;
|
color: #fff;
|
||||||
color: #000000;
|
background-color:#71300F;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 1px solid #666;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align:center;
|
||||||
|
text-decoration: none;
|
||||||
width: auto;
|
width: auto;
|
||||||
padding: 0px 6px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
form div.submit div input.inputSubmit, form div.submit div input.inputButton {
|
form div.submit div input.inputSubmit, form div.submit div input.inputButton {
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
/* CSS Document */
|
/* CSS Document */
|
||||||
|
h1
|
||||||
|
{
|
||||||
|
padding: 2px 6px;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #71300F;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
h2
|
||||||
|
{
|
||||||
|
padding: 1px 6px;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #71300F;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
code, pre {
|
code, pre {
|
||||||
color:#44a;
|
color:#44a;
|
||||||
font-family:monospace;
|
font-family:monospace;
|
||||||
|
@ -26,65 +40,79 @@ li {
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice {
|
.notice {
|
||||||
background: #71300F;
|
color: #71300F;
|
||||||
border: solid 2px #eeb;
|
background-color: #DBA941;
|
||||||
display: block;
|
|
||||||
font-family: Verdana;
|
font-family: Verdana;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
.tip {
|
.tip {
|
||||||
background: #71300F;
|
color: #71300F;
|
||||||
border: solid 2px #333;
|
background-color: #DBA941;
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
.error {
|
|
||||||
color: #DBA941
|
|
||||||
background: #f4f4f4;
|
|
||||||
border: solid 2px #333;
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.actions {
|
ul.actions {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
text-align:right;
|
text-align:left;
|
||||||
margin:2em 0;
|
margin:2em 0;
|
||||||
|
padding: 0 0em;
|
||||||
}
|
}
|
||||||
ul.actions li {
|
ul.actions li {
|
||||||
border: 1px solid #333;
|
|
||||||
margin-left:1em;
|
margin-left:1em;
|
||||||
width:10em;
|
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
display: inline;
|
||||||
}
|
}
|
||||||
ul.actions li a, ul.actions li input {
|
ul.actions li a, ul.actions li input {
|
||||||
background-color:#71300F;
|
padding: 2px 12px;
|
||||||
border:1px solid #71300F;
|
color: #71300F;
|
||||||
clear: both;
|
background-color:#ccc;
|
||||||
color: #fff;
|
text-decoration: none;
|
||||||
display:block;
|
border: 1px solid #666;
|
||||||
|
line-height: 24px;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
ul.actions li a:hover {
|
||||||
|
color: #71300F;
|
||||||
|
background-color:#fff;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
td.listactions {
|
td.listactions {
|
||||||
width:17em;
|
width: 14em;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
td.listactions a {
|
td.listactions a {
|
||||||
float: left;
|
|
||||||
|
padding: 0px 8px;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #71300F;
|
||||||
|
background-color:#ccc;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 1px solid #666;
|
||||||
|
|
||||||
|
}
|
||||||
|
td.listactions a:hover {
|
||||||
|
padding: 0px 8px;
|
||||||
|
text-align:center;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color:#71300F;
|
background-color:#71300F;
|
||||||
display:block;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
margin-bottom:3px;
|
border: 1px solid #666;
|
||||||
margin-right: 3px;
|
white-space: nowrap;
|
||||||
border: 1px;
|
|
||||||
width:5em;
|
|
||||||
}
|
}
|
||||||
table {
|
table {
|
||||||
|
width: 100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border: 1px solid #333;
|
border: 1px solid #333;
|
||||||
clear:both;
|
clear:both;
|
||||||
margin: 1em 0 2em 0;
|
margin: 0em 0 2em 0;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
th {
|
th {
|
||||||
|
@ -92,13 +120,15 @@ th {
|
||||||
border-top: 1px solid #fff;
|
border-top: 1px solid #fff;
|
||||||
border-right: 1px solid #666;
|
border-right: 1px solid #666;
|
||||||
border-bottom: 1px solid #666;
|
border-bottom: 1px solid #666;
|
||||||
text-align: left;
|
text-align: center;
|
||||||
padding:3px;
|
padding:3px;
|
||||||
}
|
}
|
||||||
table tr td {
|
table tr td {
|
||||||
border-right: 1px solid #ccc;
|
border-right: 1px solid #ccc;
|
||||||
padding:2px 4px;
|
padding:4px 4px;
|
||||||
|
font-size: 12px;
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
table tr.altRow td {
|
table tr.altRow td {
|
||||||
background: #f4f4f4;
|
background: #f4f4f4;
|
||||||
|
|
|
@ -109,8 +109,8 @@ require_once LIBS.'inflector.php';
|
||||||
|
|
||||||
if (strpos($url, 'ccss/') === 0)
|
if (strpos($url, 'ccss/') === 0)
|
||||||
{
|
{
|
||||||
include ROOT.'public'.DS.'css.php';
|
include WWW_ROOT.DS.'css.php';
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -399,23 +399,23 @@ function params($p)
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function setUri() {
|
function setUri()
|
||||||
if (isset($_SERVER['REQUEST_URI']))
|
|
||||||
{
|
{
|
||||||
$uri = $_SERVER['REQUEST_URI'];
|
if (isset($_SERVER['REQUEST_URI']))
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (isset($_SERVER['argv']))
|
|
||||||
{
|
{
|
||||||
$uri = $_SERVER['PHP_SELF'] .'/'. $_SERVER['argv'][0];
|
$uri = $_SERVER['REQUEST_URI'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$uri = $_SERVER['PHP_SELF'] .'/'. $_SERVER['QUERY_STRING'];
|
if (isset($_SERVER['argv']))
|
||||||
|
{
|
||||||
|
$uri = $_SERVER['PHP_SELF'] .'/'. $_SERVER['argv'][0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$uri = $_SERVER['PHP_SELF'] .'/'. $_SERVER['QUERY_STRING'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return $uri;
|
||||||
return $uri;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -649,6 +649,7 @@ class Controller extends Object
|
||||||
}
|
}
|
||||||
switch( $type )
|
switch( $type )
|
||||||
{
|
{
|
||||||
|
|
||||||
case "text":
|
case "text":
|
||||||
{
|
{
|
||||||
$fieldNames[ $tabl['name']]['type'] = 'area';
|
$fieldNames[ $tabl['name']]['type'] = 'area';
|
||||||
|
@ -664,9 +665,8 @@ class Controller extends Object
|
||||||
$fieldNames[ $tabl['name']]['options'] = array();
|
$fieldNames[ $tabl['name']]['options'] = array();
|
||||||
|
|
||||||
// get the list of options from the other model.
|
// get the list of options from the other model.
|
||||||
$registry =& ClassRegistry::getInstance();
|
$registry = ClassRegistry::getInstance();
|
||||||
$otherModel =& $registry->getObject($fieldNames[ $tabl['name']]['model']);
|
$otherModel = $registry->getObject($fieldNames[$tabl['name']]['model']);
|
||||||
|
|
||||||
if( is_object($otherModel) )
|
if( is_object($otherModel) )
|
||||||
{
|
{
|
||||||
if( $doCreateOptions )
|
if( $doCreateOptions )
|
||||||
|
@ -726,8 +726,9 @@ class Controller extends Object
|
||||||
$fieldNames[ $tabl['name']]['options'] = array();
|
$fieldNames[ $tabl['name']]['options'] = array();
|
||||||
|
|
||||||
// get the list of options from the other model.
|
// get the list of options from the other model.
|
||||||
$registry =& ClassRegistry::getInstance();
|
$registry = ClassRegistry::getInstance();
|
||||||
$otherModel =& $registry->getObject($fieldNames[ $tabl['name']]['model']);
|
|
||||||
|
$otherModel = $registry->getObject($fieldNames[$tabl['name']]['model']);
|
||||||
|
|
||||||
if( is_object($otherModel) )
|
if( is_object($otherModel) )
|
||||||
{
|
{
|
||||||
|
@ -789,34 +790,34 @@ class Controller extends Object
|
||||||
// loop through the many to many relations to make a list box.
|
// loop through the many to many relations to make a list box.
|
||||||
foreach( $objRegistryModel->_manyToMany as $relation )
|
foreach( $objRegistryModel->_manyToMany as $relation )
|
||||||
{
|
{
|
||||||
list($tableName) = $relation;
|
list($modelName) = $relation;
|
||||||
|
|
||||||
$otherModelName = Inflector::underscore($tableName);
|
$modelKey = Inflector::underscore($modelName);
|
||||||
$otherModel = new $otherModelName();
|
$modelObject = new $modelName();
|
||||||
|
|
||||||
if( $doCreateOptions )
|
if( $doCreateOptions )
|
||||||
{
|
{
|
||||||
$otherDisplayField = $otherModel->getDisplayField();
|
$otherDisplayField = $modelObject->getDisplayField();
|
||||||
$fieldNames[$tableName]['model'] = $tableName;
|
$fieldNames[$modelKey]['model'] = $modelName;
|
||||||
$fieldNames[$tableName]['prompt'] = "Related ".Inflector::humanize($tableName);
|
$fieldNames[$modelKey]['prompt'] = "Related ".Inflector::humanize(Inflector::pluralize($modelName));
|
||||||
$fieldNames[$tableName]['type'] = "selectMultiple";
|
$fieldNames[$modelKey]['type'] = "selectMultiple";
|
||||||
$fieldNames[$tableName]['tagName'] = $otherModelName.'/'.Inflector::underscore($tableName);
|
$fieldNames[$modelKey]['tagName'] = $modelKey.'/'.$modelKey;
|
||||||
|
|
||||||
foreach( $otherModel->findAll() as $pass )
|
foreach( $modelObject->findAll() as $pass )
|
||||||
{
|
{
|
||||||
foreach( $pass as $key=>$value )
|
foreach( $pass as $key=>$value )
|
||||||
{
|
{
|
||||||
if( $key == $otherModelName && isset( $value['id'] ) && isset( $value[$otherDisplayField] ) )
|
if( $key == $modelKey && isset( $value['id'] ) && isset( $value[$otherDisplayField] ) )
|
||||||
{
|
{
|
||||||
$fieldNames[$tableName]['options'][$value['id']] = $value[$otherDisplayField];
|
$fieldNames[$modelKey]['options'][$value['id']] = $value[$otherDisplayField];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( isset( $data[$tableName] ) )
|
if( isset( $data[$modelKey] ) )
|
||||||
{
|
{
|
||||||
foreach( $data[$tableName] as $row )
|
foreach( $data[$modelKey] as $row )
|
||||||
{
|
{
|
||||||
$fieldNames[$tableName]['selected'][$row['id']] = $row['id'];
|
$fieldNames[$modelKey]['selected'][$row['id']] = $row['id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,13 @@
|
||||||
* @lastmodified $Date$
|
* @lastmodified $Date$
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||||
*/
|
*/
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
|
$modelName = Inflector::singularize($this->name);
|
||||||
|
$modelKey = Inflector::underscore($modelName);
|
||||||
|
?>
|
||||||
|
<h1>Edit <?php echo Inflector::humanize($modelName);?></h1>
|
||||||
|
|
||||||
|
<?php
|
||||||
echo $html->formTag('/'.Inflector::underscore($this->name).'/update');
|
echo $html->formTag('/'.Inflector::underscore($this->name).'/update');
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,14 +45,13 @@
|
||||||
?>
|
?>
|
||||||
<ul class='actions'>
|
<ul class='actions'>
|
||||||
<?php
|
<?php
|
||||||
$modelName = Inflector::singularize($this->name);
|
|
||||||
$modelKey = Inflector::underscore($modelName);
|
|
||||||
echo "<li>".$html->linkTo('Delete '.Inflector::humanize($modelName), '/'.$this->viewPath.'/destroy/'.$data[$modelKey]['id'])."</li>";
|
|
||||||
|
|
||||||
|
echo "<li>".$html->linkTo('Delete '.Inflector::humanize($modelName), '/'.$this->viewPath.'/destroy/'.$data[$modelKey]['id'])."</li>";
|
||||||
|
echo "<li>".$html->linkTo('List '.Inflector::humanize($modelName), '/'.$this->viewPath.'/list')."</li>";
|
||||||
foreach( $fieldNames as $field => $value ) {
|
foreach( $fieldNames as $field => $value ) {
|
||||||
if( isset( $value['foreignKey'] ) )
|
if( isset( $value['foreignKey'] ) )
|
||||||
{
|
{
|
||||||
echo "<li>".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[Inflector::singularize($params['controller'])][$field] )."</li>";
|
echo "<li>".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[$modelKey][$field] )."</li>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -29,11 +29,10 @@
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
<h1>List <?php echo Inflector::humanize($this->name)?></h1>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$model = Inflector::pluralize($this->name);
|
$model = Inflector::singularize($this->name);
|
||||||
//$table = Inflector::underscore(get_class($this->models[strtolower(Inflector::singularize(Inflector::underscore($this->name)))]));
|
|
||||||
|
|
||||||
$modelKey = Inflector::underscore(Inflector::singularize($this->name));
|
$modelKey = Inflector::underscore(Inflector::singularize($this->name));
|
||||||
$humanName = Inflector::humanize($this->name);
|
$humanName = Inflector::humanize($this->name);
|
||||||
$humanSingularName = Inflector::singularize( $humanName );
|
$humanSingularName = Inflector::singularize( $humanName );
|
||||||
|
@ -65,16 +64,15 @@
|
||||||
{
|
{
|
||||||
|
|
||||||
// this is a foreign key, figure out what the display field should be for this model.
|
// this is a foreign key, figure out what the display field should be for this model.
|
||||||
$otherModelName = $value['model'];
|
$otherModelKey = Inflector::underscore($value['model']);
|
||||||
$otherControllerName = $value['controller'];
|
$otherControllerName = $value['controller'];
|
||||||
|
$registry = ClassRegistry::getInstance();
|
||||||
$registry =& ClassRegistry::getInstance();
|
$otherModelObject = $registry->getObject( $otherModelKey );
|
||||||
$otherModelObject =& $registry->getObject( $otherModelName );
|
|
||||||
if( is_object($otherModelObject) )
|
if( is_object($otherModelObject) )
|
||||||
{
|
{
|
||||||
$displayText = $row[$value['model']][ $otherModelObject->getDisplayField() ];
|
$displayText = $row[$otherModelKey][ $otherModelObject->getDisplayField() ];
|
||||||
} else{
|
} else{
|
||||||
$displayText = $row[$modelKey][$field];
|
$displayText = $row[$otherModelKey][$field];
|
||||||
}
|
}
|
||||||
echo $html->linkTo( $displayText, "/".Inflector::underscore($otherControllerName)."/show/".$row[$modelKey][$field] );
|
echo $html->linkTo( $displayText, "/".Inflector::underscore($otherControllerName)."/show/".$row[$modelKey][$field] );
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,19 @@
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
<h1>New <?php echo Inflector::humanize($this->name)?></h1>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
echo $html->formTag('/'.Inflector::underscore($this->name).'/create');
|
echo $html->formTag('/'.Inflector::underscore($this->name).'/create');
|
||||||
|
|
||||||
echo $form->generateFields( $fieldNames );
|
echo $form->generateFields( $fieldNames );
|
||||||
|
|
||||||
echo $form->generateSubmitDiv( 'Add' )
|
echo $form->generateSubmitDiv( 'Add' )
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<ul class='actions'>
|
||||||
|
<?php
|
||||||
|
echo "<li>".$html->linkTo('List '.Inflector::humanize($this->name), '/'.$this->viewPath.'/list')."</li>";
|
||||||
|
|
||||||
|
?>
|
||||||
|
</ul>
|
|
@ -30,7 +30,6 @@
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$modelName = Inflector::singularize($this->name);
|
$modelName = Inflector::singularize($this->name);
|
||||||
$modelKey = Inflector::underscore($modelName);
|
$modelKey = Inflector::underscore($modelName);
|
||||||
|
@ -38,6 +37,8 @@
|
||||||
$objModel = $registry->getObject($modelName);
|
$objModel = $registry->getObject($modelName);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<h1>Show <?php echo Inflector::humanize($modelName)?></h1>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<?php foreach($fieldNames as $field => $value)
|
<?php foreach($fieldNames as $field => $value)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +79,8 @@
|
||||||
<?php
|
<?php
|
||||||
echo "<li>".$html->linkTo('Edit '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/edit/'.$data[$objModel->tableToModel[$objModel->table]]['id'])."</li>";
|
echo "<li>".$html->linkTo('Edit '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/edit/'.$data[$objModel->tableToModel[$objModel->table]]['id'])."</li>";
|
||||||
echo "<li>".$html->linkTo('Delete '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/destroy/'.$data[$objModel->tableToModel[$objModel->table]]['id'])."</li>";
|
echo "<li>".$html->linkTo('Delete '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/destroy/'.$data[$objModel->tableToModel[$objModel->table]]['id'])."</li>";
|
||||||
|
echo "<li>".$html->linkTo('List '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/list')."</li>";
|
||||||
|
echo "<li>".$html->linkTo('New '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/new')."</li>";
|
||||||
foreach( $fieldNames as $field => $value ) {
|
foreach( $fieldNames as $field => $value ) {
|
||||||
if( isset( $value['foreignKey'] ) )
|
if( isset( $value['foreignKey'] ) )
|
||||||
{
|
{
|
||||||
|
@ -92,10 +94,11 @@
|
||||||
<?php
|
<?php
|
||||||
foreach ($objModel->_oneToOne as $relation)
|
foreach ($objModel->_oneToOne as $relation)
|
||||||
{
|
{
|
||||||
list($table, $field, $value) = $relation;
|
list($model, $value) = $relation;
|
||||||
$otherModelName = $objModel->tableToModel[$table];
|
$otherModelName = $objModel->tableToModel[$model];
|
||||||
|
$controller = Inflector::pluralize($model);
|
||||||
echo "<div class='related'><H2>Related ".Inflector::humanize($otherModelName)."</H2><br/><br/>";
|
|
||||||
|
echo "<div class='related'><H2>Related ".Inflector::humanize($otherModelName)."</H2>";
|
||||||
echo "<dl>";
|
echo "<dl>";
|
||||||
if( isset($data[$otherModelName]) && is_array($data[$otherModelName]) )
|
if( isset($data[$otherModelName]) && is_array($data[$otherModelName]) )
|
||||||
{
|
{
|
||||||
|
@ -112,7 +115,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
echo "</dl>";
|
echo "</dl>";
|
||||||
echo "<ul class='actions'><li>".$html->linkTo('Edit '.Inflector::humanize($otherModelName),"/".Inflector::underscore($table)."/edit/{$data[$otherModelName]['id']}")."</li></ul></div>";
|
echo "<ul class='actions'><li>".$html->linkTo('Edit '.Inflector::humanize($otherModelName),"/".Inflector::underscore($controller)."/edit/{$data[$otherModelName]['id']}")."</li></ul></div>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -136,7 +139,7 @@
|
||||||
$otherModelName = Inflector::singularize($model);
|
$otherModelName = Inflector::singularize($model);
|
||||||
$controller = Inflector::pluralize($model);
|
$controller = Inflector::pluralize($model);
|
||||||
|
|
||||||
echo "<div class='related'><H2>Related ".Inflector::humanize($objModel->tableToModel[$objModel->{$model}->table])."</H2><br/><br/>";
|
echo "<div class='related'><H2>Related ".Inflector::humanize(Inflector::pluralize($objModel->tableToModel[$objModel->{$model}->table]))."</H2>";
|
||||||
if( isset($data[$objModel->tableToModel[$objModel->{$model}->table]]) && is_array($data[$objModel->tableToModel[$objModel->{$model}->table]]) )
|
if( isset($data[$objModel->tableToModel[$objModel->{$model}->table]]) && is_array($data[$objModel->tableToModel[$objModel->{$model}->table]]) )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -845,6 +845,7 @@ class Model extends Object
|
||||||
{
|
{
|
||||||
foreach ($y as $name => $value)
|
foreach ($y as $name => $value)
|
||||||
{
|
{
|
||||||
|
$name = Inflector::camelize($name);
|
||||||
$joinTable[] = $this->{$name}->{$this->currentModel.'_jointable'};
|
$joinTable[] = $this->{$name}->{$this->currentModel.'_jointable'};
|
||||||
$mainKey = $this->{$name}->{$this->currentModel.'_foreignkey'};
|
$mainKey = $this->{$name}->{$this->currentModel.'_foreignkey'};
|
||||||
$keys[] = $mainKey;
|
$keys[] = $mainKey;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<?php echo $html->charset('UTF-8')?>
|
<?php echo $html->charset('UTF-8')?>
|
||||||
<?php echo $html->css('cake.default')?>
|
<?php echo $html->css('cake.default')?>
|
||||||
<?php echo $html->css('cake.scaffold')?>
|
<?php echo $html->css('cake.scaffold')?>
|
||||||
<?php echo $html->css('cake.form')?>
|
<?php echo $html->css('cake.forms')?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="container">
|
<div id="container">
|
||||||
|
@ -17,21 +17,21 @@
|
||||||
<?php echo $html->image('cake.logo.png', array('alt'=>"CakePHP : Rapid Development Framework")); ?>
|
<?php echo $html->image('cake.logo.png', array('alt'=>"CakePHP : Rapid Development Framework")); ?>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="headerNav">
|
<span class="headerNav">
|
||||||
<?php
|
<?php
|
||||||
$css_class = ($title_for_layout == 'Blog') ? 'active' : '';
|
$css_class = ($title_for_layout == 'Blog') ? 'active' : '';
|
||||||
echo $html->link('CakeBlog', '/',array('class'=>$css_class));
|
echo $html->link('Blog', 'blog',array('class'=>$css_class));
|
||||||
|
|
||||||
echo $html->link('CakeWiki', 'http://wiki.cakephp.org',array('class'=>$css_class));
|
echo $html->link('Wiki', 'http://wiki.cakephp.org',array('class'=>$css_class));
|
||||||
|
|
||||||
echo $html->link('CakeForge', 'http://cakeforge.org',array('class'=>$css_class));
|
echo $html->link('CakeForge', 'http://cakeforge.org',array('class'=>$css_class));
|
||||||
|
|
||||||
echo $html->link('CakeTrac', 'https://trac.cakephp.org',array('class'=>$css_class));
|
echo $html->link('Trac', 'https://trac.cakephp.org',array('class'=>$css_class));
|
||||||
|
|
||||||
$css_class = ($title_for_layout == 'Pastes') ? 'active' : '';
|
$css_class = ($title_for_layout == 'Pastes') ? 'active' : '';
|
||||||
echo $html->link('CakeBin', 'http://cakephp.org/pastes/',array('class'=>$css_class));
|
echo $html->link('CakeBin', 'http://cakephp.org/pastes/',array('class'=>$css_class));
|
||||||
?>
|
?>
|
||||||
</div>
|
</class>
|
||||||
</div>
|
</div>
|
||||||
<div id="pageNav">
|
<div id="pageNav">
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Add table
Reference in a new issue