aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Appman.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-26 18:12:56 +0000
committerMario <mario@mariovavti.com>2022-10-26 18:12:56 +0000
commit40ae6b396f3760c4c4b6e4de776869a88ce07fce (patch)
treee54516ed5ca3d86faf24e1833c1b88294366f7a9 /Zotlabs/Module/Appman.php
parent9c117ffa0546d6131310ae175e16e5ebf63992a1 (diff)
downloadvolse-hubzilla-40ae6b396f3760c4c4b6e4de776869a88ce07fce.tar.gz
volse-hubzilla-40ae6b396f3760c4c4b6e4de776869a88ce07fce.tar.bz2
volse-hubzilla-40ae6b396f3760c4c4b6e4de776869a88ce07fce.zip
fix php warnings
Diffstat (limited to 'Zotlabs/Module/Appman.php')
-rw-r--r--Zotlabs/Module/Appman.php58
1 files changed, 28 insertions, 30 deletions
diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php
index 2ada83c3e..34f5f453d 100644
--- a/Zotlabs/Module/Appman.php
+++ b/Zotlabs/Module/Appman.php
@@ -65,15 +65,15 @@ class Appman extends \Zotlabs\Web\Controller {
}
if (intval($sync[0]['app_system'])) {
- Libsync::build_sync_packet($uid, ['sysapp' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
- Libsync::build_sync_packet($uid, ['app' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
- if(isset($_POST['deleted']) && $_POST['deleted']) {
+ if(isset($_POST['delete']) && $_POST['delete']) {
// Fetch the app for sync before it is deleted (if it is deletable))
$sync = q("SELECT * FROM app WHERE app_channel = %d AND app_id = '%s' LIMIT 1",
@@ -91,18 +91,18 @@ class Appman extends \Zotlabs\Web\Controller {
$sync[0]['app_deleted'] = 1;
if (intval($sync[0]['app_system'])) {
- Libsync::build_sync_packet($uid, ['sysapp' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
- Libsync::build_sync_packet($uid, ['app' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
- if($_POST['edit']) {
+ if(isset($_POST['edit']) && $_POST['edit']) {
return;
}
- if($_POST['feature']) {
+ if(isset($_POST['feature']) && $_POST['feature']) {
Apps::app_feature(local_channel(), $papp, $_POST['feature']);
$sync = q("SELECT * FROM app WHERE app_channel = %d AND app_id = '%s' LIMIT 1",
@@ -111,14 +111,14 @@ class Appman extends \Zotlabs\Web\Controller {
);
if (intval($sync[0]['app_system'])) {
- Libsync::build_sync_packet($uid, ['sysapp' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
- Libsync::build_sync_packet($uid, ['app' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
- if($_POST['pin']) {
+ if(isset($_POST['pin']) && $_POST['pin']) {
Apps::app_feature(local_channel(), $papp, $_POST['pin']);
$sync = q("SELECT * FROM app WHERE app_channel = %d AND app_id = '%s' LIMIT 1",
@@ -127,14 +127,14 @@ class Appman extends \Zotlabs\Web\Controller {
);
if (intval($sync[0]['app_system'])) {
- Libsync::build_sync_packet($uid, ['sysapp' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
- Libsync::build_sync_packet($uid, ['app' => $sync]);
+ Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
- if($_POST['aj']) {
+ if(isset($_POST['aj']) && $_POST['aj']) {
killme();
}
@@ -171,7 +171,7 @@ class Appman extends \Zotlabs\Web\Controller {
$app = null;
$embed = null;
- if($_REQUEST['appid']) {
+ if(isset($_REQUEST['appid']) && $_REQUEST['appid']) {
$r = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($_REQUEST['appid']),
dbesc(local_channel())
@@ -200,27 +200,25 @@ class Appman extends \Zotlabs\Web\Controller {
}
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'] : ''),
- '$author' => (($app) ? $app['app_author'] : $channel['channel_hash']),
- '$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']),
- '$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')),
- '$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')),
- '$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''),
- '$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_photo'] : ''), t('80 x 80 pixels - optional')),
- '$categories' => array('categories',t('Categories (optional, comma separated list)'),(($app) ? $app['categories'] : ''),''),
- '$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''),
- '$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''),
- '$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''),
- '$system' => (($app) ? intval($app['app_system']) : 0),
- '$plugin' => (($app) ? $app['app_plugin'] : ''),
- '$requires' => (($app) ? $app['app_requires'] : ''),
+ '$guid' => $app['app_id'] ?? '',
+ '$author' => $app['app_author'] ?? $channel['channel_hash'],
+ '$addr' => $app['app_addr'] ?? $channel['xchan_addr'],
+ '$name' => array('name', t('Name of app'), $app['app_name'] ?? '', t('Required')),
+ '$url' => array('url', t('Location (URL) of app'), $app['app_url'] ?? '', t('Required')),
+ '$desc' => array('desc', t('Description'), $app['app_desc'] ?? '', ''),
+ '$photo' => array('photo', t('Photo icon URL'),$app['app_photo'] ?? '', t('80 x 80 pixels - optional')),
+ '$categories' => array('categories',t('Categories (optional, comma separated list)'), $app['categories'] ?? '',''),
+ '$version' => array('version', t('Version ID'), $app['app_version'] ?? '', ''),
+ '$price' => array('price', t('Price of app'), $app['app_price'] ?? '', ''),
+ '$page' => array('page', t('Location (URL) to purchase app'), $app['app_page'] ?? '', ''),
+ '$system' => $app['app_system'] ?? 0,
+ '$plugin' => $app['app_plugin'] ?? '',
+ '$requires' => $app['app_requires'] ?? '',
'$embed' => $embed,
'$submit' => t('Submit')
));
-
}
}