Skip to content

Commit

Permalink
making filter buttons more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Dec 31, 2009
1 parent 1f4e4ec commit d48eb8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions app_helper.php
Expand Up @@ -149,14 +149,21 @@ function adminTableHeadImages()
);
}

function adminIndexHead( $view = array(), $pagintion = array() )
function adminIndexHead( $view = array(), $pagintion = array(), $filterOptions = array() )
{
if ( empty( $view ) )
{
$this->errors[] = 'I need the view.';
return false;
}

$filters = '';
if ( !empty( $filterOptions ) )
{
App::import( 'Helper', 'FilterHelper' );
$filters = FilterHelper::clear( $filterOptions );
}

$out = '<div class="adminTopBar">';
$out .= $this->adminPageHead( $view );
$out .= '<div class="main-actions">';
Expand All @@ -169,7 +176,7 @@ function adminIndexHead( $view = array(), $pagintion = array() )
$out .= '</div>';
$out .= '</div>';

return $out;
return $out.$filters;
}

function adminOtherHead( $view = array() )
Expand Down
4 changes: 1 addition & 3 deletions plugins/blog/views/posts/admin_index.ctp
Expand Up @@ -17,9 +17,7 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

echo $this->Blog->adminIndexHead( $this, $paginator );

echo $this->Filter->clear( $filterOptions );
echo $this->Blog->adminIndexHead( $this, $paginator, $filterOptions );
?>
<div class="table">
<?php echo $this->Blog->adminTableHeadImages(); ?>
Expand Down

0 comments on commit d48eb8e

Please sign in to comment.