diff --git a/Code/Lib/Apps.php b/Code/Lib/Apps.php index 5686115de..173c72aef 100644 --- a/Code/Lib/Apps.php +++ b/Code/Lib/Apps.php @@ -378,6 +378,7 @@ class Apps 'Help' => t('Help'), 'Invite' => t('Invite'), 'Language' => t('Language'), + 'Legal' => t('Legal'), 'Login' => t('Login'), 'Mail' => t('Mail'), 'Markup' => t('Markup'), diff --git a/Code/Lib/Navbar.php b/Code/Lib/Navbar.php index 34dedfcf3..8445c6c83 100644 --- a/Code/Lib/Navbar.php +++ b/Code/Lib/Navbar.php @@ -12,7 +12,7 @@ use Code\Lib\Menu; use Code\Lib\Head; use Code\Render\Theme; use Code\Extend\Hook; - + require_once('include/security.php'); require_once('include/conversation.php'); @@ -199,10 +199,6 @@ class Navbar { Hook::call('nav', $x); - // Not sure the best place to put this on the page. So I'm implementing it but leaving it - // turned off until somebody discovers this and figures out a good location for it. - $powered_by = ''; - if (App::$profile_uid && App::$nav_sel['raw_name']) { $active_app = q( "SELECT app_url FROM app WHERE app_channel = %d AND app_name = '%s' LIMIT 1", @@ -299,7 +295,6 @@ class Navbar { '$baseurl' => z_root(), '$site_home' => Channel::url($site_channel), '$project_icon' => $site_icon, - '$project_title' => t('Powered by $Projectname'), '$fulldocs' => t('Help'), '$sitelocation' => $sitelocation, '$nav' => $x['nav'], @@ -309,7 +304,6 @@ class Navbar { '$localuser' => local_channel(), '$is_owner' => $is_owner, '$sel' => App::$nav_sel, - '$powered_by' => $powered_by, '$asidetitle' => t('Side Panel'), '$help' => t('@name, #tag, ?doc, content'), '$pleasewait' => t('Please wait...'), diff --git a/Code/Module/Admin/Site.php b/Code/Module/Admin/Site.php index 7e71b9567..8e0f86039 100644 --- a/Code/Module/Admin/Site.php +++ b/Code/Module/Admin/Site.php @@ -4,6 +4,7 @@ namespace Code\Module\Admin; use App; use Code\Lib\System; +use Code\Lib\PConfig; use Code\Access\PermissionRoles; use Code\Lib\Channel; use Code\Render\Theme; @@ -35,6 +36,7 @@ class Site $admininfo = ((x($_POST, 'admininfo')) ? trim($_POST['admininfo']) : false); $siteinfo = ((x($_POST, 'siteinfo')) ? trim($_POST['siteinfo']) : ''); + $legal = ((x($_POST, 'legal')) ? trim($_POST['legal']) : ''); $language = ((x($_POST, 'language')) ? notags(trim($_POST['language'])) : 'en'); $theme = ((x($_POST, 'theme')) ? notags(trim($_POST['theme'])) : ''); // $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : ''); @@ -124,6 +126,7 @@ class Site set_config('system', 'max_imported_follow', $max_imported_follow); set_config('system', 'animated_avatars', $animations); set_config('system', 'tos_required', $tos_required); + PConfig::Set(App::$sys_channel['channel_id'], 'system', 'legal', $legal); if ($admininfo == '') { del_config('system', 'admininfo'); @@ -268,6 +271,10 @@ class Site $role = ['permissions_role', t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'), $perm_roles]; + $legal = PConfig::Get(App::$sys_channel['channel_id'], 'system', 'legal'); + if (!$legal) { + $legal = file_get_contents('doc/en/TermsOfService.mc'); + } $homelogin = get_config('system', 'login_on_homepage'); $enable_context_help = get_config('system', 'enable_context_help'); @@ -285,6 +292,7 @@ class Site '$sitename' => ['sitename', t("Site name"), htmlspecialchars(get_config('system', 'sitename', App::get_hostname()), ENT_QUOTES, 'UTF-8'), ''], '$admininfo' => ['admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. Multicode may be used here.")], '$siteinfo' => ['siteinfo', t('Site Information'), get_config('system', 'siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. Multicode may be used here.")], + '$legal' => ['legal',t('Legal Information'), htmlspecialchars($legal), ''], '$language' => ['language', t("System language"), get_config('system', 'language', 'en'), "", $lang_choices], '$theme' => ['theme', t("System theme"), get_config('system', 'theme'), t("Default system theme - may be over-ridden by user profiles - change theme settings"), $theme_choices], // '$theme_mobile' => [ 'theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile ], diff --git a/Code/Module/Legal.php b/Code/Module/Legal.php new file mode 100644 index 000000000..2c63c85df --- /dev/null +++ b/Code/Module/Legal.php @@ -0,0 +1,22 @@ +