aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Defperms.php112
-rw-r--r--Zotlabs/Module/Invite.php5
-rw-r--r--Zotlabs/Module/Lang.php16
-rw-r--r--Zotlabs/Module/Mood.php86
-rw-r--r--Zotlabs/Module/Notes.php8
-rw-r--r--Zotlabs/Module/Tokens.php16
-rw-r--r--app/connections.apd3
-rw-r--r--app/defperm.apd3
-rw-r--r--app/directory.apd3
-rw-r--r--app/help.apd3
-rw-r--r--app/invite.apd3
-rw-r--r--app/lang.apd3
-rw-r--r--app/mood.apd3
-rw-r--r--app/notes.apd3
-rw-r--r--app/storage.apd3
-rw-r--r--app/tokens.apd3
-rw-r--r--view/js/main.js2
17 files changed, 137 insertions, 138 deletions
diff --git a/Zotlabs/Module/Defperms.php b/Zotlabs/Module/Defperms.php
index f2f7c10e5..309a5a65a 100644
--- a/Zotlabs/Module/Defperms.php
+++ b/Zotlabs/Module/Defperms.php
@@ -19,13 +19,13 @@ class Defperms extends Controller {
*/
function init() {
-
+
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Default Permissions'))
return;
-
+
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_self = 1 and abook_channel = %d LIMIT 1",
@@ -37,39 +37,39 @@ class Defperms extends Controller {
$channel = App::get_channel();
if($channel)
- head_set_icon($channel['xchan_photo_s']);
+ head_set_icon($channel['xchan_photo_s']);
}
-
+
/* @brief Evaluate posted values and set changes
*
*/
-
+
function post() {
-
+
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Default Permissions'))
return;
-
+
$contact_id = intval(argv(1));
if(! $contact_id)
return;
-
+
$channel = App::get_channel();
-
+
$orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
intval($contact_id),
intval(local_channel())
);
-
+
if(! $orig_record) {
notice( t('Could not access contact record.') . EOL);
goaway(z_root() . '/connections');
return; // NOTREACHED
}
-
+
if(intval($orig_record[0]['abook_self'])) {
$autoperms = intval($_POST['autoperms']);
@@ -79,8 +79,8 @@ class Defperms extends Controller {
$autoperms = null;
$is_self = false;
}
-
-
+
+
$all_perms = \Zotlabs\Access\Permissions::Perms();
if($all_perms) {
@@ -105,15 +105,15 @@ class Defperms extends Controller {
}
}
- if(! is_null($autoperms))
+ if(! is_null($autoperms))
set_pconfig($channel['channel_id'],'system','autoperms',$autoperms);
-
-
+
+
notice( t('Settings updated.') . EOL);
-
+
// Refresh the structure in memory with the new data
-
+
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_id = %d LIMIT 1",
@@ -123,28 +123,28 @@ class Defperms extends Controller {
if($r) {
App::$poi = $r[0];
}
-
-
+
+
$this->defperms_clone($a);
-
+
goaway(z_root() . '/defperms');
-
+
return;
-
+
}
-
+
/* @brief Clone connection
*
*
*/
-
+
function defperms_clone(&$a) {
-
+
if(! App::$poi)
return;
-
+
$channel = App::get_channel();
-
+
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_id = %d LIMIT 1",
@@ -154,30 +154,30 @@ class Defperms extends Controller {
if($r) {
App::$poi = array_shift($r);
}
-
+
$clone = App::$poi;
-
+
unset($clone['abook_id']);
unset($clone['abook_account']);
unset($clone['abook_channel']);
-
+
$abconfig = load_abconfig($channel['channel_id'],$clone['abook_xchan']);
if($abconfig)
$clone['abconfig'] = $abconfig;
-
+
Libsync::build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
}
-
+
/* @brief Generate content of connection default permissions page
*
*
*/
-
+
function get() {
-
+
$sort_type = 0;
$o = '';
-
+
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return login();
@@ -186,17 +186,15 @@ class Defperms extends Controller {
if(! Apps::system_app_installed(local_channel(), 'Default Permissions')) {
//Do not display any associated widgets at this point
App::$pdl = '';
-
- $o = '<b>' . t('Default Permissions App') . ' (' . t('Not Installed') . '):</b><br>';
- $o .= t('Set custom default permissions for new connections');
- return $o;
+ $papp = Apps::get_papp('Default Permissions');
+ return Apps::app_render($papp, 'module');
}
-
+
$section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : '');
$channel = App::get_channel();
-
+
$yes_no = array(t('No'),t('Yes'));
-
+
$connect_perms = \Zotlabs\Access\Permissions::connect_perms(local_channel());
$o .= "<script>function connectDefaultShare() {
@@ -210,28 +208,28 @@ class Defperms extends Controller {
}
}
$o .= " }\n</script>\n";
-
+
if(App::$poi) {
-
+
$sections = [];
$self = false;
-
+
$tpl = get_markup_template('defperms.tpl');
-
-
+
+
$perms = array();
$channel = App::get_channel();
$contact = App::$poi;
-
+
$global_perms = \Zotlabs\Access\Permissions::Perms();
$hidden_perms = [];
-
+
foreach($global_perms as $k => $v) {
$thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k);
-
+
$checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k);
$inherited = (($checkinherited & PERMS_SPECIFIC) ? false : true);
@@ -241,7 +239,7 @@ class Defperms extends Controller {
$hidden_perms[] = [ 'perms_' . $k, intval($thisperm) ];
}
}
-
+
$pcat = new \Zotlabs\Lib\Permcat(local_channel());
$pcatlist = $pcat->listing();
$permcats = [];
@@ -272,13 +270,13 @@ class Defperms extends Controller {
'$contact_id' => $contact['abook_id'],
'$name' => $contact['xchan_name'],
]);
-
+
$arr = array('contact' => $contact,'output' => $o);
-
+
call_hooks('contact_edit', $arr);
-
+
return $arr['output'];
-
- }
+
+ }
}
}
diff --git a/Zotlabs/Module/Invite.php b/Zotlabs/Module/Invite.php
index 34f1858fd..40f972385 100644
--- a/Zotlabs/Module/Invite.php
+++ b/Zotlabs/Module/Invite.php
@@ -306,9 +306,8 @@ class Invite extends Controller {
if(! Apps::system_app_installed(local_channel(), 'Invite')) {
//Do not display any associated widgets at this point
App::$pdl = '';
-
- $o = 'ZAI0102E,' . t('Invite App') . ' (' . t('Not Installed') . ')' . EOL;
- return $o;
+ $papp = Apps::get_papp('Invite');
+ return Apps::app_render($papp, 'module');
}
if (! (get_config('system','invitation_also') || get_config('system','invitation_only')) ) {
diff --git a/Zotlabs/Module/Lang.php b/Zotlabs/Module/Lang.php
index 1a2f1664e..fe185ebea 100644
--- a/Zotlabs/Module/Lang.php
+++ b/Zotlabs/Module/Lang.php
@@ -28,9 +28,9 @@ class Lang extends Controller {
}
}
- $lc = x($_POST['zinlc']) && preg_match('/^\?\?|[a-z]{2,2}[x_\-]{0,1}[a-zA-Z]{0,2}$/', $_POST['zinlc'])
+ $lc = x($_POST['zinlc']) && preg_match('/^\?\?|[a-z]{2,2}[x_\-]{0,1}[a-zA-Z]{0,2}$/', $_POST['zinlc'])
? $_POST['zinlc'] : '';
- $lcs= x($_POST['zinlcs']) && preg_match('/^[a-z,_\-]{0,191}$/', $_POST['zinlcs'])
+ $lcs= x($_POST['zinlcs']) && preg_match('/^[a-z,_\-]{0,191}$/', $_POST['zinlcs'])
? $_POST['zinlcs'] : '';
if ($isajax) {
@@ -57,12 +57,10 @@ class Lang extends Controller {
if(local_channel()) {
if(! Apps::system_app_installed(local_channel(), 'Language')) {
- //Do not display any associated widgets at this point
- App::$pdl = '';
-
- $o = '<b>' . t('Language App') . ' (' . t('Not Installed') . '):</b><br>';
- $o .= t('Change UI language');
- return $o;
+ //Do not display any associated widgets at this point
+ App::$pdl = '';
+ $papp = Apps::get_papp('Language');
+ return Apps::app_render($papp, 'module');
}
}
@@ -70,5 +68,5 @@ class Lang extends Controller {
return lang_selector();
}
-
+
}
diff --git a/Zotlabs/Module/Mood.php b/Zotlabs/Module/Mood.php
index 453f08f9f..cb2ca566b 100644
--- a/Zotlabs/Module/Mood.php
+++ b/Zotlabs/Module/Mood.php
@@ -14,36 +14,36 @@ require_once('include/items.php');
class Mood extends Controller {
function init() {
-
+
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
return;
}
-
+
$uid = local_channel();
$channel = App::get_channel();
$verb = notags(trim($_GET['verb']));
-
- if(! $verb)
+
+ if(! $verb)
return;
-
+
$verbs = get_mood_verbs();
-
+
if(! array_key_exists($verb,$verbs))
return;
-
+
$activity = ACTIVITY_MOOD . '#' . urlencode($verb);
-
+
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0);
-
-
+
+
logger('mood: verb ' . $verb, LOGGER_DEBUG);
-
-
+
+
if($parent) {
- $r = q("select mid, owner_xchan, private, allow_cid, allow_gid, deny_cid, deny_gid
+ $r = q("select mid, owner_xchan, private, allow_cid, allow_gid, deny_cid, deny_gid
from item where id = %d and parent = %d and uid = %d limit 1",
intval($parent),
intval($parent),
@@ -59,24 +59,24 @@ class Mood extends Controller {
}
}
else {
-
+
$private = 0;
-
+
$allow_cid = $channel['channel_allow_cid'];
$allow_gid = $channel['channel_allow_gid'];
$deny_cid = $channel['channel_deny_cid'];
$deny_gid = $channel['channel_deny_gid'];
}
-
+
$poster = App::get_observer();
-
+
$uuid = item_message_id();
$mid = z_root() . '/item/' . $uuid;
-
- $action = sprintf( t('%1$s is %2$s','mood'), '[zrl=' . $poster['xchan_url'] . ']' . $poster['xchan_name'] . '[/zrl]' , $verbs[$verb]);
-
+
+ $action = sprintf( t('%1$s is %2$s','mood'), '[zrl=' . $poster['xchan_url'] . ']' . $poster['xchan_name'] . '[/zrl]' , $verbs[$verb]);
+
$arr = array();
-
+
$arr['aid'] = get_account_id();
$arr['uid'] = $uid;
$arr['uuid'] = $uuid;
@@ -97,31 +97,31 @@ class Mood extends Controller {
$arr['item_unseen'] = 1;
if(! $parent_mid)
$item['item_thread_top'] = 1;
-
+
if ((! $arr['plink']) && intval($arr['item_thread_top'])) {
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']);
}
-
-
+
+
$post = item_store($arr);
$item_id = $post['item_id'];
-
+
if($item_id) {
\Zotlabs\Daemon\Master::Summon(array('Notifier','activity', $item_id));
}
-
+
call_hooks('post_local_end', $arr);
-
+
if($_SESSION['return_url'])
goaway(z_root() . '/' . $_SESSION['return_url']);
-
+
return;
}
-
-
-
+
+
+
function get() {
-
+
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
@@ -130,26 +130,24 @@ class Mood extends Controller {
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
//Do not display any associated widgets at this point
App::$pdl = '';
-
- $o = '<b>' . t('Mood App') . ' (' . t('Not Installed') . '):</b><br>';
- $o .= t('Set your current mood and tell your friends');
- return $o;
+ $papp = Apps::get_papp('Mood');
+ return Apps::app_render($papp, 'module');
}
nav_set_selected('Mood');
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0');
-
+
$verbs = get_mood_verbs();
-
+
$shortlist = array();
foreach($verbs as $k => $v)
if($v !== 'NOTRANSLATION')
$shortlist[] = array($k,$v);
-
-
+
+
$tpl = get_markup_template('mood_content.tpl');
-
+
$o = replace_macros($tpl,array(
'$title' => t('Mood'),
'$desc' => t('Set your current mood and tell your friends'),
@@ -157,9 +155,9 @@ class Mood extends Controller {
'$parent' => $parent,
'$submit' => t('Submit'),
));
-
+
return $o;
-
+
}
-
+
}
diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php
index 452e3df60..6e8e03f20 100644
--- a/Zotlabs/Module/Notes.php
+++ b/Zotlabs/Module/Notes.php
@@ -51,11 +51,9 @@ class Notes extends Controller {
if(! Apps::system_app_installed(local_channel(), 'Notes')) {
//Do not display any associated widgets at this point
- App::$pdl = EMPTY_STR;
-
- $o = '<b>' . t('Notes App') . ' (' . t('Not Installed') . '):</b><br>';
- $o .= t('A simple notes app with a widget (note: notes are not encrypted)');
- return $o;
+ App::$pdl = '';
+ $papp = Apps::get_papp('Notes');
+ return Apps::app_render($papp, 'module');
}
$w = new \Zotlabs\Widget\Notes;
diff --git a/Zotlabs/Module/Tokens.php b/Zotlabs/Module/Tokens.php
index 1ba41dcc5..31b219019 100644
--- a/Zotlabs/Module/Tokens.php
+++ b/Zotlabs/Module/Tokens.php
@@ -46,7 +46,7 @@ class Tokens extends Controller {
return;
}
if($atoken_id) {
- $r = q("update atoken set atoken_name = '%s', atoken_token = '%s', atoken_expires = '%s'
+ $r = q("update atoken set atoken_name = '%s', atoken_token = '%s', atoken_expires = '%s'
where atoken_id = %d and atoken_uid = %d",
dbesc($name),
dbesc($token),
@@ -80,12 +80,12 @@ class Tokens extends Controller {
}
}
}
-
+
info( t('Token saved.') . EOL);
return;
}
-
+
function get() {
@@ -95,10 +95,8 @@ class Tokens extends Controller {
if(! Apps::system_app_installed(local_channel(), 'Guest Access')) {
//Do not display any associated widgets at this point
App::$pdl = '';
-
- $o = '<b>' . t('Guest Access App') . ' (' . t('Not Installed') . '):</b><br>';
- $o .= t('Create access tokens so that non-members can access private content');
- return $o;
+ $papp = Apps::get_papp('Guest Access');
+ return Apps::app_render($papp, 'module');
}
$channel = App::get_channel();
@@ -128,7 +126,7 @@ class Tokens extends Controller {
$t = q("select * from atoken where atoken_uid = %d",
intval(local_channel())
- );
+ );
$desc = t('Use this form to create temporary access identifiers to share things with non-members. These identities may be used in Access Control Lists and visitors may login using these credentials to access private content.');
@@ -189,5 +187,5 @@ class Tokens extends Controller {
));
return $o;
}
-
+
}
diff --git a/app/connections.apd b/app/connections.apd
index 0e4c7d670..006d2cde2 100644
--- a/app/connections.apd
+++ b/app/connections.apd
@@ -1,6 +1,7 @@
-version: 2
+version: 3
url: $baseurl/connections, $baseurl/settings/connections
requires: local_channel
name: Connections
photo: icon:users
categories: nav_featured_app, Networking
+desc: Manage your connections.
diff --git a/app/defperm.apd b/app/defperm.apd
index 2b241ee7f..18259c7b1 100644
--- a/app/defperm.apd
+++ b/app/defperm.apd
@@ -1,6 +1,7 @@
-version: 2
+version: 3
url: $baseurl/defperms
requires: local_channel, custom_role
name: Default Permissions
photo: icon:unlock-alt
categories: Access Control
+desc: Set custom default permissions for new connections.
diff --git a/app/directory.apd b/app/directory.apd
index 887c31e30..10d9054ff 100644
--- a/app/directory.apd
+++ b/app/directory.apd
@@ -1,5 +1,6 @@
-version: 2
+version: 3
url: $baseurl/directory, $baseurl/settings/directory
name: Directory
photo: icon:sitemap
categories: nav_featured_app, Networking
+desc: Members directory of the Zot network.
diff --git a/app/help.apd b/app/help.apd
index a0e6a491b..41f9cb6a0 100644
--- a/app/help.apd
+++ b/app/help.apd
@@ -1,5 +1,6 @@
-version: 2
+version: 3
url: $baseurl/help
name: Help
photo: icon:question
categories: nav_featured_app, System
+desc: The Hubzilla help pages.
diff --git a/app/invite.apd b/app/invite.apd
index 5c0e8d09f..8506408a6 100644
--- a/app/invite.apd
+++ b/app/invite.apd
@@ -1,6 +1,7 @@
-version: 2
+version: 3
url: $baseurl/invite
requires: local_channel
name: Invite
photo: icon:user-plus
categories: Networking
+desc: Send invite emails with an invite token. This app only works if your hub is configured to allow invites.
diff --git a/app/lang.apd b/app/lang.apd
index 1856336ef..27e2d7c84 100644
--- a/app/lang.apd
+++ b/app/lang.apd
@@ -1,5 +1,6 @@
-version: 5.6
+version: 3
url: $baseurl/lang
name: Language
photo: icon:language
categories: System
+desc: A simple language selector.
diff --git a/app/mood.apd b/app/mood.apd
index dd4e51cec..81b53a2ce 100644
--- a/app/mood.apd
+++ b/app/mood.apd
@@ -1,6 +1,7 @@
-version: 2
+version: 3
url: $baseurl/mood
requires: local_channel
name: Mood
photo: icon:smile-o
categories: Social
+desc: Set your current mood and tell your friends.
diff --git a/app/notes.apd b/app/notes.apd
index 01f94c60a..20794ebb4 100644
--- a/app/notes.apd
+++ b/app/notes.apd
@@ -1,6 +1,7 @@
-version: 2
+version: 3
url: $baseurl/notes
requires: local_channel
name: Notes
photo: icon:sticky-note-o
categories: Personal, Productivity
+desc: A simple notes app. It provides a dedicated notes app and a widget which can be added to other pages.
diff --git a/app/storage.apd b/app/storage.apd
index ea15a2ef2..a81af9c52 100644
--- a/app/storage.apd
+++ b/app/storage.apd
@@ -1,6 +1,7 @@
-version: 2
+version: 3
url: $baseurl/cloud/$nick
requires: local_channel
name: Files
photo: icon:folder-open
categories: nav_featured_app, Productivity
+desc: A mighty tool to manage your files and folders.
diff --git a/app/tokens.apd b/app/tokens.apd
index f271dc56c..95506f11c 100644
--- a/app/tokens.apd
+++ b/app/tokens.apd
@@ -1,6 +1,7 @@
-version: 2
+version: 3
url: $baseurl/tokens
requires: local_channel
name: Guest Access
photo: icon:user-secret
categories: Access Control
+desc: Create and manage guest access tokens. Those tokens are useful to share private content with people outside the Zot network.
diff --git a/view/js/main.js b/view/js/main.js
index db844a6f0..68f3415ee 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1014,7 +1014,7 @@ function liveUpdate(notify_id) {
//console.log('all images loaded, at least one is broken');
})
.progress( function( instance, image ) {
- $('#image_counter').html(instance.progressedCount + '/' + instance.images.length);
+ $('#image_counter').html(Math.floor((instance.progressedCount*100)/instance.images.length) + '%');
//var result = image.isLoaded ? 'loaded' : 'broken';
//console.log( 'image is ' + result + ' for ' + image.img.src );
});