From c3e365ef4718e4c9d06eb962cb3deeb9fb39a2d9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 28 Jan 2018 15:56:31 -0800 Subject: Surface the ability to change the landing page after channel creation and create a 'go' module to present several possible things to do at this point. Change the default from 'settings' to 'profiles' so that the focus is more on you rather than the software configuration. --- Zotlabs/Module/Admin/Site.php | 3 ++ Zotlabs/Module/Go.php | 66 ++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Module/New_channel.php | 4 +-- view/pdl/mod_go.pdl | 6 ++++ view/tpl/admin_site.tpl | 1 + view/tpl/go.tpl | 16 ++++++++++ 6 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 Zotlabs/Module/Go.php create mode 100644 view/pdl/mod_go.pdl create mode 100644 view/tpl/go.tpl diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 037f49277..52b36e03e 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -38,6 +38,7 @@ class Site { $site_sellpage = ((x($_POST,'site_sellpage')) ? notags(trim($_POST['site_sellpage'])) : ''); $site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : ''); $frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : ''); + $firstpage = ((x(trim($_POST,'firstpage'))) ? notags(trim($_POST['firstpage'])) : 'profiles'); $mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0); $directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : ''); $allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : ''); @@ -80,6 +81,7 @@ class Site { set_config('system', 'maxloadavg', $maxloadavg); set_config('system', 'frontpage', $frontpage); set_config('system', 'sellpage', $site_sellpage); + set_config('system', 'workflow_channel_next', $firstpage); set_config('system', 'site_location', $site_location); set_config('system', 'mirror_frontpage', $mirror_frontpage); set_config('system', 'sitename', $sitename); @@ -340,6 +342,7 @@ class Site { '$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')), '$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())), + '$firstpage' => array('firstpage', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Recommend: profiles, go, or settings')), '$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')), diff --git a/Zotlabs/Module/Go.php b/Zotlabs/Module/Go.php new file mode 100644 index 000000000..2c2dcf460 --- /dev/null +++ b/Zotlabs/Module/Go.php @@ -0,0 +1,66 @@ + t('Upload a profile photo'), + 'profiles' => t('Edit your default profile'), + 'suggest' => t('View friend suggestions'), + 'directory' => t('View the directory to find other interesting channels'), + 'settings' => t('View/edit your channel settings'), + 'help' => t('View the site or project documentation'), + 'channel/' . $channel['channel_address'] => t('Visit your channel homepage'), + 'connections' => t('View your connections and/or add somebody whose address you already know'), + 'network' => t('View your personal stream (this may be empty until you add some connections)'), + + ]; + + $site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false); + $net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true); + + if($site_firehose || $net_firehose) { + $options['pubstream'] = t('View the public stream. Warning: this content is not moderated'); + } + + $o = replace_macros(get_markup_template('go.tpl'), [ + '$title' => $title, + '$m' => $m, + '$m1' => $m1, + '$options' => $options + + ]); + + return $o; + + } + +} \ No newline at end of file diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index 2b73fa191..9f2fea802 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -89,9 +89,7 @@ class New_channel extends \Zotlabs\Web\Controller { change_channel($result['channel']['channel_id']); - if(! strlen($next_page = get_config('system','workflow_channel_next'))) - $next_page = 'settings'; - + $next_page = get_config('system', 'workflow_channel_next', 'profiles'); goaway(z_root() . '/' . $next_page); } diff --git a/view/pdl/mod_go.pdl b/view/pdl/mod_go.pdl new file mode 100644 index 000000000..c34898dd5 --- /dev/null +++ b/view/pdl/mod_go.pdl @@ -0,0 +1,6 @@ +[region=aside] +[widget=fullprofile][/widget] +[/region] +[region=right_aside] +[widget=notifications][/widget] +[/region] diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index 50482f03d..0eabe620d 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -74,6 +74,7 @@ {{include file="field_select.tpl" field=$access_policy}} {{include file="field_input.tpl" field=$location}} {{include file="field_input.tpl" field=$sellpage}} + {{include file="field_input.tpl" field=$firstpage}}
diff --git a/view/tpl/go.tpl b/view/tpl/go.tpl new file mode 100644 index 000000000..f0f9ee79e --- /dev/null +++ b/view/tpl/go.tpl @@ -0,0 +1,16 @@ +

{{$title}}

+ +
+

{{$m}}

+

{{$m1}}

+
+ +{{if $options}} + +{{/if}} + + -- cgit v1.2.3