aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/nav.php20
-rw-r--r--include/template_processor.php13
2 files changed, 28 insertions, 5 deletions
diff --git a/include/nav.php b/include/nav.php
index bb1a5b2d8..f9e72bda7 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -157,8 +157,28 @@ function nav(&$a) {
'$banner' => $banner,
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $userinfo,
+ '$sel' => $a->nav_sel,
));
call_hooks('page_header', $a->page['nav']);
+}
+/*
+ * Set a menu item in navbar as selected
+ *
+ */
+function nav_set_selected($item){
+ $a = get_app();
+ $a->nav_sel = array(
+ 'community' => null,
+ 'network' => null,
+ 'home' => null,
+ 'profiles' => null,
+ 'notifications' => null,
+ 'messages' => null,
+ 'directyory' => null,
+ 'settings' => null,
+ 'contacts' => null,
+ );
+ $a->nav_sel[$item] = 'selected';
}
diff --git a/include/template_processor.php b/include/template_processor.php
index f1d2eae4e..11769bbd0 100644
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -11,15 +11,18 @@
private function _preg_error(){
switch(preg_last_error()){
- case PREG_INTERNAL_ERROR: die('PREG_INTERNAL_ERROR'); break;
- case PREG_BACKTRACK_LIMIT_ERROR: die('PREG_BACKTRACK_LIMIT_ERROR'); break;
- case PREG_RECURSION_LIMIT_ERROR: die('PREG_RECURSION_LIMIT_ERROR'); break;
- case PREG_BAD_UTF8_ERROR: die('PREG_BAD_UTF8_ERROR'); break;
- case PREG_BAD_UTF8_OFFSET_ERROR: die('PREG_BAD_UTF8_OFFSET_ERROR'); break;
+ case PREG_INTERNAL_ERROR: echo('PREG_INTERNAL_ERROR'); break;
+ case PREG_BACKTRACK_LIMIT_ERROR: echo('PREG_BACKTRACK_LIMIT_ERROR'); break;
+ case PREG_RECURSION_LIMIT_ERROR: echo('PREG_RECURSION_LIMIT_ERROR'); break;
+ case PREG_BAD_UTF8_ERROR: echo('PREG_BAD_UTF8_ERROR'); break;
+ case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
default:
//die("Unknown preg error.");
return;
}
+ echo "<hr><pre>";
+ debug_print_backtrace();
+ die();
}
private function _build_replace($r, $prefix){