}
$json = array('cancel' => 1);
- if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload']))
+ if (x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload'])) {
$json['reload'] = App::get_baseurl() . '/' . $_REQUEST['jsreload'];
+ }
echo json_encode($json);
killme();
if($api_source)
return;
- if($return_path) {
+ if ($return_path) {
goaway($return_path);
}
$json = array('success' => 1);
- if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload']))
+ if (x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload'])) {
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
+ }
logger('post_json: ' . print_r($json,true), LOGGER_DEBUG);
function item_content(&$a) {
- if((! local_user()) && (! remote_user()))
+ if ((! local_user()) && (! remote_user())) {
return;
+ }
require_once('include/security.php');
$o = '';
- if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
+ if (($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
$o = drop_item($a->argv[2], !is_ajax());
- if (is_ajax()){
+ if (is_ajax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>]
echo json_encode(array(intval($a->argv[2]), intval($o)));
killme();
* This function removes the tag $tag from the text $body and replaces it with
* the appropiate link.
*
+ * @param App $a Application instance @TODO is unused in this function's scope (excluding included files)
* @param unknown_type $body the text to replace the tag in
* @param string $inform a comma-seperated string containing everybody to inform
* @param string $str_tags string to add the tag to
$r = null;
//is it a person tag?
- if(strpos($tag,'@') === 0) {
+ if (strpos($tag,'@') === 0) {
//is it already replaced?
- if(strpos($tag,'[url=')) {
+ if (strpos($tag,'[url=')) {
//append tag to str_tags
- if(!stristr($str_tags,$tag)) {
- if(strlen($str_tags))
+ if (!stristr($str_tags,$tag)) {
+ if (strlen($str_tags)) {
$str_tags .= ',';
+ }
$str_tags .= $tag;
}