aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2018-09-28 15:46:14 +0200
committerMax Kostikov <max@kostikov.co>2018-09-28 15:46:14 +0200
commit4a904fa3a8af1c101ede76657249fb7eb47faf60 (patch)
tree544509813fb68579ef2b556ce879a971d183269a /Zotlabs/Widget
parentf5f6ec3d71acb3e0488386819d5060e59331ec23 (diff)
parentc13d7e29ef9676b0f0e4ae23aa52e203f4ad8895 (diff)
downloadvolse-hubzilla-4a904fa3a8af1c101ede76657249fb7eb47faf60.tar.gz
volse-hubzilla-4a904fa3a8af1c101ede76657249fb7eb47faf60.tar.bz2
volse-hubzilla-4a904fa3a8af1c101ede76657249fb7eb47faf60.zip
Merge branch 'patch-29' into 'dev'
Patch 29 See merge request Kostikov/core!3
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r--Zotlabs/Widget/Activity_filter.php8
-rw-r--r--Zotlabs/Widget/Activity_order.php2
-rw-r--r--Zotlabs/Widget/Appstore.php6
-rw-r--r--Zotlabs/Widget/Categories.php13
-rw-r--r--Zotlabs/Widget/Cover_photo.php6
-rw-r--r--Zotlabs/Widget/Newmember.php9
-rw-r--r--Zotlabs/Widget/Notes.php14
-rw-r--r--Zotlabs/Widget/Settings_menu.php70
8 files changed, 46 insertions, 82 deletions
diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php
index fadf39144..c27a5d48b 100644
--- a/Zotlabs/Widget/Activity_filter.php
+++ b/Zotlabs/Widget/Activity_filter.php
@@ -2,6 +2,8 @@
namespace Zotlabs\Widget;
+use Zotlabs\Lib\Apps;
+
class Activity_filter {
function widget($arr) {
@@ -44,8 +46,8 @@ class Activity_filter {
];
}
- if(feature_enabled(local_channel(),'groups')) {
- $groups = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
+ if(Apps::system_app_installed(local_channel(), 'Privacy Groups')) {
+ $groups = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval(local_channel())
);
@@ -180,7 +182,7 @@ class Activity_filter {
$arr = ['tabs' => $tabs];
- call_hooks('network_tabs', $arr);
+ call_hooks('activity_filter', $arr);
$o = '';
diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php
index 27d1a971a..2dceee70e 100644
--- a/Zotlabs/Widget/Activity_order.php
+++ b/Zotlabs/Widget/Activity_order.php
@@ -110,7 +110,7 @@ class Activity_order {
$arr = ['tabs' => $tabs];
- call_hooks('network_tabs', $arr);
+ call_hooks('activity_order', $arr);
$o = '';
diff --git a/Zotlabs/Widget/Appstore.php b/Zotlabs/Widget/Appstore.php
index 237707733..6a00ac06a 100644
--- a/Zotlabs/Widget/Appstore.php
+++ b/Zotlabs/Widget/Appstore.php
@@ -10,9 +10,9 @@ class Appstore {
return replace_macros(get_markup_template('appstore.tpl'), [
'$title' => t('App Collections'),
'$options' => [
- [ z_root() . '/apps/available', t('Available Apps'), $store ],
- [ z_root() . '/apps', t('Installed apps'), 1 - $store ]
+ [ z_root() . '/apps', t('Installed apps'), 1 - $store ],
+ [ z_root() . '/apps/available', t('Available Apps'), $store ]
]
]);
}
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php
index 9bfa9742a..27d4b5980 100644
--- a/Zotlabs/Widget/Categories.php
+++ b/Zotlabs/Widget/Categories.php
@@ -2,6 +2,9 @@
namespace Zotlabs\Widget;
+use App;
+use Zotlabs\Lib\Apps;
+
require_once('include/contact_widgets.php');
class Categories {
@@ -10,22 +13,22 @@ class Categories {
$cards = ((array_key_exists('cards',$arr) && $arr['cards']) ? true : false);
- if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards')))
+ if(($cards) && (! Apps::system_app_installed(App::$profile['profile_uid'], 'Cards')))
return '';
$articles = ((array_key_exists('articles',$arr) && $arr['articles']) ? true : false);
- if(($articles) && (! feature_enabled(\App::$profile['profile_uid'],'articles')))
+ if(($articles) && (! feature_enabled(App::$profile['profile_uid'],'articles')))
return '';
- if((! \App::$profile['profile_uid'])
- || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) {
+ if((! App::$profile['profile_uid'])
+ || (! perm_is_allowed(App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) {
return '';
}
$cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : '');
- $srchurl = (($cards) ? \App::$argv[0] . '/' . \App::$argv[1] : \App::$query_string);
+ $srchurl = (($cards) ? App::$argv[0] . '/' . App::$argv[1] : App::$query_string);
$srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&');
$srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);
diff --git a/Zotlabs/Widget/Cover_photo.php b/Zotlabs/Widget/Cover_photo.php
index af1ae5c7f..955048992 100644
--- a/Zotlabs/Widget/Cover_photo.php
+++ b/Zotlabs/Widget/Cover_photo.php
@@ -21,9 +21,9 @@ class Cover_photo {
return '';
// only show cover photos once per login session
-
+ $hide_cover = false;
if(array_key_exists('channels_visited',$_SESSION) && is_array($_SESSION['channels_visited']) && in_array($channel_id,$_SESSION['channels_visited'])) {
- return EMPTY_STR;
+ $hide_cover = true;
}
if(! array_key_exists('channels_visited',$_SESSION)) {
$_SESSION['channels_visited'] = [];
@@ -55,6 +55,7 @@ class Cover_photo {
$c = get_cover_photo($channel_id,'html');
if($c) {
+ $c = str_replace('src=', 'data-src=', $c);
$photo_html = (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c);
$o = replace_macros(get_markup_template('cover_photo_widget.tpl'),array(
@@ -62,6 +63,7 @@ class Cover_photo {
'$title' => $title,
'$subtitle' => $subtitle,
'$hovertitle' => t('Click to show more'),
+ '$hide_cover' => $hide_cover
));
}
return $o;
diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php
index 1a4b575b9..e57cf5171 100644
--- a/Zotlabs/Widget/Newmember.php
+++ b/Zotlabs/Widget/Newmember.php
@@ -17,7 +17,14 @@ class Newmember {
if(! $a)
return EMPTY_STR;
- if(! feature_enabled(local_channel(),'start_menu'))
+ if($a['account_created'] > datetime_convert('','','now - 60 days')) {
+ $enabled = get_pconfig(local_channel(), 'system', 'start_menu', 1);
+ }
+ else {
+ $enabled = get_pconfig(local_channel(), 'system', 'start_menu', 0);
+ }
+
+ if(! $enabled)
return EMPTY_STR;
$options = [
diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php
index 5c83a550f..238008d81 100644
--- a/Zotlabs/Widget/Notes.php
+++ b/Zotlabs/Widget/Notes.php
@@ -2,20 +2,26 @@
namespace Zotlabs\Widget;
+use Zotlabs\Lib\Apps;
+
class Notes {
function widget($arr) {
if(! local_channel())
- return '';
- if(! feature_enabled(local_channel(),'private_notes'))
- return '';
+ return EMPTY_STR;
+
+ if(! Apps::system_app_installed(local_channel(), 'Notes'))
+ return EMPTY_STR;
$text = get_pconfig(local_channel(),'notes','text');
- $o = replace_macros(get_markup_template('notes.tpl'), array(
+ $tpl = get_markup_template('notes.tpl');
+
+ $o = replace_macros($tpl, array(
'$banner' => t('Notes'),
'$text' => $text,
'$save' => t('Save'),
+ '$app' => ((isset($arr['app'])) ? true : false)
));
return $o;
diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php
index f35d6f147..238b8071e 100644
--- a/Zotlabs/Widget/Settings_menu.php
+++ b/Zotlabs/Widget/Settings_menu.php
@@ -45,19 +45,6 @@ class Settings_menu {
);
- if(get_account_techlevel() > 0 && get_features()) {
- $tabs[] = array(
- 'label' => t('Additional features'),
- 'url' => z_root().'/settings/features',
- 'selected' => ((argv(1) === 'features') ? 'active' : ''),
- );
- }
-
- $tabs[] = array(
- 'label' => t('Addon settings'),
- 'url' => z_root().'/settings/featured',
- 'selected' => ((argv(1) === 'featured') ? 'active' : ''),
- );
$tabs[] = array(
'label' => t('Display settings'),
@@ -65,6 +52,12 @@ class Settings_menu {
'selected' => ((argv(1) === 'display') ? 'active' : ''),
);
+ $tabs[] = array(
+ 'label' => t('Addon settings'),
+ 'url' => z_root().'/settings/featured',
+ 'selected' => ((argv(1) === 'featured') ? 'active' : ''),
+ );
+
if($hublocs) {
$tabs[] = array(
'label' => t('Manage locations'),
@@ -79,39 +72,6 @@ class Settings_menu {
'selected' => ''
);
- if(feature_enabled(local_channel(),'oauth_clients')) {
- $tabs[] = array(
- 'label' => t('OAuth1 apps'),
- 'url' => z_root() . '/settings/oauth',
- 'selected' => ((argv(1) === 'oauth') ? 'active' : ''),
- );
- }
-
- if(feature_enabled(local_channel(),'oauth2_clients')) {
- $tabs[] = array(
- 'label' => t('OAuth2 apps'),
- 'url' => z_root() . '/settings/oauth2',
- 'selected' => ((argv(1) === 'oauth2') ? 'active' : ''),
- );
- }
-
- if(feature_enabled(local_channel(),'access_tokens')) {
- $tabs[] = array(
- 'label' => t('Guest Access Tokens'),
- 'url' => z_root() . '/settings/tokens',
- 'selected' => ((argv(1) === 'tokens') ? 'active' : ''),
- );
- }
-
- if(feature_enabled(local_channel(),'permcats')) {
- $tabs[] = array(
- 'label' => t('Permission Categories'),
- 'url' => z_root() . '/settings/permcats',
- 'selected' => ((argv(1) === 'permcats') ? 'active' : ''),
- );
- }
-
-
if($role === false || $role === 'custom') {
$tabs[] = array(
'label' => t('Connection Default Permissions'),
@@ -120,22 +80,6 @@ class Settings_menu {
);
}
- if(feature_enabled(local_channel(),'premium_channel')) {
- $tabs[] = array(
- 'label' => t('Premium Channel Settings'),
- 'url' => z_root() . '/connect/' . $channel['channel_address'],
- 'selected' => ''
- );
- }
-
- if(feature_enabled(local_channel(),'channel_sources')) {
- $tabs[] = array(
- 'label' => t('Channel Sources'),
- 'url' => z_root() . '/sources',
- 'selected' => ''
- );
- }
-
$tabtpl = get_markup_template("generic_links_widget.tpl");
return replace_macros($tabtpl, array(
'$title' => t('Settings'),
@@ -144,4 +88,4 @@ class Settings_menu {
));
}
-} \ No newline at end of file
+}