]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #7165 from nupplaphil/task/mod_dirfind
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 20 May 2019 18:45:19 +0000 (14:45 -0400)
committerGitHub <noreply@github.com>
Mon, 20 May 2019 18:45:19 +0000 (14:45 -0400)
Move mod/dirfind to src/Module/Search/Directory

76 files changed:
VERSION
boot.php
mod/cal.php
mod/common.php
mod/fsuggest.php
mod/newmember.php [deleted file]
mod/photos.php
mod/probe.php [deleted file]
mod/videos.php
src/App/Router.php
src/Content/Widget.php
src/Content/Widget/CalendarExport.php
src/Content/Widget/ContactBlock.php
src/Content/Widget/TagCloud.php
src/Module/Babel.php [deleted file]
src/Module/Contact.php
src/Module/Debug/Babel.php [new file with mode: 0644]
src/Module/Debug/Feed.php [new file with mode: 0644]
src/Module/Debug/ItemBody.php [new file with mode: 0644]
src/Module/Debug/Localtime.php [new file with mode: 0644]
src/Module/Debug/Probe.php [new file with mode: 0644]
src/Module/Debug/WebFinger.php [new file with mode: 0644]
src/Module/Feedtest.php [deleted file]
src/Module/GnuSocial/Notice.php [deleted file]
src/Module/ItemBody.php [deleted file]
src/Module/Itemsource.php [deleted file]
src/Module/Localtime.php [deleted file]
src/Module/WebFinger.php [deleted file]
src/Module/Welcome.php [new file with mode: 0644]
src/Protocol/DFRN.php
src/Util/Strings.php
src/Util/XML.php
src/Worker/Delivery.php
tests/src/Content/Text/BBCodeTest.php
view/templates/categories_widget.tpl [deleted file]
view/templates/contact_block.tpl [deleted file]
view/templates/contacts-widget-sidebar.tpl [deleted file]
view/templates/events_aside.tpl [deleted file]
view/templates/fileas_widget.tpl [deleted file]
view/templates/follow.tpl [deleted file]
view/templates/nets.tpl [deleted file]
view/templates/peoplefind.tpl [deleted file]
view/templates/probe.tpl [new file with mode: 0644]
view/templates/remote_friends_common.tpl [deleted file]
view/templates/tagblock_widget.tpl [deleted file]
view/templates/vcard-widget.tpl [deleted file]
view/templates/welcome.tpl [new file with mode: 0644]
view/templates/widget/contacts.tpl [new file with mode: 0644]
view/templates/widget/events.tpl [new file with mode: 0644]
view/templates/widget/filter.tpl [new file with mode: 0644]
view/templates/widget/follow.tpl [new file with mode: 0644]
view/templates/widget/peoplefind.tpl [new file with mode: 0644]
view/templates/widget/remote_friends_common.tpl [new file with mode: 0644]
view/templates/widget/tagcloud.tpl [new file with mode: 0644]
view/templates/widget/vcard.tpl [new file with mode: 0644]
view/theme/duepuntozero/deriv/darkzero.css
view/theme/duepuntozero/deriv/slackr.css
view/theme/duepuntozero/style.css
view/theme/frio/templates/contact_block.tpl [deleted file]
view/theme/frio/templates/fileas_widget.tpl [deleted file]
view/theme/frio/templates/follow.tpl [deleted file]
view/theme/frio/templates/nets.tpl [deleted file]
view/theme/frio/templates/peoplefind.tpl [deleted file]
view/theme/frio/templates/vcard-widget.tpl [deleted file]
view/theme/frio/templates/widget/contacts.tpl [new file with mode: 0644]
view/theme/frio/templates/widget/follow.tpl [new file with mode: 0644]
view/theme/frio/templates/widget/peoplefind.tpl [new file with mode: 0644]
view/theme/frio/templates/widget/vcard.tpl [new file with mode: 0644]
view/theme/quattro/templates/fileas_widget.tpl [deleted file]
view/theme/quattro/templates/nets.tpl [deleted file]
view/theme/quattro/templates/widget/filter.tpl [new file with mode: 0644]
view/theme/smoothly/style.css
view/theme/smoothly/templates/follow.tpl [deleted file]
view/theme/smoothly/templates/widget/follow.tpl [new file with mode: 0644]
view/theme/vier/style.css
view/theme/vier/templates/communityhome.tpl

diff --git a/VERSION b/VERSION
index bd61e84f201b1c465b68ab34eac49b31314178de..6952a8d6e3786608c338676b1f5894fd9e6339e1 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2019.06-dev
+2019.06-rc
index dfedcdbbbecd87668ae4d14eca4866f91cd8f08e..b8705fdf133cadb057f0ec82cab00d688a6971b5 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -31,7 +31,7 @@ use Friendica\Util\DateTimeFormat;
 
 define('FRIENDICA_PLATFORM',     'Friendica');
 define('FRIENDICA_CODENAME',     'Dalmatian Bellflower');
-define('FRIENDICA_VERSION',      '2019.06-dev');
+define('FRIENDICA_VERSION',      '2019.06-rc');
 define('DFRN_PROTOCOL_VERSION',  '2.23');
 define('NEW_UPDATE_ROUTINE_VERSION', 1170);
 
index 4b41c24e35e867af712ee4a5c62a8388f6abf99d..3f3cba466f5d8cbc5c63f55ab6cc3809daa917ac 100644 (file)
@@ -59,7 +59,7 @@ function cal_init(App $a)
 
        $account_type = Contact::getAccountType($profile);
 
-       $tpl = Renderer::getMarkupTemplate("vcard-widget.tpl");
+       $tpl = Renderer::getMarkupTemplate("widget/vcard.tpl");
 
        $vcard_widget = Renderer::replaceMacros($tpl, [
                '$name' => $profile['name'],
index 6b6090e19beedef238ac97652a75a628e5ef4019..a2821921c6ca21a4f4c8a0ba48999b4e6619782f 100644 (file)
@@ -47,7 +47,7 @@ function common_content(App $a)
                $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);
 
                if (DBA::isResult($contact)) {
-                       $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate("vcard-widget.tpl"), [
+                       $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate("widget/vcard.tpl"), [
                                '$name'  => $contact['name'],
                                '$photo' => $contact['photo'],
                                'url'    => 'contact/' . $cid
index 58bb11670070bbf22ceeee11fa1ede56c97b766c..2cede5685215abe6ad0bbf8bbddaa90b42efd86e 100644 (file)
@@ -13,7 +13,7 @@ use Friendica\Util\Strings;
 
 function fsuggest_post(App $a)
 {
-       if (! local_user()) {
+       if (!local_user()) {
                return;
        }
 
@@ -22,53 +22,38 @@ function fsuggest_post(App $a)
        }
 
        $contact_id = intval($a->argv[1]);
+       if (empty($contact_id)) {
+               return;
+       }
 
-       $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
-       if (! DBA::isResult($contact)) {
+       // We do query the "uid" as well to ensure that it is our contact
+       if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
                notice(L10n::t('Contact not found.') . EOL);
                return;
        }
 
-       $new_contact = intval($_POST['suggest']);
+       $suggest_contact_id = intval($_POST['suggest']);
+       if (empty($suggest_contact_id)) {
+               return;
+       }
 
-       $hash = Strings::getRandomHex();
+       // We do query the "uid" as well to ensure that it is our contact
+       $contact = DBA::selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]);
+       if (!DBA::isResult($contact)) {
+               notice(L10n::t('Suggested contact not found.') . EOL);
+               return;
+       }
 
        $note = Strings::escapeHtml(trim(defaults($_POST, 'note', '')));
 
-       if ($new_contact) {
-               $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
-                       intval($new_contact),
-                       intval(local_user())
-               );
-               if (DBA::isResult($r)) {
-                       q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
-                               VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
-                               intval(local_user()),
-                               intval($contact_id),
-                               DBA::escape($contact['name']),
-                               DBA::escape($contact['url']),
-                               DBA::escape($contact['request']),
-                               DBA::escape($contact['photo']),
-                               DBA::escape($hash),
-                               DBA::escape(DateTimeFormat::utcNow())
-                       );
-                       $r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
-                               DBA::escape($hash),
-                               intval(local_user())
-                       );
-                       if (DBA::isResult($r)) {
-                               $fsuggest_id = $contact['id'];
-                               q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d",
-                                       DBA::escape($note),
-                                       intval($fsuggest_id),
-                                       intval(local_user())
-                               );
-                               Worker::add(PRIORITY_HIGH, 'Notifier', 'suggest', $fsuggest_id);
-                       }
-
-                       info(L10n::t('Friend suggestion sent.') . EOL);
-               }
-       }
+       $fields = ['uid' => local_user(),'cid' => $contact_id, 'name' => $contact['name'],
+               'url' => $contact['url'], 'request' => $contact['request'],
+               'photo' => $contact['avatar'], 'note' => $note, 'created' => DateTimeFormat::utcNow()];
+       DBA::insert('fsuggest', $fields);
+
+       Worker::add(PRIORITY_HIGH, 'Notifier', 'suggest', DBA::lastInsertId());
+
+       info(L10n::t('Friend suggestion sent.') . EOL);
 }
 
 function fsuggest_content(App $a)
diff --git a/mod/newmember.php b/mod/newmember.php
deleted file mode 100644 (file)
index b1eda7a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * @file mod/newmember.php
- */
-use Friendica\App;
-use Friendica\Core\Config;
-use Friendica\Core\L10n;
-
-function newmember_content(App $a)
-{
-       $o = '<div class="generic-page-wrapper">';
-       $o .= '<h1>' . L10n::t('Welcome to Friendica') . '</h1>';
-       $o .= '<h3>' . L10n::t('New Member Checklist') . '</h3>';
-       $o .= '<div style="font-size: 120%;">';
-       $o .= L10n::t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
-       $o .= '<h4>' . L10n::t('Getting Started') . '</h4>';
-       $o .= '<ul>';
-       $o .= '<li> ' . '<a target="newmember" href="help/Quick-Start-guide">' . L10n::t('Friendica Walk-Through') . '</a><br />' . L10n::t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
-       $o .= '</ul>';
-       $o .= '<h4>' . L10n::t('Settings') . '</h4>';
-       $o .= '<ul>';
-       $o .= '<li>' . '<a target="newmember" href="settings">' . L10n::t('Go to Your Settings') . '</a><br />' . L10n::t('On your <em>Settings</em> page -  change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
-       $o .= '<li>' . L10n::t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
-       $o .= '</ul>';
-       $o .= '<h4>' . L10n::t('Profile') . '</h4>';
-       $o .= '<ul>';
-       $o .= '<li>' . '<a target="newmember" href="profile_photo">' . L10n::t('Upload Profile Photo') . '</a><br />' . L10n::t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
-       $o .= '<li>' . '<a target="newmember" href="profiles">' . L10n::t('Edit Your Profile') . '</a><br />' . L10n::t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
-       $o .= '<li>' . '<a target="newmember" href="profiles">' . L10n::t('Profile Keywords') . '</a><br />' . L10n::t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
-       $o .= '</ul>';
-       $o .= '<h4>' . L10n::t('Connecting') . '</h4>';
-       $o .= '<ul>';
-
-       $mail_disabled = ((function_exists('imap_open') && (!Config::get('system', 'imap_disabled'))) ? 0 : 1);
-
-       if (!$mail_disabled) {
-               $o .= '<li>' . '<a target="newmember" href="settings/connectors">' . L10n::t('Importing Emails') . '</a><br />' . L10n::t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
-       }
-
-       $o .= '<li>' . '<a target="newmember" href="contact">' . L10n::t('Go to Your Contacts Page') . '</a><br />' . L10n::t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
-       $o .= '<li>' . '<a target="newmember" href="directory">' . L10n::t("Go to Your Site's Directory") . '</a><br />' . L10n::t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
-       $o .= '<li>' . '<a target="newmember" href="contact">' . L10n::t('Finding New People') . '</a><br />' . L10n::t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
-       $o .= '</ul>';
-       $o .= '<h4>' . L10n::t('Groups') . '</h4>';
-       $o .= '<ul>';
-       $o .= '<li>' . '<a target="newmember" href="contact">' . L10n::t('Group Your Contacts') . '</a><br />' . L10n::t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
-
-       if (Config::get('system', 'newuser_private')) {
-               $o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . L10n::t("Why Aren't My Posts Public?") . '</a><br />' . L10n::t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
-       }
-
-       $o .= '</ul>';
-       $o .= '<h4>' . L10n::t('Getting Help') . '</h4>';
-       $o .= '<ul>';
-       $o .= '<li>' . '<a target="newmember" href="help">' . L10n::t('Go to the Help Section') . '</a><br />' . L10n::t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
-       $o .= '</ul>';
-       $o .= '</div>';
-       $o .= '</div>';
-
-       return $o;
-}
index db9beb6685fa8e712386ca830700a3983c75cfce..7c0ca1b7badc4465b7276052100ad6530a8db8cf 100644 (file)
@@ -61,7 +61,7 @@ function photos_init(App $a) {
 
                $account_type = Contact::getAccountType($profile);
 
-               $tpl = Renderer::getMarkupTemplate("vcard-widget.tpl");
+               $tpl = Renderer::getMarkupTemplate("widget/vcard.tpl");
 
                $vcard_widget = Renderer::replaceMacros($tpl, [
                        '$name' => $profile['name'],
diff --git a/mod/probe.php b/mod/probe.php
deleted file mode 100644 (file)
index 7fc3a92..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * @file mod/probe.php
- */
-use Friendica\App;
-use Friendica\Core\L10n;
-use Friendica\Core\System;
-use Friendica\Network\Probe;
-
-function probe_content(App $a)
-{
-       if (!local_user()) {
-               $e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t("Only logged in users are permitted to perform a probing."));
-               $e->httpdesc = L10n::t("Public access denied.");
-               throw $e;
-       }
-
-       $o = '<div class="generic-page-wrapper">';
-       $o .= '<h3>Probe Diagnostic</h3>';
-
-       $o .= '<form action="probe" method="get">';
-       $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . defaults($_GET, 'addr', '') . '" />';
-       $o .= '<input type="submit" name="submit" value="Submit" /></form>';
-
-       $o .= '<br /><br />';
-
-       if (!empty($_GET['addr'])) {
-               $addr = trim($_GET['addr']);
-               $res = Probe::uri($addr, "", 0, false);
-               $o .= '<pre>';
-               $o .= str_replace("\n", '<br />', print_r($res, true));
-               $o .= '</pre>';
-       }
-       $o .= '</div>';
-
-       return $o;
-}
index 728a71bb5d70495bd6810c2a143e77f71294b78d..3fb36a73e4d319e20b04d8d634c03e3e44cf4436 100644 (file)
@@ -49,7 +49,7 @@ function videos_init(App $a)
 
                $account_type = Contact::getAccountType($profile);
 
-               $tpl = Renderer::getMarkupTemplate("vcard-widget.tpl");
+               $tpl = Renderer::getMarkupTemplate("widget/vcard.tpl");
 
                $vcard_widget = Renderer::replaceMacros($tpl, [
                        '$name' => $profile['name'],
index 02072594cdd5ca51da1b40e3480ee1f3feddcb74..be81c143d1aa845c32f520573077b3fd7170b565 100644 (file)
@@ -92,7 +92,7 @@ class Router
                $this->routeCollector->addRoute(['GET'],         '/allfriends/{id:\d+}', Module\AllFriends::class);
                $this->routeCollector->addRoute(['GET'],         '/apps',                Module\Apps::class);
                $this->routeCollector->addRoute(['GET'],         '/attach/{item:\d+}',   Module\Attach::class);
-               $this->routeCollector->addRoute(['GET'],         '/babel',               Module\Babel::class);
+               $this->routeCollector->addRoute(['GET'],         '/babel',               Module\Debug\Babel::class);
                $this->routeCollector->addRoute(['GET'],         '/bookmarklet',         Module\Bookmarklet::class);
                $this->routeCollector->addGroup('/contact', function (RouteCollector $collector) {
                        $collector->addRoute(['GET'], '[/]',                                 Module\Contact::class);
@@ -105,7 +105,6 @@ class Router
                        $collector->addRoute(['GET'], '/{id:\d+}/posts',                     Module\Contact::class);
                        $collector->addRoute(['GET'], '/{id:\d+}/update',                    Module\Contact::class);
                        $collector->addRoute(['GET'], '/{id:\d+}/updateprofile',             Module\Contact::class);
-                       $collector->addRoute(['GET'], '/all',                                Module\Contact::class);
                        $collector->addRoute(['GET'], '/archived',                           Module\Contact::class);
                        $collector->addRoute(['GET', 'POST'], '/batch',                      Module\Contact::class);
                        $collector->addRoute(['GET'], '/blocked',                            Module\Contact::class);
@@ -122,7 +121,7 @@ class Router
                        $collector->addRoute(['GET'], '/{nickname}/replies',                 Module\Feed::class);
                        $collector->addRoute(['GET'], '/{nickname}/activity',                Module\Feed::class);
                });
-               $this->routeCollector->addRoute(['GET'],         '/feedtest',            Module\Feedtest::class);
+               $this->routeCollector->addRoute(['GET'],         '/feedtest',            Module\Debug\Feed::class);
                $this->routeCollector->addGroup('/fetch', function (RouteCollector $collector) {
                        $collector->addRoute(['GET'], '/{guid}/post',                        Module\Diaspora\Fetch::class);
                        $collector->addRoute(['GET'], '/{guid}/status_message',              Module\Diaspora\Fetch::class);
@@ -154,15 +153,15 @@ class Router
                        $collector->addRoute(['GET', 'POST'], '[/]',                         Module\Install::class);
                        $collector->addRoute(['GET'],         '/testrewrite',                Module\Install::class);
                });
-               $this->routeCollector->addRoute(['GET', 'POST'], '/itemsource[/{guid}]', Module\Itemsource::class);
                $this->routeCollector->addRoute(['GET'],         '/like/{item:\d+}',     Module\Like::class);
-               $this->routeCollector->addRoute(['GET', 'POST'], '/localtime',           Module\Localtime::class);
+               $this->routeCollector->addRoute(['GET', 'POST'], '/localtime',           Module\Debug\Localtime::class);
                $this->routeCollector->addRoute(['GET', 'POST'], '/login',               Module\Login::class);
                $this->routeCollector->addRoute(['GET', 'POST'], '/logout',              Module\Logout::class);
                $this->routeCollector->addRoute(['GET'],         '/magic',               Module\Magic::class);
                $this->routeCollector->addRoute(['GET'],         '/maintenance',         Module\Maintenance::class);
                $this->routeCollector->addRoute(['GET'],         '/manifest',            Module\Manifest::class);
                $this->routeCollector->addRoute(['GET'],         '/modexp/{nick}',       Module\PublicRSAKey::class);
+               $this->routeCollector->addRoute(['GET'],         '/newmember',           Module\Welcome::class);
                $this->routeCollector->addRoute(['GET'],         '/nodeinfo/1.0',        Module\NodeInfo::class);
                $this->routeCollector->addRoute(['GET'],         '/nogroup',             Module\Group::class);
                $this->routeCollector->addGroup('/notify', function (RouteCollector $collector) {
@@ -170,7 +169,6 @@ class Router
                        $collector->addRoute(['GET'], '/view/{id:\d+}',                      Module\Notifications\Notify::class);
                        $collector->addRoute(['GET'], '/mark/all',                           Module\Notifications\Notify::class);
                });
-               $this->routeCollector->addRoute(['GET'],         '/notice/{id:\d+}',     Module\GnuSocial\Notice::class);
                $this->routeCollector->addRoute(['GET'],         '/objects/{guid}',      Module\Objects::class);
                $this->routeCollector->addGroup('/oembed', function (RouteCollector $collector) {
                        $collector->addRoute(['GET'], '/b2h',                                Module\Oembed::class);
@@ -186,6 +184,7 @@ class Router
                        $collector->addRoute(['GET'], '/{type}/{customize}/{name}',          Module\Photo::class);
                });
                $this->routeCollector->addRoute(['GET'],         '/pretheme',            Module\ThemeDetails::class);
+               $this->routeCollector->addRoute(['GET'],         '/probe',               Module\Debug\Probe::class);
                $this->routeCollector->addGroup('/profile', function (RouteCollector $collector) {
                        $collector->addRoute(['GET'], '/{nickname}',                         Module\Profile::class);
                        $collector->addRoute(['GET'], '/{profile:\d+}/view',                 Module\Profile::class);
@@ -214,8 +213,8 @@ class Router
                $this->routeCollector->addRoute(['GET'],         '/toggle_mobile',       Module\ToggleMobile::class);
                $this->routeCollector->addRoute(['GET'],         '/tos',                 Module\Tos::class);
                $this->routeCollector->addRoute(['GET'],         '/view/theme/{theme}/style.pcss',  Module\Theme::class);
-               $this->routeCollector->addRoute(['GET'],         '/viewsrc/{item:\d+}',  Module\ItemBody::class);
-               $this->routeCollector->addRoute(['GET'],         '/webfinger',           Module\WebFinger::class);
+               $this->routeCollector->addRoute(['GET'],         '/viewsrc/{item:\d+}',  Module\Debug\ItemBody::class);
+               $this->routeCollector->addRoute(['GET'],         '/webfinger',           Module\Debug\WebFinger::class);
                $this->routeCollector->addRoute(['GET'],         '/xrd',                 Module\Xrd::class);
        }
 
index b7fa5ab4e8903f1e42c3e8a5e67405206acea80b..b5f83a803e1e12ccdab0af78c0f7ef0dd4d3feaf 100644 (file)
@@ -31,7 +31,7 @@ class Widget
         */
        public static function follow($value = "")
        {
-               return Renderer::replaceMacros(Renderer::getMarkupTemplate('follow.tpl'), array(
+               return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/follow.tpl'), array(
                        '$connect' => L10n::t('Add New Contact'),
                        '$desc' => L10n::t('Enter address or web location'),
                        '$hint' => L10n::t('Example: bob@example.com, http://example.com/barbara'),
@@ -74,7 +74,7 @@ class Widget
                $aside = [];
                $aside['$nv'] = $nv;
 
-               return Renderer::replaceMacros(Renderer::getMarkupTemplate('peoplefind.tpl'), $aside);
+               return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/peoplefind.tpl'), $aside);
        }
 
        /**
@@ -120,6 +120,46 @@ class Widget
                return $network_filter;
        }
 
+       /**
+        * @param string $type
+        * @param string $title
+        * @param string $desc
+        * @param string $all
+        * @param string $baseUrl
+        * @param array  $options
+        * @param string $selected
+        * @return string
+        * @throws \Exception
+        */
+       public static function filter($type, $title, $desc, $all, $baseUrl, array $options, $selected = null)
+       {
+               $queryString = parse_url($baseUrl, PHP_URL_QUERY);
+               $queryArray = [];
+
+               if ($queryString) {
+                       parse_str($queryString, $queryArray);
+                       unset($queryArray[$type]);
+
+                       if (count($queryArray)) {
+                               $baseUrl = substr($baseUrl, 0, strpos($baseUrl, '?')) . '?' . http_build_query($queryArray) . '&';
+                       } else {
+                               $baseUrl = substr($baseUrl, 0, strpos($baseUrl, '?')) . '?';
+                       }
+               } else {
+                       $baseUrl = trim($baseUrl, '?') . '?';
+               }
+
+               return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/filter.tpl'), [
+                       '$type'      => $type,
+                       '$title'     => $title,
+                       '$desc'      => $desc,
+                       '$selected'  => $selected,
+                       '$all_label' => $all,
+                       '$options'   => $options,
+                       '$base'      => $baseUrl,
+               ]);
+       }
+
        /**
         * Return networks widget
         *
@@ -146,7 +186,7 @@ class Widget
 
                $nets = array();
                while ($rr = DBA::fetch($r)) {
-                       $nets[] = array('ref' => $rr['network'], 'name' => ContactSelector::networkToName($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
+                       $nets[] = ['ref' => $rr['network'], 'name' => ContactSelector::networkToName($rr['network'])];
                }
                DBA::close($r);
 
@@ -154,14 +194,15 @@ class Widget
                        return '';
                }
 
-               return Renderer::replaceMacros(Renderer::getMarkupTemplate('nets.tpl'), array(
-                       '$title' => L10n::t('Protocols'),
-                       '$desc' => '',
-                       '$sel_all' => (($selected == '') ? 'selected' : ''),
-                       '$all' => L10n::t('All Protocols'),
-                       '$nets' => $nets,
-                       '$base' => $baseurl,
-               ));
+               return self::filter(
+                       'nets',
+                       L10n::t('Protocols'),
+                       '',
+                       L10n::t('All Protocols'),
+                       $baseurl,
+                       $nets,
+                       $selected
+               );
        }
 
        /**
@@ -183,25 +224,26 @@ class Widget
                        return;
                }
 
-               $matches = false;
+               $matches = [];
                $terms = array();
                $cnt = preg_match_all('/\[(.*?)\]/', $saved, $matches, PREG_SET_ORDER);
                if ($cnt) {
                        foreach ($matches as $mtch)
                        {
                                $unescaped = XML::escape(FileTag::decode($mtch[1]));
-                               $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
+                               $terms[] = ['ref' => $unescaped, 'name' => $unescaped];
                        }
                }
 
-               return Renderer::replaceMacros(Renderer::getMarkupTemplate('fileas_widget.tpl'), array(
-                       '$title' => L10n::t('Saved Folders'),
-                       '$desc' => '',
-                       '$sel_all' => (($selected == '') ? 'selected' : ''),
-                       '$all' => L10n::t('Everything'),
-                       '$terms' => $terms,
-                       '$base' => $baseurl,
-               ));
+               return self::filter(
+                       'file',
+                       L10n::t('Saved Folders'),
+                       '',
+                       L10n::t('Everything'),
+                       $baseurl,
+                       $terms,
+                       $selected
+               );
        }
 
        /**
@@ -225,25 +267,26 @@ class Widget
                        return;
                }
 
-               $matches = false;
+               $matches = [];
                $terms = array();
                $cnt = preg_match_all('/<(.*?)>/', $saved, $matches, PREG_SET_ORDER);
 
                if ($cnt) {
                        foreach ($matches as $mtch) {
                                $unescaped = XML::escape(FileTag::decode($mtch[1]));
-                               $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
+                               $terms[] = ['ref' => $unescaped, 'name' => $unescaped];
                        }
                }
 
-               return Renderer::replaceMacros(Renderer::getMarkupTemplate('categories_widget.tpl'), array(
-                       '$title' => L10n::t('Categories'),
-                       '$desc' => '',
-                       '$sel_all' => (($selected == '') ? 'selected' : ''),
-                       '$all' => L10n::t('Everything'),
-                       '$terms' => $terms,
-                       '$base' => $baseurl,
-               ));
+               return self::filter(
+                       'category',
+                       L10n::t('Categories'),
+                       '',
+                       L10n::t('Everything'),
+                       $baseurl,
+                       $terms,
+                       $selected
+               );
        }
 
        /**
@@ -319,7 +362,7 @@ class Widget
                        $entries[] = $entry;
                }
 
-               $tpl = Renderer::getMarkupTemplate('remote_friends_common.tpl');
+               $tpl = Renderer::getMarkupTemplate('widget/remote_friends_common.tpl');
                return Renderer::replaceMacros($tpl, [
                        '$desc'     => L10n::tt("%d contact in common", "%d contacts in common", $t),
                        '$base'     => System::baseUrl(),
index 120af99d00f98e439924e4afc7b1e05fe5086772..84482f638b90e8a7be334712749ec5505e5b147a 100644 (file)
@@ -59,7 +59,7 @@ class CalendarExport
                // of the profile page it should be the personal /events page. So we can use $a->user.
                $user = defaults($a->data['user'], 'nickname', $a->user['nickname']);
 
-               $tpl = Renderer::getMarkupTemplate("events_aside.tpl");
+               $tpl = Renderer::getMarkupTemplate("widget/events.tpl");
                $return = Renderer::replaceMacros($tpl, [
                        '$etitle'      => L10n::t("Export"),
                        '$export_ical' => L10n::t("Export calendar as ical"),
index 6c77e7f3fd3119747050f983a7779384a55ecac0..f4fdea2fb4c3b6be90212defe83ddadf87d1e19d 100644 (file)
@@ -26,7 +26,7 @@ class ContactBlock
        /**
         * Get HTML for contact block
         *
-        * @template contact_block.tpl
+        * @template widget/contacts.tpl
         * @hook contact_block_end (contacts=>array, output=>string)
         * @return string
         */
@@ -102,7 +102,7 @@ class ContactBlock
                        DBA::close($contact_ids_stmt);
                }
 
-               $tpl = Renderer::getMarkupTemplate('contact_block.tpl');
+               $tpl = Renderer::getMarkupTemplate('widget/contacts.tpl');
                $o = Renderer::replaceMacros($tpl, [
                        '$contacts' => $contacts_title,
                        '$nickname' => $profile['nickname'],
index 8413eccd19c8d13e7a4e57414b7644d9d91ed0d1..bbf8c3885893dda75b4f1fb3e978295c838f19a6 100644 (file)
@@ -49,7 +49,7 @@ class TagCloud
                                $tags[] = $tag;
                        }
 
-                       $tpl = Renderer::getMarkupTemplate('tagblock_widget.tpl');
+                       $tpl = Renderer::getMarkupTemplate('widget/tagcloud.tpl');
                        $o = Renderer::replaceMacros($tpl, [
                                '$title' => L10n::t('Tags'),
                                '$tags' => $tags
diff --git a/src/Module/Babel.php b/src/Module/Babel.php
deleted file mode 100644 (file)
index 93bb310..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-<?php
-
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Content\Text;
-use Friendica\Core\L10n;
-use Friendica\Core\Renderer;
-use Friendica\Model\Item;
-
-/**
- * Translates input text into different formats (HTML, BBCode, Markdown)
- */
-class Babel extends BaseModule
-{
-       public static function content()
-       {
-               function visible_whitespace($s)
-               {
-                       $s = str_replace(' ', '&nbsp;', $s);
-
-                       return str_replace(["\r\n", "\n", "\r"], '<br />', $s);
-               }
-
-               $results = [];
-               if (!empty($_REQUEST['text'])) {
-                       switch (defaults($_REQUEST, 'type', 'bbcode')) {
-                               case 'bbcode':
-                                       $bbcode = trim($_REQUEST['text']);
-                                       $results[] = [
-                                               'title'   => L10n::t('Source input'),
-                                               'content' => visible_whitespace($bbcode)
-                                       ];
-
-                                       $plain = Text\BBCode::toPlaintext($bbcode, false);
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::toPlaintext'),
-                                               'content' => visible_whitespace($plain)
-                                       ];
-
-                                       $html = Text\BBCode::convert($bbcode);
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::convert (raw HTML)'),
-                                               'content' => visible_whitespace(htmlspecialchars($html))
-                                       ];
-
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::convert'),
-                                               'content' => $html
-                                       ];
-
-                                       $bbcode2 = Text\HTML::toBBCode($html);
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::convert => HTML::toBBCode'),
-                                               'content' => visible_whitespace($bbcode2)
-                                       ];
-
-                                       $markdown = Text\BBCode::toMarkdown($bbcode);
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown'),
-                                               'content' => visible_whitespace($markdown)
-                                       ];
-
-                                       $html2 = Text\Markdown::convert($markdown);
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown => Markdown::convert'),
-                                               'content' => $html2
-                                       ];
-
-                                       $bbcode3 = Text\Markdown::toBBCode($markdown);
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown => Markdown::toBBCode'),
-                                               'content' => visible_whitespace($bbcode3)
-                                       ];
-
-                                       $bbcode4 = Text\HTML::toBBCode($html2);
-                                       $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown =>  Markdown::convert => HTML::toBBCode'),
-                                               'content' => visible_whitespace($bbcode4)
-                                       ];
-
-                                       $item = [
-                                               'body' => $bbcode,
-                                               'tag'  => '',
-                                       ];
-
-                                       Item::setHashtags($item);
-                                       $results[] = [
-                                               'title'   => L10n::t('Item Body'),
-                                               'content' => visible_whitespace($item['body'])
-                                       ];
-                                       $results[] = [
-                                               'title'   => L10n::t('Item Tags'),
-                                               'content' => $item['tag']
-                                       ];
-                                       break;
-                               case 'markdown':
-                                       $markdown = trim($_REQUEST['text']);
-                                       $results[] = [
-                                               'title'   => L10n::t('Source input (Diaspora format)'),
-                                               'content' => '<pre>' . $markdown . '</pre>'
-                                       ];
-
-                                       $html = Text\Markdown::convert($markdown);
-                                       $results[] = [
-                                               'title'   => L10n::t('Markdown::convert (raw HTML)'),
-                                               'content' => visible_whitespace(htmlspecialchars($html))
-                                       ];
-
-                                       $results[] = [
-                                               'title'   => L10n::t('Markdown::convert'),
-                                               'content' => $html
-                                       ];
-
-                                       $bbcode = Text\Markdown::toBBCode($markdown);
-                                       $results[] = [
-                                               'title'   => L10n::t('Markdown::toBBCode'),
-                                               'content' => '<pre>' . $bbcode . '</pre>'
-                                       ];
-                                       break;
-                               case 'html' :
-                                       $html = trim($_REQUEST['text']);
-                                       $results[] = [
-                                               'title'   => L10n::t('Raw HTML input'),
-                                               'content' => htmlspecialchars($html)
-                                       ];
-
-                                       $results[] = [
-                                               'title'   => L10n::t('HTML Input'),
-                                               'content' => $html
-                                       ];
-
-                                       $bbcode = Text\HTML::toBBCode($html);
-                                       $results[] = [
-                                               'title'   => L10n::t('HTML::toBBCode'),
-                                               'content' => visible_whitespace($bbcode)
-                                       ];
-
-                                       $html2 = Text\BBCode::convert($bbcode);
-                                       $results[] = [
-                                               'title'   => L10n::t('HTML::toBBCode => BBCode::convert'),
-                                               'content' => $html2
-                                       ];
-
-                                       $results[] = [
-                                               'title'   => L10n::t('HTML::toBBCode => BBCode::convert (raw HTML)'),
-                                               'content' => htmlspecialchars($html2)
-                                       ];
-
-                                       $markdown = Text\HTML::toMarkdown($html);
-                                       $results[] = [
-                                               'title'   => L10n::t('HTML::toMarkdown'),
-                                               'content' => visible_whitespace($markdown)
-                                       ];
-
-                                       $text = Text\HTML::toPlaintext($html);
-                                       $results[] = [
-                                               'title'   => L10n::t('HTML::toPlaintext'),
-                                               'content' => '<pre>' . $text . '</pre>'
-                                       ];
-                       }
-               }
-
-               $tpl = Renderer::getMarkupTemplate('babel.tpl');
-               $o = Renderer::replaceMacros($tpl, [
-                       '$text'          => ['text', L10n::t('Source text'), defaults($_REQUEST, 'text', ''), ''],
-                       '$type_bbcode'   => ['type', L10n::t('BBCode'), 'bbcode', '', defaults($_REQUEST, 'type', 'bbcode') == 'bbcode'],
-                       '$type_markdown' => ['type', L10n::t('Markdown'), 'markdown', '', defaults($_REQUEST, 'type', 'bbcode') == 'markdown'],
-                       '$type_html'     => ['type', L10n::t('HTML'), 'html', '', defaults($_REQUEST, 'type', 'bbcode') == 'html'],
-                       '$results'       => $results
-               ]);
-
-               return $o;
-       }
-}
index b1c37e21ad0d922fc3f43da1cb3f8bc7a3f44e3c..4429573ab78ec120385ab83ef6a6ece9f2a88b9f 100644 (file)
@@ -18,6 +18,8 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Model;
+use Friendica\Network\HTTPException\BadRequestException;
+use Friendica\Network\HTTPException\NotFoundException;
 use Friendica\Network\Probe;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Proxy as ProxyUtils;
@@ -30,102 +32,6 @@ use Friendica\Util\Strings;
  */
 class Contact extends BaseModule
 {
-       public static function init()
-       {
-               $a = self::getApp();
-
-               if (!local_user()) {
-                       return;
-               }
-
-               $nets = defaults($_GET, 'nets', '');
-
-               if (empty($a->page['aside'])) {
-                       $a->page['aside'] = '';
-               }
-
-               $contact_id = null;
-               $contact = null;
-               // @TODO: Replace with parameter from router
-               if ($a->argc == 2 && intval($a->argv[1])
-                       || $a->argc == 3 && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])
-               ) {
-                       $contact_id = intval($a->argv[1]);
-                       $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'deleted' => false]);
-
-                       if (!DBA::isResult($contact)) {
-                               $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => 0, 'deleted' => false]);
-                       }
-
-                       // Don't display contacts that are about to be deleted
-                       if ($contact['network'] == Protocol::PHANTOM) {
-                               $contact = false;
-                       }
-               }
-
-               if (DBA::isResult($contact)) {
-                       if ($contact['self']) {
-                               // @TODO: Replace with parameter from router
-                               if (($a->argc == 3) && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])) {
-                                       $a->internalRedirect('profile/' . $contact['nick']);
-                               } else {
-                                       $a->internalRedirect('profile/' . $contact['nick'] . '?tab=profile');
-                               }
-                       }
-
-                       $a->data['contact'] = $contact;
-
-                       if (($contact['network'] != '') && ($contact['network'] != Protocol::DFRN)) {
-                               $network_link = Strings::formatNetworkName($contact['network'], $contact['url']);
-                       } else {
-                               $network_link = '';
-                       }
-
-                       $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate('vcard-widget.tpl'), [
-                               '$name'         => $contact['name'],
-                               '$photo'        => $contact['photo'],
-                               '$url'          => Model\Contact::MagicLink($contact['url']),
-                               '$addr'         => defaults($contact, 'addr', ''),
-                               '$network_link' => $network_link,
-                               '$network'      => L10n::t('Network:'),
-                               '$account_type' => Model\Contact::getAccountType($contact)
-                       ]);
-
-                       $findpeople_widget = '';
-                       $follow_widget = '';
-                       $networks_widget = '';
-               } else {
-                       $vcard_widget = '';
-                       $networks_widget = Widget::networks('contact', $nets);
-                       if (isset($_GET['add'])) {
-                               $follow_widget = Widget::follow($_GET['add']);
-                       } else {
-                               $follow_widget = Widget::follow();
-                       }
-
-                       $findpeople_widget = Widget::findPeople();
-               }
-
-               if ($contact['uid'] != 0) {
-                       $groups_widget = Model\Group::sidebarWidget('contact', 'group', 'full', 'everyone', $contact_id);
-               } else {
-                       $groups_widget = null;
-               }
-
-               $a->page['aside'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('contacts-widget-sidebar.tpl'), [
-                       '$vcard_widget'      => $vcard_widget,
-                       '$findpeople_widget' => $findpeople_widget,
-                       '$follow_widget'     => $follow_widget,
-                       '$groups_widget'     => $groups_widget,
-                       '$networks_widget'   => $networks_widget
-               ]);
-
-               $tpl = Renderer::getMarkupTemplate('contacts-head.tpl');
-               $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$baseurl' => $a->getBaseURL(true),
-               ]);
-       }
-
        private static function batchActions(App $a)
        {
                if (empty($_POST['contact_batch']) || !is_array($_POST['contact_batch'])) {
@@ -353,7 +259,93 @@ class Contact extends BaseModule
 
        public static function content($update = 0)
        {
+               if (!local_user()) {
+                       return Login::form($_SERVER['REQUET_URI']);
+               }
+
                $a = self::getApp();
+
+               $nets = defaults($_GET, 'nets', '');
+
+               if (empty($a->page['aside'])) {
+                       $a->page['aside'] = '';
+               }
+
+               $contact_id = null;
+               $contact = null;
+               // @TODO: Replace with parameter from router
+               if ($a->argc == 2 && intval($a->argv[1])
+                       || $a->argc == 3 && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])
+               ) {
+                       $contact_id = intval($a->argv[1]);
+                       $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'deleted' => false]);
+
+                       if (!DBA::isResult($contact)) {
+                               $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => 0, 'deleted' => false]);
+                       }
+
+                       // Don't display contacts that are about to be deleted
+                       if ($contact['network'] == Protocol::PHANTOM) {
+                               $contact = false;
+                       }
+               }
+
+               if (DBA::isResult($contact)) {
+                       if ($contact['self']) {
+                               // @TODO: Replace with parameter from router
+                               if (($a->argc == 3) && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])) {
+                                       $a->internalRedirect('profile/' . $contact['nick']);
+                               } else {
+                                       $a->internalRedirect('profile/' . $contact['nick'] . '?tab=profile');
+                               }
+                       }
+
+                       $a->data['contact'] = $contact;
+
+                       if (($contact['network'] != '') && ($contact['network'] != Protocol::DFRN)) {
+                               $network_link = Strings::formatNetworkName($contact['network'], $contact['url']);
+                       } else {
+                               $network_link = '';
+                       }
+
+                       $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [
+                               '$name'         => $contact['name'],
+                               '$photo'        => $contact['photo'],
+                               '$url'          => Model\Contact::magicLinkByContact($contact, $contact['url']),
+                               '$addr'         => defaults($contact, 'addr', ''),
+                               '$network_link' => $network_link,
+                               '$network'      => L10n::t('Network:'),
+                               '$account_type' => Model\Contact::getAccountType($contact)
+                       ]);
+
+                       $findpeople_widget = '';
+                       $follow_widget = '';
+                       $networks_widget = '';
+               } else {
+                       $vcard_widget = '';
+                       $findpeople_widget = Widget::findPeople();
+                       if (isset($_GET['add'])) {
+                               $follow_widget = Widget::follow($_GET['add']);
+                       } else {
+                               $follow_widget = Widget::follow();
+                       }
+
+                       $networks_widget = Widget::networks($_SERVER['REQUEST_URI'], $nets);
+               }
+
+               if ($contact['uid'] != 0) {
+                       $groups_widget = Model\Group::sidebarWidget('contact', 'group', 'full', 'everyone', $contact_id);
+               } else {
+                       $groups_widget = null;
+               }
+
+               $a->page['aside'] .= $vcard_widget . $findpeople_widget . $follow_widget . $groups_widget . $networks_widget;
+
+               $tpl = Renderer::getMarkupTemplate('contacts-head.tpl');
+               $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
+                       '$baseurl' => $a->getBaseURL(true),
+               ]);
+
                $sort_type = 0;
                $o = '';
                Nav::setSelected('contact');
@@ -366,7 +358,7 @@ class Contact extends BaseModule
                if ($a->argc == 3) {
                        $contact_id = intval($a->argv[1]);
                        if (!$contact_id) {
-                               return;
+                               throw new BadRequestException();
                        }
 
                        // @TODO: Replace with parameter from router
@@ -374,9 +366,7 @@ class Contact extends BaseModule
 
                        $orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false, 'deleted' => false]);
                        if (!DBA::isResult($orig_record)) {
-                               notice(L10n::t('Could not access contact record.') . EOL);
-                               $a->internalRedirect('contact');
-                               return; // NOTREACHED
+                               throw new NotFoundException(L10n::t('Contact not found'));
                        }
 
                        if ($cmd === 'update' && ($orig_record['uid'] != 0)) {
@@ -398,7 +388,7 @@ class Contact extends BaseModule
                                info(($blocked ? L10n::t('Contact has been blocked') : L10n::t('Contact has been unblocked')) . EOL);
 
                                $a->internalRedirect('contact/' . $contact_id);
-                               return; // NOTREACHED
+                               // NOTREACHED
                        }
 
                        if ($cmd === 'ignore') {
@@ -408,7 +398,7 @@ class Contact extends BaseModule
                                info(($ignored ? L10n::t('Contact has been ignored') : L10n::t('Contact has been unignored')) . EOL);
 
                                $a->internalRedirect('contact/' . $contact_id);
-                               return; // NOTREACHED
+                               // NOTREACHED
                        }
 
                        if ($cmd === 'archive' && ($orig_record['uid'] != 0)) {
@@ -419,7 +409,7 @@ class Contact extends BaseModule
                                }
 
                                $a->internalRedirect('contact/' . $contact_id);
-                               return; // NOTREACHED
+                               // NOTREACHED
                        }
 
                        if ($cmd === 'drop' && ($orig_record['uid'] != 0)) {
@@ -459,7 +449,7 @@ class Contact extends BaseModule
                                info(L10n::t('Contact has been removed.') . EOL);
 
                                $a->internalRedirect('contact');
-                               return; // NOTREACHED
+                               // NOTREACHED
                        }
                        if ($cmd === 'posts') {
                                return self::getPostsHTML($a, $contact_id);
@@ -664,30 +654,24 @@ class Contact extends BaseModule
                        return $arr['output'];
                }
 
-               $blocked = false;
-               $hidden = false;
-               $ignored = false;
-               $archived = false;
-               $all = false;
-
                // @TODO: Replace with parameter from router
-               if (($a->argc == 2) && ($a->argv[1] === 'all')) {
-                       $sql_extra = '';
-                       $all = true;
-               } elseif (($a->argc == 2) && ($a->argv[1] === 'blocked')) {
-                       $sql_extra = " AND `blocked` = 1 ";
-                       $blocked = true;
-               } elseif (($a->argc == 2) && ($a->argv[1] === 'hidden')) {
-                       $sql_extra = " AND `hidden` = 1 ";
-                       $hidden = true;
-               } elseif (($a->argc == 2) && ($a->argv[1] === 'ignored')) {
-                       $sql_extra = " AND `readonly` = 1 ";
-                       $ignored = true;
-               } elseif (($a->argc == 2) && ($a->argv[1] === 'archived')) {
-                       $sql_extra = " AND `archive` = 1 ";
-                       $archived = true;
-               } else {
-                       $sql_extra = " AND `blocked` = 0 ";
+               $type = defaults($a->argv, 1, '');
+
+               switch ($type) {
+                       case 'blocked':
+                               $sql_extra = " AND `blocked` = 1";
+                               break;
+                       case 'hidden':
+                               $sql_extra = " AND `hidden` = 1 AND `blocked` = 0";
+                               break;
+                       case 'ignored':
+                               $sql_extra = " AND `readonly` = 1 AND `blocked` = 0";
+                               break;
+                       case 'archived':
+                               $sql_extra = " AND `archive` = 1 AND `blocked` = 0";
+                               break;
+                       default:
+                               $sql_extra = " AND `blocked` = 0";
                }
 
                $sql_extra .= sprintf(" AND `network` != '%s' ", Protocol::PHANTOM);
@@ -696,34 +680,18 @@ class Contact extends BaseModule
                $nets   = Strings::escapeTags(trim(defaults($_GET, 'nets'  , '')));
 
                $tabs = [
-                       [
-                               'label' => L10n::t('Suggestions'),
-                               'url'   => 'suggest',
-                               'sel'   => '',
-                               'title' => L10n::t('Suggest potential friends'),
-                               'id'    => 'suggestions-tab',
-                               'accesskey' => 'g',
-                       ],
                        [
                                'label' => L10n::t('All Contacts'),
-                               'url'   => 'contact/all',
-                               'sel'   => ($all) ? 'active' : '',
+                               'url'   => 'contact',
+                               'sel'   => !$type ? 'active' : '',
                                'title' => L10n::t('Show all contacts'),
                                'id'    => 'showall-tab',
                                'accesskey' => 'l',
                        ],
-                       [
-                               'label' => L10n::t('Unblocked'),
-                               'url'   => 'contact',
-                               'sel'   => ((!$all) && (!$blocked) && (!$hidden) && (!$search) && (!$nets) && (!$ignored) && (!$archived)) ? 'active' : '',
-                               'title' => L10n::t('Only show unblocked contacts'),
-                               'id'    => 'showunblocked-tab',
-                               'accesskey' => 'o',
-                       ],
                        [
                                'label' => L10n::t('Blocked'),
                                'url'   => 'contact/blocked',
-                               'sel'   => ($blocked) ? 'active' : '',
+                               'sel'   => $type == 'blocked' ? 'active' : '',
                                'title' => L10n::t('Only show blocked contacts'),
                                'id'    => 'showblocked-tab',
                                'accesskey' => 'b',
@@ -731,7 +699,7 @@ class Contact extends BaseModule
                        [
                                'label' => L10n::t('Ignored'),
                                'url'   => 'contact/ignored',
-                               'sel'   => ($ignored) ? 'active' : '',
+                               'sel'   => $type == 'ignored' ? 'active' : '',
                                'title' => L10n::t('Only show ignored contacts'),
                                'id'    => 'showignored-tab',
                                'accesskey' => 'i',
@@ -739,7 +707,7 @@ class Contact extends BaseModule
                        [
                                'label' => L10n::t('Archived'),
                                'url'   => 'contact/archived',
-                               'sel'   => ($archived) ? 'active' : '',
+                               'sel'   => $type == 'archived' ? 'active' : '',
                                'title' => L10n::t('Only show archived contacts'),
                                'id'    => 'showarchived-tab',
                                'accesskey' => 'y',
@@ -747,7 +715,7 @@ class Contact extends BaseModule
                        [
                                'label' => L10n::t('Hidden'),
                                'url'   => 'contact/hidden',
-                               'sel'   => ($hidden) ? 'active' : '',
+                               'sel'   => $type == 'hidden' ? 'active' : '',
                                'title' => L10n::t('Only show hidden contacts'),
                                'id'    => 'showhidden-tab',
                                'accesskey' => 'h',
@@ -755,7 +723,7 @@ class Contact extends BaseModule
                        [
                                'label' => L10n::t('Groups'),
                                'url'   => 'group',
-                               'sel'   => ($hidden) ? 'active' : '',
+                               'sel'   => '',
                                'title' => L10n::t('Organize your contact groups'),
                                'id'    => 'contactgroups-tab',
                                'accesskey' => 'e',
@@ -809,9 +777,18 @@ class Contact extends BaseModule
                        }
                }
 
+               switch ($type) {
+                       case 'blocked':  $header .= ' - ' . L10n::t('Blocked'); break;
+                       case 'hidden':   $header .= ' - ' . L10n::t('Hidden'); break;
+                       case 'ignored':  $header .= ' - ' . L10n::t('Ignored'); break;
+                       case 'archived': $header .= ' - ' . L10n::t('Archived'); break;
+               }
+
+               $header .= $nets ? ' - ' . ContactSelector::networkToName($nets) : '';
+
                $tpl = Renderer::getMarkupTemplate('contacts-template.tpl');
                $o .= Renderer::replaceMacros($tpl, [
-                       '$header'     => L10n::t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
+                       '$header'     => $header,
                        '$tabs'       => $t,
                        '$total'      => $total,
                        '$search'     => $search_hdr,
diff --git a/src/Module/Debug/Babel.php b/src/Module/Debug/Babel.php
new file mode 100644 (file)
index 0000000..1ce1ac4
--- /dev/null
@@ -0,0 +1,176 @@
+<?php
+
+namespace Friendica\Module\Debug;
+
+use Friendica\BaseModule;
+use Friendica\Content\Text;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Model\Item;
+use Friendica\Util\XML;
+
+/**
+ * Translates input text into different formats (HTML, BBCode, Markdown)
+ */
+class Babel extends BaseModule
+{
+       public static function content()
+       {
+               function visible_whitespace($s)
+               {
+                       $s = str_replace(' ', '&nbsp;', $s);
+
+                       return str_replace(["\r\n", "\n", "\r"], '<br />', $s);
+               }
+
+               $results = [];
+               if (!empty($_REQUEST['text'])) {
+                       switch (defaults($_REQUEST, 'type', 'bbcode')) {
+                               case 'bbcode':
+                                       $bbcode = trim($_REQUEST['text']);
+                                       $results[] = [
+                                               'title'   => L10n::t('Source input'),
+                                               'content' => visible_whitespace($bbcode)
+                                       ];
+
+                                       $plain = Text\BBCode::toPlaintext($bbcode, false);
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::toPlaintext'),
+                                               'content' => visible_whitespace($plain)
+                                       ];
+
+                                       $html = Text\BBCode::convert($bbcode);
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::convert (raw HTML)'),
+                                               'content' => visible_whitespace(htmlspecialchars($html))
+                                       ];
+
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::convert'),
+                                               'content' => $html
+                                       ];
+
+                                       $bbcode2 = Text\HTML::toBBCode($html);
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::convert => HTML::toBBCode'),
+                                               'content' => visible_whitespace($bbcode2)
+                                       ];
+
+                                       $markdown = Text\BBCode::toMarkdown($bbcode);
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::toMarkdown'),
+                                               'content' => visible_whitespace($markdown)
+                                       ];
+
+                                       $html2 = Text\Markdown::convert($markdown);
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::toMarkdown => Markdown::convert'),
+                                               'content' => $html2
+                                       ];
+
+                                       $bbcode3 = Text\Markdown::toBBCode($markdown);
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::toMarkdown => Markdown::toBBCode'),
+                                               'content' => visible_whitespace($bbcode3)
+                                       ];
+
+                                       $bbcode4 = Text\HTML::toBBCode($html2);
+                                       $results[] = [
+                                               'title'   => L10n::t('BBCode::toMarkdown =>  Markdown::convert => HTML::toBBCode'),
+                                               'content' => visible_whitespace($bbcode4)
+                                       ];
+
+                                       $item = [
+                                               'body' => $bbcode,
+                                               'tag'  => '',
+                                       ];
+
+                                       Item::setHashtags($item);
+                                       $results[] = [
+                                               'title'   => L10n::t('Item Body'),
+                                               'content' => visible_whitespace($item['body'])
+                                       ];
+                                       $results[] = [
+                                               'title'   => L10n::t('Item Tags'),
+                                               'content' => $item['tag']
+                                       ];
+                                       break;
+                               case 'markdown':
+                                       $markdown = trim($_REQUEST['text']);
+                                       $results[] = [
+                                               'title'   => L10n::t('Source input (Diaspora format)'),
+                                               'content' => '<pre>' . htmlspecialchars($markdown) . '</pre>'
+                                       ];
+
+                                       $html = Text\Markdown::convert(html_entity_decode($markdown,ENT_COMPAT, 'UTF-8'));
+                                       $results[] = [
+                                               'title'   => L10n::t('Markdown::convert (raw HTML)'),
+                                               'content' => visible_whitespace(htmlspecialchars($html))
+                                       ];
+
+                                       $results[] = [
+                                               'title'   => L10n::t('Markdown::convert'),
+                                               'content' => $html
+                                       ];
+
+                                       $bbcode = Text\Markdown::toBBCode(XML::unescape($markdown));
+                                       $results[] = [
+                                               'title'   => L10n::t('Markdown::toBBCode'),
+                                               'content' => '<pre>' . $bbcode . '</pre>'
+                                       ];
+                                       break;
+                               case 'html' :
+                                       $html = trim($_REQUEST['text']);
+                                       $results[] = [
+                                               'title'   => L10n::t('Raw HTML input'),
+                                               'content' => htmlspecialchars($html)
+                                       ];
+
+                                       $results[] = [
+                                               'title'   => L10n::t('HTML Input'),
+                                               'content' => $html
+                                       ];
+
+                                       $bbcode = Text\HTML::toBBCode($html);
+                                       $results[] = [
+                                               'title'   => L10n::t('HTML::toBBCode'),
+                                               'content' => visible_whitespace($bbcode)
+                                       ];
+
+                                       $html2 = Text\BBCode::convert($bbcode);
+                                       $results[] = [
+                                               'title'   => L10n::t('HTML::toBBCode => BBCode::convert'),
+                                               'content' => $html2
+                                       ];
+
+                                       $results[] = [
+                                               'title'   => L10n::t('HTML::toBBCode => BBCode::convert (raw HTML)'),
+                                               'content' => htmlspecialchars($html2)
+                                       ];
+
+                                       $markdown = Text\HTML::toMarkdown($html);
+                                       $results[] = [
+                                               'title'   => L10n::t('HTML::toMarkdown'),
+                                               'content' => visible_whitespace($markdown)
+                                       ];
+
+                                       $text = Text\HTML::toPlaintext($html);
+                                       $results[] = [
+                                               'title'   => L10n::t('HTML::toPlaintext'),
+                                               'content' => '<pre>' . $text . '</pre>'
+                                       ];
+                       }
+               }
+
+               $tpl = Renderer::getMarkupTemplate('babel.tpl');
+               $o = Renderer::replaceMacros($tpl, [
+                       '$text'          => ['text', L10n::t('Source text'), defaults($_REQUEST, 'text', ''), ''],
+                       '$type_bbcode'   => ['type', L10n::t('BBCode'), 'bbcode', '', defaults($_REQUEST, 'type', 'bbcode') == 'bbcode'],
+                       '$type_markdown' => ['type', L10n::t('Markdown'), 'markdown', '', defaults($_REQUEST, 'type', 'bbcode') == 'markdown'],
+                       '$type_html'     => ['type', L10n::t('HTML'), 'html', '', defaults($_REQUEST, 'type', 'bbcode') == 'html'],
+                       '$results'       => $results
+               ]);
+
+               return $o;
+       }
+}
diff --git a/src/Module/Debug/Feed.php b/src/Module/Debug/Feed.php
new file mode 100644 (file)
index 0000000..a11df59
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+namespace Friendica\Module\Debug;
+
+use Friendica\BaseModule;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Model;
+use Friendica\Protocol;
+use Friendica\Util\Network;
+
+/**
+ * Tests a given feed of a contact
+ */
+class Feed extends BaseModule
+{
+       public static function init()
+       {
+               if (!local_user()) {
+                       info(L10n::t('You must be logged in to use this module'));
+                       self::getApp()->internalRedirect();
+               }
+       }
+
+       public static function content()
+       {
+               $result = [];
+               if (!empty($_REQUEST['url'])) {
+                       $url = $_REQUEST['url'];
+
+                       $importer = Model\User::getById(local_user());
+
+                       $contact_id = Model\Contact::getIdForURL($url, local_user(), true);
+                       $contact = Model\Contact::getById($contact_id);
+
+                       $xml = Network::fetchUrl($contact['poll']);
+
+                       $dummy = null;
+                       $import_result = Protocol\Feed::import($xml, $importer, $contact, $dummy, true);
+
+                       $result = [
+                               'input' => $xml,
+                               'output' => var_export($import_result, true),
+                       ];
+               }
+
+               $tpl = Renderer::getMarkupTemplate('feedtest.tpl');
+               return Renderer::replaceMacros($tpl, [
+                       '$url'    => ['url', L10n::t('Source URL'), defaults($_REQUEST, 'url', ''), ''],
+                       '$result' => $result
+               ]);
+       }
+}
diff --git a/src/Module/Debug/ItemBody.php b/src/Module/Debug/ItemBody.php
new file mode 100644 (file)
index 0000000..fead255
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+
+namespace Friendica\Module\Debug;
+
+use Friendica\BaseModule;
+use Friendica\Core\L10n;
+use Friendica\Model\Item;
+use Friendica\Network\HTTPException;
+
+/**
+ * Print the body of an Item
+ */
+class ItemBody extends BaseModule
+{
+       public static function content()
+       {
+               if (!local_user()) {
+                       throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));
+               }
+
+               $app = self::getApp();
+
+               // @TODO: Replace with parameter from router
+               $itemId = (($app->argc > 1) ? intval($app->argv[1]) : 0);
+
+               if (!$itemId) {
+                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
+               }
+
+               $item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $itemId]);
+
+               if (!empty($item)) {
+                       if ($app->isAjax()) {
+                               echo str_replace("\n", '<br />', $item['body']);
+                               exit();
+                       } else {
+                               return str_replace("\n", '<br />', $item['body']);
+                       }
+               } else {
+                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
+               }
+       }
+}
diff --git a/src/Module/Debug/Localtime.php b/src/Module/Debug/Localtime.php
new file mode 100644 (file)
index 0000000..36eaa17
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+
+namespace Friendica\Module\Debug;
+
+use Friendica\BaseModule;
+use Friendica\Core\Installer;
+use Friendica\Core\L10n;
+use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Temporal;
+
+class Localtime extends BaseModule
+{
+       public static function post()
+       {
+               $time = defaults($_REQUEST, 'time', 'now');
+
+               $bd_format = L10n::t('l F d, Y \@ g:i A');
+
+               if (!empty($_POST['timezone'])) {
+                       self::getApp()->data['mod-localtime'] = DateTimeFormat::convert($time, $_POST['timezone'], 'UTC', $bd_format);
+               }
+       }
+
+       public static function content()
+       {
+               $app = self::getApp();
+
+               $time = defaults($_REQUEST, 'time', 'now');
+
+               $output  = '<h3>' . L10n::t('Time Conversion') . '</h3>';
+               $output .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
+               $output .= '<p>' . L10n::t('UTC time: %s', $time) . '</p>';
+
+               if (!empty($_REQUEST['timezone'])) {
+                       $output .= '<p>' . L10n::t('Current timezone: %s', $_REQUEST['timezone']) . '</p>';
+               }
+
+               if (!empty($app->data['mod-localtime'])) {
+                       $output .= '<p>' . L10n::t('Converted localtime: %s', $app->data['mod-localtime']) . '</p>';
+               }
+
+               $output .= '<form action ="' . $app->getBaseURL() . '/localtime?f=&time=' . $time . '" method="post" >';
+               $output .= '<p>' . L10n::t('Please select your timezone:') . '</p>';
+               $output .= Temporal::getTimezoneSelect(defaults($_REQUEST, 'timezone', Installer::DEFAULT_TZ));
+               $output .= '<input type="submit" name="submit" value="' . L10n::t('Submit') . '" /></form>';
+
+               return $output;
+       }
+}
diff --git a/src/Module/Debug/Probe.php b/src/Module/Debug/Probe.php
new file mode 100644 (file)
index 0000000..f29f3b3
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+
+namespace Friendica\Module\Debug;
+
+use Friendica\BaseModule;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Network\HTTPException;
+use Friendica\Network\Probe as NetworkProbe;
+
+/**
+ * Fetch information (protocol endpoints and user information) about a given uri
+ */
+class Probe extends BaseModule
+{
+       public static function content()
+       {
+               if (!local_user()) {
+                       $e           = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));
+                       $e->httpdesc = L10n::t('Public access denied.');
+                       throw $e;
+               }
+
+               $addr = defaults($_GET, 'addr', '');
+               $res  = '';
+
+               if (!empty($addr)) {
+                       $res = NetworkProbe::uri($addr, '', 0, false);
+                       $res = print_r($res, true);
+               }
+
+               $tpl = Renderer::getMarkupTemplate('probe.tpl');
+               return Renderer::replaceMacros($tpl, [
+                       '$addr' => ['addr',
+                               L10n::t('Lookup address'),
+                               $addr,
+                               '',
+                               'required'
+                       ],
+                       '$res'  => $res,
+               ]);
+       }
+}
diff --git a/src/Module/Debug/WebFinger.php b/src/Module/Debug/WebFinger.php
new file mode 100644 (file)
index 0000000..2b0b9c5
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+namespace Friendica\Module\Debug;
+
+use Friendica\BaseModule;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Network\Probe;
+
+/**
+ * Web based module to perform webfinger probing
+ */
+class WebFinger extends BaseModule
+{
+       public static function content()
+       {
+               if (!local_user()) {
+                       $e           = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));
+                       $e->httpdesc = L10n::t('Public access denied.');
+                       throw $e;
+               }
+
+               $addr = defaults($_GET, 'addr', '');
+               $res  = '';
+
+               if (!empty($addr)) {
+                       $res = Probe::lrdd($addr);
+                       $res = print_r($res, true);
+               }
+
+               $tpl = Renderer::getMarkupTemplate('webfinger.tpl');
+               return Renderer::replaceMacros($tpl, [
+                       '$addr' => $addr,
+                       '$res'  => $res,
+               ]);
+       }
+}
diff --git a/src/Module/Feedtest.php b/src/Module/Feedtest.php
deleted file mode 100644 (file)
index 75cca52..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Core\L10n;
-use Friendica\Core\Renderer;
-use Friendica\Model;
-use Friendica\Protocol;
-use Friendica\Util\Network;
-
-/**
- * Tests a given feed of a contact
- */
-class Feedtest extends BaseModule
-{
-       public static function init()
-       {
-               if (!local_user()) {
-                       info(L10n::t('You must be logged in to use this module'));
-                       self::getApp()->internalRedirect();
-               }
-       }
-
-       public static function content()
-       {
-               $result = [];
-               if (!empty($_REQUEST['url'])) {
-                       $url = $_REQUEST['url'];
-
-                       $importer = Model\User::getById(local_user());
-
-                       $contact_id = Model\Contact::getIdForURL($url, local_user(), true);
-                       $contact = Model\Contact::getById($contact_id);
-
-                       $xml = Network::fetchUrl($contact['poll']);
-
-                       $dummy = null;
-                       $import_result = Protocol\Feed::import($xml, $importer, $contact, $dummy, true);
-
-                       $result = [
-                               'input' => $xml,
-                               'output' => var_export($import_result, true),
-                       ];
-               }
-
-               $tpl = Renderer::getMarkupTemplate('feedtest.tpl');
-               return Renderer::replaceMacros($tpl, [
-                       '$url'    => ['url', L10n::t('Source URL'), defaults($_REQUEST, 'url', ''), ''],
-                       '$result' => $result
-               ]);
-       }
-}
diff --git a/src/Module/GnuSocial/Notice.php b/src/Module/GnuSocial/Notice.php
deleted file mode 100644 (file)
index 88598ff..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-namespace Friendica\Module\GnuSocial;
-
-use Friendica\BaseModule;
-use Friendica\Core\L10n;
-use Friendica\Database\DBA;
-use Friendica\Network\HTTPException;
-
-/**
- * GNU Social -> friendica items permanent-url compatibility
- */
-class Notice extends BaseModule
-{
-       public static function content()
-       {
-               $a = self::getApp();
-
-               // @TODO: Replace with parameter from router
-               $id = ($a->argc > 1) ? $a->argv[1] : 0;
-
-               if (empty($id)) {
-                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
-               }
-
-               $item = DBA::selectFirst('item', ['guid'], ['id' => $id]);
-
-               if (empty($item )) {
-                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
-               } else {
-                       $a->internalRedirect('display/' . $item['guid']);
-               }
-       }
-}
diff --git a/src/Module/ItemBody.php b/src/Module/ItemBody.php
deleted file mode 100644 (file)
index ee50b52..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Core\L10n;
-use Friendica\Model\Item;
-use Friendica\Network\HTTPException;
-
-/**
- * Print the body of an Item
- */
-class ItemBody extends BaseModule
-{
-       public static function content()
-       {
-               if (!local_user()) {
-                       throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));
-               }
-
-               $app = self::getApp();
-
-               // @TODO: Replace with parameter from router
-               $itemId = (($app->argc > 1) ? intval($app->argv[1]) : 0);
-
-               if (!$itemId) {
-                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
-               }
-
-               $item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $itemId]);
-
-               if (!empty($item)) {
-                       if ($app->isAjax()) {
-                               echo str_replace("\n", '<br />', $item['body']);
-                               exit();
-                       } else {
-                               return str_replace("\n", '<br />', $item['body']);
-                       }
-               } else {
-                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
-               }
-       }
-}
diff --git a/src/Module/Itemsource.php b/src/Module/Itemsource.php
deleted file mode 100644 (file)
index d781db3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-namespace Friendica\Module;
-
-use Friendica\Core\L10n;
-use Friendica\Core\Renderer;
-use Friendica\Model;
-
-/**
- * @author Hypolite Petovan <mrpetovan@gmail.com>
- */
-class Itemsource extends \Friendica\BaseModule
-{
-       public static function content()
-       {
-               if (!is_site_admin()) {
-                       return;
-               }
-
-               $a = self::getApp();
-
-               // @TODO: Replace with parameter from router
-               if (!empty($a->argv[1])) {
-                       $guid = $a->argv[1];
-               }
-
-               $guid = defaults($_REQUEST['guid'], $guid);
-
-               $source = '';
-               $item_uri = '';
-               $item_id = '';
-               $terms = [];
-               if (!empty($guid)) {
-                       $item = Model\Item::selectFirst(['id', 'guid', 'uri'], ['guid' => $guid]);
-
-                       $conversation = Model\Conversation::getByItemUri($item['uri']);
-
-                       $item_id = $item['id'];
-                       $item_uri = $item['uri'];
-                       $source = $conversation['source'];
-                       $terms = Model\Term::tagArrayFromItemId($item['id'], [Model\Term::HASHTAG, Model\Term::MENTION, Model\Term::IMPLICIT_MENTION]);
-               }
-
-               $tpl = Renderer::getMarkupTemplate('debug/itemsource.tpl');
-               $o = Renderer::replaceMacros($tpl, [
-                       '$guid'          => ['guid', L10n::t('Item Guid'), $guid, ''],
-                       '$source'        => $source,
-                       '$item_uri'      => $item_uri,
-                       '$item_id'       => $item_id,
-                       '$terms'         => $terms,
-               ]);
-
-               return $o;
-       }
-}
diff --git a/src/Module/Localtime.php b/src/Module/Localtime.php
deleted file mode 100644 (file)
index d0b5408..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Core\Installer;
-use Friendica\Core\L10n;
-use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Temporal;
-
-class Localtime extends BaseModule
-{
-       public static function post()
-       {
-               $time = defaults($_REQUEST, 'time', 'now');
-
-               $bd_format = L10n::t('l F d, Y \@ g:i A');
-
-               if (!empty($_POST['timezone'])) {
-                       self::getApp()->data['mod-localtime'] = DateTimeFormat::convert($time, $_POST['timezone'], 'UTC', $bd_format);
-               }
-       }
-
-       public static function content()
-       {
-               $app = self::getApp();
-
-               $time = defaults($_REQUEST, 'time', 'now');
-
-               $output  = '<h3>' . L10n::t('Time Conversion') . '</h3>';
-               $output .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
-               $output .= '<p>' . L10n::t('UTC time: %s', $time) . '</p>';
-
-               if (!empty($_REQUEST['timezone'])) {
-                       $output .= '<p>' . L10n::t('Current timezone: %s', $_REQUEST['timezone']) . '</p>';
-               }
-
-               if (!empty($app->data['mod-localtime'])) {
-                       $output .= '<p>' . L10n::t('Converted localtime: %s', $app->data['mod-localtime']) . '</p>';
-               }
-
-               $output .= '<form action ="' . $app->getBaseURL() . '/localtime?f=&time=' . $time . '" method="post" >';
-               $output .= '<p>' . L10n::t('Please select your timezone:') . '</p>';
-               $output .= Temporal::getTimezoneSelect(defaults($_REQUEST, 'timezone', Installer::DEFAULT_TZ));
-               $output .= '<input type="submit" name="submit" value="' . L10n::t('Submit') . '" /></form>';
-
-               return $output;
-       }
-}
diff --git a/src/Module/WebFinger.php b/src/Module/WebFinger.php
deleted file mode 100644 (file)
index 0c1a692..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Core\L10n;
-use Friendica\Core\Renderer;
-use Friendica\Network\Probe;
-
-/**
- * Web based module to perform webfinger probing
- */
-class WebFinger extends BaseModule
-{
-       public static function content()
-       {
-               if (!local_user()) {
-                       $e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t("Only logged in users are permitted to perform a probing."));
-                       $e->httpdesc = L10n::t("Public access denied.");
-                       throw $e;
-               }
-
-               $app = self::getApp();
-
-               $addr = defaults($_GET, 'addr', '');
-               $res = '';
-
-               if (!empty($addr)) {
-                       $res = Probe::lrdd($addr);
-                       $res = print_r($res, true);
-               }
-
-               $tpl = Renderer::getMarkupTemplate('webfinger.tpl');
-               return Renderer::replaceMacros($tpl, [
-                       '$addr' => $addr,
-                       '$res'  => $res,
-               ]);
-       }
-}
diff --git a/src/Module/Welcome.php b/src/Module/Welcome.php
new file mode 100644 (file)
index 0000000..9e1eace
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+
+namespace Friendica\Module;
+
+use Friendica\BaseModule;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+
+/**
+ * Prints the welcome page for new users
+ */
+class Welcome extends BaseModule
+{
+       public static function content()
+       {
+               $config = self::getApp()->getConfig();
+
+               $mail_disabled   = ((function_exists('imap_open') &&
+                                    (!$config->get('system', 'imap_disabled'))));
+               $newuser_private = $config->get('system', 'newuser_private');
+
+               $tpl = Renderer::getMarkupTemplate('welcome.tpl');
+
+               return Renderer::replaceMacros($tpl, [
+                       '$welcome'     => L10n::t('Welcome to Friendica'),
+                       '$checklist'   => L10n::t('New Member Checklist'),
+                       '$description' => L10n::t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.'),
+
+                       '$started'         => L10n::t('Getting Started'),
+                       '$quickstart_link' => L10n::t('Friendica Walk-Through'),
+                       '$quickstart_txt'  => L10n::t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.'),
+
+                       '$settings'       => L10n::t('Settings'),
+                       '$settings_link'  => L10n::t('Go to Your Settings'),
+                       '$settings_txt'   => L10n::t('On your <em>Settings</em> page -  change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.'),
+                       '$settings_other' => L10n::t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.'),
+
+                       '$profile'                => L10n::t('Profile'),
+                       '$profile_photo_link'     => L10n::t('Upload Profile Photo'),
+                       '$profile_photo_txt'      => L10n::t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.'),
+                       '$profiles_link'          => L10n::t('Edit Your Profile'),
+                       '$profiles_txt'           => L10n::t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.'),
+                       '$profiles_keywords_link' => L10n::t('Profile Keywords'),
+                       '$profiles_keywords_txt'  => L10n::t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.'),
+
+                       '$connecting'       => L10n::t('Connecting'),
+                       '$mail_disabled'    => $mail_disabled,
+                       '$import_mail_link' => L10n::t('Importing Emails'),
+                       '$import_mail_txt'  => L10n::t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX'),
+                       '$contact_link'     => L10n::t('Go to Your Contacts Page'),
+                       '$contact_txt'      => L10n::t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.'),
+                       '$directory_link'   => L10n::t('Go to Your Site\'s Directory'),
+                       '$directory_txt'    => L10n::t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.'),
+                       '$finding_link'     => L10n::t('Finding New People'),
+                       '$finding_txt'      => L10n::t('On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.'),
+
+                       '$groups'             => L10n::t('Groups'),
+                       '$group_contact_link' => L10n::t('Group Your Contacts'),
+                       '$group_contact_txt'  => L10n::t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.'),
+                       '$newuser_private'    => $newuser_private,
+                       '$private_link'       => L10n::t('Why Aren\'t My Posts Public?'),
+                       '$private_txt'        => L10n::t('Friendica respects your privacy. By default, your posts will only show up to people you\'ve added as friends. For more information, see the help section from the link above.'),
+
+                       '$help'      => L10n::t('Getting Help'),
+                       '$help_link' => L10n::t('Go to the Help Section'),
+                       '$help_txt'  => L10n::t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.'),
+               ]);
+       }
+}
index e83732ffe2b57c219362995cee2b58136be3aa2a..f74b572949d3f140285cfdb5095ca9d9facbb38d 100644 (file)
@@ -1893,17 +1893,17 @@ class DFRN
         */
        private static function processSuggestion($xpath, $suggestion, $importer)
        {
-               Logger::log("Processing suggestions");
+               Logger::log('Processing suggestions');
 
                /// @TODO Rewrite this to one statement
                $suggest = [];
-               $suggest["uid"] = $importer["importer_uid"];
-               $suggest["cid"] = $importer["id"];
-               $suggest["url"] = $xpath->query("dfrn:url/text()", $suggestion)->item(0)->nodeValue;
-               $suggest["name"] = $xpath->query("dfrn:name/text()", $suggestion)->item(0)->nodeValue;
-               $suggest["photo"] = $xpath->query("dfrn:photo/text()", $suggestion)->item(0)->nodeValue;
-               $suggest["request"] = $xpath->query("dfrn:request/text()", $suggestion)->item(0)->nodeValue;
-               $suggest["body"] = $xpath->query("dfrn:note/text()", $suggestion)->item(0)->nodeValue;
+               $suggest['uid'] = $importer['importer_uid'];
+               $suggest['cid'] = $importer['id'];
+               $suggest['url'] = $xpath->query('dfrn:url/text()', $suggestion)->item(0)->nodeValue;
+               $suggest['name'] = $xpath->query('dfrn:name/text()', $suggestion)->item(0)->nodeValue;
+               $suggest['photo'] = $xpath->query('dfrn:photo/text()', $suggestion)->item(0)->nodeValue;
+               $suggest['request'] = $xpath->query('dfrn:request/text()', $suggestion)->item(0)->nodeValue;
+               $suggest['body'] = $xpath->query('dfrn:note/text()', $suggestion)->item(0)->nodeValue;
 
                // Does our member already have a friend matching this description?
 
@@ -1914,22 +1914,19 @@ class DFRN
                 *
                 * @see https://github.com/friendica/friendica/pull/3254#discussion_r107315246
                 */
-               $condition = ['name' => $suggest["name"], 'nurl' => Strings::normaliseLink($suggest["url"]),
-                       'uid' => $suggest["uid"]];
+               $condition = ['nurl' => Strings::normaliseLink($suggest['url']), 'uid' => $suggest['uid']];
                if (DBA::exists('contact', $condition)) {
                        return false;
                }
-
                // Do we already have an fcontact record for this person?
 
                $fid = 0;
-               $condition = ['url' => $suggest["url"], 'name' => $suggest["name"], 'request' => $suggest["request"]];
-               $fcontact = DBA::selectFirst('fcontact', ['id'], $condition);
+               $fcontact = DBA::selectFirst('fcontact', ['id'], ['url' => $suggest['url']]);
                if (DBA::isResult($fcontact)) {
-                       $fid = $fcontact["id"];
+                       $fid = $fcontact['id'];
 
                        // OK, we do. Do we already have an introduction for this person?
-                       if (DBA::exists('intro', ['uid' => $suggest["uid"], 'fid' => $fid])) {
+                       if (DBA::exists('intro', ['uid' => $suggest['uid'], 'fid' => $fid])) {
                                /*
                                 * The valid result means the friend we're about to send a friend
                                 * suggestion already has them in their contact, which means no further
@@ -1940,58 +1937,44 @@ class DFRN
                                return false;
                        }
                }
+
                if (!$fid) {
-                       $r = q(
-                               "INSERT INTO `fcontact` (`name`,`url`,`photo`,`request`) VALUES ('%s', '%s', '%s', '%s')",
-                               DBA::escape($suggest["name"]),
-                               DBA::escape($suggest["url"]),
-                               DBA::escape($suggest["photo"]),
-                               DBA::escape($suggest["request"])
-                       );
-                       $fid = $r[0]["id"];
+                       $fields = ['name' => $suggest['name'], 'url' => $suggest['url'],
+                               'photo' => $suggest['photo'], 'request' => $suggest['request']];
+                       DBA::insert('fcontact', $fields);
+                       $fid = DBA::lastInsertId();
                }
 
-               $condition = ['url' => $suggest["url"], 'name' => $suggest["name"], 'request' => $suggest["request"]];
-               $fcontact = DBA::selectFirst('fcontact', ['id'], $condition);
-
                /*
                 * If no record in fcontact is found, below INSERT statement will not
                 * link an introduction to it.
                 */
-               if (!DBA::isResult($fcontact)) {
+               if (empty($fid)) {
                        // Database record did not get created. Quietly give up.
                        exit();
                }
 
                $hash = Strings::getRandomHex();
 
-               q(
-                       "INSERT INTO `intro` (`uid`, `fid`, `contact-id`, `note`, `hash`, `datetime`, `blocked`)
-                       VALUES(%d, %d, %d, '%s', '%s', '%s', %d)",
-                       intval($suggest["uid"]),
-                       intval($fid),
-                       intval($suggest["cid"]),
-                       DBA::escape($suggest["body"]),
-                       DBA::escape($hash),
-                       DBA::escape(DateTimeFormat::utcNow()),
-                       intval(0)
-               );
+               $fields = ['uid' => $suggest['uid'], 'fid' => $fid, 'contact-id' => $suggest['cid'],
+                       'note' => $suggest['body'], 'hash' => $hash, 'datetime' => DateTimeFormat::utcNow(), 'blocked' => false];
+               DBA::insert('intro', $fields);
 
                notification(
                        [
-                               "type"         => NOTIFY_SUGGEST,
-                               "notify_flags" => $importer["notify-flags"],
-                               "language"     => $importer["language"],
-                               "to_name"      => $importer["username"],
-                               "to_email"     => $importer["email"],
-                               "uid"          => $importer["importer_uid"],
-                               "item"         => $suggest,
-                               "link"         => System::baseUrl()."/notifications/intros",
-                               "source_name"  => $importer["name"],
-                               "source_link"  => $importer["url"],
-                               "source_photo" => $importer["photo"],
-                               "verb"         => ACTIVITY_REQ_FRIEND,
-                               "otype"        => "intro"]
+                               'type'         => NOTIFY_SUGGEST,
+                               'notify_flags' => $importer['notify-flags'],
+                               'language'     => $importer['language'],
+                               'to_name'      => $importer['username'],
+                               'to_email'     => $importer['email'],
+                               'uid'          => $importer['importer_uid'],
+                               'item'         => $suggest,
+                               'link'         => System::baseUrl().'/notifications/intros',
+                               'source_name'  => $importer['name'],
+                               'source_link'  => $importer['url'],
+                               'source_photo' => $importer['photo'],
+                               'verb'         => ACTIVITY_REQ_FRIEND,
+                               'otype'        => 'intro']
                );
 
                return true;
index b2b710d96f2c59ca86e9a545bb342b88849868d7..3f8990d6c124ee268b0de9b10becd1e35adba9d5 100644 (file)
@@ -355,25 +355,25 @@ class Strings
         */
        public static function autoLinkRegEx()
        {
-               return '@(?xi)
+               return '@
 (?<![=\'\]"/])          # Not preceded by [, =, \', ], ", /
 \b
 (                              # Capture 1: entire matched URL
   https?://                            # http or https protocol
   (?:
-    [^/\s`!()\[\]{};:\'",<>?«»“”‘’.]    # Domain can\'t start with a . 
-    [^/\s`!()\[\]{};:\'",<>?«»“”‘’]+    # Domain can\'t end with a .
+    [^/\s\xA0`!()\[\]{};:\'",<>?«»“”‘’.]    # Domain can\'t start with a . 
+    [^/\s\xA0`!()\[\]{};:\'",<>?«»“”‘’]+    # Domain can\'t end with a .
     \.
-    [^/\s`!()\[\]{};:\'".,<>?«»“”‘’]+/? # Followed by a slash
+    [^/\s\xA0`!()\[\]{};:\'".,<>?«»“”‘’]+/? # Followed by a slash
   )
   (?:                                  # One or more:
-    [^\s()<>]+                         # Run of non-space, non-()<>
+    [^\s\xA0()<>]+                         # Run of non-space, non-()<>
     |                                  #   or
-    \(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels
+    \(([^\s\xA0()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels
     |                                  #   or
-    [^\s`!()\[\]{};:\'".,<>?«»“”‘’]    # not a space or one of these punct chars
+    [^\s\xA0`!()\[\]{};:\'".,<>?«»“”‘’]    # not a space or one of these punct chars
   )*
-)@';
+)@xiu';
        }
 
        /**
index 3159fb95e9d1add80e8e7f3223b150587af6fa4c..476ecb4b00e7f964325e647472afd8b6bcf345c6 100644 (file)
@@ -471,7 +471,7 @@ class XML
         */
        public static function escape($str)
        {
-               $buffer = htmlentities($str, ENT_QUOTES, 'UTF-8');
+               $buffer = htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
                $buffer = trim($buffer);
 
                return $buffer;
@@ -485,7 +485,7 @@ class XML
         */
        public static function unescape($s)
        {
-               $ret = html_entity_decode($s, ENT_QUOTES);
+               $ret = htmlspecialchars_decode($s, ENT_QUOTES);
                return $ret;
        }
 
index 921662a11542c9ecab671686ab25142ebc45b432..904e9904efed4830dbadc9db151759549596cd7d 100644 (file)
@@ -319,7 +319,7 @@ class Delivery extends BaseObject
                        $deliver_status = DFRN::deliver($owner, $contact, $atom, false, true);
                }
 
-               Logger::log('Delivery to ' . $contact['url'] . ' with guid ' . defaults($target_item, 'guid', $target_item['id']) . ' returns ' . $deliver_status);
+               Logger::info('DFRN Delivery', ['cmd' => $cmd, 'url' => $contact['url'], 'guid' => defaults($target_item, 'guid', $target_item['id']), 'return' => $deliver_status]);
 
                if ($deliver_status < 0) {
                        Logger::info('Delivery failed: defer message', ['id' => defaults($target_item, 'guid', $target_item['id'])]);
index 802a90278b9ec33c1b2070033b2ed4539fd0a531..864a3794d31f67a9588bd281125b34f6e8c8e984 100644 (file)
@@ -109,6 +109,10 @@ class BBCodeTest extends MockedTest
                                'data' => "http://example.com<ul>",
                                'assertHTML' => false
                        ],
+                       'bug-7150' => [
+                               'data' => html_entity_decode('http://example.com&nbsp;', ENT_QUOTES, 'UTF-8'),
+                               'assertHTML' => false
+                       ],
                ];
        }
 
diff --git a/view/templates/categories_widget.tpl b/view/templates/categories_widget.tpl
deleted file mode 100644 (file)
index e3cf0fc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-<div id="categories-sidebar" class="widget">
-       <h3>{{$title}}</h3>
-       <div id="nets-desc">{{$desc nofilter}}</div>
-       
-       <ul class="categories-ul">
-               <li class="tool"><a href="{{$base}}" class="categories-link categories-all{{if $sel_all}} categories-selected{{/if}}">{{$all}}</a></li>
-               {{foreach $terms as $term}}
-                       <li class="tool"><a href="{{$base}}?f=&category={{$term.name}}" class="categories-link{{if $term.selected}} categories-selected{{/if}}">{{$term.name}}</a></li>
-               {{/foreach}}
-       </ul>
-       
-</div>
diff --git a/view/templates/contact_block.tpl b/view/templates/contact_block.tpl
deleted file mode 100644 (file)
index 49a0e43..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-<div id="contact-block">
-<h3 class="contact-block-h4">{{$contacts}}</h3>
-{{if $micropro}}
-               <a class="allcontact-link" href="viewcontacts/{{$nickname}}">{{$viewcontacts}}</a>
-               <div class='contact-block-content'>
-               {{foreach $micropro as $m}}
-                       {{$m nofilter}}
-               {{/foreach}}
-               </div>
-{{/if}}
-</div>
-<div class="clear"></div>
diff --git a/view/templates/contacts-widget-sidebar.tpl b/view/templates/contacts-widget-sidebar.tpl
deleted file mode 100644 (file)
index af578ac..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-{{$vcard_widget nofilter}}
-{{$findpeople_widget nofilter}}
-{{$follow_widget nofilter}}
-{{$groups_widget nofilter}}
-{{$networks_widget nofilter}}
-
diff --git a/view/templates/events_aside.tpl b/view/templates/events_aside.tpl
deleted file mode 100644 (file)
index e9b5477..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-<div id="sidebar-events" class="widget">
-       <h3>{{$etitle}}</h3>
-
-       <ul class="sidebar-calendar-export-ul">
-               <li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/ical" >{{$export_ical}}</a></li>
-               <li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/csv" >{{$export_csv}}</a></li>
-       </ul>
-</div>
diff --git a/view/templates/fileas_widget.tpl b/view/templates/fileas_widget.tpl
deleted file mode 100644 (file)
index a55c90b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-<div id="fileas-sidebar" class="widget">
-       <h3>{{$title}}</h3>
-       <div id="nets-desc">{{$desc nofilter}}</div>
-       
-       <ul class="fileas-ul">
-               <li class="tool"><a href="{{$base}}" class="fileas-link fileas-all{{if $sel_all}} fileas-selected{{/if}}">{{$all}}</a></li>
-               {{foreach $terms as $term}}
-                       <li class="tool"><a href="{{$base}}?f=&file={{$term.name}}" class="fileas-link{{if $term.selected}} fileas-selected{{/if}}">{{$term.name}}</a></li>
-               {{/foreach}}
-       </ul>
-       
-</div>
diff --git a/view/templates/follow.tpl b/view/templates/follow.tpl
deleted file mode 100644 (file)
index 12a5621..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-<div id="follow-sidebar" class="widget">
-       <h3>{{$connect}}</h3>
-       <div id="connect-desc">{{$desc nofilter}}</div>
-       <form action="follow" method="get" >
-               <input id="side-follow-url" type="text" name="url" value="{{$value}}" size="24" placeholder="{{$hint}}" title="{{$hint}}" /><input id="side-follow-submit" type="submit" name="submit" value="{{$follow}}" />
-       </form>
-</div>
-
diff --git a/view/templates/nets.tpl b/view/templates/nets.tpl
deleted file mode 100644 (file)
index 5ea602a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-<div id="nets-sidebar" class="widget">
-       <h3>{{$title}}</h3>
-       <div id="nets-desc">{{$desc nofilter}}</div>
-       <a href="{{$base}}" class="nets-link{{if $sel_all}} nets-selected{{/if}} nets-all">{{$all}}</a>
-       <ul role="menu" class="nets-ul">
-       {{foreach $nets as $net}}
-       <li role="menuitem" ><a href="{{$base}}?nets={{$net.ref}}" class="nets-link{{if $net.selected}} nets-selected{{/if}}">{{$net.name}}</a></li>
-       {{/foreach}}
-       </ul>
-</div>
diff --git a/view/templates/peoplefind.tpl b/view/templates/peoplefind.tpl
deleted file mode 100644 (file)
index d4d99c2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-<div id="peoplefind-sidebar" class="widget">
-       <h3>{{$nv.findpeople}}</h3>
-       <div id="peoplefind-desc">{{$nv.desc}}</div>
-       <form action="dirfind" method="get" />
-               <input id="side-peoplefind-url" type="text" name="search" size="24" title="{{$nv.hint}}" /><input id="side-peoplefind-submit" type="submit" name="submit" value="{{$nv.findthem}}" />
-       </form>
-       <div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
-       <div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
-       <div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
-       <div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
-       <div class="side-link" id="side-random-profile-link" ><a href="randprof" target="extlink" >{{$nv.random}}</a></div>
-       {{if $nv.inv}} 
-       <div class="side-link" id="side-invite-link" ><a href="invite" >{{$nv.inv}}</a></div>
-       {{/if}}
-</div>
-
diff --git a/view/templates/probe.tpl b/view/templates/probe.tpl
new file mode 100644 (file)
index 0000000..5f31cc5
--- /dev/null
@@ -0,0 +1,24 @@
+<div id="probe" class="generic-page-wrapper">
+       <h2>Probe Diagnostic</h2>
+       <form action="probe" method="get" class="panel panel-default">
+               <div class="panel-body">
+                       <div class="form-group">
+                               {{include file="field_input.tpl" field=$addr}}
+                       </div>
+                       <p><button type="submit" class="btn btn-primary">Submit</button></p>
+               </div>
+       </form>
+
+       {{if $res}}
+               <div class="probe-result">
+                       <div class="panel panel-default">
+                               <div class="panel-heading">
+                                       <h3 class="panel-title">Output</h3>
+                               </div>
+                               <div class="panel-body">
+                                       <pre>{{$res}}</pre>
+                               </div>
+                       </div>
+               </div>
+       {{/if}}
+</div>
diff --git a/view/templates/remote_friends_common.tpl b/view/templates/remote_friends_common.tpl
deleted file mode 100644 (file)
index 4ae682f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-<div id="remote-friends-in-common" class="bigwidget">
-       <div id="rfic-desc">{{$desc nofilter}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{if $linkmore}}<a href="{{$base}}/common/rem/{{$uid}}/{{$cid}}">{{$more}}</a>{{/if}}</div>
-       {{if $items}}
-       {{foreach $items as $item}}
-       <div class="profile-match-wrapper">
-               <div class="profile-match-photo">
-                       <a href="{{$item.url}}">
-                               <img src="{{$item.photo}}" width="80" height="80" alt="{{$item.name}}" title="{{$item.name}}" />
-                       </a>
-               </div>
-               <div class="profile-match-break"></div>
-               <div class="profile-match-name">
-                       <a href="{{$item.url}}" title="{{$item.name}}">{{$item.name}}</a>
-               </div>
-               <div class="profile-match-end"></div>
-       </div>
-       {{/foreach}}
-       {{/if}}
-       <div id="rfic-end" class="clear"></div>
-</div>
-
diff --git a/view/templates/tagblock_widget.tpl b/view/templates/tagblock_widget.tpl
deleted file mode 100644 (file)
index fd007c9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-<div class="tagblock widget">
-       <h3>{{$title}}</h3>
-
-       <div class="tag-cloud">
-               {{foreach $tags as $tag}}
-               <span class="tags">
-                       <span class="tag{{$tag.level}}">#</span><a href="{{$tag.url}}" class="tag{{$tag.level}}">{{$tag.name}}</a>
-               </span>
-               {{/foreach}}
-       </div>
-       <div class="tagblock-widget-end clear"></div>
-</div>
diff --git a/view/templates/vcard-widget.tpl b/view/templates/vcard-widget.tpl
deleted file mode 100644 (file)
index 2404664..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-<div class="vcard h-card">
-       <div class="fn p-name">{{$name}}</div>
-       {{if $addr}}<div class="p-addr">{{$addr}}</div>{{/if}}
-       {{if $pdesc}}<div class="title p-job-title">{{$pdesc}}</div>{{/if}}
-       {{if $url}}
-       <div id="profile-photo-wrapper"><a href="{{$url}}"><img class="vcard-photo photo u-photo" style="width: 175px; height: 175px;" src="{{$photo}}" alt="{{$name}}" /></a></div>
-       {{else}}
-       <div id="profile-photo-wrapper"><img class="vcard-photo photo u-photo" style="width: 175px; height: 175px;" src="{{$photo}}" alt="{{$name}}" /></div>
-       {{/if}}
-       {{if $account_type}}<div class="account-type">{{$account_type}}</div>{{/if}}
-       {{if $network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$network_link nofilter}}</dd></dl>{{/if}}
-       <div id="profile-vcard-break"></div>
-</div>
diff --git a/view/templates/welcome.tpl b/view/templates/welcome.tpl
new file mode 100644 (file)
index 0000000..9f343ef
--- /dev/null
@@ -0,0 +1,80 @@
+<div id="welcome" class="generic-page-wrapper">
+       <h1>{{$welcome nofilter}}</h1>
+       <h3>{{$checklist nofilter}}</h3>
+       <div style="font-size: 120%;">
+               {{$description nofilter}}
+               <h4>{{$started nofilter}}</h4>
+               <ul>
+                       <li>
+                               <a target="newmember" href="help/Quick-Start-guide">{{$quickstart_link}}</a><br />
+                               {{$quickstart_txt nofilter}}
+                       </li>
+               </ul>
+               <h4>{{$settings nofilter}}</h4>
+               <ul>
+                       <li>
+                               <a target="newmember" href="settings">{{$settings_link}}</a><br />
+                               {{$settings_txt nofilter}}
+                       </li>
+                       <li>
+                               {{$settings_other nofilter}}
+                       </ul>
+               <h4>{{$profile nofilter}}</h4>
+               <ul>
+                       <li>
+                               <a target="newmember" href="profile_photo">{{$profile_photo_link}}</a><br />
+                               {{$profile_photo_txt nofilter}}
+                       </li>
+                       <li>
+                               <a target="newmember" href="profiles">{{$profiles_link}}</a><br />
+                               {{$profiles_txt nofilter}}
+                       </li>
+                       <li>
+                               <a target="newmember" href="profiles">{{$profiles_keywords_link}}</a><br />
+                               {{$profiles_keywords_txt nofilter}}
+                       </li>
+               </ul>
+               <h4>{{$connecting nofilter}}</h4>
+               <ul>
+                       {{if $mail_disabled}}
+                       <li>
+                               <a target="newmember" href="settings/connectors">{{$import_mail_link}}</a><br />
+                               {{$import_mail_txt nofilter}}
+                       </li>
+                       {{/if}}
+                       <li>
+                               <a target="newmember" href="contact">{{$contact_link}}</a><br />
+                               {{$contact_txt nofilter}}
+                       </li>
+                       <li>
+                               <a target="newmember" href="directory">{{$directory_link}}</a><br />
+                               {{$directory_txt nofilter}}
+                       </li>
+                       <li>
+                               <a target="newmember" href="contact">{{$finding_link}}</a><br />
+                               {{$finding_txt nofilter}}
+                       </li>
+               </ul>
+               <h4>{{$groups nofilter}}</h4>
+               <ul>
+                       <li>
+                               <a target="newmember" href="contact">{{$group_contact_link}}</a><br />
+                               {{$group_contact_txt nofilter}}
+                       </li>
+
+                       {{if $newuser_private}}
+                       <li>
+                               <a target="newmember" href="help/Groups-and-Privacy">{{$private_link}}</a><br />
+                               {{$private_txt nofilter}}
+                       </li>
+                       {{/if}}
+               </ul>
+               <h4>{{$help}}</h4>
+               <ul>
+                       <li>
+                               <a target="newmember" href="help">{{$help_link}}</a><br />
+                               {{$help_txt nofilter}}
+                       </li>
+               </ul>
+       </div>
+</div>
diff --git a/view/templates/widget/contacts.tpl b/view/templates/widget/contacts.tpl
new file mode 100644 (file)
index 0000000..fa6e223
--- /dev/null
@@ -0,0 +1,13 @@
+
+<div id="contact-block">
+<h3 class="contact-block-h4">{{$contacts}}</h3>
+{{if $micropro}}
+               <a class="allcontact-link" href="profile/{{$nickname}}/contacts">{{$viewcontacts}}</a>
+               <div class='contact-block-content'>
+               {{foreach $micropro as $m}}
+                       {{$m nofilter}}
+               {{/foreach}}
+               </div>
+{{/if}}
+</div>
+<div class="clear"></div>
diff --git a/view/templates/widget/events.tpl b/view/templates/widget/events.tpl
new file mode 100644 (file)
index 0000000..e9b5477
--- /dev/null
@@ -0,0 +1,9 @@
+
+<div id="sidebar-events" class="widget">
+       <h3>{{$etitle}}</h3>
+
+       <ul class="sidebar-calendar-export-ul">
+               <li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/ical" >{{$export_ical}}</a></li>
+               <li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/csv" >{{$export_csv}}</a></li>
+       </ul>
+</div>
diff --git a/view/templates/widget/filter.tpl b/view/templates/widget/filter.tpl
new file mode 100644 (file)
index 0000000..bef4969
--- /dev/null
@@ -0,0 +1,11 @@
+
+<div id="{{$type}}-sidebar" class="widget">
+       <h3>{{$title}}</h3>
+       <div id="{{$type}}-desc">{{$desc nofilter}}</div>
+       <ul role="menu" class="{{$type}}-ul">
+               <li role="menuitem" {{if !$selected}}class="selected"{{/if}}><a href="{{$base}}" class="{{$type}}-link{{if !$selected}} {{$type}}-selected{{/if}} {{$type}}-all">{{$all_label}}</a></li>
+               {{foreach $options as $option}}
+                       <li role="menuitem" {{if $selected == $option.ref}}class="selected"{{/if}}><a href="{{$base}}{{$type}}={{$option.ref}}" class="{{$type}}-link{{if $selected == $option.ref}} {{$type}}-selected{{/if}}">{{$option.name}}</a></li>
+               {{/foreach}}
+       </ul>
+</div>
diff --git a/view/templates/widget/follow.tpl b/view/templates/widget/follow.tpl
new file mode 100644 (file)
index 0000000..12a5621
--- /dev/null
@@ -0,0 +1,9 @@
+
+<div id="follow-sidebar" class="widget">
+       <h3>{{$connect}}</h3>
+       <div id="connect-desc">{{$desc nofilter}}</div>
+       <form action="follow" method="get" >
+               <input id="side-follow-url" type="text" name="url" value="{{$value}}" size="24" placeholder="{{$hint}}" title="{{$hint}}" /><input id="side-follow-submit" type="submit" name="submit" value="{{$follow}}" />
+       </form>
+</div>
+
diff --git a/view/templates/widget/peoplefind.tpl b/view/templates/widget/peoplefind.tpl
new file mode 100644 (file)
index 0000000..d4d99c2
--- /dev/null
@@ -0,0 +1,17 @@
+
+<div id="peoplefind-sidebar" class="widget">
+       <h3>{{$nv.findpeople}}</h3>
+       <div id="peoplefind-desc">{{$nv.desc}}</div>
+       <form action="dirfind" method="get" />
+               <input id="side-peoplefind-url" type="text" name="search" size="24" title="{{$nv.hint}}" /><input id="side-peoplefind-submit" type="submit" name="submit" value="{{$nv.findthem}}" />
+       </form>
+       <div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
+       <div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
+       <div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
+       <div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
+       <div class="side-link" id="side-random-profile-link" ><a href="randprof" target="extlink" >{{$nv.random}}</a></div>
+       {{if $nv.inv}} 
+       <div class="side-link" id="side-invite-link" ><a href="invite" >{{$nv.inv}}</a></div>
+       {{/if}}
+</div>
+
diff --git a/view/templates/widget/remote_friends_common.tpl b/view/templates/widget/remote_friends_common.tpl
new file mode 100644 (file)
index 0000000..4ae682f
--- /dev/null
@@ -0,0 +1,22 @@
+
+<div id="remote-friends-in-common" class="bigwidget">
+       <div id="rfic-desc">{{$desc nofilter}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{if $linkmore}}<a href="{{$base}}/common/rem/{{$uid}}/{{$cid}}">{{$more}}</a>{{/if}}</div>
+       {{if $items}}
+       {{foreach $items as $item}}
+       <div class="profile-match-wrapper">
+               <div class="profile-match-photo">
+                       <a href="{{$item.url}}">
+                               <img src="{{$item.photo}}" width="80" height="80" alt="{{$item.name}}" title="{{$item.name}}" />
+                       </a>
+               </div>
+               <div class="profile-match-break"></div>
+               <div class="profile-match-name">
+                       <a href="{{$item.url}}" title="{{$item.name}}">{{$item.name}}</a>
+               </div>
+               <div class="profile-match-end"></div>
+       </div>
+       {{/foreach}}
+       {{/if}}
+       <div id="rfic-end" class="clear"></div>
+</div>
+
diff --git a/view/templates/widget/tagcloud.tpl b/view/templates/widget/tagcloud.tpl
new file mode 100644 (file)
index 0000000..fd007c9
--- /dev/null
@@ -0,0 +1,13 @@
+
+<div class="tagblock widget">
+       <h3>{{$title}}</h3>
+
+       <div class="tag-cloud">
+               {{foreach $tags as $tag}}
+               <span class="tags">
+                       <span class="tag{{$tag.level}}">#</span><a href="{{$tag.url}}" class="tag{{$tag.level}}">{{$tag.name}}</a>
+               </span>
+               {{/foreach}}
+       </div>
+       <div class="tagblock-widget-end clear"></div>
+</div>
diff --git a/view/templates/widget/vcard.tpl b/view/templates/widget/vcard.tpl
new file mode 100644 (file)
index 0000000..2404664
--- /dev/null
@@ -0,0 +1,14 @@
+
+<div class="vcard h-card">
+       <div class="fn p-name">{{$name}}</div>
+       {{if $addr}}<div class="p-addr">{{$addr}}</div>{{/if}}
+       {{if $pdesc}}<div class="title p-job-title">{{$pdesc}}</div>{{/if}}
+       {{if $url}}
+       <div id="profile-photo-wrapper"><a href="{{$url}}"><img class="vcard-photo photo u-photo" style="width: 175px; height: 175px;" src="{{$photo}}" alt="{{$name}}" /></a></div>
+       {{else}}
+       <div id="profile-photo-wrapper"><img class="vcard-photo photo u-photo" style="width: 175px; height: 175px;" src="{{$photo}}" alt="{{$name}}" /></div>
+       {{/if}}
+       {{if $account_type}}<div class="account-type">{{$account_type}}</div>{{/if}}
+       {{if $network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$network_link nofilter}}</dd></dl>{{/if}}
+       <div id="profile-vcard-break"></div>
+</div>
index 908574f7064565105179372217e93e3bce7dc3ee..3b6fa92e3b27d25849e8806550949613fc17be93 100644 (file)
@@ -153,7 +153,7 @@ input#acl-search {
   background:#2e2f2e;
 }
 
-.group-selected, .nets-selected, .fileas-selected, .categories-selected{
+.widget .selected, .group-selected {
   background:#2e2f2e;
 }
 
index 3b42cdd10b3e1522930a3b4a656737b57f33956c..c096ffa7dfcf1335fa5043b9bdbd5aa6d2eab4b3 100644 (file)
@@ -126,7 +126,7 @@ nav #site-location {
 
 }
 
-.contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo, .profile-jot-text, .group-selected, .nets-selected, .fileas-selected, #profile-jot-submit, .categories-selected {
+.contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo, .profile-jot-text, .group-selected, .widget .selected, #profile-jot-submit {
        border-radius: 3px;
        -moz-border-radius: 3px;
        box-shadow: 4px 4px 3px 0 #444444;
index 7cda87c1e47660f5fc9232f84e3f28a543db298c..f586d6e04d740fe705200e2364a8d25502bdc38e 100644 (file)
@@ -386,7 +386,7 @@ div.wall-item-content-wrapper.shiny {
        margin-bottom: 10px;
 }
 
-.group-selected, .nets-selected, .fileas-selected, .categories-selected, .forum-selected {
+.widget .selected, .group-selected, .forum-selected {
        padding: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
@@ -2124,11 +2124,11 @@ a.mail-list-link {
        list-style: none;
 }
 
-.nets-ul, .fileas-ul, .categories-ul, .datebrowse-ul {
+.nets-ul, .fileas-ul, .category-ul, .datebrowse-ul {
        list-style-type: none;
 }
 
-.nets-ul li, .fileas-ul li, .categories-ul li, .datebrowse-ul li {
+.nets-ul li, .fileas-ul li, .category-ul li, .datebrowse-ul li {
        margin-top: 10px;
 }
 
@@ -2139,11 +2139,11 @@ a.mail-list-link {
        margin-left: 42px;
 }
 
-.fileas-link, .categories-link {
+.fileas-link, .category-link {
        margin-left: 24px;
 }
 
-.fileas-all, .categories-all {
+.fileas-all, .category-all {
        margin-left: 0px;
 }
 
diff --git a/view/theme/frio/templates/contact_block.tpl b/view/theme/frio/templates/contact_block.tpl
deleted file mode 100644 (file)
index 0ae6479..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-
-<div id="contact-block">
-       <h3 class="contact-block-h4 pull-left">{{$contacts}}</h3>
-
-       {{if $micropro}}
-       <a class="pull-right widget-action faded-icon" id="contact-block-view-contacts" href="viewcontacts/{{$nickname}}">
-               <i class="fa fa-eye" aria-hidden="true"></i>
-               <span class="sr-only">{{$viewcontacts}}</span>
-       </a>
-
-       <div class='contact-block-content'>
-               {{foreach $micropro as $m}}
-                       {{$m nofilter}}
-               {{/foreach}}
-       </div>
-       {{/if}}
-</div>
-<div class="clear"></div>
diff --git a/view/theme/frio/templates/fileas_widget.tpl b/view/theme/frio/templates/fileas_widget.tpl
deleted file mode 100644 (file)
index b7d867e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-<div id="fileas-sidebar" class="widget">
-       <h3>{{$title}}</h3>
-       <div id="nets-desc">{{$desc nofilter}}</div>
-       
-       <ul class="fileas-ul">
-               <li class="tool{{if $sel_all}} selected{{/if}}"><a href="{{$base}}" class="fileas-link fileas-all{{if $sel_all}} fileas-selected{{/if}}">{{$all}}</a></li>
-               {{foreach $terms as $term}}
-                       <li class="tool{{if $term.selected}} selected{{/if}}"><a href="{{$base}}?f=&file={{$term.name}}" class="fileas-link{{if $term.selected}} fileas-selected{{/if}}">{{$term.name}}</a></li>
-               {{/foreach}}
-       </ul>
-       
-</div>
diff --git a/view/theme/frio/templates/follow.tpl b/view/theme/frio/templates/follow.tpl
deleted file mode 100644 (file)
index fadd0a6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-<div id="follow-sidebar" class="widget">
-       <h3>{{$connect}}</h3>
-
-       <form action="follow" method="get">
-               <label for="side-follow-url" id="connect-desc">{{$desc nofilter}}</label>
-               {{* The input field - For visual consistence we are using a search input field*}}
-               <div class="form-group form-group-search">
-                       <input id="side-follow-url" class="search-input form-control form-search" type="text" name="url" value="{{$value}}" placeholder="{{$hint}}" data-toggle="tooltip" title="{{$hint}}" />
-                       <button id="side-follow-submit" class="btn btn-default btn-sm form-button-search" type="submit">{{$follow}}</button>
-               </div>
-       </form>
-</div>
-
diff --git a/view/theme/frio/templates/nets.tpl b/view/theme/frio/templates/nets.tpl
deleted file mode 100644 (file)
index 8bc0c91..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-<div id="nets-sidebar" class="widget">
-       <h3>{{$title}}</h3>
-       <div id="nets-desc">{{$desc nofilter}}</div>
-       <ul role="menu" class="nets-ul">
-               <li role="menuitem" {{if $sel_all}}class="selected"{{/if}}><a href="{{$base}}" class="nets-link{{if $sel_all}} nets-selected{{/if}} nets-all">{{$all}}</a></li>
-               {{foreach $nets as $net}}
-               <li role="menuitem" {{if $net.selected}}class="selected"{{/if}}><a href="{{$base}}?nets={{$net.ref}}" class="nets-link{{if $net.selected}} nets-selected{{/if}}">{{$net.name}}</a></li>
-               {{/foreach}}
-       </ul>
-</div>
diff --git a/view/theme/frio/templates/peoplefind.tpl b/view/theme/frio/templates/peoplefind.tpl
deleted file mode 100644 (file)
index fc5d249..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="peoplefind-sidebar" class="widget">
-       <h3>{{$nv.findpeople}}</h3>
-
-       <form action="dirfind" method="get">
-               {{* The search field *}}
-               <label for="side-peoplefind-url" id="peoplefind-desc">{{$nv.desc}}</label>
-               <div class="form-group form-group-search">
-                       <input id="side-peoplefind-url" class="search-input form-control form-search" type="text" name="search" data-toggle="tooltip" title="{{$nv.hint}}" />
-                       <button id="side-peoplefind-submit" class="btn btn-default btn-sm form-button-search" type="submit">{{$nv.findthem}}</button>
-               </div>
-       </form>
-
-       {{* Directory links *}}
-       <div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
-       <div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
-       {{* Additional links *}}
-       <div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
-       <div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
-
-       {{if $nv.inv}} 
-       <div class="side-link" id="side-invite-link" ><button type="button" class="btn-link" onclick="addToModal('invite'); return false;">{{$nv.inv}}</button></div>
-       {{/if}}
-</div>
diff --git a/view/theme/frio/templates/vcard-widget.tpl b/view/theme/frio/templates/vcard-widget.tpl
deleted file mode 100644 (file)
index d1b4172..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<div class="vcard h-card widget">
-
-       <div id="profile-photo-wrapper">
-               {{if $url}}
-               <a href="{{$url}}"><img class="photo u-photo" src="{{$photo}}" alt="{{$name}}" /></a>
-               {{else}}
-               <img class="photo u-photo" src="{{$photo}}" alt="{{$name}}" />
-               {{/if}}
-       </div>
-
-       {{* The short information which will appended to the second navbar by scrollspy *}}
-       <div id="vcard-short-info-wrapper" style="display: none;">
-               <div id="vcard-short-info" class="media" style="display: none">
-                       <div id="vcard-short-photo-wrapper" class="pull-left">
-                               <img class="media-object" src="{{$photo}}" alt="{{$name}}" />
-                       </div>
-
-                       <div id="vcard-short-desc" class="media-body">
-                               <h4 class="media-heading">{{$name}}</h4>
-                               {{if $addr}}<div class="vcard-short-addr">{{$addr}}</div>{{/if}}
-                       </div>
-               </div>
-       </div>
-
-       <div class="panel-body">
-               <div class="profile-header">
-                       <h3 class="fn p-name">{{$name}}</h3>
-
-                       {{if $addr}}<div class="p-addr">{{$addr}}</div>{{/if}}
-
-                       {{if $account_type}}<div class="account-type">({{$account_type}})</div>{{/if}}
-
-                       {{if $pdesc}}<div class="title">{{$pdesc}}</div>{{/if}}
-
-                       {{if $network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$network_link nofilter}}</dd></dl>{{/if}}
-               </div>
-       </div>
-</div>
diff --git a/view/theme/frio/templates/widget/contacts.tpl b/view/theme/frio/templates/widget/contacts.tpl
new file mode 100644 (file)
index 0000000..e084381
--- /dev/null
@@ -0,0 +1,18 @@
+
+<div id="contact-block">
+       <h3 class="contact-block-h4 pull-left">{{$contacts}}</h3>
+
+{{if $micropro}}
+       <a class="pull-right widget-action faded-icon" id="contact-block-view-contacts" href="profile/{{$nickname}}/contacts">
+               <i class="fa fa-eye" aria-hidden="true"></i>
+               <span class="sr-only">{{$viewcontacts}}</span>
+       </a>
+
+       <div class='contact-block-content'>
+       {{foreach $micropro as $m}}
+               {{$m nofilter}}
+       {{/foreach}}
+       </div>
+{{/if}}
+</div>
+<div class="clear"></div>
diff --git a/view/theme/frio/templates/widget/follow.tpl b/view/theme/frio/templates/widget/follow.tpl
new file mode 100644 (file)
index 0000000..fadd0a6
--- /dev/null
@@ -0,0 +1,14 @@
+
+<div id="follow-sidebar" class="widget">
+       <h3>{{$connect}}</h3>
+
+       <form action="follow" method="get">
+               <label for="side-follow-url" id="connect-desc">{{$desc nofilter}}</label>
+               {{* The input field - For visual consistence we are using a search input field*}}
+               <div class="form-group form-group-search">
+                       <input id="side-follow-url" class="search-input form-control form-search" type="text" name="url" value="{{$value}}" placeholder="{{$hint}}" data-toggle="tooltip" title="{{$hint}}" />
+                       <button id="side-follow-submit" class="btn btn-default btn-sm form-button-search" type="submit">{{$follow}}</button>
+               </div>
+       </form>
+</div>
+
diff --git a/view/theme/frio/templates/widget/peoplefind.tpl b/view/theme/frio/templates/widget/peoplefind.tpl
new file mode 100644 (file)
index 0000000..fc5d249
--- /dev/null
@@ -0,0 +1,23 @@
+<div id="peoplefind-sidebar" class="widget">
+       <h3>{{$nv.findpeople}}</h3>
+
+       <form action="dirfind" method="get">
+               {{* The search field *}}
+               <label for="side-peoplefind-url" id="peoplefind-desc">{{$nv.desc}}</label>
+               <div class="form-group form-group-search">
+                       <input id="side-peoplefind-url" class="search-input form-control form-search" type="text" name="search" data-toggle="tooltip" title="{{$nv.hint}}" />
+                       <button id="side-peoplefind-submit" class="btn btn-default btn-sm form-button-search" type="submit">{{$nv.findthem}}</button>
+               </div>
+       </form>
+
+       {{* Directory links *}}
+       <div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
+       <div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
+       {{* Additional links *}}
+       <div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
+       <div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
+
+       {{if $nv.inv}} 
+       <div class="side-link" id="side-invite-link" ><button type="button" class="btn-link" onclick="addToModal('invite'); return false;">{{$nv.inv}}</button></div>
+       {{/if}}
+</div>
diff --git a/view/theme/frio/templates/widget/vcard.tpl b/view/theme/frio/templates/widget/vcard.tpl
new file mode 100644 (file)
index 0000000..d1b4172
--- /dev/null
@@ -0,0 +1,38 @@
+<div class="vcard h-card widget">
+
+       <div id="profile-photo-wrapper">
+               {{if $url}}
+               <a href="{{$url}}"><img class="photo u-photo" src="{{$photo}}" alt="{{$name}}" /></a>
+               {{else}}
+               <img class="photo u-photo" src="{{$photo}}" alt="{{$name}}" />
+               {{/if}}
+       </div>
+
+       {{* The short information which will appended to the second navbar by scrollspy *}}
+       <div id="vcard-short-info-wrapper" style="display: none;">
+               <div id="vcard-short-info" class="media" style="display: none">
+                       <div id="vcard-short-photo-wrapper" class="pull-left">
+                               <img class="media-object" src="{{$photo}}" alt="{{$name}}" />
+                       </div>
+
+                       <div id="vcard-short-desc" class="media-body">
+                               <h4 class="media-heading">{{$name}}</h4>
+                               {{if $addr}}<div class="vcard-short-addr">{{$addr}}</div>{{/if}}
+                       </div>
+               </div>
+       </div>
+
+       <div class="panel-body">
+               <div class="profile-header">
+                       <h3 class="fn p-name">{{$name}}</h3>
+
+                       {{if $addr}}<div class="p-addr">{{$addr}}</div>{{/if}}
+
+                       {{if $account_type}}<div class="account-type">({{$account_type}})</div>{{/if}}
+
+                       {{if $pdesc}}<div class="title">{{$pdesc}}</div>{{/if}}
+
+                       {{if $network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$network_link nofilter}}</dd></dl>{{/if}}
+               </div>
+       </div>
+</div>
diff --git a/view/theme/quattro/templates/fileas_widget.tpl b/view/theme/quattro/templates/fileas_widget.tpl
deleted file mode 100644 (file)
index 7946e8f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<div id="fileas-sidebar" class="widget">
-       <h3>{{$title}}</h3>
-       <div id="nets-desc">{{$desc nofilter}}</div>
-       
-       <ul class="fileas-ul">
-               <li class="tool {{if $sel_all}}selected{{/if}}"><a href="{{$base}}" class="fileas-link fileas-all">{{$all}}</a></li>
-               {{foreach $terms as $term}}
-                       <li class="tool {{if $term.selected}}selected{{/if}}"><a href="{{$base}}?f=&file={{$term.name}}" class="fileas-link">{{$term.name}}</a></li>
-               {{/foreach}}
-       </ul>
-       
-</div>
diff --git a/view/theme/quattro/templates/nets.tpl b/view/theme/quattro/templates/nets.tpl
deleted file mode 100644 (file)
index 2d488dc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<div id="nets-sidebar" class="widget">
-       <h3>{{$title}}</h3>
-       <div id="nets-desc">{{$desc nofilter}}</div>
-       
-       <ul class="nets-ul">
-               <li class="tool {{if $sel_all}}selected{{/if}}"><a href="{{$base}}" class="nets-link nets-all">{{$all}}</a>
-               {{foreach $nets as $net}}
-                       <li class="tool {{if $net.selected}}selected{{/if}}"><a href="{{$base}}?f=&nets={{$net.ref}}" class="nets-link">{{$net.name}}</a></li>
-               {{/foreach}}
-       </ul>
-       
-</div>
diff --git a/view/theme/quattro/templates/widget/filter.tpl b/view/theme/quattro/templates/widget/filter.tpl
new file mode 100644 (file)
index 0000000..8a44bec
--- /dev/null
@@ -0,0 +1,14 @@
+<div id="{{$type}}-sidebar" class="widget">
+       <h3>{{$title}}</h3>
+{{if $desc}}
+       <div id="{{$type}}-desc">{{$desc nofilter}}</div>
+{{/if}}
+       
+       <ul class="{{$type}}-ul">
+               <li class="tool {{if !$selected}}selected{{/if}}"><a href="{{$base}}" class="{{$type}}-link {{$type}}-all">{{$all_label}}</a>
+{{foreach $options as $option}}
+               <li class="tool {{if $selected == $option.ref}}selected{{/if}}"><a href="{{$base}}{{$type}}={{$option.ref}}" class="{{$type}}-link">{{$option.name}}</a></li>
+{{/foreach}}
+       </ul>
+       
+</div>
index 9866bc362a3b2b82d06db8bc67ccb4bfd912bd20..9bbf00c78030af7d751e570a2d0e933a3c6aec0f 100644 (file)
@@ -962,10 +962,9 @@ li.widget-list {
        top: 1px;
 }
 
-.group-selected,
-.nets-selected,
-.fileas-selected,
-.categories-selected {
+
+.widget .selected,
+.group-selected {
        padding-bottom: 0px;
        padding-left: 2px;
        padding-right: 2px;
@@ -1006,13 +1005,13 @@ ul .sidebar-group-li .icon {
        width: 12px;
 }
 
-.nets-ul, .fileas-ul, .categories-ul, .datebrowse-ul  {
+.nets-ul, .fileas-ul, .category-ul, .datebrowse-ul  {
        list-style-type: none;
 }
 
 .nets-ul li,
 .fileas-ul li,
-.categories-ul li,
+.category-ul li,
 .datebrowse-link {
 }
 
@@ -1029,12 +1028,12 @@ ul .sidebar-group-li .icon {
 }
 
 .fileas-link,
-.categories-link {
+.category-link {
        margin-left: 0px;
 }
 
 .fileas-all,
-.categories-all {
+.category-all {
        margin-left: 0px;
 }
 
@@ -4627,7 +4626,7 @@ hr.line-dots {
 
 #birthday-notice {}
 #nav-notifications-template {}
-#categories-sidebar {}
+#category-sidebar {}
 #nets-desc {}
 #status-tab {}
 #page-footer {}
diff --git a/view/theme/smoothly/templates/follow.tpl b/view/theme/smoothly/templates/follow.tpl
deleted file mode 100644 (file)
index 4d52485..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-<div id="follow-sidebar" class="widget">
-       <h3>{{$connect}}</h3>
-       <div id="connect-desc">{{$desc nofilter}}</div>
-       <form action="follow" method="post" >
-               <input id="side-follow-url" type="text-sidebar" name="url" size="24" title="{{$hint}}" /><input id="side-follow-submit" type="submit" name="submit" value="{{$follow}}" />
-       </form>
-</div>
-
diff --git a/view/theme/smoothly/templates/widget/follow.tpl b/view/theme/smoothly/templates/widget/follow.tpl
new file mode 100644 (file)
index 0000000..4d52485
--- /dev/null
@@ -0,0 +1,9 @@
+
+<div id="follow-sidebar" class="widget">
+       <h3>{{$connect}}</h3>
+       <div id="connect-desc">{{$desc nofilter}}</div>
+       <form action="follow" method="post" >
+               <input id="side-follow-url" type="text-sidebar" name="url" size="24" title="{{$hint}}" /><input id="side-follow-submit" type="submit" name="submit" value="{{$follow}}" />
+       </form>
+</div>
+
index eedbe09a45f149a412f83537341a4315a7b60f46..3dc9b4649134c807db9e98655692420b9801997a 100644 (file)
@@ -448,7 +448,7 @@ pre code {
        /* color: #000; */
 }
 
-.group-selected, .nets-selected, .fileas-selected, .forum-selected {
+.widget .selected, .forum-selected {
        font-weight: bold;
 }
 
index 618ba8e1e574838d7a30e474057c26e70104f4b7..94c8abcd7bbbed97f36eb973a117b897725bdc8a 100644 (file)
@@ -39,7 +39,7 @@
 {{/if}}
 
 {{if $nv}}
-{{include file='peoplefind.tpl' nv=$nv}}
+{{include file='widget/peoplefind.tpl' nv=$nv}}
 {{/if}}
 
 {{if $lastusers_title}}