fix button save settings CT#7539

1.10.x
aragonc 10 years ago
parent f18f238ab3
commit 116af4f1f8
  1. 364
      app/Resources/public/css/base.css
  2. 2
      main/admin/settings.lib.php
  3. 106
      main/inc/lib/social.lib.php
  4. 99
      main/template/default/social/user_block.tpl

@ -1384,207 +1384,6 @@ a.unread {
padding:2px;
}
.social-profile-extended {
width:320px;
overflow:hidden;
}
div.image-social-content {
float:left;
/*border:1px dotted #ccc;*/
margin:2px;
padding: 8px 4px 4px 4px;
background: #ffffff;
height:105px;
width:82px;
z-index:5;
cursor:pointer;
position:relative;
overflow:hidden;
}
div.image-social-content span {
overflow:hidden;
display:block;
height:75px;
}
div.image-social-content img {
vertical-align:middle;
}
div.image-social-content center.friend {
overflow:hidden;
height:30px;
}
.image-social-content .image-delete {
position: absolute;
top: 1px;
right: 1px;
cursor: pointer;
}
.social-info {
background:#B8C8DC;
color:#4475B0;
font-size:12px;
font-weight:bold;
}
.social-display-image {
float:right;
margin-top:-130px;
margin-right:5px;
}
.social-search-image {
color:#000033;
margin-top:2px;
width:200px;
}
.social-subtitle-search {
background:#ffffff;
border-top:1px #9DACBF solid;
border-bottom:1px #9DACBF solid;
}
.social-align-box {
text-align:left;
float:left;
}
.social-header {
margin-bottom:8px;
}
#social-content {
width:100%;
height:auto;
overflow:hidden;
margin-left:auto;
margin-right:auto;
}
#social-content-right {
height: auto;
margin-left: 190px;
overflow: hidden;
width: 75%;
}
.social-content-image {
margin-bottom:10px;
margin-top:2px;
overflow:hidden;
}
#social-content-left {
display:block;
float:left;
height:auto;
min-height:300px;
overflow:hidden;
width:180px;
}
.social-content-description {
background:#ECE9D8;
}
.social-content-body {
background:#ffffff;
}
.social-content-table {
border-top:1px #9DACBF solid;
border-left:1px #9DACBF solid;
border-right:1px #9DACBF solid;
border-bottom:1px #9DACBF solid;
}
.social-profile-info {
width:100%;
}
/* general layout of the profile page */
#social-profile-wrapper {
width: 100%;
text-align:left;
margin:0 auto;
float: left;
}
#social-profile-container {
/* width: 705px; */
}
#social-profile-left {
float:left;
width:22%;
}
#social-profile-content {
float:right;
width:47%;
margin-left: 4px;
}
#social-profile-right {
float:right;
width:30%;
margin-left: 4px;
}
/* SOCIAL MENU VERTICAL */
.social-network-menu {
width:100%;
height:auto;
}
.social-menu-sub-level {
margin-left:20px;
}
/* BOX SHARED PROFILE */
.social-menu-groups {
border-top:1px solid #ddd;
margin-top:2px;
}
.social-menu-groups li {
padding:5px;
}
.social-menu-groups li a{
margin-left:6px;
}
.social_menu_items ul li{
padding:5px;
}
.social_menu_items ul li a{
padding-left:6px;
}
.social_menu_option {
color: #999999;
font-size: 9px;
font-weight: bold;
margin-top: 12px;
margin-bottom:10px;
}
.social-friend-container {
width:100%;
overflow:hidden;
}
.shared_profile_mygroups_grid_container {
width:100%;
overflow:hidden;
}
.shared_profile_mygroups_grid_item {
width:42%;
float:left;
height:140px;
margin:20px;
}
.social-menu-group-member {
float:left;
height:120px;
margin:5px;
overflow:hidden;
padding:2px;
width:76px;
}
.box_shared_profile_group_title {
border-bottom:1pt dotted #000;
padding:5px;
@ -1606,115 +1405,6 @@ div.image-social-content center.friend {
text-align:right;
}
.social-groups-text1 {
font-size:12px;
color:#669;
}
.social-groups-text2 {
font-size:12px;
color:#686868;
font-weight:bold;
}
.social-groups-text3 {
font-size:12px;
color:#000;
font-weight:bold;
text-transform:capitalize;
margin-top:5px;
}
.social-groups-text4 {
font-size:12px;
color:#666666;
}
.social-groups-image {
/* border: 2px solid #cac9c9; */
}
.social-groups-home-title {
border-top: 1px solid #E2E2E2;
padding:2px;
margin-bottom:5px;
font-weight:bold;
background: #F2F2F2;
}
.social-home-users-online {
border:3px solid #E6E6E6;
}
#social-content-online {
margin-bottom:5px;
margin-top:2px;
padding:1px;
}
#social-group-details {
margin-bottom:20px;
}
.social-group-details-info span {
color:#777;
}
.social-group-details-info {
padding:2px 0px 2px 0px;
}
.social-background-content {
z-index:5;
text-align: center;
}
.social-background-content .hidden_message {
cursor:pointer;
position:absolute;
top:0px;
right:0px;
}
.hidden_message {
background-color:#5A5A5A;
padding:2px;
margin:0px;
}
.hidden_message a {
color:#fff !important;
/* text-decoration: underline; */
}
#social-forum-main-title {
font-size:130%;
font-weight:bold;
padding: 0px 8px 0px 8px;
}
#social-forum-title {
font-size:130%;
font-weight:bold;
padding: 0px 8px 0px 8px;
}
#social-thread {
/*-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px; */
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
border:1px solid #E1E1E0;
background-color:#E1E1E0;
padding:8px;
font-size:110%;
font-weight:bold;
}
#social-post {
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
/* -moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px; */
border:1px solid #E1E1E0;
background-color:#ECECEB;
padding:12px;
}
/* GROUP TOOL */
#group_description {
margin: 10px 0px 10px 0px;
}
@ -1816,34 +1506,6 @@ div.image-social-content center.friend {
margin-right:4px;
}
textarea {
border:1px solid #CCCCCC;
padding:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
color:#666666;
}
select {
color:#555;
border: 1px solid #CCC;
padding: 4px;
background-color: #F3F3F3;
font-size: 12px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
}
/* Fixes the FB input*/
input.maininput:focus {
box-shadow:0 0 0px #fff;
border:none;
}
/* Big icons course home page styles */
#course_tools .big_icon {
padding:10px;
@ -4780,9 +4442,13 @@ i.size-32.icon-new-work{
margin-right: 5px;
}
.social-network-menu .nav li a{
padding: 8px;
padding: 5px;
font-size: 12px;
}
.social-network-menu .nav-pills li.active a{
background: none;
color: #1ABC9C;
}
.social-network-menu .nav li a img{
vertical-align: bottom;
margin-right: 5px;
@ -4800,16 +4466,26 @@ i.size-32.icon-new-work{
.bottom_actions {
display: block;
}
.bottom_actions .form-group{
margin-bottom: 10px;
}
.bottom_actions_fixed {
position: fixed;
z-index: 9001;
z-index: 9999;
bottom: 0;
left: 0px;
margin-bottom: 0px;
background:#ECF0F1;
padding: 20px;
border-top: 3px solid #DCE4EC;
padding-top: 20px;
padding-bottom: 10px;
border-top: 1px solid #DCE4EC;
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed));
background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%);
background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%);
background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%);
background: linear-gradient(to bottom, #ffffff 0%,#f6f6f6 47%,#ededed 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 );
}
.sessions-items{
list-style: none;

@ -1440,7 +1440,9 @@ function generate_settings_form($settings, $settings_by_access_list)
if (!empty($settings)) {
$form->setDefaults($default_values);
}
$form->addHtml('<div class="bottom_actions">');
$form->addButtonSave(get_lang('SaveSettings'));
$form->addHtml('</div>');
return $form;
}

@ -725,18 +725,18 @@ class SocialManager extends UserManager
array('shared_profile', 'groups', 'group_edit', 'member_list', 'waiting_list', 'invite_friends')
)) {
$html .= '<div class="panel panel-default sidebar-nav">';
$html .= '<div class="panel-body">';
$html .= '<ul class="nav nav-pills nav-stacked">';
$links .= '<ul class="nav nav-pills nav-stacked">';
$active = $show == 'home' ? 'active' : null;
$html .= '
$links .= '
<li class="home-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
' . $homeIcon . ' ' . get_lang('Home') . '
</a>
</li>';
$active = $show == 'messages' ? 'active' : null;
$html .= '
$links .= '
<li class="messages-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
@ -745,7 +745,7 @@ class SocialManager extends UserManager
//Invitations
$active = $show == 'invitations' ? 'active' : null;
$html .= '
$links .= '
<li class="invitations-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
@ -754,21 +754,21 @@ class SocialManager extends UserManager
//Shared profile and groups
$active = $show == 'shared_profile' ? 'active' : null;
$html .= '
$links .= '
<li class="shared-profile-icon' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
</a>
</li>';
$active = $show == 'friends' ? 'active' : null;
$html .= '
$links .= '
<li class="friends-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
' . $friendsIcon . ' ' . get_lang('Friends') . '
</a>
</li>';
$active = $show == 'browse_groups' ? 'active' : null;
$html .= '
$links .= '
<li class="browse-groups-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
@ -777,7 +777,7 @@ class SocialManager extends UserManager
//Search users
$active = $show == 'search' ? 'active' : null;
$html .= '
$links .= '
<li class="search-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
' . $searchIcon . ' ' . get_lang('Search') . '
@ -786,13 +786,22 @@ class SocialManager extends UserManager
//My files
$active = $show == 'myfiles' ? 'active' : null;
$html .= '
$links .= '
<li class="myfiles-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
' . $filesIcon . ' ' . get_lang('MyFiles') . '
</a>
</li>';
$html .='</ul></div></div>';
$links .='</ul>';
$html .= Display::panelCollapse(
get_lang('SocialNetwork'),
$links,
'social-network-menu',
null,
'sn-sidebar',
'sn-sidebar-collapse'
);
}
if (in_array($show, $show_groups) && !empty($group_id)) {
@ -804,13 +813,12 @@ class SocialManager extends UserManager
}
if ($show == 'shared_profile') {
$html .= '<div class="panel panel-default sidebar-nav">';
$html .= '<div class="panel-body">';
$html .= '<ul class="nav nav-pills nav-stacked">';
$links .= '<ul class="nav nav-pills nav-stacked">';
// My own profile
if ($show_full_profile && $user_id == intval(api_get_user_id())) {
$html .= '
$links .= '
<li class="home-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
' . $homeIcon . ' ' . get_lang('Home') . '
@ -822,14 +830,14 @@ class SocialManager extends UserManager
</a>
</li>';
$active = $show == 'invitations' ? 'active' : null;
$html .= '
$links .= '
<li class="invitations-icon' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
</a>
</li>';
$html .= '
$links .= '
<li class="shared-profile-icon active">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
@ -846,14 +854,14 @@ class SocialManager extends UserManager
</a>
</li>';
$active = $show == 'search' ? 'active' : null;
$html .= '
$links .= '
<li class="search-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
' . $searchIcon . ' ' . get_lang('Search') . '
</a>
</li>';
$active = $show == 'myfiles' ? 'active' : null;
$html .= '
$links .= '
<li class="myfiles-icon ' . $active . '">
<a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
' . $filesIcon . ' ' . get_lang('MyFiles') . '
@ -875,8 +883,8 @@ class SocialManager extends UserManager
'user_id' => $user_id
]);
$html .= '<li>';
$html .= Display::url(
$links .= '<li>';
$links .= Display::url(
"$sendMessageIcon $sendMessageText",
$sendMesssageUrl,
[
@ -885,59 +893,29 @@ class SocialManager extends UserManager
'data-title' => $sendMessageText
]
);
$html .= '</li>';
$links .= '</li>';
}
// Check if I already sent an invitation message
$invitation_sent_list = SocialManager::get_list_invitation_sent_by_user_id(api_get_user_id());
if (isset($invitation_sent_list[$user_id]) && is_array($invitation_sent_list[$user_id]) && count($invitation_sent_list[$user_id]) > 0) {
$html .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/invitations.php">'.Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')).'&nbsp;&nbsp;'.get_lang('YouAlreadySentAnInvitation').'</a></li>';
$links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/invitations.php">'.Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')).'&nbsp;&nbsp;'.get_lang('YouAlreadySentAnInvitation').'</a></li>';
} else {
if (!$show_full_profile) {
$html .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="' . $user_id . '" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
$links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="' . $user_id . '" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
}
}
// Chat
//@todo check if user is online and if it's a friend to show the chat link
/*if (api_is_global_chat_enabled()) {
$user_name = $user_info['complete_name'];
if ($user_friend_relation == USER_RELATION_TYPE_FRIEND) {
if ($user_id != api_get_user_id()) {
//Only show chat if I'm available to talk
if ($current_user_info['user_is_online_in_chat'] == 1) {
$options = array('onclick' => "javascript:chatWith('".$user_id."', '".Security::remove_XSS($user_name)."', '".$user_info['user_is_online_in_chat']."')");
$chat_icon = $user_info['user_is_online_in_chat'] ? Display::return_icon('online.png', get_lang('Online')) : Display::return_icon('offline.png', get_lang('Offline'));
$html .= Display::tag('li',
Display::url(
$chat_icon.'&nbsp;&nbsp;'.get_lang('Chat'),
'javascript:void(0);',
$options
)
);
}
}
} else {
if ($user_id != api_get_user_id()) {
if ($current_user_info['user_is_online_in_chat'] == 1) {
$message = Security::remove_XSS(sprintf(get_lang("YouHaveToAddXAsAFriendFirst"), $user_name));
$options = array('onclick' => "javascript:chatNotYetWith('".$message."')");
$chat_icon = $user_info['user_is_online_in_chat'] ? Display::return_icon('online.png', get_lang('Online')) : Display::return_icon('offline.png', get_lang('Offline'));
$html .= Display::tag('li',
Display::url(
$chat_icon.'&nbsp;&nbsp;'.get_lang('Chat'),
'javascript:void(0);',
$options
)
);
}
}
}
}*/
$html .= '</ul></div></div>';
$links .= '</ul>';
$html .= Display::panelCollapse(
get_lang('SocialNetwork'),
$links,
'social-network-menu',
null,
'sn-sidebar',
'sn-sidebar-collapse'
);
if ($show_full_profile && $user_id == intval(api_get_user_id())) {
$personal_course_list = UserManager::get_personal_session_course_list($user_id);

@ -1,48 +1,57 @@
<div class="social-avatar">
<div class="panel panel-default">
{{ social_avatar_block }}
<p class="lead">
{{ user.firstname }}<br>{{ user.lastname }}
</p>
<ul class="list-unstyled user-details">
<li>
<a href="{{ _p.web }}main/messages/new_message.php">
<img src="{{ "instant_message.png" | icon }}" alt="{{ "Email" | get_lang }}">
{{ user.email}}
</a>
</li>
<li>
<a href="{{ vcard_user_link }}">
<img src="{{ "vcard.png" | icon(22) }}" alt="{{ "UserInfo" | get_lang }}" width="22" height="22">
{{ "UserInfo" | get_lang }}
</a>
</li>
{% if chat_enabled == 1 %}
<li>
{% if user.id == _u.id %}
<img src="{{ "online.png" | icon }}" alt="{{ "Online" | get_lang }}">
{{ "Chat" | get_lang }} ({{ "Online" | get_lang }})
{% elseif user.user_is_online_in_chat != 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 }})
<div class="sidebar-avatar">
<div class="panel-group" id="sn-avatar" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="heading-sn">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#sn-avatar" href="#sn-avatar-one" aria-expanded="true" aria-controls="sn-avatar-one">
{{ "Role" | get_lang }}
</a>
{% else %}
<img src="{{ "offline.png" | icon }}" alt="{{ "Online" | get_lang }}">
{{ "Chat" | get_lang }} ({{ "Offline" | get_lang }})
{% endif %}
</li>
{% endif %}
</ul>
{% if not profile_edition_link is empty %}
<p>
<a class="btn btn-default btn-sm" href="{{ profile_edition_link }}">
<i class="fa fa-edit"></i>
{{ "EditProfile" | get_lang }}
</a>
</p>
{% endif %}
</h4>
</div>
<div id="sn-avatar-one" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading-sn">
<div class="panel-body">
{{ social_avatar_block }}
{{ user.complete_name }}
<ul class="list-unstyled user-details">
<li>
<a href="{{ _p.web }}main/messages/new_message.php">
<img src="{{ "instant_message.png" | icon }}" alt="{{ "Email" | get_lang }}">
{{ user.email}}
</a>
</li>
<li>
<a href="{{ vcard_user_link }}">
<img src="{{ "vcard.png" | icon(22) }}" alt="{{ "UserInfo" | get_lang }}" width="22" height="22">
{{ "UserInfo" | get_lang }}
</a>
</li>
{% if chat_enabled == 1 %}
<li>
{% if user.id == _u.id %}
<img src="{{ "online.png" | icon }}" alt="{{ "Online" | get_lang }}">
{{ "Chat" | get_lang }} ({{ "Online" | get_lang }})
{% elseif user.user_is_online_in_chat != 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>
{% else %}
<img src="{{ "offline.png" | icon }}" alt="{{ "Online" | get_lang }}">
{{ "Chat" | get_lang }} ({{ "Offline" | get_lang }})
{% endif %}
</li>
{% endif %}
</ul>
{% if not profile_edition_link is empty %}
<a class="btn btn-default btn-sm" href="{{ profile_edition_link }}">
<i class="fa fa-edit"></i>{{ "EditProfile" | get_lang }}
</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save