From 8cbb2a88024969f7efd90f8053f3b0805fa2f8fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 3 Aug 2013 08:25:11 +0200 Subject: twig implementation --- inc/poche/pocheCore.php | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/pocheCore.php b/inc/poche/pocheCore.php index e68696af..3e32c4a8 100644 --- a/inc/poche/pocheCore.php +++ b/inc/poche/pocheCore.php @@ -134,10 +134,12 @@ function fetch_url_content($url) return FALSE; } -function display_view($view, $id = 0, $full_head = 'yes') +function display_view($view, $id = 0) { global $tpl, $store; + $tpl_vars = array(); + switch ($view) { case 'install': @@ -186,21 +188,25 @@ function display_view($view, $id = 0, $full_head = 'yes') break; default: # home view $entries = $store->getEntriesByView($view); - $tpl->assign('entries', $entries); + $tpl_vars = array( + 'entries' => $entries, + ); - if ($full_head == 'yes') { - $tpl->assign('load_all_js', 1); - $tpl->draw('head'); - $tpl->draw('home'); - } + // if ($full_head == 'yes') { + // $tpl->assign('load_all_js', 1); + // $tpl->draw('head'); + // $tpl->draw('home'); + // } - $tpl->draw('entries'); - if ($full_head == 'yes') { - $tpl->draw('js'); - $tpl->draw('footer'); - } + // $tpl->draw('entries'); + // if ($full_head == 'yes') { + // $tpl->draw('js'); + // $tpl->draw('footer'); + // } break; } + + return $tpl_vars; } /** -- cgit v1.2.3