Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #403 from localheinz/fix/just-one-layout
Browse files Browse the repository at this point in the history
Fix: Use just one layout and switch header based on view variable
  • Loading branch information
Ocramius committed Feb 20, 2015
2 parents 2515113 + 3218858 commit 18f3019
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 133 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"require": {
"bshaffer/oauth2-server-php": "dev-develop",
"evandotpro/edp-github": "dev-master",
"evandotpro/edp-module-layouts": "1.0.*",
"ezyang/htmlpurifier": "4.6.*",
"monolog/monolog": "~1.12",
"php": "~5.5",
Expand Down
40 changes: 1 addition & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion config/application.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'EdpGithub',
'Application',
'User',
'EdpModuleLayouts',
'ZfModule',
],
'module_listener_options' => [
Expand Down
5 changes: 0 additions & 5 deletions config/autoload/global.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?php
return [
'module_layouts' => [
'User' => 'layout/layout-small-header.phtml',
'ZfcUser' => 'layout/layout-small-header.phtml',
'ZfModule' => 'layout/layout-small-header.phtml',
],
'asset_manager' => [
'caching' => [
'default' => [
Expand Down
2 changes: 1 addition & 1 deletion module/Application/config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'application/index/pagination' => __DIR__ . '/../view/application/index/pagination.phtml',
'application/search/index' => __DIR__ . '/../view/application/search/index.phtml',
'layout/error' => __DIR__ . '/../view/layout/layout-small-header.phtml',
'layout/error' => __DIR__ . '/../view/layout/layout.phtml',
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
Expand Down
2 changes: 2 additions & 0 deletions module/Application/view/application/index/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<?php $this->inlineScript()->appendFile($this->basePath('js/jquery.livesearch.js')); ?>
<?php $this->inlineScript()->appendScript('$(\'#live-search input[name="query"]\').liveSearch({url: "' . $this->url('live-search', [], ['query' => ['query' => '']]) . '"});'); ?>
<?php $this->layout()->withLargeHeader = true; ?>
<div class="col-xs-12 col-md-8">
<div class="well well-sm">
<form id="live-search">
Expand Down
86 changes: 0 additions & 86 deletions module/Application/view/layout/layout-small-header.phtml

This file was deleted.

17 changes: 17 additions & 0 deletions module/Application/view/layout/layout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
</div>
</div>

<?php if (true === $this->withLargeHeader): ?>
<div class="container-fluid landing-intro">
<div class="container">
<div class="row">
Expand Down Expand Up @@ -82,6 +83,22 @@
</div>
</div>
</div>
<?php else: ?>
<div class="container-fluid landing-intro small-header">
<div class="container">
<div class="row">
<div class="col-md-8">
<a href="<?php echo $this->url('home'); ?>" style="text-decoration:none">
<img src="<?php echo $this->basePath('img/zend-logo_small.png'); ?>" alt="ZF Modules">
<p class="zf-green">
Modules
</p>
</a>
</div>
</div>
</div>
</div>
<?php endif; ?>

<div class="container main-content">
<div class="container-fluid">
Expand Down

0 comments on commit 18f3019

Please sign in to comment.