Skip to content

Commit

Permalink
added the ability to cache navigations (refs openpne#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Jan 3, 2010
1 parent d7c8fed commit a05fd0f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/pc_frontend/config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ prod:
no_script_name: true
logging_enabled: false
check_lock: true
cache: on
.actions:
error_404_action: error
module_disabled_action: error
Expand Down
5 changes: 5 additions & 0 deletions apps/pc_frontend/modules/default/config/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_globalNav:
enabled: on

_localNav:
enabled: on
8 changes: 7 additions & 1 deletion apps/pc_frontend/templates/_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@


<div id="globalNav">
<?php include_component('default', 'globalNav') ?>
<?php
$globalNavOptions = array(
'is_secure' => opToolkit::isSecurePage(),
'culture' => sfContext::getInstance()->getUser()->getCulture(),
);
include_component('default', 'globalNav', $globalNavOptions);
?>
</div><!-- globalNav -->

<div id="topBanner">
Expand Down
12 changes: 11 additions & 1 deletion apps/pc_frontend/templates/_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@
<div id="ContentsContainer">

<div id="localNav">
<?php include_component('default', 'localNav') ?>
<?php
$context = sfContext::getInstance();
$module = $context->getActionStack()->getLastEntry()->getModuleName();
$localNavOptions = array(
'is_secure' => opToolkit::isSecurePage(),
'id' => $context->getRequest()->getParameter('id'),
'type' => sfConfig::get('sf_nav_type', sfConfig::get('mod_'.$module.'_default_nav', 'default')),
'culture' => $context->getUser()->getCulture(),
);
include_component('default', 'localNav', $localNavOptions);
?>
</div><!-- localNav -->

<div id="Layout<?php echo $layout ?>" class="Layout">
Expand Down

0 comments on commit a05fd0f

Please sign in to comment.