From d86135b0d7cdf6f1e945fea2137b085931b54902 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 21 Sep 2015 09:25:01 +0200 Subject: [PATCH] Fix twig code, format code --- main/inc/lib/social.lib.php | 8 ++++---- main/social/profile.php | 10 +++++++--- main/social/search.php | 6 +++--- main/social/vcard_export.php | 14 ++++++-------- main/template/default/social/form_modals.tpl | 5 +---- main/template/default/social/group_block.tpl | 2 +- main/template/default/social/profile.tpl | 13 ++++++------- main/template/default/social/search.tpl | 4 ++-- main/template/default/social/user_block.tpl | 11 +++++------ 9 files changed, 35 insertions(+), 38 deletions(-) diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 5dbeeded24..aa36a5bc78 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -1581,16 +1581,16 @@ class SocialManager extends UserManager if (api_get_user_id() == $userId) { $profileEditionLink = Display::getProfileEditionLink($userId); } - + $vCardUserLink = Display::getVCardUserLink($userId); $userInfo = api_get_user_info($userId, true, false, true); $template->assign('user', $userInfo); - $template->assign('socialAvatarBlock', $socialAvatarBlock); - $template->assign('profileEditionLink', $profileEditionLink); + $template->assign('social_avatar_block', $socialAvatarBlock); + $template->assign('profile_edition_link', $profileEditionLink); //Added the link to export the vCard to the Template - $template->assign('vCardUserLink', $vCardUserLink); + $template->assign('vcard_user_link', $vCardUserLink); if (api_get_setting('gamification_mode') === '1') { $gamificationPoints = GamificationUtils::getTotalUserPoints( diff --git a/main/social/profile.php b/main/social/profile.php index 150435e717..b6c89d2d7e 100755 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -54,6 +54,8 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp ); } + Display::addFlash(Display::return_message(get_lang('MessageSent'))); + $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); header('Location: ' . $url); @@ -68,6 +70,7 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp $messageId, MESSAGE_STATUS_WALL ); + Display::addFlash(Display::return_message(get_lang('MessageSent'))); $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); header('Location: ' . $url); @@ -76,6 +79,7 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp } else if (isset($_GET['messageId'])) { $messageId = Security::remove_XSS($_GET['messageId']); $status = SocialManager::deleteMessage($messageId); + Display::addFlash(Display::return_message(get_lang('MessageDeleted'))); header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php'); exit; @@ -637,11 +641,11 @@ $tpl->assign('social_right_information', $socialRightInformation); $tpl->assign('social_auto_extend_link', $socialAutoExtendLink); $formModalTpl = new Template(); -$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message')); -$formModalTpl->assign('invitationForm', MessageManager::generate_invitation_form('send_invitation')); +//$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message')); +$formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation')); $formModals = $formModalTpl->fetch('default/social/form_modals.tpl'); -$tpl->assign('formModals', $formModals); +$tpl->assign('form_modals', $formModals); $social_layout = $tpl->get_template('social/profile.tpl'); $tpl->display($social_layout); diff --git a/main/social/search.php b/main/social/search.php index de6ab5dede..95458f4440 100755 --- a/main/social/search.php +++ b/main/social/search.php @@ -220,11 +220,11 @@ $tpl->assign('social_right_content', $social_right_content); $tpl->assign('search_form', $searchForm); $formModalTpl = new Template(); -$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message')); -$formModalTpl->assign('invitationForm', MessageManager::generate_invitation_form('send_invitation')); +//$formModalTpl->assign('message_form', MessageManager::generate_message_form('send_message')); +$formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation')); $formModals = $formModalTpl->fetch('default/social/form_modals.tpl'); -$tpl->assign('formModals', $formModals); +$tpl->assign('form_modals', $formModals); $social_layout = $tpl->get_template('social/search.tpl'); $tpl->display($social_layout); diff --git a/main/social/vcard_export.php b/main/social/vcard_export.php index 529cef0f4f..ee5007d3f7 100644 --- a/main/social/vcard_export.php +++ b/main/social/vcard_export.php @@ -16,29 +16,27 @@ api_block_anonymous_users(); if (isset($_REQUEST['userId'])) { $userId = intval($_REQUEST['userId']); } else { - api_not_allowed(); - die(); + api_not_allowed(); } -//Return User Info to vCard Export +// Return User Info to vCard Export $userInfo = api_get_user_info($userId, true, false, true); -//Pre-Loaded User Info +// Pre-Loaded User Info $firstname = $userInfo['firstname']; $lastname = $userInfo['lastname']; $email = $userInfo['email']; $phone = $userInfo['phone']; $language = get_lang('Language').': '.$userInfo['language']; - -//Instance the vCard Class +// Instance the vCard Class $vcard = new VCard(); -//Adding the User Info to the vCard +// Adding the User Info to the vCard $vcard->addName($lastname, $firstname); $vcard->addEmail($email); $vcard->addPhoneNumber($phone, 'CELL'); $vcard->addNote($language); -//Generate the vCard +// Generate the vCard return $vcard->download(); diff --git a/main/template/default/social/form_modals.tpl b/main/template/default/social/form_modals.tpl index 60276ad17d..527e551ac8 100644 --- a/main/template/default/social/form_modals.tpl +++ b/main/template/default/social/form_modals.tpl @@ -9,7 +9,7 @@