From 6f709a6f57d10df73bf6d6ba5fc44c22d80f8717 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 7 Oct 2017 23:44:27 -0700 Subject: navbar controls now functionally hidden with too low z-index when cover_photo is showing and navbar doesn't have class fixed-top --- view/theme/redbasic/css/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index de6f8dac1..22bdc2dbc 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1454,6 +1454,10 @@ blockquote { background-color: $nav_bg !important; } +.navbar { + z-index:1030; +} + .navbar-dark .navbar-nav .nav-link, .usermenu i { color: $nav_icon_colour; -- cgit v1.2.3 From 4011dd18f01d275620b13815573e359c77664e3a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 8 Oct 2017 16:48:24 -0700 Subject: alternate navbar layouts --- Zotlabs/Render/Comanche.php | 5 + boot.php | 16 ++- doc/member/member_guide.bb | 9 ++ include/nav.php | 14 ++- view/tpl/nav.tpl | 1 + view/tpl/navbar_tucson.tpl | 289 ++++++++++++++++++++++++++++++++++++++++++++ view/tpl/profile_tabs.tpl | 3 - 7 files changed, 325 insertions(+), 12 deletions(-) create mode 100755 view/tpl/navbar_tucson.tpl diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index d126cb3da..ca664cba6 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -121,6 +121,11 @@ class Comanche { if($cnt) \App::$layout['theme'] = trim($matches[1]); + $cnt = preg_match("/\[navbar\](.*?)\[\/navbar\]/ism", $s, $matches); + if($cnt) + \App::$layout['navbar'] = trim($matches[1]); + + $cnt = preg_match_all("/\[webpage\](.*?)\[\/webpage\]/ism", $s, $matches, PREG_SET_ORDER); if($cnt) { // only the last webpage definition is used if there is more than one diff --git a/boot.php b/boot.php index f955ba511..df57009e5 100755 --- a/boot.php +++ b/boot.php @@ -2090,17 +2090,21 @@ function construct_page() { $installing = false; + $navbar = get_config('system','navbar','nav'); + if(App::$profile_uid) { + $navbar = get_pconfig(App::$profile_uid,'system','navbar',$navbar); + } + + if($comanche && App::$layout['navbar']) { + $navbar = App::$layout['navbar']; + } + if (App::$module == 'setup') { $installing = true; } else { - nav($a); + nav($navbar); } - if ($comanche) { - if (App::$layout['nav']) { - App::$page['nav'] = get_custom_nav(App::$layout['nav']); - } - } $current_theme = Zotlabs\Render\Theme::current(); diff --git a/doc/member/member_guide.bb b/doc/member/member_guide.bb index 0a2d11a88..0794f24d3 100644 --- a/doc/member/member_guide.bb +++ b/doc/member/member_guide.bb @@ -634,6 +634,15 @@ This will select the theme named "suckerberg" and select the "pas The condensed notation isn't part of Comanche itself but is recognised by $Projectname platform as a theme specifier. +[h4]Navbar[/h4] + +[code] + [navbar]tucson[/navbar] +[/code] + +Use the 'tucson' navbar template and CSS rules. By default the 'nav' navbar template will be used. + + [h4]Regions[/h4] Each region has a name, as noted above. You will specify the region of interest using a 'region' tag, which includes the name. Any content you wish placed in this region should be placed between the opening region tag and the closing tag. diff --git a/include/nav.php b/include/nav.php index 6b56c9aee..622717347 100644 --- a/include/nav.php +++ b/include/nav.php @@ -6,7 +6,7 @@ require_once('include/security.php'); require_once('include/menu.php'); -function nav() { +function nav($template = 'nav') { /** * @@ -267,7 +267,16 @@ EOT; $nav_apps[] = Zlib\Apps::app_render($app,'nav'); } - $tpl = get_markup_template('nav.tpl'); + $c = theme_include('navbar_' . $template . '.css'); + $tpl = get_markup_template('navbar_' . $template . '.tpl'); + + if($c && $tpl) { + head_add_css('navbar_' . $template . '.css'); + } + + if(! $tpl) { + $tpl = get_markup_template('nav.tpl'); + } App::$page['nav'] .= replace_macros($tpl, array( '$baseurl' => z_root(), @@ -490,7 +499,6 @@ function channel_apps($is_owner = false, $nickname = null) { '$tabs' => $arr['tabs'], '$name' => App::$profile['channel_name'], '$thumb' => App::$profile['thumb'], - '$channel_menu' => get_config('system','channel_menu') ] ); } diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index a19fa15a1..1d905d173 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -252,6 +252,7 @@ {{foreach $channel_apps as $channel_app}} {{$channel_app}} {{/foreach}} + diff --git a/view/tpl/navbar_tucson.tpl b/view/tpl/navbar_tucson.tpl new file mode 100755 index 000000000..15f06eda1 --- /dev/null +++ b/view/tpl/navbar_tucson.tpl @@ -0,0 +1,289 @@ +{{if $nav.login && !$userinfo}} +
+ + {{$nav.loginmenu.1.1}} + + {{if $nav.register}} + + {{$nav.register.1}} + + {{/if}} +
+{{/if}} +{{if $userinfo}} + +{{/if}} + + + +{{if $nav.help.6}} +
+ {{$nav.help.5}} + +
+{{/if}} diff --git a/view/tpl/profile_tabs.tpl b/view/tpl/profile_tabs.tpl index b59135209..72e98ae82 100644 --- a/view/tpl/profile_tabs.tpl +++ b/view/tpl/profile_tabs.tpl @@ -2,6 +2,3 @@ {{foreach $tabs as $tab}} {{$tab.label}} {{/foreach}} -{{if ! $channel_menu}} - -{{/if}} \ No newline at end of file -- cgit v1.2.3 From c37908f344ecbac3ee60e3e36701161a4047d639 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 8 Oct 2017 17:22:38 -0700 Subject: check write_storage permission in /display --- Zotlabs/Lib/ThreadStream.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/ThreadStream.php b/Zotlabs/Lib/ThreadStream.php index d7a898704..436723f8c 100644 --- a/Zotlabs/Lib/ThreadStream.php +++ b/Zotlabs/Lib/ThreadStream.php @@ -68,7 +68,7 @@ class ThreadStream { // pull some trickery which allows us to re-invoke this function afterward // it's an ugly hack so @FIXME $this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments'); - $this->uploadable = false; + $this->uploadable = perm_is_allowed($this->profile_owner,$ob_hash,'write_storage'); break; case 'page': $this->profile_owner = \App::$profile['uid']; -- cgit v1.2.3 From 23812e5b48b7a4d4f0c275c0fbb3d244a582397c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 8 Oct 2017 19:43:03 -0700 Subject: ability to pin apps to the navbar when using named navbars --- Zotlabs/Lib/Apps.php | 7 +++++++ include/nav.php | 13 +++++++++++-- view/tpl/app_nav.tpl | 1 + view/tpl/navbar_tucson.tpl | 7 +++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 view/tpl/app_nav.tpl diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index c4f4038dc..f13fbe362 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -383,6 +383,13 @@ class Apps { $install_action = (($installed) ? t('Update') : t('Install')); $icon = ((strpos($papp['photo'],'icon:') === 0) ? substr($papp['photo'],5) : ''); + if($mode === 'navbar') { + return replace_macros(get_markup_template('app_nav.tpl'),array( + '$app' => $papp, + '$icon' => $icon, + )); + } + return replace_macros(get_markup_template('app.tpl'),array( '$app' => $papp, '$icon' => $icon, diff --git a/include/nav.php b/include/nav.php index 622717347..588104eda 100644 --- a/include/nav.php +++ b/include/nav.php @@ -261,10 +261,18 @@ EOT; if(\App::$nav_sel['active'] == $app['name']) $app['active'] = true; - if($is_owner) + if($is_owner) { $nav_apps[] = Zlib\Apps::app_render($app,'nav'); - elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) + if(strpos($app['categories'],'navbar_' . $template)) { + $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); + } + } + elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { $nav_apps[] = Zlib\Apps::app_render($app,'nav'); + if(strpos($app['categories'],'navbar_' . $template)) { + $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); + } + } } $c = theme_include('navbar_' . $template . '.css'); @@ -294,6 +302,7 @@ EOT; '$help' => t('@name, #tag, ?doc, content'), '$pleasewait' => t('Please wait...'), '$nav_apps' => $nav_apps, + '$navbar_apps' => $navbar_apps, '$channel_menu' => get_config('system','channel_menu'), '$channel_thumb' => ((App::$profile) ? App::$profile['thumb'] : ''), '$channel_apps' => $channel_apps, diff --git a/view/tpl/app_nav.tpl b/view/tpl/app_nav.tpl new file mode 100644 index 000000000..1ee5adb70 --- /dev/null +++ b/view/tpl/app_nav.tpl @@ -0,0 +1 @@ +{{if $icon}}{{else}}{{/if}} diff --git a/view/tpl/navbar_tucson.tpl b/view/tpl/navbar_tucson.tpl index 15f06eda1..ace22a880 100755 --- a/view/tpl/navbar_tucson.tpl +++ b/view/tpl/navbar_tucson.tpl @@ -213,6 +213,13 @@