* Copyright 2005-2007, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.views
* @since CakePHP(tm) v 1.2.0.5234
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
";?>
sort('{$field['name']}');?>";?> |
";?> |
\n";
echo "\t>\n";
foreach ($fields as $field) {
if (in_array($field['name'], array_keys($foreignKeys))) {
$otherModelClass = $foreignKeys[$field['name']][1];
$otherModelKey = Inflector::underscore($otherModelClass);
$otherControllerName = Inflector::pluralize($otherModelClass);
$otherControllerPath = Inflector::underscore($otherControllerName);
if (isset($foreignKeys[$field['name']][2])) {
$otherModelClass = $foreignKeys[$field['name']][2];
}
$otherVariableName = Inflector::variable($otherModelClass);
$otherModelObj =& ClassRegistry::getObject($otherModelKey);
$otherPrimaryKey = $otherModelObj->primaryKey;
$otherDisplayField = $otherModelObj->displayField;
echo "\t\t\n\t\t\tlink(\${$singularVar}['{$otherModelClass}']['{$otherDisplayField}'], array('controller'=> '{$otherControllerPath}', 'action'=>'view', \${$singularVar}['{$otherModelClass}']['{$otherPrimaryKey}'])); ?>\n\t\t | \n";
} else {
echo "\t\t\n\t\t\t\n\t\t | \n";
}
}
echo "\t\t\n";
echo "\t\t\tlink(__('View', true), array('action'=>'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
echo "\t\t\tlink(__('Edit', true), array('action'=>'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
echo "\t\t\tlink(__('Delete', true), array('action'=>'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, __('Are you sure you want to delete', true).' #' . \${$singularVar}['{$modelClass}']['{$primaryKey}']); ?>\n";
echo "\t\t | \n";
echo "\t
\n";
echo "\n";
?>
prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?>
| numbers();?>\n"?>
next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>\n";?>
- link(__('New', true).' '.__('{$singularHumanName}', true), array('action'=>'add')); ?>";?>
$value) {
$otherModelClass = $value['1'];
if ($otherModelClass != $modelClass) {
$otherModelKey = Inflector::underscore($otherModelClass);
$otherControllerName = Inflector::pluralize($otherModelClass);
$otherControllerPath = Inflector::underscore($otherControllerName);
$otherVariableName = Inflector::variable($otherModelClass);
$otherPluralHumanName = Inflector::humanize($otherControllerPath);
$otherSingularHumanName = Inflector::humanize($otherModelKey);
echo "\t\t- link(__('List', true).' '.__('{$otherPluralHumanName}', true), array('controller'=> '{$otherControllerPath}', 'action'=>'index')); ?>
\n";
echo "\t\t- link(__('New', true).' '.__('{$otherSingularHumanName}', true), array('controller'=> '{$otherControllerPath}', 'action'=>'add')); ?>
\n";
}
}
?>