if (x($_REQUEST, 'dropitems')) {
$arr_drop = explode(',', $_REQUEST['dropitems']);
drop_items($arr_drop);
- $json = array('success' => 1);
+ $json = ['success' => 1];
echo json_encode($json);
killme();
}
}
}
- $tagged = array();
+ $tagged = [];
$private_forum = false;
$only_to_forum = false;
- $forum_contact = array();
+ $forum_contact = [];
if (count($tags)) {
foreach ($tags as $tag) {
$parent_uri = $uri;
}
- $datarray = array();
+ $datarray = [];
$datarray['uid'] = $profile_uid;
$datarray['type'] = $post_type;
$datarray['wall'] = $wall;
$datarray['postopts'] = $postopts;
$datarray['origin'] = $origin;
$datarray['moderated'] = $allow_moderated;
- $datarray['gcontact-id'] = GContact::getId(array("url" => $datarray['author-link'], "network" => $datarray['network'],
- "photo" => $datarray['author-avatar'], "name" => $datarray['author-name']));
+ $datarray['gcontact-id'] = GContact::getId(["url" => $datarray['author-link'], "network" => $datarray['network'],
+ "photo" => $datarray['author-avatar'], "name" => $datarray['author-name']]);
$datarray['object'] = $object;
$datarray['last-child'] = 1;
// We set the datarray ID to -1 because in preview mode the dataray
// doesn't have an ID.
$datarray["id"] = -1;
- $o = conversation($a,array(array_merge($contact_record,$datarray)),'search', false, true);
+ $o = conversation($a,[array_merge($contact_record,$datarray)],'search', false, true);
logger('preview: ' . $o);
- echo json_encode(array('preview' => $o));
+ echo json_encode(['preview' => $o]);
killme();
}
goaway($return_path);
}
- $json = array('cancel' => 1);
+ $json = ['cancel' => 1];
if (x($_REQUEST, 'jsreload') && strlen($_REQUEST['jsreload'])) {
$json['reload'] = System::baseUrl() . '/' . $_REQUEST['jsreload'];
}
// This could be done in Item::update as well - but we have to check for the existance of some fields.
put_item_in_cache($datarray);
- $fields = array(
+ $fields = [
'title' => $datarray['title'],
'body' => $datarray['body'],
'tag' => $datarray['tag'],
'rendered-html' => $datarray['rendered-html'],
'rendered-hash' => $datarray['rendered-hash'],
'edited' => datetime_convert(),
- 'changed' => datetime_convert());
+ 'changed' => datetime_convert()];
Item::update($fields, ['id' => $post_id]);
// These notifications are sent if someone else is commenting other your wall
if ($parent) {
if ($contact_record != $author) {
- notification(array(
+ notification([
'type' => NOTIFY_COMMENT,
'notify_flags' => $user['notify-flags'],
'language' => $user['language'],
'otype' => 'item',
'parent' => $parent,
'parent_uri' => $parent_item['uri']
- ));
+ ]);
}
// Store the comment signature information in case we need to relay to Diaspora
Diaspora::storeCommentSignature($datarray, $author, ($self ? $user['prvkey'] : false), $post_id);
} else {
if (($contact_record != $author) && !count($forum_contact)) {
- notification(array(
+ notification([
'type' => NOTIFY_WALL,
'notify_flags' => $user['notify-flags'],
'language' => $user['language'],
'source_photo' => $datarray['author-avatar'],
'verb' => ACTIVITY_POST,
'otype' => 'item'
- ));
+ ]);
}
}
$html = prepare_body($datarray);
$message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
include_once 'include/html2plain.php';
- $params = array (
+ $params = [
'fromName' => $a->user['username'],
'fromEmail' => $a->user['email'],
'toEmail' => $addr,
'messageSubject' => $subject,
'htmlVersion' => $message,
'textVersion' => html2plain($html.$disclaimer)
- );
+ ];
Emailer::send($params);
}
}
// We now do it in the background to save some time.
// This is important in interactive environments like the frontend or the API.
// We don't fork a new process since this is done anyway with the following command
- Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowEntry", $post_id);
+ Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "CreateShadowEntry", $post_id);
// Call the background process that is delivering the item to the receivers
Worker::add(PRIORITY_HIGH, "Notifier", $notify_type, $post_id);
goaway($return_path);
}
- $json = array('success' => 1);
+ $json = ['success' => 1];
if (x($_REQUEST, 'jsreload') && strlen($_REQUEST['jsreload'])) {
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
}
$o = drop_item($a->argv[2], !is_ajax());
if (is_ajax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>]
- echo json_encode(array(intval($a->argv[2]), intval($o)));
+ echo json_encode([intval($a->argv[2]), intval($o)]);
killme();
}
}
}
}
- return array('replaced' => $replaced, 'contact' => $r[0]);
+ return ['replaced' => $replaced, 'contact' => $r[0]];
}