diff options
-rw-r--r-- | Zotlabs/Lib/System.php | 14 | ||||
-rw-r--r-- | Zotlabs/Module/Admin/Site.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Connedit.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Siteinfo.php | 80 | ||||
-rw-r--r-- | include/bbcode.php | 6 | ||||
-rw-r--r-- | view/js/autocomplete.js | 2 | ||||
-rwxr-xr-x | view/tpl/abook_edit.tpl | 11 | ||||
-rwxr-xr-x | view/tpl/admin_site.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/siteinfo.tpl | 61 |
9 files changed, 96 insertions, 84 deletions
diff --git a/Zotlabs/Lib/System.php b/Zotlabs/Lib/System.php index 26768af26..70443016f 100644 --- a/Zotlabs/Lib/System.php +++ b/Zotlabs/Lib/System.php @@ -42,6 +42,20 @@ class System { } + static public function get_project_link() { + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_link']) + return \App::$config['system']['project_link']; + return 'https://hubzilla.org'; + } + + static public function get_project_srclink() { + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_srclink']) + return \App::$config['system']['project_srclink']; + return 'https://github.com/redmatrix/hubzilla'; + } + + + static public function get_server_role() { if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['server_role']) return \App::$config['system']['server_role']; diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 251533e68..829ca71e4 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -22,6 +22,7 @@ class Site { $banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false); $admininfo = ((x($_POST,'admininfo')) ? trim($_POST['admininfo']) : false); + $siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : ''); $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : ''); $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : ''); $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : ''); @@ -97,6 +98,7 @@ class Site { linkify_tags($a, $admininfo, local_channel()); set_config('system', 'admininfo', $admininfo); } + set_config('system','siteinfo',$siteinfo); set_config('system', 'language', $language); set_config('system', 'theme', $theme); if ( $theme_mobile === '---' ) { @@ -273,6 +275,7 @@ class Site { '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$admininfo' => array('admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. BBCode can be used here")), + '$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices), '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 47e1ce167..5968ccde6 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -398,6 +398,7 @@ class Connedit extends \Zotlabs\Web\Controller { return login(); } + $section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : ''); $channel = \App::get_channel(); $my_perms = get_channel_default_perms(local_channel()); $role = get_pconfig(local_channel(),'system','permissions_role'); @@ -779,6 +780,7 @@ class Connedit extends \Zotlabs\Web\Controller { '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])), '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no), '$addr' => $contact['xchan_addr'], + '$section' => $section, '$addr_text' => t('This connection\'s primary address is'), '$loc_text' => t('Available locations:'), '$locstr' => $locstr, diff --git a/Zotlabs/Module/Siteinfo.php b/Zotlabs/Module/Siteinfo.php index a15e2896d..461db1752 100644 --- a/Zotlabs/Module/Siteinfo.php +++ b/Zotlabs/Module/Siteinfo.php @@ -15,63 +15,33 @@ class Siteinfo extends \Zotlabs\Web\Controller { function get() { - if(! get_config('system','hidden_version_siteinfo')) { - $version = sprintf( t('Version %s'), \Zotlabs\Lib\System::get_project_version()); - if(@is_dir('.git') && function_exists('shell_exec')) { - $commit = @shell_exec('git log -1 --format="%h"'); - $tag = \Zotlabs\Lib\System::get_std_version(); // @shell_exec('git describe --tags --abbrev=0'); - } - if(! isset($commit) || strlen($commit) > 16) - $commit = ''; - } - else { - $version = $commit = ''; - } + $siteinfo = replace_macros(get_markup_template('siteinfo.tpl'), + [ + '$title' => t('About this site'), + '$sitenametxt' => t('Site Name'), + '$sitename' => \Zotlabs\Lib\System::get_site_name(), + '$headline' => t('Site Information'), + '$site_about' => bbcode(get_config('system','siteinfo')), + '$admin_headline' => t('Administrator'), + '$admin_about' => bbcode(get_config('system','admininfo')), + '$terms' => t('Terms of Service'), + '$prj_header' => t('Software and Project information'), + '$prj_name' => t('This site is powered by $Projectname'), + '$prj_transport' => t('Federated and decentralised networking and identity services provided by Zot'), + '$transport_link' => '<a href="http://zotlabs.com">http://zotlabs.com</a>', + '$prj_version' => ((get_config('system','hidden_version_siteinfo')) ? '' : sprintf( t('Version %s'), \Zotlabs\Lib\System::get_project_version())), + '$prj_linktxt' => t('Project homepage'), + '$prj_srctxt' => t('Developer homepage'), + '$prj_link' => \Zotlabs\Lib\System::get_project_link(), + '$prj_src' => \Zotlabs\Lib\System::get_project_srclink(), + ] + ); - $plugins_list = implode(', ',visible_plugin_list()); + call_hooks('about_hook', $siteinfo); + + return $siteinfo; - if($plugins_list) - $plugins_text = t('Installed plugins/addons/apps:'); - else - $plugins_text = t('No installed plugins/addons/apps'); - - $txt = get_config('system','admininfo'); - $admininfo = bbcode($txt); - - if(file_exists('doc/site_donate.html')) - $donate .= file_get_contents('doc/site_donate.html'); - - if(function_exists('sys_getloadavg')) - $loadavg = sys_getloadavg(); - - $o = replace_macros(get_markup_template('siteinfo.tpl'), array( - '$title' => t('$Projectname'), - '$description' => t('This is a hub of $Projectname - a global cooperative network of decentralized privacy enhanced websites.'), - '$version' => $version, - '$tag_txt' => t('Tag: '), - '$tag' => $tag, - '$polled' => t('Last background fetch: '), - '$lastpoll' => get_poller_runtime(), - '$load_average' => t('Current load average: '), - '$loadavg_all' => $loadavg[0] . ', ' . $loadavg[1] . ', ' . $loadavg[2], - '$commit' => $commit, - '$web_location' => t('Running at web location') . ' ' . z_root(), - '$visit' => t('Please visit <a href="http://hubzilla.org">hubzilla.org</a> to learn more about $Projectname.'), - '$bug_text' => t('Bug reports and issues: please visit'), - '$bug_link_url' => 'https://github.com/redmatrix/hubzilla/issues', - '$bug_link_text' => t('$projectname issues'), - '$contact' => t('Suggestions, praise, etc. - please email "redmatrix" at librelist - dot com'), - '$donate' => $donate, - '$adminlabel' => t('Site Administrators'), - '$admininfo' => $admininfo, - '$plugins_text' => $plugins_text, - '$plugins_list' => $plugins_list - )); - - call_hooks('about_hook', $o); - - return $o; - } + } diff --git a/include/bbcode.php b/include/bbcode.php index 1aabbc129..7e932151f 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -787,6 +787,12 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) if (strpos($Text,'[/color]') !== false) { $Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])ism", "<span style=\"color: $1;\">$2</span>", $Text); } + // Check for colored text + if (strpos($Text,'[/hl]') !== false) { + $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "<span style=\"background-color: yellow;\">$1</span>", $Text); + $Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "<span style=\"background-color: $1;\">$2</span>", $Text); + } + // Check for sized text // [size=50] --> font-size: 50px (with the unit). if (strpos($Text,'[/size]') !== false) { diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index aa47a6e19..905c7ca28 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -269,7 +269,7 @@ function string2bb(element) { $.fn.bbco_autocomplete = function(type) { if(type=='bbcode') { - var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'open', 'spoiler', 'map', 'nobb', 'list', 'checklist', 'ul', 'ol', 'dl', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer', 'embed']; + var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'open', 'spoiler', 'map', 'nobb', 'list', 'checklist', 'ul', 'ol', 'dl', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer', 'embed', 'hl']; var open_elements = ['observer.baseurl', 'observer.address', 'observer.photo', 'observer.name', 'observer.webname', 'observer.url', '*', 'hr', ]; var elements = open_close_elements.concat(open_elements); diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index 12ec879a9..2e02de33b 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -21,10 +21,10 @@ {{if $abook_prev || $abook_next}} <div class="btn-group"> {{if $abook_prev}} - <a href="connedit/{{$abook_prev}}" class="btn btn-default btn-xs" ><i class="fa fa-backward"></i></a> + <a href="connedit/{{$abook_prev}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-default btn-xs" ><i class="fa fa-backward"></i></a> {{/if}} {{if $abook_next}} - <a href="connedit/{{$abook_next}}" class="btn btn-default btn-xs" ><i class="fa fa-forward"></i></a> + <a href="connedit/{{$abook_next}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-default btn-xs" ><i class="fa fa-forward"></i></a> {{/if}} </div> {{/if}} @@ -63,6 +63,7 @@ <form id="abook-edit-form" action="connedit/{{$contact_id}}" method="post" > <input type="hidden" name="contact_id" value="{{$contact_id}}"> + <input type="hidden" name="section" value="{{$section}}"> <div class="panel-group" id="contact-edit-tools" role="tablist" aria-multiselectable="true"> {{if $notself}} @@ -96,7 +97,7 @@ </a> </h3> </div> - <div id="affinity-tool-collapse" class="panel-collapse collapse{{if !$is_pending}} in{{/if}}" role="tabpanel" aria-labelledby="affinity-tool"> + <div id="affinity-tool-collapse" class="panel-collapse collapse{{if !$is_pending || $section == 'affinity'}} in{{/if}}" role="tabpanel" aria-labelledby="affinity-tool"> <div class="section-content-tools-wrapper"> {{if $slide}} <div class="form-group"><strong>{{$lbl_slider}}</strong></div> @@ -127,7 +128,7 @@ </a> </h3> </div> - <div id="fitert-tool-collapse" class="panel-collapse collapse{{if !$is_pending && !($slide || $multiprofs)}} in{{/if}}" role="tabpanel" aria-labelledby="fitert-tool"> + <div id="fitert-tool-collapse" class="panel-collapse collapse{{if ( !$is_pending && !($slide || $multiprofs)) || $section == 'filter' }} in{{/if}}" role="tabpanel" aria-labelledby="fitert-tool"> <div class="section-content-tools-wrapper"> {{include file="field_textarea.tpl" field=$incl}} {{include file="field_textarea.tpl" field=$excl}} @@ -181,7 +182,7 @@ </h3> </div> {{/if}} - <div id="perms-tool-collapse" class="panel-collapse collapse{{if $self}} in{{/if}}" role="tabpanel" aria-labelledby="perms-tool"> + <div id="perms-tool-collapse" class="panel-collapse collapse{{if $self || $section === 'perms'}} in{{/if}}" role="tabpanel" aria-labelledby="perms-tool"> <div class="section-content-tools-wrapper"> <div class="section-content-warning-wrapper"> {{if $notself}}{{$permnote}}{{/if}} diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index a5b32f08f..0bb3ceb15 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -49,6 +49,7 @@ {{/if}} {{include file="field_textarea.tpl" field=$banner}} + {{include file="field_textarea.tpl" field=$siteinfo}} {{include file="field_textarea.tpl" field=$admininfo}} {{include file="field_select.tpl" field=$language}} {{include file="field_select.tpl" field=$theme}} diff --git a/view/tpl/siteinfo.tpl b/view/tpl/siteinfo.tpl index e50284b9c..a5b99fd83 100755 --- a/view/tpl/siteinfo.tpl +++ b/view/tpl/siteinfo.tpl @@ -1,26 +1,41 @@ <div class="generic-content-wrapper-styled"> -<h3>{{$title}}</h3> -<p></p> -<p>{{$description}}</p> -{{if $version}} -<p>{{$version}}{{if $commit}}+{{$commit}}{{/if}}</p> +<h2>{{$title}}</h2> + +<h3>{{$sitenametxt}}</h3> + +<div>{{$sitename}}</div> + +<h3>{{$headline}}</h3> + +<div>{{if $site_about}}{{$site_about}}{{else}}--{{/if}}</div> + +<h3>{{$admin_headline}}</h3> + +<div>{{if $admin_about}}{{$admin_about}}{{else}}--{{/if}}</div> + +<br><br> +<div><a href="help/TermsOfService">{{$terms}}</a></div> + +<hr> + +<h2>{{$prj_header}}</h2> + +<div>{{$prj_name}} ({{$z_server_role}})</div> + +{{if $prj_version}} +<div>{{$prj_version}}</div> {{/if}} -{{if $tag}} -<p>{{$tag_txt}} {{$tag}}</p> -{{/if}} -{{if $polled}} -<p>{{$polled}} {{$lastpoll}}</p> -{{/if}} -<p>{{$load_average}} {{$loadavg_all}}</p> -<p>{{$web_location}}</p> -<p>{{$visit}}</p> -<p>{{$bug_text}} <a href="{{$bug_link_url}}">{{$bug_link_text}}</a></p> -<p>{{$adminlabel}}</p> -<p>{{$admininfo}}</p> -<p>{{$contact}}</p> -<p>{{$plugins_text}}</p> -{{if $plugins_list}} - <div style="margin-left: 25px; margin-right: 25px;">{{$plugins_list}}</div> -{{/if}} -<p>{{$donate}}</p> + + +<h3>{{$prj_linktxt}}</h3> + +<div>{{$prj_link}}</div> + +<h3>{{$prj_srctxt}}</h3> + +<div>{{$prj_src}}</div> + +<br><br> +<div>{{$prj_transport}} ({{$transport_link}})</div> + </div> |