]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Tos.php
Random profiles now moved away from "gcontact" as well
[friendica.git] / src / Module / Tos.php
index 5442fdf45bfaacefa7fbabbc2f617ef11e21339f..2bc3393b2362f65d634d0dcb8e2abbadbf302a33 100644 (file)
@@ -1,16 +1,27 @@
 <?php
 /**
- * @file mod/tos.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  *
- * This module displays the Terms of Service for a node, if the admin
- * wants them to be displayed.
  */
 
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
-use Friendica\Core\Config;
-use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Content\Text\BBCode;
 use Friendica\DI;
@@ -32,12 +43,12 @@ class Tos extends BaseModule
         **/
        public function __construct()
        {
-               $this->privacy_operate = L10n::t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
-               $this->privacy_distribute = L10n::t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
-               $this->privacy_delete = L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl());
+               $this->privacy_operate = DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
+               $this->privacy_distribute = DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
+               $this->privacy_delete = DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl());
                // In some cases we don't need every single one of the above separate, but all in one block.
                // So here is an array to look over
-               $this->privacy_complete = [L10n::t('Privacy Statement'), $this->privacy_operate, $this->privacy_distribute, $this->privacy_delete];
+               $this->privacy_complete = [DI::l10n()->t('Privacy Statement'), $this->privacy_operate, $this->privacy_distribute, $this->privacy_delete];
        }
 
        /**
@@ -49,8 +60,8 @@ class Tos extends BaseModule
         **/
        public static function init(array $parameters = [])
        {
-               if (strlen(Config::get('system','singleuser'))) {
-                       DI::baseUrl()->redirect('profile/' . Config::get('system','singleuser'));
+               if (strlen(DI::config()->get('system','singleuser'))) {
+                       DI::baseUrl()->redirect('profile/' . DI::config()->get('system','singleuser'));
                }
        }
 
@@ -68,15 +79,15 @@ class Tos extends BaseModule
         */
        public static function content(array $parameters = []) {
                $tpl = Renderer::getMarkupTemplate('tos.tpl');
-               if (Config::get('system', 'tosdisplay')) {
+               if (DI::config()->get('system', 'tosdisplay')) {
                        return Renderer::replaceMacros($tpl, [
-                               '$title' => L10n::t('Terms of Service'),
-                               '$tostext' => BBCode::convert(Config::get('system', 'tostext')),
-                               '$displayprivstatement' => Config::get('system', 'tosprivstatement'),
-                               '$privstatementtitle' => L10n::t('Privacy Statement'),
-                               '$privacy_operate' => L10n::t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'),
-                               '$privacy_distribute' => L10n::t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'),
-                               '$privacy_delete' => L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl())
+                               '$title' => DI::l10n()->t('Terms of Service'),
+                               '$tostext' => BBCode::convert(DI::config()->get('system', 'tostext')),
+                               '$displayprivstatement' => DI::config()->get('system', 'tosprivstatement'),
+                               '$privstatementtitle' => DI::l10n()->t('Privacy Statement'),
+                               '$privacy_operate' => DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'),
+                               '$privacy_distribute' => DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'),
+                               '$privacy_delete' => DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl())
                        ]);
                } else {
                        return;