aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-08-03 07:12:35 +0000
committerMario <mario@mariovavti.com>2021-08-03 07:12:35 +0000
commitcddc0217724f1a7661014d50e4c940e623a0c2dc (patch)
treef24595d659adbb7d1e5d2e8e6dcd829b093887bb /Zotlabs
parent571bae9d1c07bb08270163a314c91c138b42e62f (diff)
downloadvolse-hubzilla-cddc0217724f1a7661014d50e4c940e623a0c2dc.tar.gz
volse-hubzilla-cddc0217724f1a7661014d50e4c940e623a0c2dc.tar.bz2
volse-hubzilla-cddc0217724f1a7661014d50e4c940e623a0c2dc.zip
Apps drag and drop feature
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Appman.php46
-rw-r--r--Zotlabs/Widget/Activity.php10
-rw-r--r--Zotlabs/Widget/Forums.php10
3 files changed, 35 insertions, 31 deletions
diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php
index 39689665e..9d065768e 100644
--- a/Zotlabs/Module/Appman.php
+++ b/Zotlabs/Module/Appman.php
@@ -1,6 +1,6 @@
<?php /** @file */
-namespace Zotlabs\Module;
+namespace Zotlabs\Module;
//require_once('include/apps.php');
@@ -9,10 +9,10 @@ use \Zotlabs\Lib as Zlib;
class Appman extends \Zotlabs\Web\Controller {
function post() {
-
+
if(! local_channel())
return;
-
+
if($_POST['url']) {
$arr = array(
'uid' => intval($_REQUEST['uid']),
@@ -32,30 +32,30 @@ class Appman extends \Zotlabs\Web\Controller {
'sig' => escape_tags($_REQUEST['sig']),
'categories' => escape_tags($_REQUEST['categories'])
);
-
+
$_REQUEST['appid'] = Zlib\Apps::app_install(local_channel(),$arr);
-
+
if(Zlib\Apps::app_installed(local_channel(),$arr))
info( t('App installed.') . EOL);
goaway(z_root() . '/apps');
return; //not reached
}
-
-
+
+
$papp = Zlib\Apps::app_decode($_POST['papp']);
-
+
if(! is_array($papp)) {
notice( t('Malformed app.') . EOL);
return;
}
-
+
if($_POST['install']) {
Zlib\Apps::app_install(local_channel(),$papp);
if(Zlib\Apps::app_installed(local_channel(),$papp))
info( t('App installed.') . EOL);
}
-
+
if($_POST['delete']) {
Zlib\Apps::app_destroy(local_channel(),$papp);
}
@@ -72,17 +72,21 @@ class Appman extends \Zotlabs\Web\Controller {
Zlib\Apps::app_feature(local_channel(), $papp, $_POST['pin']);
}
- if($_SESSION['return_url'])
+ if($_POST['aj']) {
+ killme();
+ }
+
+ if($_SESSION['return_url'])
goaway(z_root() . '/' . $_SESSION['return_url']);
goaway(z_root() . '/apps');
-
-
+
+
}
-
-
+
+
function get() {
-
+
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
@@ -130,11 +134,11 @@ class Appman extends \Zotlabs\Web\Controller {
}
$embed = array('embed', t('Embed code'), Zlib\Apps::app_encode($app,true),'', 'onclick="this.select();"');
-
+
}
-
+
return replace_macros(get_markup_template('app_create.tpl'), array(
-
+
'$banner' => (($app) ? t('Edit App') : t('Create App')),
'$app' => $app,
'$guid' => (($app) ? $app['app_id'] : ''),
@@ -154,7 +158,7 @@ class Appman extends \Zotlabs\Web\Controller {
'$embed' => $embed,
'$submit' => t('Submit')
));
-
+
}
-
+
}
diff --git a/Zotlabs/Widget/Activity.php b/Zotlabs/Widget/Activity.php
index 04e9fc4b1..5d9795c7e 100644
--- a/Zotlabs/Widget/Activity.php
+++ b/Zotlabs/Widget/Activity.php
@@ -35,7 +35,7 @@ class Activity {
}
}
foreach($contributors as $k => $v) {
- $arr[] = [ 'author_xchan' => $k, 'total' => $v ];
+ $arr[] = [ 'author_xchan' => $k, 'total' => $v ];
}
usort($arr,'total_sort');
xchan_query($arr);
@@ -43,19 +43,19 @@ class Activity {
$x = [ 'entries' => $arr ];
call_hooks('activity_widget',$x);
- $arr = $x['entries'];
+ $arr = $x['entries'];
if($arr) {
$o .= '<div class="widget">';
- $o .= '<h3>' . t('Activity','widget') . '</h3><ul class="nav nav-pills flex-column">';
+ $o .= '<h3>' . t('Activity','widget') . '</h3><ul class="nav rounded-pill flex-column">';
foreach($arr as $rv) {
- $o .= '<li class="nav-item"><a class="nav-link" href="network?f=&xchan=' . urlencode($rv['author_xchan']) . '" ><span class="badge badge-secondary float-right">' . ((intval($rv['total'])) ? intval($rv['total']) : '') . '</span><img src="' . $rv['author']['xchan_photo_s'] . '" class="menu-img-1" /> ' . $rv['author']['xchan_name'] . '</a></li>';
+ $o .= '<li class="nav-item"><a class="nav-link" href="network?f=&xchan=' . urlencode($rv['author_xchan']) . '" ><span class="badge bg-secondary float-end">' . ((intval($rv['total'])) ? intval($rv['total']) : '') . '</span><img src="' . $rv['author']['xchan_photo_s'] . '" class="menu-img-1" /> ' . $rv['author']['xchan_name'] . '</a></li>';
}
$o .= '</ul></div>';
}
return $o;
}
-}
+}
diff --git a/Zotlabs/Widget/Forums.php b/Zotlabs/Widget/Forums.php
index d3e2f2534..2af7347f1 100644
--- a/Zotlabs/Widget/Forums.php
+++ b/Zotlabs/Widget/Forums.php
@@ -34,7 +34,7 @@ class Forums {
intval(local_channel())
);
- if($x2) {
+ if($x2) {
$xf = ids_to_querystr($x2,'xchan',true);
// private forums
@@ -47,7 +47,7 @@ class Forums {
}
}
- $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
+ $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
@@ -64,7 +64,7 @@ class Forums {
// There also should be a way to update this via ajax.
for($x = 0; $x < count($r1); $x ++) {
- $r = q("select sum(item_unseen) as unseen from item
+ $r = q("select sum(item_unseen) as unseen from item
where uid = %d and owner_xchan = '%s' and item_unseen = 1 $perms_sql ",
intval(local_channel()),
dbesc($r1[$x]['xchan_hash'])
@@ -109,12 +109,12 @@ class Forums {
}
}
}
-
+
if($unseen && (! intval($rr['unseen'])))
continue;
- $o .= '<li class="nav-item"><a class="nav-link" href="' . $link . '" ><span class="badge badge-secondary float-right">' . ((intval($rr['unseen'])) ? intval($rr['unseen']) : '') . '</span><img class ="menu-img-1" src="' . $rr['xchan_photo_s'] . '" /> ' . $rr['xchan_name'] . '</a></li>';
+ $o .= '<li class="nav-item"><a class="nav-link" href="' . $link . '" ><span class="badge bg-secondary float-end">' . ((intval($rr['unseen'])) ? intval($rr['unseen']) : '') . '</span><img class ="menu-img-1" src="' . $rr['xchan_photo_s'] . '" /> ' . $rr['xchan_name'] . '</a></li>';
}
$o .= '</ul></div>';
}