Reformatted Webpages.php to clean up whitespace, where there was a mixture of spaces and tabs for indentation. No other changes made.

This commit is contained in:
Andrew Manning 2017-04-29 12:56:25 -04:00
parent 635b8ff73a
commit e99be61d49

View File

@ -1,11 +1,11 @@
<?php <?php
namespace Zotlabs\Module; namespace Zotlabs\Module;
require_once('include/channel.php'); require_once('include/channel.php');
require_once('include/conversation.php'); require_once('include/conversation.php');
require_once('include/acl_selectors.php'); require_once('include/acl_selectors.php');
class Webpages extends \Zotlabs\Web\Controller { class Webpages extends \Zotlabs\Web\Controller {
function init() { function init() {
@ -23,10 +23,8 @@ class Webpages extends \Zotlabs\Web\Controller {
return; return;
profile_load($which); profile_load($which);
} }
function get() { function get() {
if (!\App::$profile) { if (!\App::$profile) {
@ -100,8 +98,7 @@ class Webpages extends \Zotlabs\Web\Controller {
if (!$owner) { if (!$owner) {
// Figure out who the page owner is. // Figure out who the page owner is.
$r = q("select channel_id from channel where channel_address = '%s'", $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which)
dbesc($which)
); );
if ($r) { if ($r) {
$owner = intval($r[0]['channel_id']); $owner = intval($r[0]['channel_id']);
@ -135,8 +132,7 @@ class Webpages extends \Zotlabs\Web\Controller {
'deny_cid' => $channel['channel_deny_cid'], 'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid'] 'deny_gid' => $channel['channel_deny_gid']
); );
} } else {
else {
$channel_acl = ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '']; $channel_acl = ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => ''];
} }
@ -180,15 +176,12 @@ class Webpages extends \Zotlabs\Web\Controller {
/** @TODO - this should be replaced with pagelist_widget */ /** @TODO - this should be replaced with pagelist_widget */
$sql_extra = item_permissions_sql($owner); $sql_extra = item_permissions_sql($owner);
$r = q("select * from iconfig left join item on iconfig.iid = item.id $r = q("select * from iconfig left join item on iconfig.iid = item.id
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item_type = %d where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item_type = %d
$sql_extra order by item.created desc", $sql_extra order by item.created desc", intval($owner), intval(ITEM_TYPE_WEBPAGE)
intval($owner),
intval(ITEM_TYPE_WEBPAGE)
); );
// $r = q("select * from item_id left join item on item_id.iid = item.id // $r = q("select * from item_id left join item on item_id.iid = item.id
@ -309,7 +302,6 @@ class Webpages extends \Zotlabs\Web\Controller {
return null; return null;
} }
$cloud = true; $cloud = true;
} }
// If the website files were uploaded or specified in the cloud files, then $cloud // If the website files were uploaded or specified in the cloud files, then $cloud
@ -335,7 +327,6 @@ class Webpages extends \Zotlabs\Web\Controller {
notice(t('No webpage elements detected.') . EOL); notice(t('No webpage elements detected.') . EOL);
$_SESSION['action'] = null; $_SESSION['action'] = null;
} }
} }
// If the website elements were imported from a zip file, delete the temporary decompressed files // If the website elements were imported from a zip file, delete the temporary decompressed files
@ -352,7 +343,6 @@ class Webpages extends \Zotlabs\Web\Controller {
// Import layout first so that pages that reference new layouts will find // Import layout first so that pages that reference new layouts will find
// the mid of layout items in the database // the mid of layout items in the database
// Obtain the user-selected layouts to import and import them // Obtain the user-selected layouts to import and import them
$checkedlayouts = $_POST['layout']; $checkedlayouts = $_POST['layout'];
$layouts = []; $layouts = [];
@ -426,7 +416,6 @@ class Webpages extends \Zotlabs\Web\Controller {
$filename = 'website.zip'; $filename = 'website.zip';
} }
$_SESSION['zipfilename'] = $filename; $_SESSION['zipfilename'] = $filename;
} }
break; break;
@ -462,9 +451,7 @@ class Webpages extends \Zotlabs\Web\Controller {
foreach ($checkedblocks as $mid) { foreach ($checkedblocks as $mid) {
$b = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig $b = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig
left join item on item.id = iconfig.iid left join item on item.id = iconfig.iid
where mid = '%s' and item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'BUILDBLOCK' order by iconfig.v asc limit 1", where mid = '%s' and item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'BUILDBLOCK' order by iconfig.v asc limit 1", dbesc($mid), intval($channel['channel_id'])
dbesc($mid),
intval($channel['channel_id'])
); );
if ($b) { if ($b) {
$b = $b[0]; $b = $b[0];
@ -520,9 +507,7 @@ class Webpages extends \Zotlabs\Web\Controller {
foreach ($checkedlayouts as $mid) { foreach ($checkedlayouts as $mid) {
$l = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig $l = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig
left join item on item.id = iconfig.iid left join item on item.id = iconfig.iid
where mid = '%s' and item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'PDL' order by iconfig.v asc limit 1", where mid = '%s' and item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'PDL' order by iconfig.v asc limit 1", dbesc($mid), intval($channel['channel_id'])
dbesc($mid),
intval($channel['channel_id'])
); );
if ($l) { if ($l) {
$l = $l[0]; $l = $l[0];
@ -564,10 +549,7 @@ class Webpages extends \Zotlabs\Web\Controller {
foreach ($checkedpages as $mid) { foreach ($checkedpages as $mid) {
$p = q("select * from iconfig left join item on iconfig.iid = item.id $p = q("select * from iconfig left join item on iconfig.iid = item.id
where item.uid = %d and item.mid = '%s' and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item_type = %d", where item.uid = %d and item.mid = '%s' and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item_type = %d", intval($channel['channel_id']), dbesc($mid), intval(ITEM_TYPE_WEBPAGE)
intval($channel['channel_id']),
dbesc($mid),
intval(ITEM_TYPE_WEBPAGE)
); );
if ($p) { if ($p) {
@ -577,9 +559,7 @@ class Webpages extends \Zotlabs\Web\Controller {
if ($pp['layout_mid']) { if ($pp['layout_mid']) {
$l = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig $l = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig
left join item on item.id = iconfig.iid left join item on item.id = iconfig.iid
where mid = '%s' and item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'PDL' order by iconfig.v asc limit 1", where mid = '%s' and item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'PDL' order by iconfig.v asc limit 1", dbesc($pp['layout_mid']), intval($channel['channel_id'])
dbesc($pp['layout_mid']),
intval($channel['channel_id'])
); );
if ($l) { if ($l) {
$l = $l[0]; $l = $l[0];
@ -693,15 +673,14 @@ class Webpages extends \Zotlabs\Web\Controller {
logger('Error exporting webpage elements', LOGGER_NORMAL); logger('Error exporting webpage elements', LOGGER_NORMAL);
} }
rrmdir($zip_folderpath); rrmdir($tmp_folderpath); // delete temporary files rrmdir($zip_folderpath);
rrmdir($tmp_folderpath); // delete temporary files
break; break;
default : default :
break; break;
} }
}
}
} }
} }