aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Admin/Site.php7
-rw-r--r--Zotlabs/Module/Channel.php1
-rw-r--r--Zotlabs/Module/Cloud_tiles.php17
-rw-r--r--Zotlabs/Module/Display.php1
-rw-r--r--Zotlabs/Module/Magic.php13
-rw-r--r--Zotlabs/Module/Network.php16
-rw-r--r--Zotlabs/Module/Owa.php4
-rw-r--r--Zotlabs/Module/Page.php24
-rw-r--r--Zotlabs/Module/Pdledit.php8
-rw-r--r--Zotlabs/Module/Profile_photo.php10
-rw-r--r--Zotlabs/Module/Pubstream.php20
-rw-r--r--Zotlabs/Module/Search.php1
-rw-r--r--Zotlabs/Module/Settings/Display.php3
-rw-r--r--Zotlabs/Module/Starred.php2
-rw-r--r--Zotlabs/Render/Comanche.php3
-rw-r--r--Zotlabs/Storage/Browser.php20
-rw-r--r--Zotlabs/Widget/Portfolio.php12
-rw-r--r--doc/Widgets.md34
-rw-r--r--include/connections.php2
-rw-r--r--include/nav.php2
-rw-r--r--include/queue_fn.php12
-rw-r--r--include/zot.php4
-rwxr-xr-xutil/add_widget_repo11
-rw-r--r--view/pdl/mod_search.pdl2
-rw-r--r--view/pdl/mod_sources.pdl6
-rw-r--r--view/theme/redbasic/css/style.css23
-rwxr-xr-xview/tpl/admin_site.tpl1
-rwxr-xr-xview/tpl/build_query.tpl2
-rw-r--r--view/tpl/cloud_directory.tpl35
-rw-r--r--view/tpl/cloud_header.tpl1
-rw-r--r--view/tpl/pdledit.tpl3
-rwxr-xr-xview/tpl/settings_display.tpl1
32 files changed, 257 insertions, 44 deletions
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index d3d058c53..2df8b9908 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -61,8 +61,9 @@ class Site {
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
$feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0);
$verify_email = ((x($_POST,'verify_email')) ? 1 : 0);
- $techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
- $imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
+ $techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
+ $imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
+ $force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 300);
$techlevel = null;
if(array_key_exists('techlevel', $_POST))
@@ -128,6 +129,7 @@ class Site {
set_config('system','allowed_sites', $allowed_sites);
set_config('system','publish_all', $force_publish);
set_config('system','disable_discover_tab', $disable_discover_tab);
+ set_config('system','force_queue_threshold', $force_queue);
if ($global_directory == '') {
del_config('system', 'directory_submit_url');
} else {
@@ -318,6 +320,7 @@ class Site {
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
'$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")),
'$delivery_batch_count' => array('delivery_batch_count', t('Deliveries per process'),(x(get_config('system','delivery_batch_count'))?get_config('system','delivery_batch_count'):1), t("Number of deliveries to attempt in a single operating system process. Adjust if necessary to tune system performance. Recommend: 1-5.")),
+ '$force_queue' => array('force_queue', t("Queue Threshold"), get_config('system','force_queue_threshold',300), t("Always defer immediate delivery if queue contains more than this number of entries.")),
'$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")),
'$imagick_path' => array('imagick_path', t("Path to ImageMagick convert program"), get_config('system','imagick_convert_path'), t("If set, use this program to generate photo thumbnails for huge images ( > 4000 pixels in either dimension), otherwise memory exhaustion may occur. Example: /usr/bin/convert")),
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 14d02d873..7c4c900a1 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -332,6 +332,7 @@ class Channel extends \Zotlabs\Web\Controller {
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
'$mid' => $mid,
'$verb' => '',
+ '$net' => '',
'$dend' => $datequery,
'$dbegin' => $datequery2
));
diff --git a/Zotlabs/Module/Cloud_tiles.php b/Zotlabs/Module/Cloud_tiles.php
new file mode 100644
index 000000000..45124cdfa
--- /dev/null
+++ b/Zotlabs/Module/Cloud_tiles.php
@@ -0,0 +1,17 @@
+<?php
+
+namespace Zotlabs\Module;
+
+class Cloud_tiles extends \Zotlabs\Web\Controller {
+
+ function init() {
+
+ if(intval($_SESSION['cloud_tiles']))
+ $_SESSION['cloud_tiles'] = 0;
+ else
+ $_SESSION['cloud_tiles'] = 1;
+
+ goaway(z_root() . '/' . hex2bin(argv(1)));
+
+ }
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 785274105..85f08fd08 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -188,6 +188,7 @@ class Display extends \Zotlabs\Web\Controller {
'$dend' => '',
'$dbegin' => '',
'$verb' => '',
+ '$net' => '',
'$mid' => $mid
));
diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php
index 879085f96..9ad9c951c 100644
--- a/Zotlabs/Module/Magic.php
+++ b/Zotlabs/Module/Magic.php
@@ -146,10 +146,17 @@ class Magic extends \Zotlabs\Web\Controller {
if($x['success']) {
$j = json_decode($x['body'],true);
- if($j['success'] && $j['token']) {
- $x = strpbrk($dest,'?&');
- $args = (($x) ? '&owt=' . $j['token'] : '?f=&owt=' . $j['token']) . (($delegate) ? '&delegate=1' : '');
+ if($j['success']) {
+ $token = '';
+ if($j['encrypted_token']) {
+ openssl_private_decrypt(base64url_decode($j['encrypted_token']),$token,$channel['channel_prvkey']);
+ }
+ else {
+ $token = $j['token'];
+ }
+ $x = strpbrk($dest,'?&');
+ $args = (($x) ? '&owt=' . $token : '?f=&owt=' . $token) . (($delegate) ? '&delegate=1' : '');
goaway($dest . $args);
}
}
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index ee736ff42..66032aada 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -119,6 +119,7 @@ class Network extends \Zotlabs\Web\Controller {
$cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
$file = ((x($_GET,'file')) ? $_GET['file'] : '');
$xchan = ((x($_GET,'xchan')) ? $_GET['xchan'] : '');
+ $net = ((x($_GET,'net')) ? $_GET['net'] : '');
$deftag = '';
@@ -326,7 +327,8 @@ class Network extends \Zotlabs\Web\Controller {
'$tags' => urlencode($hashtags),
'$dend' => $datequery,
'$mid' => '',
- '$verb' => $verb,
+ '$verb' => $verb,
+ '$net' => $net,
'$dbegin' => $datequery2
));
}
@@ -404,7 +406,10 @@ class Network extends \Zotlabs\Web\Controller {
}
-
+
+ $net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
+ $net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
+
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
$uids = " and item.uid = " . local_channel() . " ";
@@ -441,10 +446,12 @@ class Network extends \Zotlabs\Web\Controller {
$items = q("SELECT item.*, item.id AS item_id, received FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
+ $net_query
WHERE true $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$simple_update
$sql_extra $sql_nets
+ $net_query2
ORDER BY item.received DESC $pager_sql "
);
@@ -469,10 +476,12 @@ class Network extends \Zotlabs\Web\Controller {
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
+ $net_query
WHERE true $uids $item_normal
AND item.parent = item.id
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets
+ $net_query2
ORDER BY $ordering DESC $pager_sql "
);
@@ -482,9 +491,10 @@ class Network extends \Zotlabs\Web\Controller {
// this is an update
$r = q("SELECT item.parent AS item_id FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
+ $net_query
WHERE true $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets "
+ $sql_extra3 $sql_extra $sql_nets $net_query2"
);
$_SESSION['loadtime'] = datetime_convert();
}
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php
index 4b0d855c5..d58fd7a41 100644
--- a/Zotlabs/Module/Owa.php
+++ b/Zotlabs/Module/Owa.php
@@ -41,7 +41,9 @@ class Owa extends \Zotlabs\Web\Controller {
$ret['success'] = true;
$token = random_string(32);
\Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']);
- $ret['token'] = $token;
+ $result = '';
+ openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
+ $ret['encrypted_token'] = base64url_encode($result);
}
}
}
diff --git a/Zotlabs/Module/Page.php b/Zotlabs/Module/Page.php
index c142afe77..5fdd32825 100644
--- a/Zotlabs/Module/Page.php
+++ b/Zotlabs/Module/Page.php
@@ -89,22 +89,30 @@ class Page extends \Zotlabs\Web\Controller {
if(! $ignore_language) {
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
- and (( iconfig.k = 'WEBPAGE' and item_type = %d )
- OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
+ and iconfig.k = 'WEBPAGE' and item_type = %d
+ $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($lang_page_id),
- intval(ITEM_TYPE_WEBPAGE),
- intval(ITEM_TYPE_PDL)
+ intval(ITEM_TYPE_WEBPAGE)
+ );
+ }
+ if(! $r) {
+ $r = q("select item.* from item left join iconfig on item.id = iconfig.iid
+ where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
+ and iconfig.k = 'WEBPAGE' and item_type = %d
+ $sql_options $revision limit 1",
+ intval($u[0]['channel_id']),
+ dbesc($page_id),
+ intval(ITEM_TYPE_WEBPAGE)
);
}
if(! $r) {
+ // no webpage by that name, but we do allow you to load/preview a layout using this module. Try that.
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
- and (( iconfig.k = 'WEBPAGE' and item_type = %d )
- OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
+ and iconfig.k = 'PDL' AND item_type = %d $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
- intval(ITEM_TYPE_WEBPAGE),
intval(ITEM_TYPE_PDL)
);
}
@@ -129,7 +137,7 @@ class Page extends \Zotlabs\Web\Controller {
}
return;
}
-
+
if($r[0]['title'])
\App::$page['title'] = escape_tags($r[0]['title']);
diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php
index f8af470ac..9b86b599b 100644
--- a/Zotlabs/Module/Pdledit.php
+++ b/Zotlabs/Module/Pdledit.php
@@ -77,8 +77,10 @@ class Pdledit extends \Zotlabs\Web\Controller {
}
$t = get_pconfig(local_channel(),'system',$module);
- if(! $t)
- $t = file_get_contents(theme_include($module));
+ $s = file_get_contents(theme_include($module));
+ if(! $t) {
+ $t = $s;
+ }
if(! $t) {
notice( t('Layout not found.') . EOL);
return '';
@@ -89,7 +91,9 @@ class Pdledit extends \Zotlabs\Web\Controller {
'$mname' => t('Module Name:'),
'$help' => t('Layout Help'),
'$another' => t('Edit another layout'),
+ '$original' => t('System layout'),
'$module' => argv(1),
+ '$src' => $s,
'$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'),
'$submit' => t('Submit')
));
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index 27e6bc445..411518c61 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -150,6 +150,14 @@ class Profile_photo extends \Zotlabs\Web\Controller {
// If setting for the default profile, unset the profile photo flag from any other photos I own
if($is_default_profile) {
+
+ $r = q("update profile set photo = '%s', thumb = '%s' where is_default = 1 and uid = %d",
+ dbesc(z_root() . '/photo/profile/l/' . local_channel()),
+ dbesc(z_root() . '/photo/profile/m/' . local_channel()),
+ intval(local_channel())
+ );
+
+
$r = q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d
AND resource_id != '%s' AND uid = %d",
intval(PHOTO_NORMAL),
@@ -159,8 +167,6 @@ class Profile_photo extends \Zotlabs\Web\Controller {
);
-
-
send_profile_photo_activity($channel,$base_image,$profile);
}
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index 15e2d8a74..e83de6bc0 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -31,6 +31,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
$item_normal_update = item_normal_update();
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
+ $net = ((array_key_exists('net',$_REQUEST)) ? escape_tags($_REQUEST['net']) : '');
if(! $update && !$load) {
@@ -81,7 +82,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$tags' => '',
'$dend' => '',
'$mid' => $mid,
- '$verb' => '',
+ '$verb' => '',
+ '$net' => $net,
'$dbegin' => ''
));
}
@@ -112,6 +114,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$page_mode = 'list';
else
$page_mode = 'client';
+
+
+ $net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
+ $net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
$simple_update = (($update) ? " and item.item_unseen = 1 " : '');
@@ -134,9 +140,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
if($mid) {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE mid like '%s' $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets LIMIT 1",
+ $sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
);
}
@@ -144,10 +151,11 @@ class Pubstream extends \Zotlabs\Web\Controller {
// Fetch a page full of parent items for this page
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE true $uids $item_normal
AND item.parent = item.id
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets
+ $sql_extra3 $sql_extra $sql_nets $net_query2
ORDER BY $ordering DESC $pager_sql "
);
}
@@ -156,19 +164,21 @@ class Pubstream extends \Zotlabs\Web\Controller {
if($mid) {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE mid like '%s' $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets LIMIT 1",
+ $sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
);
}
else {
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
left join abook on item.author_xchan = abook.abook_xchan
+ $net_query
WHERE true $uids $item_normal_update
AND item.parent = item.id $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
- $sql_extra3 $sql_extra $sql_nets"
+ $sql_extra3 $sql_extra $sql_nets $net_query2"
);
}
$_SESSION['loadtime'] = datetime_convert();
diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php
index 37e9a336f..7bc3429b1 100644
--- a/Zotlabs/Module/Search.php
+++ b/Zotlabs/Module/Search.php
@@ -138,6 +138,7 @@ class Search extends \Zotlabs\Web\Controller {
'$tags' => '',
'$mid' => '',
'$verb' => '',
+ '$net' => '',
'$dend' => '',
'$dbegin' => ''
));
diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php
index a444d28a2..e1ea0e3e5 100644
--- a/Zotlabs/Module/Settings/Display.php
+++ b/Zotlabs/Module/Settings/Display.php
@@ -23,6 +23,7 @@ class Display {
$mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : '');
$preload_images = ((x($_POST,'preload_images')) ? intval($_POST['preload_images']) : 0);
+ $channel_menu = ((x($_POST,'channel_menu')) ? intval($_POST['channel_menu']) : 0);
$user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0);
$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0);
$title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0);
@@ -63,6 +64,7 @@ class Display {
set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height);
set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height);
set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update);
+ set_pconfig(local_channel(),'system','channel_menu', $channel_menu);
$newschema = '';
if($theme){
@@ -217,6 +219,7 @@ class Display {
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
'$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')),
'$nosmile' => array('nosmile', t("Show emoticons (smilies) as images"), 1-intval($nosmile), '', $yes_no),
+ '$channel_menu' => [ 'channel_menu', t('Provide channel menu in navigation bar'), get_pconfig(local_channel(),'system','channel_menu',get_config('system','channel_menu',0)), t('Default: channel menu located in app menu'),$yes_no ],
'$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no),
'$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no),
'$layout_editor' => t('System Page Layout Editor - (advanced)'),
diff --git a/Zotlabs/Module/Starred.php b/Zotlabs/Module/Starred.php
index 4f1d99ec6..8349ae25c 100644
--- a/Zotlabs/Module/Starred.php
+++ b/Zotlabs/Module/Starred.php
@@ -16,7 +16,7 @@ class Starred extends \Zotlabs\Web\Controller {
if(! $message_id)
killme();
- $r = q("SELECT item_flags FROM item WHERE uid = %d AND id = %d LIMIT 1",
+ $r = q("SELECT item_starred FROM item WHERE uid = %d AND id = %d LIMIT 1",
intval(local_channel()),
intval($message_id)
);
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index 8831bd117..78ca870a7 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -469,8 +469,11 @@ class Comanche {
if(file_exists('Zotlabs/SiteWidget/' . $clsname . '.php'))
require_once('Zotlabs/SiteWidget/' . $clsname . '.php');
+ elseif(file_exists('widget/' . $clsname . '/' . $clsname . '.php'))
+ require_once('widget/' . $clsname . '/' . $clsname . '.php');
elseif(file_exists('Zotlabs/Widget/' . $clsname . '.php'))
require_once('Zotlabs/Widget/' . $clsname . '.php');
+
if(class_exists($nsname)) {
$x = new $nsname;
$f = 'widget';
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 6f6f4a292..b5c3ac1cf 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -173,6 +173,7 @@ class Browser extends DAV\Browser\Plugin {
$displayName = $this->escapeHTML($displayName);
$type = $this->escapeHTML($type);
+
$icon = '';
if ($this->enableAssets) {
@@ -196,12 +197,28 @@ class Browser extends DAV\Browser\Plugin {
}
}
+ $photo_icon = '';
+
+ if(strpos($type,'image/') === 0 && $attachHash) {
+ $r = q("select resource_id, imgscale from photo where resource_id = '%s' and imgscale in ( %d, %d ) order by imgscale asc limit 1",
+ dbesc($attachHash),
+ intval(PHOTO_RES_320),
+ intval(PHOTO_RES_PROFILE_80)
+ );
+ if($r) {
+ $photo_icon = $r[0]['resource_id'] . '-' . $r[0]['imgscale'];
+ }
+ }
+
+
+
$attachIcon = ""; // "<a href=\"attach/".$attachHash."\" title=\"".$displayName."\"><i class=\"fa fa-arrow-circle-o-down\"></i></a>";
// put the array for this file together
$ft['attachId'] = $this->findAttachIdByHash($attachHash);
$ft['fileStorageUrl'] = substr($fullPath, 0, strpos($fullPath, "cloud/")) . "filestorage/" . $this->auth->getCurrentUser();
$ft['icon'] = $icon;
+ $ft['photo_icon'] = $photo_icon;
$ft['attachIcon'] = (($size) ? $attachIcon : '');
// @todo Should this be an item value, not a global one?
$ft['is_owner'] = $is_owner;
@@ -221,6 +238,7 @@ class Browser extends DAV\Browser\Plugin {
$this->server->emit('onHTMLActionsPanel', array($parent, &$output, $path));
}
+
$html .= replace_macros(get_markup_template('cloud.tpl'), array(
'$header' => t('Files') . ": " . $this->escapeHTML($path) . "/",
'$total' => t('Total'),
@@ -230,6 +248,8 @@ class Browser extends DAV\Browser\Plugin {
'$upload' => t('Upload'),
'$is_owner' => $is_owner,
'$parentpath' => $parentpath,
+ '$cpath' => bin2hex(\App::$query_string),
+ '$tiles' => intval($_SESSION['cloud_tiles']),
'$entries' => $f,
'$name' => t('Name'),
'$type' => t('Type'),
diff --git a/Zotlabs/Widget/Portfolio.php b/Zotlabs/Widget/Portfolio.php
index 216ca952c..0cd043246 100644
--- a/Zotlabs/Widget/Portfolio.php
+++ b/Zotlabs/Widget/Portfolio.php
@@ -20,6 +20,15 @@ class Portfolio {
$album = $args['album'];
if($args['title'])
$title = $args['title'];
+ if(array_key_exists('mode', $args) && isset($args['mode']))
+ $mode = $args['mode'];
+ else
+ $mode = '';
+ if(array_key_exists('count', $args) && isset($args['count']))
+ $count = $args['count'];
+ else
+ $count = '';
+
/**
* This may return incorrect permissions if you have multiple directories of the same name.
@@ -92,6 +101,8 @@ class Portfolio {
$tpl = get_markup_template('photo_album_portfolio.tpl');
$o .= replace_macros($tpl, array(
'$photos' => $photos,
+ '$mode' => $mode,
+ '$count' => $count,
'$album' => (($title) ? $title : $album),
'$album_id' => rand(),
'$album_edit' => array(t('Edit Album'), $album_edit),
@@ -106,3 +117,4 @@ class Portfolio {
}
}
+
diff --git a/doc/Widgets.md b/doc/Widgets.md
index 4ad899a0f..7761b1833 100644
--- a/doc/Widgets.md
+++ b/doc/Widgets.md
@@ -129,14 +129,44 @@ Some/many of these widgets have restrictions which may restrict the type of page
Creating New Widgets
====================
-If you want a widget named 'slugfish', create widget/slugfish.php containing
+### Class Widgets
+
+To create a class-based widget named 'slugfish' create a file with the following contents:
+
+````
+<?php
+
+namespace Zotlabs\Widget;
+
+
+class Slugfish {
+
+ function widget($args) {
+
+ ... widget code goes here.
+ ... The function returns a string which is the HTML content of the widget.
+ ... $args is a named array which is passed any [var] variables from the layout editor
+ ... For instance [widget=slugfish][var=count]3[/var][/widget] will populate $args with
+ ... [ 'count' => 3 ]
+
+ }
+
+````
+
+The resultant file may be placed in widget/Slugfish/Slugfish.php , or Zotlabs/SiteWidgets/Slugfish.php . It also may be linked from a git repository using util/add_widget_repo.
+
+
+
+Traditional function based widget:
+
+If you want a widget named 'slugfish', create widget/widget_slugfish.php containing
<?php
function widget_slugfish($args) {
- .. widget code goes here
+ .. widget code goes here. See above information for class-based widgets for details.
}
diff --git a/include/connections.php b/include/connections.php
index 60bce018e..e9d7daa2d 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -369,7 +369,7 @@ function contact_remove($channel_id, $abook_id) {
return false;
- $r = q("select * from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d",
+ $r = q("select id from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d",
dbesc($abook['abook_xchan']),
dbesc($abook['abook_xchan']),
intval($channel_id)
diff --git a/include/nav.php b/include/nav.php
index 89947e270..af0ebbae2 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -312,7 +312,7 @@ EOT;
'$pleasewait' => t('Please wait...'),
'$nav_apps' => $nav_apps,
'$navbar_apps' => $navbar_apps,
- '$channel_menu' => get_config('system','channel_menu'),
+ '$channel_menu' => get_pconfig(App::$profile_uid,'system','channel_menu',get_config('system','channel_menu')),
'$channel_thumb' => ((App::$profile) ? App::$profile['thumb'] : ''),
'$channel_apps' => $channel_apps,
'$addapps' => t('Add Apps'),
diff --git a/include/queue_fn.php b/include/queue_fn.php
index c9179b953..c09033d0a 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -158,6 +158,16 @@ function queue_deliver($outq, $immediate = false) {
}
}
+ if($immediate) {
+ $x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
+ if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
+ logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
+ update_queue_item($outq['outq_hash']);
+ return;
+ }
+ }
+
+
$arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate);
call_hooks('queue_deliver',$arr);
if($arr['handled'])
@@ -205,7 +215,7 @@ function queue_deliver($outq, $immediate = false) {
else {
logger('deliver: queue post returned ' . $result['return_code']
. ' from ' . $outq['outq_posturl'],LOGGER_DEBUG);
- update_queue_item($outq['outq_posturl']);
+ update_queue_item($outq['outq_hash']);
}
return;
}
diff --git a/include/zot.php b/include/zot.php
index dad30dbb0..5270ed8b8 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -3649,6 +3649,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
$disallowed = array('id','aid','uid','guid');
foreach($arr['profile'] as $profile) {
+
$x = q("select * from profile where profile_guid = '%s' and uid = %d limit 1",
dbesc($profile['profile_guid']),
intval($channel['channel_id'])
@@ -3671,6 +3672,9 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(in_array($k,$disallowed))
continue;
+ if($profile['is_default'] && in_array($k,['photo','thumb']))
+ continue;
+
if($k === 'name')
$clean['fullname'] = $v;
elseif($k === 'with')
diff --git a/util/add_widget_repo b/util/add_widget_repo
index cb3112626..4cfd6a170 100755
--- a/util/add_widget_repo
+++ b/util/add_widget_repo
@@ -5,17 +5,6 @@ if [ $# -lt 2 ]; then
exit 1
fi
-#if [[ $1 != *"//github.com/redmatrix"* && $3 != 'insecure' ]]; then
-# echo "";
-# echo "This is NOT an official project repository.";
-# echo "In order to protect you from unverified and";
-# echo "possibly malicious content, this repository";
-# echo "will not be linked to your site unless you";
-# echo "append the word 'insecure' to the command.";
-# echo "";
-# exit 1
-#fi
-
mkdir -p extend/widget/$2
mkdir widget > /dev/null 2>&1
git clone $1 extend/widget/$2
diff --git a/view/pdl/mod_search.pdl b/view/pdl/mod_search.pdl
index 8353b4571..0bcdfdee3 100644
--- a/view/pdl/mod_search.pdl
+++ b/view/pdl/mod_search.pdl
@@ -1,5 +1,5 @@
[region=aside]
-[comment][widget=sitesearch][/widget][/comment]
+[widget=sitesearch][/widget]
[/region]
[region=right_aside]
[widget=notifications][/widget]
diff --git a/view/pdl/mod_sources.pdl b/view/pdl/mod_sources.pdl
new file mode 100644
index 000000000..53a3ac9e5
--- /dev/null
+++ b/view/pdl/mod_sources.pdl
@@ -0,0 +1,6 @@
+[region=aside]
+[widget=settings_menu][/widget]
+[/region]
+[region=right_aside]
+[widget=notifications][/widget]
+[/region]
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index aea75df65..9f9ece7c3 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -1695,3 +1695,26 @@ dl.bb-dl > dd > li {
#permcat-index {
margin: 10px;
}
+
+.cloud-container {
+ float: left;
+ width: 80px;
+ height: 80px;
+ margin: 5px;
+}
+
+.cloud-icon i {
+ font-size: 48px;
+}
+
+.cloud-icon img {
+ width: 48px;
+ height: 48px;
+}
+
+.cloud-title {
+ width: 78px;
+ height: 36px;
+ overflow: hidden;
+}
+
diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl
index d6ff34f93..6b39e844a 100755
--- a/view/tpl/admin_site.tpl
+++ b/view/tpl/admin_site.tpl
@@ -88,6 +88,7 @@
{{include file="field_input.tpl" field=$timeout}}
{{include file="field_input.tpl" field=$delivery_interval}}
{{include file="field_input.tpl" field=$delivery_batch_count}}
+ {{include file="field_input.tpl" field=$force_queue}}
{{include file="field_input.tpl" field=$poll_interval}}
{{include file="field_input.tpl" field=$maxloadavg}}
{{include file="field_input.tpl" field=$abandon_days}}
diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl
index a76d4e549..bfe5c8a08 100755
--- a/view/tpl/build_query.tpl
+++ b/view/tpl/build_query.tpl
@@ -29,6 +29,7 @@
var bParam_dbegin = "{{$dbegin}}";
var bParam_mid = "{{$mid}}";
var bParam_verb = "{{$verb}}";
+ var bParam_net = "{{$net}}";
function buildCmd() {
var udargs = ((page_load) ? "/load" : "");
@@ -57,6 +58,7 @@
if(bParam_dbegin != "") bCmd = bCmd + "&dbegin=" + bParam_dbegin;
if(bParam_mid != "") bCmd = bCmd + "&mid=" + bParam_mid;
if(bParam_verb != "") bCmd = bCmd + "&verb=" + bParam_verb;
+ if(bParam_net != "") bCmd = bCmd + "&net=" + bParam_net;
if(bParam_page != 1) bCmd = bCmd + "&page=" + bParam_page;
return(bCmd);
}
diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl
index e8ae6a590..40278661f 100644
--- a/view/tpl/cloud_directory.tpl
+++ b/view/tpl/cloud_directory.tpl
@@ -1,4 +1,38 @@
<div id="cloud-drag-area" class="section-content-wrapper-np">
+ {{if $tiles}}
+
+ {{if $parentpath}}
+ <div class="cloud-container" >
+ <div class="cloud-icon"><a href="{{$parentpath.path}}">
+ <i class="fa fa-fw fa-level-up" ></i>
+ </a>
+ </div>
+ <div class="cloud-title"><a href="{{$parentpath.path}}">..</a>
+ </div>
+ </div>
+ {{/if}}
+
+ {{foreach $entries as $item}}
+ <div class="cloud-container">
+ <div class="cloud-icon"><a href="{{$item.fullPath}}">
+ {{if $item.photo_icon}}
+ <img src="photo/{{$item.photo_icon}}" title="{{$item.type}}" >
+ {{else}}
+ <i class="fa fa-fw {{$item.iconFromType}}" title="{{$item.type}}"></i>
+ {{/if}}
+ </a>
+ </div>
+ <div class="cloud-title"><a href="{{$item.fullPath}}">
+ {{$item.displayName}}
+ </a>
+ </div>
+ {{if $item.is_owner}}
+
+ {{/if}}
+ </div>
+ {{/foreach}}
+ <div class="clear"></div>
+ {{else}}
<table id="cloud-index">
<tr>
<th width="1%"></th>
@@ -42,4 +76,5 @@
{{/foreach}}
</table>
+ {{/if}}
</div>
diff --git a/view/tpl/cloud_header.tpl b/view/tpl/cloud_header.tpl
index c1e589341..468f2febc 100644
--- a/view/tpl/cloud_header.tpl
+++ b/view/tpl/cloud_header.tpl
@@ -1,6 +1,7 @@
<div class="section-title-wrapper">
{{if $actionspanel}}
<div class="pull-right">
+ <a href="cloud_tiles/{{$cpath}}" class="btn btn-sm btn-outline-secondary"><i class="fa fa-fw {{if $tiles}}fa-list-ul{{else}}fa-table{{/if}}"></i></a>
{{if $is_owner}}
<a href="/sharedwithme" class="btn btn-sm btn-outline-secondary"><i class="fa fa-cloud-download"></i>&nbsp;{{$shared}}</a>
{{/if}}
diff --git a/view/tpl/pdledit.tpl b/view/tpl/pdledit.tpl
index 2ea89b6c1..66b8209c9 100644
--- a/view/tpl/pdledit.tpl
+++ b/view/tpl/pdledit.tpl
@@ -11,7 +11,10 @@
<br />
<br />
+<div class="descriptive-text">{{$original}}</div>
+<pre><code>{{$src}}</code></pre>
+<br />
<form action="pdledit" method="post" >
<input type="hidden" name="module" value="{{$module}}" />
diff --git a/view/tpl/settings_display.tpl b/view/tpl/settings_display.tpl
index d8c1ac7aa..d1e6e0609 100755
--- a/view/tpl/settings_display.tpl
+++ b/view/tpl/settings_display.tpl
@@ -64,6 +64,7 @@
{{include file="field_input.tpl" field=$channel_divmore_height}}
{{include file="field_input.tpl" field=$network_divmore_height}}
{{include file="field_checkbox.tpl" field=$nosmile}}
+ {{include file="field_checkbox.tpl" field=$channel_menu}}
{{include file="field_checkbox.tpl" field=$title_tosource}}
{{include file="field_checkbox.tpl" field=$channel_list_mode}}
{{include file="field_checkbox.tpl" field=$network_list_mode}}