From 8eb781994bd53451cfea95b2632c22ced8543e32 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Wed, 23 Jan 2013 09:58:30 -0500 Subject: [PATCH 1/2] profile_vcard: add correct menu for profile editing when multiple profiles are disabled --- boot.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 188c1b34..accaf1d0 100644 --- a/boot.php +++ b/boot.php @@ -1364,9 +1364,15 @@ if(! function_exists('profile_sidebar')) { } - - } + if ($profile['uid'] == local_user() && !feature_enabled(local_user(),'multi_profiles')) { + $profile['edit'] = array($a->get_baseurl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile')); + $profile['menu'] = array( + 'chg_photo' => t('Change profile photo'), + 'cr_new' => null, + 'entries' => array(), + ); + } @@ -1419,6 +1425,7 @@ if(! function_exists('profile_sidebar')) { if($a->theme['template_engine'] === 'internal') $location = template_escape($location); + $tpl = get_markup_template('profile_vcard.tpl'); $o .= replace_macros($tpl, array( '$profile' => $p, From 0a79b2300c531ac632f7005c674f278f0936eb71 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 15 Feb 2013 06:34:32 -0500 Subject: [PATCH 2/2] delete item page respond with json if called via ajax. --- mod/item.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/item.php b/mod/item.php index a037681d..612ac3a3 100644 --- a/mod/item.php +++ b/mod/item.php @@ -929,8 +929,13 @@ function item_content(&$a) { $o = ''; if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) { - require_once('include/items.php'); - $o = drop_item($a->argv[2]); + require_once('include/items.php'); + $o = drop_item($a->argv[2], !is_ajax()); + if (is_ajax()){ + // ajax return: [, 0 (no perm) | ] + echo json_encode(array(intval($a->argv[2]), intval($o))); + kllme(); + } } return $o; }