Skip to content
Permalink
Browse files

Finishing refactor on View task to use _methodsToBake

  • Loading branch information...
markstory committed Jul 28, 2009
1 parent 9d0d314 commit 80f9e6f7d6595a1b3344891585a4881715d2e0cf
Showing with 3 additions and 24 deletions.
  1. +3 −24 cake/console/libs/tasks/view.php
@@ -135,30 +135,9 @@ function execute() {
} else {
$vars = $this->__loadController();
$methods = $this->_methodsToBake();
$methods = array_diff(
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
array_map('strtolower', get_class_methods('appcontroller'))
);
if (empty($methods)) {
$methods = $this->scaffoldActions;
}
$adminRoute = Configure::read('Routing.admin');
if ($adminRoute && isset($this->params['admin'])) {
foreach ($methods as $i => $method) {
if (strpos($method, $adminRoute . '_') === false) {
unset($methods[$i]);
}
}
}
$adminDelete = null;
if (!empty($adminRoute)) {
$adminDelete = $adminRoute . '_delete';
}
foreach ($methods as $method) {
if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
$content = $this->getContent($method, $vars);
$this->bake($method, $content);
}
$content = $this->getContent($method, $vars);
$this->bake($method, $content);
}
}
}
@@ -179,7 +158,7 @@ function _methodsToBake() {
}
$adminRoute = Configure::read('Routing.admin');
foreach ($methods as $i => $method) {
if ($method == 'delete' || $method = $adminRoute . '_delete' || $method{0} == '_') {
if ($method == 'delete' || $method == $adminRoute . '_delete' || $method{0} == '_') {
unset($methods[$i]);
}
if ($adminRoute && isset($this->params['admin']) && strpos($method, $adminRoute . '_') === false) {

0 comments on commit 80f9e6f

Please sign in to comment.
You can’t perform that action at this time.