Fix twig code, format code

1.10.x
Julio Montoya 10 years ago
parent 5aadad41f3
commit d86135b0d7
  1. 6
      main/inc/lib/social.lib.php
  2. 10
      main/social/profile.php
  3. 6
      main/social/search.php
  4. 12
      main/social/vcard_export.php
  5. 5
      main/template/default/social/form_modals.tpl
  6. 2
      main/template/default/social/group_block.tpl
  7. 5
      main/template/default/social/profile.tpl
  8. 4
      main/template/default/social/search.tpl
  9. 9
      main/template/default/social/user_block.tpl

@ -1587,10 +1587,10 @@ class SocialManager extends UserManager
$userInfo = api_get_user_info($userId, true, false, true); $userInfo = api_get_user_info($userId, true, false, true);
$template->assign('user', $userInfo); $template->assign('user', $userInfo);
$template->assign('socialAvatarBlock', $socialAvatarBlock); $template->assign('social_avatar_block', $socialAvatarBlock);
$template->assign('profileEditionLink', $profileEditionLink); $template->assign('profile_edition_link', $profileEditionLink);
//Added the link to export the vCard to the Template //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') { if (api_get_setting('gamification_mode') === '1') {
$gamificationPoints = GamificationUtils::getTotalUserPoints( $gamificationPoints = GamificationUtils::getTotalUserPoints(

@ -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 = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
header('Location: ' . $url); header('Location: ' . $url);
@ -68,6 +70,7 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
$messageId, $messageId,
MESSAGE_STATUS_WALL MESSAGE_STATUS_WALL
); );
Display::addFlash(Display::return_message(get_lang('MessageSent')));
$url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
header('Location: ' . $url); header('Location: ' . $url);
@ -76,6 +79,7 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
} else if (isset($_GET['messageId'])) { } else if (isset($_GET['messageId'])) {
$messageId = Security::remove_XSS($_GET['messageId']); $messageId = Security::remove_XSS($_GET['messageId']);
$status = SocialManager::deleteMessage($messageId); $status = SocialManager::deleteMessage($messageId);
Display::addFlash(Display::return_message(get_lang('MessageDeleted')));
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php'); header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php');
exit; exit;
@ -637,11 +641,11 @@ $tpl->assign('social_right_information', $socialRightInformation);
$tpl->assign('social_auto_extend_link', $socialAutoExtendLink); $tpl->assign('social_auto_extend_link', $socialAutoExtendLink);
$formModalTpl = new Template(); $formModalTpl = new Template();
$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message')); //$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message'));
$formModalTpl->assign('invitationForm', MessageManager::generate_invitation_form('send_invitation')); $formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation'));
$formModals = $formModalTpl->fetch('default/social/form_modals.tpl'); $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'); $social_layout = $tpl->get_template('social/profile.tpl');
$tpl->display($social_layout); $tpl->display($social_layout);

@ -220,11 +220,11 @@ $tpl->assign('social_right_content', $social_right_content);
$tpl->assign('search_form', $searchForm); $tpl->assign('search_form', $searchForm);
$formModalTpl = new Template(); $formModalTpl = new Template();
$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message')); //$formModalTpl->assign('message_form', MessageManager::generate_message_form('send_message'));
$formModalTpl->assign('invitationForm', MessageManager::generate_invitation_form('send_invitation')); $formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation'));
$formModals = $formModalTpl->fetch('default/social/form_modals.tpl'); $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'); $social_layout = $tpl->get_template('social/search.tpl');
$tpl->display($social_layout); $tpl->display($social_layout);

@ -17,28 +17,26 @@ if (isset($_REQUEST['userId'])) {
$userId = intval($_REQUEST['userId']); $userId = intval($_REQUEST['userId']);
} else { } else {
api_not_allowed(); api_not_allowed();
die();
} }
//Return User Info to vCard Export // Return User Info to vCard Export
$userInfo = api_get_user_info($userId, true, false, true); $userInfo = api_get_user_info($userId, true, false, true);
//Pre-Loaded User Info // Pre-Loaded User Info
$firstname = $userInfo['firstname']; $firstname = $userInfo['firstname'];
$lastname = $userInfo['lastname']; $lastname = $userInfo['lastname'];
$email = $userInfo['email']; $email = $userInfo['email'];
$phone = $userInfo['phone']; $phone = $userInfo['phone'];
$language = get_lang('Language').': '.$userInfo['language']; $language = get_lang('Language').': '.$userInfo['language'];
// Instance the vCard Class
//Instance the vCard Class
$vcard = new VCard(); $vcard = new VCard();
//Adding the User Info to the vCard // Adding the User Info to the vCard
$vcard->addName($lastname, $firstname); $vcard->addName($lastname, $firstname);
$vcard->addEmail($email); $vcard->addEmail($email);
$vcard->addPhoneNumber($phone, 'CELL'); $vcard->addPhoneNumber($phone, 'CELL');
$vcard->addNote($language); $vcard->addNote($language);
//Generate the vCard // Generate the vCard
return $vcard->download(); return $vcard->download();

@ -9,7 +9,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div id="send-invitation-alert"></div> <div id="send-invitation-alert"></div>
{{ invitationForm }} {{ invitation_form }}
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" id="btn-send-invitation" class="btn btn-primary"> <button type="button" id="btn-send-invitation" class="btn btn-primary">
@ -23,14 +23,11 @@
<script> <script>
$(document).on('ready', function() { $(document).on('ready', function() {
var $sendInvitationModal = $('#send-invitation-modal'); var $sendInvitationModal = $('#send-invitation-modal');
var sendToUser = 0; var sendToUser = 0;
$('.btn-to-send-invitation').on('click', function(e) { $('.btn-to-send-invitation').on('click', function(e) {
e.preventDefault(); e.preventDefault();
sendToUser = $(this).data('send-to'); sendToUser = $(this).data('send-to');
$sendInvitationModal.modal('show'); $sendInvitationModal.modal('show');
}); });

@ -1,4 +1,4 @@
<div class="panel panel-default social-avatar"> <div class="panel panel-default social-avatar">
{{ socialAvatarBlock }} {{ social_avatar_block }}
<p class="lead">{{ group_info.complete_name }}</p> <p class="lead">{{ group_info.complete_name }}</p>
</div> </div>

@ -83,12 +83,11 @@
</div> </div>
{% endif %} {% endif %}
{{ social_rss_block }} {{ social_rss_block }}
{{ social_right_information }} {{ social_right_information }}
</div> </div>
</div> </div>
{% if formModals is defined %} {% if form_modals is defined %}
{{ formModals }} {{ form_modals }}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

@ -23,7 +23,7 @@
</div> </div>
</div> </div>
{% if formModals is defined %} {% if form_modals is defined %}
{{ formModals }} {{ form_modals }}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

@ -1,6 +1,6 @@
<div class="social-avatar"> <div class="social-avatar">
<div class="panel panel-default"> <div class="panel panel-default">
{{ socialAvatarBlock }} {{ social_avatar_block }}
<div class="social-avatar-name"> <div class="social-avatar-name">
<p class="firstname">{{ user.firstname }}</p> <p class="firstname">{{ user.firstname }}</p>
<p class="lastname">{{ user.lastname }}</p> <p class="lastname">{{ user.lastname }}</p>
@ -12,9 +12,8 @@
</a> </a>
</div> </div>
<div class="social-avatar-vcard"> <div class="social-avatar-vcard">
<a href="{{ vCardUserLink }}"> <a href="{{ vcard_user_link }}">
<img src="{{ "vcard.png" | icon(22) }}" alt="{{ "UserInfo" | get_lang }}"> <img src="{{ "vcard.png" | icon(22) }}" alt="{{ "UserInfo" | get_lang }}">
{{ "UserInfo" | get_lang }}
</a> </a>
</div> </div>
{% if chat_enabled == 1 %} {% if chat_enabled == 1 %}
@ -32,8 +31,8 @@
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if not profileEditionLink is empty %} {% if not profile_edition_link is empty %}
<a class="btn btn-default" href="{{ profileEditionLink }}"> <a class="btn btn-default" href="{{ profile_edition_link }}">
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
{{ "EditProfile" | get_lang }} {{ "EditProfile" | get_lang }}
</a> </a>

Loading…
Cancel
Save