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
namespace Zotlabs\Module;
require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Webpages extends \Zotlabs\Web\Controller {
function init() {
@ -23,10 +23,8 @@ class Webpages extends \Zotlabs\Web\Controller {
return;
profile_load($which);
}
function get() {
if (!\App::$profile) {
@ -100,8 +98,7 @@ class Webpages extends \Zotlabs\Web\Controller {
if (!$owner) {
// Figure out who the page owner is.
$r = q("select channel_id from channel where channel_address = '%s'",
dbesc($which)
$r = q("select channel_id from channel where channel_address = '%s'", dbesc($which)
);
if ($r) {
$owner = intval($r[0]['channel_id']);
@ -135,8 +132,7 @@ class Webpages extends \Zotlabs\Web\Controller {
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
}
else {
} else {
$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 */
$sql_extra = item_permissions_sql($owner);
$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
$sql_extra order by item.created desc",
intval($owner),
intval(ITEM_TYPE_WEBPAGE)
$sql_extra order by item.created desc", intval($owner), intval(ITEM_TYPE_WEBPAGE)
);
// $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;
}
$cloud = true;
}
// 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);
$_SESSION['action'] = null;
}
}
// 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
// the mid of layout items in the database
// Obtain the user-selected layouts to import and import them
$checkedlayouts = $_POST['layout'];
$layouts = [];
@ -426,7 +416,6 @@ class Webpages extends \Zotlabs\Web\Controller {
$filename = 'website.zip';
}
$_SESSION['zipfilename'] = $filename;
}
break;
@ -462,9 +451,7 @@ class Webpages extends \Zotlabs\Web\Controller {
foreach ($checkedblocks as $mid) {
$b = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig
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",
dbesc($mid),
intval($channel['channel_id'])
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'])
);
if ($b) {
$b = $b[0];
@ -520,9 +507,7 @@ class Webpages extends \Zotlabs\Web\Controller {
foreach ($checkedlayouts as $mid) {
$l = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig
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",
dbesc($mid),
intval($channel['channel_id'])
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'])
);
if ($l) {
$l = $l[0];
@ -564,10 +549,7 @@ class Webpages extends \Zotlabs\Web\Controller {
foreach ($checkedpages as $mid) {
$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",
intval($channel['channel_id']),
dbesc($mid),
intval(ITEM_TYPE_WEBPAGE)
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)
);
if ($p) {
@ -577,9 +559,7 @@ class Webpages extends \Zotlabs\Web\Controller {
if ($pp['layout_mid']) {
$l = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig
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",
dbesc($pp['layout_mid']),
intval($channel['channel_id'])
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'])
);
if ($l) {
$l = $l[0];
@ -693,15 +673,14 @@ class Webpages extends \Zotlabs\Web\Controller {
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;
default :
break;
}
}
}
}
}