From dcadfc395ab3d91d42ce3f0d1ee5c207828268c1 Mon Sep 17 00:00:00 2001 From: jgen Date: Fri, 25 Apr 2014 14:14:22 -0400 Subject: [PATCH] Move this code back down. --- themes/lite/layout.class.php | 114 ++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/themes/lite/layout.class.php b/themes/lite/layout.class.php index f4922887..69f4a6a7 100644 --- a/themes/lite/layout.class.php +++ b/themes/lite/layout.class.php @@ -9,62 +9,6 @@ */ class Layout { - /** - * A handy function which does exactly what it says in the method name - */ - private function block_to_html($block, $hidable=false, $salt="") { - $h = $block->header; - $b = $block->body; - $i = str_replace(' ', '_', $h) . $salt; - $html = "
"; - if(!is_null($h)) { - if($salt == "main") { - $html .= ""; - } else { - $html .= ""; - } - } - if(!is_null($b)) { - if($salt =="main") { - $html .= "
{$b}
"; - } - else { - $html .= " - - "; - } - } - $html .= "
"; - return $html; - } - - private function navlinks($link, $desc, $pages_matched) { - /** - * Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.) - */ - $html = null; - $url = ltrim($_GET['q'], "/"); - - $re1='.*?'; - $re2='((?:[a-z][a-z_]+))'; - - if (preg_match_all ("/".$re1.$re2."/is", $url, $matches)) { - $url=$matches[1][0]; - } - - $count_pages_matched = count($pages_matched); - - for($i=0; $i < $count_pages_matched; $i++) { - if($url == $pages_matched[$i]) { - $html = "{$desc}"; - } - } - - if(is_null($html)) {$html = "{$desc}";} - - return $html; - } - /** * turns the Page into HTML */ @@ -263,4 +207,62 @@ class Layout { EOD; } /* end of function display_page() */ + + + /** + * A handy function which does exactly what it says in the method name + */ + private function block_to_html($block, $hidable=false, $salt="") { + $h = $block->header; + $b = $block->body; + $i = str_replace(' ', '_', $h) . $salt; + $html = "
"; + if(!is_null($h)) { + if($salt == "main") { + $html .= ""; + } else { + $html .= ""; + } + } + if(!is_null($b)) { + if($salt =="main") { + $html .= "
{$b}
"; + } + else { + $html .= " + + "; + } + } + $html .= "
"; + return $html; + } + + private function navlinks($link, $desc, $pages_matched) { + /** + * Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.) + */ + $html = null; + $url = ltrim($_GET['q'], "/"); + + $re1='.*?'; + $re2='((?:[a-z][a-z_]+))'; + + if (preg_match_all ("/".$re1.$re2."/is", $url, $matches)) { + $url=$matches[1][0]; + } + + $count_pages_matched = count($pages_matched); + + for($i=0; $i < $count_pages_matched; $i++) { + if($url == $pages_matched[$i]) { + $html = "{$desc}"; + } + } + + if(is_null($html)) {$html = "{$desc}";} + + return $html; + } + } /* end of class Layout */