Skip to content

Commit

Permalink
some nice styles for the mass actions, also implemented in blog.posts [
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 4, 2010
1 parent 3c2a4a3 commit 91b53bc
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 39 deletions.
2 changes: 1 addition & 1 deletion app_controller.php
Expand Up @@ -449,7 +449,7 @@ protected function __massActionCopy( $ids )

if ( $saves )
{
$this->Session->setFlash( __( $saves.' copies of '.$model.'were made', true ) );
$this->Session->setFlash( __( $saves.' copies of '.$model.' was made', true ) );
$this->redirect( $this->referer() );
}

Expand Down
28 changes: 11 additions & 17 deletions app_helper.php
Expand Up @@ -151,7 +151,7 @@ function adminTableHeadImages()
);
}

function adminIndexHead( $view = array(), $pagintion = array(), $filterOptions = array() )
function adminIndexHead( $view = array(), $pagintion = array(), $filterOptions = array(), $massActions = null )
{
if ( empty( $view ) )
{
Expand All @@ -166,19 +166,7 @@ function adminIndexHead( $view = array(), $pagintion = array(), $filterOptions =
$filters = FilterHelper::clear( $filterOptions );
}

$out = '<div class="adminTopBar">';
$out .= $this->adminPageHead( $view );
$out .= '<div class="main-actions">';
$out .= $this->Html->link(
'Add',
array(
'action' => 'add'
)
);
$out .= '</div>';
$out .= '</div>';

return $out.$filters;
return $this->Design->niceBox( 'adminTopBar', $this->adminPageHead( $view ).$massActions.$filters );
}

function adminOtherHead( $view = array() )
Expand Down Expand Up @@ -327,7 +315,7 @@ function niceBoxEnd()
return '<div class="bottom"><div class="bottom"><div class="bottom"></div></div></div></div>';
}

function massActionButtons( $buttons = null )
function massActionButtons( $buttons = null, $niceBox = false )
{
if ( !$buttons )
{
Expand All @@ -349,12 +337,18 @@ function massActionButtons( $buttons = null )
$imagePath,
array(
'value' => strtolower( str_replace( array( '-', ' ' ), '_', $button ) ),
'name' => 'action'
'name' => 'action',
'title' => __( Inflector::humanize( $button ), true )
)
);
}

return $this->Design->niceBox( 'massActions', $out );
if ( $niceBox )
{
return $this->Design->niceBox( 'massActions', $out );
}

return '<div class="massActions">'.$out.'</div>';
}
}
?>
21 changes: 9 additions & 12 deletions plugins/blog/views/posts/admin_index.ctp
Expand Up @@ -17,7 +17,14 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
echo $this->Form->create( 'Post', array( 'url' => array( 'controller' => 'posts', 'action' => 'mass', 'admin' => 'true' ) ) );
echo $this->Blog->adminIndexHead( $this, $paginator, $filterOptions );
$massActions = $this->Blog->massActionButtons(
array(
'toggle',
'copy',
'delete'
)
);
echo $this->Blog->adminIndexHead( $this, $paginator, $filterOptions, $massActions );
?>
<div class="table">
<?php echo $this->Blog->adminTableHeadImages(); ?>
Expand Down Expand Up @@ -80,16 +87,6 @@
}
?>
</table>
<?php
echo $this->Blog->massActionButtons(
array(
'toggle',
'copy',
'delete'
)
);
echo $this->Form->end();

?>
<?php echo $this->Form->end(); ?>
</div>
<?php echo $this->element( 'pagination/navigation' ); ?>
11 changes: 5 additions & 6 deletions webroot/css/admin.css
Expand Up @@ -112,8 +112,12 @@ a:hover {text-decoration: underline}
margin:auto;
}

* html #middle {height:584px;}


.massActions{
position:relative;
right:0;
}
.massActions input{
float: left;
padding: 5px;
Expand Down Expand Up @@ -148,8 +152,6 @@ a:hover {text-decoration: underline}
*/
.top-bar {
float:left;
width:603px;
border-left:2px solid #f70;
padding:0 0 0 9px;
margin:0 0 4px 0;
}
Expand Down Expand Up @@ -280,7 +282,4 @@ div.table .select select {
}

.adminTopBar{
clear:both;
width:100%;
height:35px;
}
7 changes: 4 additions & 3 deletions webroot/css/admin/core.css
Expand Up @@ -36,9 +36,10 @@ img {border:none;}
}

.niceBox .middle {
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
padding: 5px 10px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
padding: 5px 10px;
background-color: #F8F8F8;
}

.niceBox .bottom {
Expand Down

0 comments on commit 91b53bc

Please sign in to comment.