Skip to content

Commit

Permalink
making the method more flexible so you can pass an array an have the …
Browse files Browse the repository at this point in the history
…buttone generated within the method insead of creating them first and then passing the html in
  • Loading branch information
dogmatic69 committed Jun 27, 2012
1 parent a78d702 commit fd33807
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions View/Helper/AppHelper.php
Expand Up @@ -301,6 +301,10 @@ public function adminIndexHead($filterOptions = array(), $massActions = null) {
if(!class_exists('FilterHelper')) {
App::uses('FilterHelper', 'Filter.View/Helper');
}

if(is_array($massActions)) {
$massActions = $this->massActionButtons($massActions);
}

return sprintf(
'<div class="adminTopBar">%s%s</div><div class="filters">%s</div>',
Expand All @@ -319,6 +323,9 @@ public function adminIndexHead($filterOptions = array(), $massActions = null) {
* @return string the markup for the page
*/
public function adminOtherHead($massActions = null) {
if(is_array($massActions)) {
$massActions = $this->massActionButtons($massActions);
}
return sprintf(
'<div class="adminTopBar">%s%s</div>',
$this->adminPageHead(),
Expand Down Expand Up @@ -408,7 +415,7 @@ public function adminQuickLink($row = array(), $url = array(), $model = '', $url
if(!$text) {
$link = $id;
}

return $this->Html->link($link, $url);
}

Expand Down Expand Up @@ -740,7 +747,7 @@ public function niceTitleText($switch = null) {
$controller = str_replace(array('global', $this->request->params['plugin']), '', $controller);
$controller = str_replace('_', ' ', $controller);
$pluralController = Inflector::pluralize($controller);

switch(strtolower($switch)) {
case 'add':
$heading = sprintf('%s %s', __('Create a New'), $controller);
Expand Down

0 comments on commit fd33807

Please sign in to comment.