* @autor Alex Aragon CSS Design and Template */ /** * Initialization */ $cidReset = true; require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH) . 'skill.lib.php'; $user_id = api_get_user_id(); $show_full_profile = true; //social tab $this_section = SECTION_SOCIAL; unset($_SESSION['this_section']); //for hmtl editor repository api_block_anonymous_users(); if (api_get_setting('allow_social_tool') != 'true') { $url = api_get_path(WEB_CODE_PATH) . 'auth/profile.php'; header('Location: ' . $url); exit; api_not_allowed(); } //fast upload image if (api_get_setting('profile', 'picture') == 'true') { $form = new FormValidator('profile', 'post', 'home.php', null, array()); // PICTURE $form->addElement('file', 'picture', get_lang('AddImage')); $form->add_progress_bar(); if (!empty($user_data['picture_uri'])) { $form->addElement( 'checkbox', 'remove_picture', null, get_lang('DelImage') ); } $allowed_picture_types = api_get_supported_image_extensions(); $form->addRule( 'picture', get_lang('OnlyImagesAllowed') . ' (' . implode( ',', $allowed_picture_types ) . ')', 'filetype', $allowed_picture_types ); $form->addButtonSave(get_lang('SaveSettings'), 'apply_change'); if ($form->validate()) { $user_data = $form->getSubmitValues(); // upload picture if a new one is provided if ($_FILES['picture']['size']) { if ($new_picture = UserManager::update_user_picture( api_get_user_id(), $_FILES['picture']['name'], $_FILES['picture']['tmp_name'] ) ) { $table_user = Database :: get_main_table(TABLE_MAIN_USER); $sql = "UPDATE $table_user SET picture_uri = '$new_picture' WHERE user_id = " . api_get_user_id(); $result = Database::query($sql); } } } } //Block Menu $social_menu_block = SocialManager::show_social_menu('home'); // Search box /*$social_search_block = '';*/ $social_search_block = Display::panel(UserManager::get_search_form(''), get_lang("SearchUsers")); //BLock Social Skill $social_skill_block = ''; if (api_get_setting('allow_skills_tool') == 'true') { $skill = new Skill(); $ranking = $skill->get_user_skill_ranking(api_get_user_id()); $skills = $skill->get_user_skills(api_get_user_id(), true); //$social_skill_block = '
'; //$social_skill_block .= '
' . get_lang('Skills'); $extra = '
'; $social_skill_block = Display::panel($content, get_lang('Skills'),null,null,$extra); $lis = ''; if (!empty($skills)) { foreach ($skills as $skill) { $badgeImage = null; if (!empty($skill['icon'])) { $badgeImage = Display::img( api_get_path(WEB_DATA_PATH) . $skill['icon'], $skill['name'] ); } else { $badgeImage = Display::return_icon( 'badges-default.png', $skill['name'], array('title' => $skill['name']), ICON_SIZE_BIG ); } $lis .= Display::tag( 'li', $badgeImage . '
' . $skill['name'] . '
' ); } /*$social_skill_block .= '
'; $social_skill_block .= Display::tag('ul', $lis, array('class' => 'list-badges')); $social_skill_block .= '
';*/ $content .= Display::tag('ul', $lis, array('class' => 'list-badges')); $social_skill_block = Display::panel($content, get_lang('Skills'),null,null,$extra); } else { $social_skill_block .= Display::panel( Display::url(get_lang('SkillsWheel'),api_get_path(WEB_CODE_PATH) . 'social/skills_wheel.php'), get_lang('WithoutAchievedSkills') ); /*$social_skill_block .= '
'; $social_skill_block .= '

'. get_lang("WithoutAchievedSkills") . '

'; $social_skill_block .= '

' . Display::url(get_lang('SkillsWheel'),api_get_path(WEB_CODE_PATH) . 'social/skills_wheel.php').'

'; $social_skill_block .= '
';*/ } } //Group box by age /*$social_group_block = '