Fix twig code, format code

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

@ -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(

@ -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);

@ -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);

@ -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();

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

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

@ -4,7 +4,7 @@
<div class="row">
<div class="col-md-3">
{{ social_avatar_block }}
{{ social_extra_info_block }}
{{ social_extra_info_block }}
<div class="social-network-menu">
{{ social_menu_block }}
</div>
@ -55,7 +55,7 @@
</div>
</div>
</div>
{% endif %}
{% endif %}
<!-- Block session list -->
{% if sessionList != null %}
<div class="panel-group" id="session-block" role="tablist" aria-multiselectable="true">
@ -81,14 +81,13 @@
</div>
</div>
</div>
{% endif %}
{% endif %}
{{ social_rss_block }}
{{ social_right_information }}
</div>
</div>
{% if formModals is defined %}
{{ formModals }}
{% if form_modals is defined %}
{{ form_modals }}
{% endif %}
{% endblock %}

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

@ -1,6 +1,6 @@
<div class="social-avatar">
<div class="panel panel-default">
{{ socialAvatarBlock }}
{{ social_avatar_block }}
<div class="social-avatar-name">
<p class="firstname">{{ user.firstname }}</p>
<p class="lastname">{{ user.lastname }}</p>
@ -12,15 +12,14 @@
</a>
</div>
<div class="social-avatar-vcard">
<a href="{{ vCardUserLink }}">
<a href="{{ vcard_user_link }}">
<img src="{{ "vcard.png" | icon(22) }}" alt="{{ "UserInfo" | get_lang }}">
{{ "UserInfo" | get_lang }}
</a>
</div>
{% if chat_enabled == 1 %}
{% if user.user_is_online_in_chat != 0 %}
<div class="social-avatar-chat">
<a onclick="javascript:chatWith('{{ user.id }}', '{{ user.complete_name }}', '{{ user.user_is_online }}','{{ user.avatar_small }}')" href="javascript:void(0);">
<a onclick="javascript:chatWith('{{ user.id }}', '{{ user.complete_name }}', '{{ user.user_is_online }}','{{ user.avatar_small }}')" href="javascript:void(0);">
<img src="{{ "online.png" | icon }}" alt="{{ "Online" | get_lang }}">
{{ "Chat" | get_lang }} ({{ "Online" | get_lang }})
</a>
@ -32,8 +31,8 @@
</div>
{% endif %}
{% endif %}
{% if not profileEditionLink is empty %}
<a class="btn btn-default" href="{{ profileEditionLink }}">
{% if not profile_edition_link is empty %}
<a class="btn btn-default" href="{{ profile_edition_link }}">
<i class="fa fa-edit"></i>
{{ "EditProfile" | get_lang }}
</a>

Loading…
Cancel
Save