From 30d9547f29ce8e3320531efa4d55a185e6444e4e Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 18 Mar 2022 12:38:08 -0700 Subject: [PATCH] sites => communities --- Code/Lib/Apps.php | 1 + Code/Module/{Sites.php => Communities.php} | 6 +++--- Code/Widget/Findpeople.php | 2 +- Code/Widget/Site_projects.php | 9 +++------ app/{sites.apd => communities.apd} | 2 +- include/text.php | 5 ++--- view/pdl/{mod_sites.pdl => mod_communities.pdl} | 2 +- view/tpl/peoplefind.tpl | 2 +- view/tpl/site_projects.tpl | 2 +- 9 files changed, 14 insertions(+), 17 deletions(-) rename Code/Module/{Sites.php => Communities.php} (98%) rename app/{sites.apd => communities.apd} (71%) rename view/pdl/{mod_sites.pdl => mod_communities.pdl} (93%) diff --git a/Code/Lib/Apps.php b/Code/Lib/Apps.php index 9ef0bdcb4..2e6f40e86 100644 --- a/Code/Lib/Apps.php +++ b/Code/Lib/Apps.php @@ -358,6 +358,7 @@ class Apps 'Chatrooms' => t('Chatrooms'), 'Clients' => t('Clients'), 'Comment Control' => t('Comment Control'), + 'Communities' => t('Communities'), 'Connections' => t('Connections'), 'Content Filter' => t('Content Filter'), 'Content Import' => t('Content Import'), diff --git a/Code/Module/Sites.php b/Code/Module/Communities.php similarity index 98% rename from Code/Module/Sites.php rename to Code/Module/Communities.php index 5dbef9759..38612fb86 100644 --- a/Code/Module/Sites.php +++ b/Code/Module/Communities.php @@ -9,7 +9,7 @@ use Code\Web\Controller; use Code\Render\Theme; -class Sites extends Controller +class Communities extends Controller { public function get() @@ -125,7 +125,7 @@ class Sites extends Controller 'photo' => $logo, 'about' => bbcode($about), 'hash' => substr(hash('sha256', $rr['site_url']), 0, 16), - 'network_label' => t('Project'), + 'network_label' => t('Type'), 'network' => $rr['site_project'], 'version_label' => t('Version'), 'version' => $rr['site_version'], @@ -175,7 +175,7 @@ class Sites extends Controller } } $projects = array_keys($ret); - rsort($projects); + sort($projects); $newret = []; foreach ($projects as $p) { diff --git a/Code/Widget/Findpeople.php b/Code/Widget/Findpeople.php index 38e7e0f8f..d1be2b76e 100644 --- a/Code/Widget/Findpeople.php +++ b/Code/Widget/Findpeople.php @@ -37,7 +37,7 @@ class Findpeople '$suggest' => t('Channel Suggestions'), '$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'), '$random' => '', // t('Random Profile'), - '$sites' => t('Affiliated sites'), + '$sites' => t('Communities'), '$inv' => '', // t('Invite Friends'), '$advanced_search' => $advanced_search, '$advanced_hint' => "\r\n" . t('Advanced example: name=fred and country=iceland'), diff --git a/Code/Widget/Site_projects.php b/Code/Widget/Site_projects.php index ec80a9036..c30cda369 100644 --- a/Code/Widget/Site_projects.php +++ b/Code/Widget/Site_projects.php @@ -32,9 +32,9 @@ class Site_projects } $o = replace_macros(Theme::get_template('site_projects.tpl'), [ - '$title' => t('Projects'), + '$title' => t('Community Types'), '$desc' => '', - '$all' => t('All projects'), + '$all' => t('All community types'), 'base' => z_root() . '/sites', '$sel_all' => (($_REQUEST['project']) ? false : true), '$terms' => $results @@ -46,9 +46,6 @@ class Site_projects public static function site_sort($a, $b) { - if ($a['site_type'] === $b['site_type']) { - return strcasecmp($b['site_project'], $a['site_project']); - } - return (($a['site_type'] < $b['site_type']) ? -1 : 1); + return strcasecmp($a['site_project'], $b['site_project']); } } diff --git a/app/sites.apd b/app/communities.apd similarity index 71% rename from app/sites.apd rename to app/communities.apd index 31ceffb6c..4db8e1ca2 100644 --- a/app/sites.apd +++ b/app/communities.apd @@ -1,5 +1,5 @@ version: 1 -url: $baseurl/sites +url: $baseurl/communities name: Sites photo: icon:cloud categories: Networking diff --git a/include/text.php b/include/text.php index a7915e9eb..91c648737 100644 --- a/include/text.php +++ b/include/text.php @@ -1515,9 +1515,8 @@ function theme_attachments(&$item) $attaches = []; foreach ($arr as $r) { $label = EMPTY_STR; - if (isset($r['type']) && $r['type']) { - $icon = getIconFromType($r['type']); - } + $icon = getIconFromType(isset($r['type']) ? $r['type'] : 'application/octet-stream'); + if (isset($r['title']) && $r['title']) { $label = urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8')); } diff --git a/view/pdl/mod_sites.pdl b/view/pdl/mod_communities.pdl similarity index 93% rename from view/pdl/mod_sites.pdl rename to view/pdl/mod_communities.pdl index 34dc0e114..815465b6e 100644 --- a/view/pdl/mod_sites.pdl +++ b/view/pdl/mod_communities.pdl @@ -4,4 +4,4 @@ [region=right_aside] [widget=notifications][/widget] [widget=newmember][/widget] -[/region] +[/region] \ No newline at end of file diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl index 13c817de8..7b188f6a6 100755 --- a/view/tpl/peoplefind.tpl +++ b/view/tpl/peoplefind.tpl @@ -11,7 +11,7 @@ diff --git a/view/tpl/site_projects.tpl b/view/tpl/site_projects.tpl index ac7cdb5b0..611d157c1 100644 --- a/view/tpl/site_projects.tpl +++ b/view/tpl/site_projects.tpl @@ -5,7 +5,7 @@