]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/vier/theme.php
Misc cleanups (#5417)
[friendica.git] / view / theme / vier / theme.php
index 482c584be0095f34016be90a7d9712312a94ce92..bd7ccf0086255e7f2d8b500cf9897f9698ac2de5 100644 (file)
@@ -17,6 +17,7 @@ use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBM;
+use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Model\Profile;
 
@@ -28,7 +29,7 @@ function vier_init(App $a)
 
        $a->set_template_engine('smarty3');
 
-       if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] || $a->argv[0] === "network" && local_user()) {
+       if (!empty($a->argv[0]) && $a->argv[0] . defaults($a->argv, 1, '') === "profile".$a->user['nickname'] || $a->argv[0] === "network" && local_user()) {
                vier_community_info();
 
                $a->page['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";
@@ -103,7 +104,7 @@ EOT;
 
        // Hide the left menu bar
        /// @TODO maybe move this static array out where it should belong?
-       if (($a->page['aside'] == "") && in_array($a->argv[0], ["community", "events", "help", "manage", "notifications",
+       if (empty($a->page['aside']) && in_array($a->argv[0], ["community", "events", "help", "manage", "notifications",
                        "probe", "webfinger", "login", "invite", "credits"])) {
                $a->page['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />";
        }
@@ -138,7 +139,7 @@ function vier_community_info()
        $show_lastusers  = get_vier_config("show_lastusers", 1);
 
        // get_baseurl
-       $url = System::baseUrl($ssl_state);
+       $url = System::baseUrl();
        $aside['$url'] = $url;
 
        // comunity_profiles
@@ -153,7 +154,6 @@ function vier_community_info()
                        foreach ($r as $rr) {
                                $entry = replace_macros($tpl, [
                                        '$id' => $rr['id'],
-                                       //'$profile_link' => Profile::zrl($rr['url']),
                                        '$profile_link' => 'follow/?url='.urlencode($rr['url']),
                                        '$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
                                        '$alt_text' => $rr['name'],
@@ -196,25 +196,25 @@ function vier_community_info()
        //right_aside FIND FRIENDS
        if ($show_friends && local_user()) {
                $nv = [];
-               $nv['title'] = ["", L10n::t('Find Friends'), "", ""];
-               $nv['directory'] = ['directory', L10n::t('Local Directory'), "", ""];
-               $nv['global_directory'] = [get_server(), L10n::t('Global Directory'), "", ""];
-               $nv['match'] = ['match', L10n::t('Similar Interests'), "", ""];
-               $nv['suggest'] = ['suggest', L10n::t('Friend Suggestions'), "", ""];
-               $nv['invite'] = ['invite', L10n::t('Invite Friends'), "", ""];
-
-               $nv['search'] = '<form name="simple_bar" method="get" action="dirfind">
-                                               <span class="sbox_l"></span>
-                                               <span class="sbox">
-                                               <input type="text" name="search" size="13" maxlength="50">
-                                               </span>
-                                               <span class="sbox_r" id="srch_clear"></span>';
+               $nv['findpeople'] = L10n::t('Find People');
+               $nv['desc'] = L10n::t('Enter name or interest');
+               $nv['label'] = L10n::t('Connect/Follow');
+               $nv['hint'] = L10n::t('Examples: Robert Morgenstein, Fishing');
+               $nv['findthem'] = L10n::t('Find');
+               $nv['suggest'] = L10n::t('Friend Suggestions');
+               $nv['similar'] = L10n::t('Similar Interests');
+               $nv['random'] = L10n::t('Random Profile');
+               $nv['inv'] = L10n::t('Invite Friends');
+               $nv['directory'] = L10n::t('Global Directory');
+               $nv['global_dir'] = get_server();
+               $nv['local_directory'] = L10n::t('Local Directory');
 
                $aside['$nv'] = $nv;
        }
 
        //Community_Pages at right_aside
        if ($show_pages && local_user()) {
+               $cid = null;
                if (x($_GET, 'cid') && intval($_GET['cid']) != 0) {
                        $cid = $_GET['cid'];
                }
@@ -234,7 +234,7 @@ function vier_community_info()
 
                                $entry = [
                                        'url'          => 'network?f=&cid=' . $contact['id'],
-                                       'external_url' => 'redir/' . $contact['id'],
+                                       'external_url' => Contact::magicLink($contact['url']),
                                        'name'         => $contact['name'],
                                        'cid'          => $contact['id'],
                                        'selected'     => $selected,
@@ -247,7 +247,7 @@ function vier_community_info()
 
                        $tpl = get_markup_template('widget_forumlist_right.tpl');
 
-                       $page .= replace_macros(
+                       $page = replace_macros(
                                $tpl,
                                [
                                        '$title'          => L10n::t('Forums'),
@@ -285,7 +285,7 @@ function vier_community_info()
                }
 
                foreach ($r as $index => $helper) {
-                       $r[$index]["url"] = Profile::zrl($helper["url"]);
+                       $r[$index]["url"] = Contact::magicLink($helper["url"]);
                }
 
                $r[] = ["url" => "help/Quick-Start-guide", "name" => L10n::t("Quick Start")];