Format code, add docs.

1.10.x
Julio Montoya 10 years ago
parent a9a92938fd
commit 099b17f076
  1. 6
      main/inc/introductionSection.inc.php
  2. 41
      main/inc/lib/glossary.lib.php
  3. 1
      main/inc/lib/grade_model.lib.php
  4. 1
      main/inc/lib/pear/HTML/QuickForm.php
  5. 121
      main/inc/lib/sessionmanager.lib.php
  6. 15
      main/inc/lib/specific_fields_manager.lib.php
  7. 18
      main/messages/inbox.php
  8. 15
      main/messages/new_message.php

@ -44,7 +44,11 @@ $intro_cmdAdd = empty($_GET['intro_cmdAdd']) ? '' : $_GET['intro_cmdAdd'];
$courseId = api_get_course_id(); $courseId = api_get_course_id();
if (!empty($courseId)) { if (!empty($courseId)) {
$form = new FormValidator('introduction_text', 'post', api_get_self().'?'.api_get_cidreq()); $form = new FormValidator(
'introduction_text',
'post',
api_get_self().'?'.api_get_cidreq()
);
} else { } else {
$form = new FormValidator('introduction_text'); $form = new FormValidator('introduction_text');
} }

@ -241,7 +241,7 @@ class GlossaryManager
c_id = $course_id AND c_id = $course_id AND
name = '".Database::escape_string($term)."'"; name = '".Database::escape_string($term)."'";
if ($not_id<>'') { if ($not_id<>'') {
$sql .= " AND glossary_id <> '".Database::escape_string($not_id)."'"; $sql .= " AND glossary_id <> '".intval($not_id)."'";
} }
$result = Database::query($sql); $result = Database::query($sql);
$count = Database::num_rows($result); $count = Database::num_rows($result);
@ -311,7 +311,13 @@ class GlossaryManager
$result = Database::query($sql); $result = Database::query($sql);
if ($result === false or Database::affected_rows($result) < 1) { return false; } if ($result === false or Database::affected_rows($result) < 1) { return false; }
//update item_property (delete) //update item_property (delete)
api_item_property_update(api_get_course_info(), TOOL_GLOSSARY, intval($glossary_id), 'delete', api_get_user_id()); api_item_property_update(
api_get_course_info(),
TOOL_GLOSSARY,
intval($glossary_id),
'delete',
api_get_user_id()
);
// reorder the remaining terms // reorder the remaining terms
GlossaryManager::reorder_glossary(); GlossaryManager::reorder_glossary();
@ -324,7 +330,8 @@ class GlossaryManager
/** /**
* This is the main function that displays the list or the table with all * This is the main function that displays the list or the table with all
* the glossary terms * the glossary terms
* @param string View ('table' or 'list'). Optional parameter. Defaults to 'table' and prefers glossary_view from the session by default. * @param string View ('table' or 'list'). Optional parameter.
* Defaults to 'table' and prefers glossary_view from the session by default.
* @return void * @return void
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University, Belgium * @author Patrick Cool <patrick.cool@ugent.be>, Ghent University, Belgium
* @version januari 2009, dokeos 1.8.6 * @version januari 2009, dokeos 1.8.6
@ -393,11 +400,11 @@ class GlossaryManager
{ {
$glossary_data = self::get_glossary_data(0,1000,0,'ASC'); $glossary_data = self::get_glossary_data(0,1000,0,'ASC');
foreach ($glossary_data as $key => $glossary_item) { foreach ($glossary_data as $key => $glossary_item) {
echo '<div class="sectiontitle">'.$glossary_item[0].'</div>'; $actions = '';
echo '<div class="sectioncomment">'.$glossary_item[1].'</div>';
if (api_is_allowed_to_edit(null,true)) { if (api_is_allowed_to_edit(null,true)) {
echo '<div>'.self::actions_filter($glossary_item[2], '',$glossary_item).'</div>'; $actions = '<div class="pull-right">'.self::actions_filter($glossary_item[2], '',$glossary_item).'</div>';
} }
echo Display::panel($glossary_item[1], $glossary_item[0].' '.$actions);
} }
return true; return true;
} }
@ -456,7 +463,12 @@ class GlossaryManager
//condition for the session //condition for the session
$session_id = api_get_session_id(); $session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id, true, true, 'glossary.session_id'); $condition_session = api_get_session_condition(
$session_id,
true,
true,
'glossary.session_id'
);
$column = intval($column); $column = intval($column);
if (!in_array($direction,array('DESC', 'ASC'))) { if (!in_array($direction,array('DESC', 'ASC'))) {
$direction = 'ASC'; $direction = 'ASC';
@ -464,7 +476,8 @@ class GlossaryManager
$from = intval($from); $from = intval($from);
$number_of_items = intval($number_of_items); $number_of_items = intval($number_of_items);
$sql = "SELECT glossary.name as col0, $sql = "SELECT
glossary.name as col0,
glossary.description as col1, glossary.description as col1,
$col2 $col2
glossary.session_id glossary.session_id
@ -481,7 +494,7 @@ class GlossaryManager
$return = array(); $return = array();
$array = array(); $array = array();
while ($data = Database::fetch_array($res)) { while ($data = Database::fetch_array($res)) {
//validacion when belongs to a session // Validation when belongs to a session
$session_img = api_get_session_image($data['session_id'], $_user['status']); $session_img = api_get_session_image($data['session_id'], $_user['status']);
$array[0] = $data[0] . $session_img; $array[0] = $data[0] . $session_img;
@ -560,7 +573,9 @@ class GlossaryManager
// Database table definition // Database table definition
$t_glossary = Database :: get_course_table(TABLE_GLOSSARY); $t_glossary = Database :: get_course_table(TABLE_GLOSSARY);
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$sql = "SELECT * FROM $t_glossary WHERE c_id = $course_id ORDER by display_order ASC"; $sql = "SELECT * FROM $t_glossary
WHERE c_id = $course_id
ORDER by display_order ASC";
$res = Database::query($sql); $res = Database::query($sql);
$i = 1; $i = 1;
@ -594,7 +609,9 @@ class GlossaryManager
} }
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$sql = "SELECT * FROM $t_glossary WHERE c_id = $course_id ORDER BY display_order $sortorder"; $sql = "SELECT * FROM $t_glossary
WHERE c_id = $course_id
ORDER BY display_order $sortorder";
$res = Database::query($sql); $res = Database::query($sql);
$found = false; $found = false;
while ($row = Database::fetch_array($res)) { while ($row = Database::fetch_array($res)) {
@ -642,6 +659,6 @@ class GlossaryManager
} else { } else {
$css = ''; $css = '';
}*/ }*/
$pdf->content_to_pdf($html, $css, get_lang('Glossary').'_'.$course_code, $course_code); $pdf->content_to_pdf($html, '', get_lang('Glossary').'_'.$course_code, $course_code);
} }
} }

@ -20,6 +20,7 @@ class GradeModel extends Model
/** /**
* @param array $where_conditions * @param array $where_conditions
*
* @return array * @return array
*/ */
public function get_all($where_conditions = array()) public function get_all($where_conditions = array())

@ -1620,7 +1620,6 @@ class HTML_QuickForm extends HTML_Common
$result = $registry->validate($rule['type'], $submitValue, $rule['format'], true); $result = $registry->validate($rule['type'], $submitValue, $rule['format'], true);
} else { } else {
$result = $registry->validate($rule['type'], $submitValue, $rule['format'], false); $result = $registry->validate($rule['type'], $submitValue, $rule['format'], false);
} }
if (!$result || (!empty($rule['howmany']) && $rule['howmany'] > (int)$result)) { if (!$result || (!empty($rule['howmany']) && $rule['howmany'] > (int)$result)) {

@ -250,6 +250,7 @@ class SessionManager
/** /**
* @param string $name * @param string $name
*
* @return bool * @return bool
*/ */
public static function session_name_exists($name) public static function session_name_exists($name)
@ -573,7 +574,10 @@ class SessionManager
/** /**
* Gets the progress of learning paths in the given session * Gets the progress of learning paths in the given session
* @param int session id * @param int $sessionId
* @param int $courseId
* @param string $date_from
* @param string $date_to
* @param array options order and limit keys * @param array options order and limit keys
* @return array table with user name, lp name, progress * @return array table with user name, lp name, progress
*/ */
@ -696,9 +700,9 @@ class SessionManager
/** /**
* Gets the survey answers * Gets the survey answers
* @param int session id * @param int $sessionId
* @param int course id * @param int $courseId
* @param int survey id * @param int $surveyId
* @param array options order and limit keys * @param array options order and limit keys
* @todo fix the query * @todo fix the query
* @return array table with user name, lp name, progress * @return array table with user name, lp name, progress
@ -807,8 +811,10 @@ class SessionManager
/** /**
* Gets the progress of the given session * Gets the progress of the given session
* @param int session id * @param int $sessionId
* @param int $courseId
* @param array options order and limit keys * @param array options order and limit keys
*
* @return array table with user name, lp name, progress * @return array table with user name, lp name, progress
*/ */
public static function get_session_progress($sessionId, $courseId, $date_from, $date_to, $options) public static function get_session_progress($sessionId, $courseId, $date_from, $date_to, $options)
@ -826,8 +832,6 @@ class SessionManager
$user = Database::get_main_table(TABLE_MAIN_USER); $user = Database::get_main_table(TABLE_MAIN_USER);
$workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION); $workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$workTableAssignment = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); $workTableAssignment = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
$forum = Database::get_course_table(TABLE_FORUM);
$forum_post = Database::get_course_table(TABLE_FORUM_POST);
$tbl_course_lp = Database::get_course_table(TABLE_LP_MAIN); $tbl_course_lp = Database::get_course_table(TABLE_LP_MAIN);
$wiki = Database::get_course_table(TABLE_WIKI); $wiki = Database::get_course_table(TABLE_WIKI);
$table_stats_default = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT); $table_stats_default = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT);
@ -1287,7 +1291,7 @@ class SessionManager
/** /**
* Creates a new course code based in given code * Creates a new course code based in given code
* *
* @param string wanted code * @param string $session_name
* <code> * <code>
* $wanted_code = 'curse' if there are in the DB codes like curse1 curse2 the function will return: course3 * $wanted_code = 'curse' if there are in the DB codes like curse1 curse2 the function will return: course3
* if the course code doest not exist in the DB the same course code will be returned * if the course code doest not exist in the DB the same course code will be returned
@ -1453,8 +1457,9 @@ class SessionManager
/** /**
* Delete session * Delete session
* @author Carlos Vargas from existing code * @author Carlos Vargas from existing code
* @param array id_checked an array to delete sessions * @param array $id_checked an array to delete sessions
* @param boolean optional, true if the function is called by a webservice, false otherwise. * @param boolean $from_ws optional, true if the function is called
* by a webservice, false otherwise.
* @return void Nothing, or false on error * @return void Nothing, or false on error
* */ * */
public static function delete($id_checked, $from_ws = false) public static function delete($id_checked, $from_ws = false)
@ -1512,6 +1517,7 @@ class SessionManager
/** /**
* @param int $id_promotion * @param int $id_promotion
*
* @return bool * @return bool
*/ */
public static function clear_session_ref_promotion($id_promotion) public static function clear_session_ref_promotion($id_promotion)
@ -1825,7 +1831,6 @@ class SessionManager
return false; return false;
} }
$courseCode = Database::escape_string($courseInfo['code']);
$courseId = $courseInfo['real_id']; $courseId = $courseInfo['real_id'];
$statusCondition = null; $statusCondition = null;
@ -2187,7 +2192,11 @@ class SessionManager
} }
// Create // Create
DocumentManager::generateDefaultCertificate($courseInfo, true, $sessionId); DocumentManager::generateDefaultCertificate(
$courseInfo,
true,
$sessionId
);
} }
} }
@ -2397,8 +2406,15 @@ class SessionManager
* @param integer day_end * @param integer day_end
* @return $id_session; * @return $id_session;
* */ * */
public static function create_category_session($sname, $syear_start, $smonth_start, $sday_start, $syear_end, $smonth_end, $sday_end) public static function create_category_session(
{ $sname,
$syear_start,
$smonth_start,
$sday_start,
$syear_end,
$smonth_end,
$sday_end
) {
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
$name = trim($sname); $name = trim($sname);
$year_start = intval($syear_start); $year_start = intval($syear_start);
@ -2462,8 +2478,16 @@ class SessionManager
* @return $id; * @return $id;
* The parameter id is a primary key * The parameter id is a primary key
* */ * */
public static function edit_category_session($id, $sname, $syear_start, $smonth_start, $sday_start, $syear_end, $smonth_end, $sday_end) public static function edit_category_session(
{ $id,
$sname,
$syear_start,
$smonth_start,
$sday_start,
$syear_end,
$smonth_end,
$sday_end
) {
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
$name = trim($sname); $name = trim($sname);
$year_start = intval($syear_start); $year_start = intval($syear_start);
@ -2658,7 +2682,9 @@ class SessionManager
{ {
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
$id = intval($id); $id = intval($id);
$sql = "SELECT id, name, date_start, date_end FROM $tbl_session_category WHERE id= $id"; $sql = "SELECT id, name, date_start, date_end
FROM $tbl_session_category
WHERE id= $id";
$result = Database::query($sql); $result = Database::query($sql);
$num = Database::num_rows($result); $num = Database::num_rows($result);
if ($num > 0) { if ($num > 0) {
@ -3103,13 +3129,13 @@ class SessionManager
$sessions = array(); $sessions = array();
if (Database::num_rows($result) > 0) { if (Database::num_rows($result) > 0) {
$sessionImage = '';
$sysUploadPath = api_get_path(SYS_UPLOAD_PATH). 'sessions/'; $sysUploadPath = api_get_path(SYS_UPLOAD_PATH). 'sessions/';
$webUploadPath = api_get_path(WEB_UPLOAD_PATH). 'sessions/'; $webUploadPath = api_get_path(WEB_UPLOAD_PATH). 'sessions/';
$imgPath = api_get_path(WEB_IMG_PATH) . 'session_default_small.png'; $imgPath = api_get_path(WEB_IMG_PATH) . 'session_default_small.png';
$tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD); $tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD);
$sql = "SELECT id FROM " . $tableExtraFields . " WHERE extra_field_type = 3 AND variable='image'"; $sql = "SELECT id FROM " . $tableExtraFields . "
WHERE extra_field_type = 3 AND variable='image'";
$resultField = Database::query($sql); $resultField = Database::query($sql);
$imageFieldId = Database::fetch_assoc($resultField); $imageFieldId = Database::fetch_assoc($resultField);
@ -3286,8 +3312,8 @@ class SessionManager
/** /**
* Gets the list of courses by session filtered by access_url * Gets the list of courses by session filtered by access_url
* @param int session id * @param int $session_id
* @param string course_name * @param string $course_name
* @return array list of courses * @return array list of courses
*/ */
public static function get_course_list_by_session_id_like($session_id, $course_name = '') public static function get_course_list_by_session_id_like($session_id, $course_name = '')
@ -3705,8 +3731,9 @@ class SessionManager
$quiz_table = Database::get_course_table(TABLE_QUIZ_TEST); $quiz_table = Database::get_course_table(TABLE_QUIZ_TEST);
$course_id = $course_info['real_id']; $course_id = $course_info['real_id'];
//@todo check this query //@todo check this query
$sql = "UPDATE $quiz_table SET active = 0 WHERE c_id = $course_id AND session_id = $sid"; $sql = "UPDATE $quiz_table SET active = 0
$result = Database::query($sql); WHERE c_id = $course_id AND session_id = $sid";
Database::query($sql);
} }
$new_short_courses[] = $course_info['real_id']; $new_short_courses[] = $course_info['real_id'];
} }
@ -4955,13 +4982,21 @@ class SessionManager
continue; continue;
} }
$messages[] = Display::return_message(get_lang('StudentList') . '<br />' . $userToString, 'info', false); $messages[] = Display::return_message(get_lang('StudentList') . '<br />' . $userToString, 'info', false);
SessionManager::suscribe_users_to_session($sessionDestinationId, $newUserList, SESSION_VISIBLE_READ_ONLY, false); SessionManager::suscribe_users_to_session(
$sessionDestinationId,
$newUserList,
SESSION_VISIBLE_READ_ONLY,
false
);
} }
} else { } else {
$messages[] = Display::return_message(get_lang('NoDestinationSessionProvided'), 'warning'); $messages[] = Display::return_message(get_lang('NoDestinationSessionProvided'), 'warning');
} }
} else { } else {
$messages[] = Display::return_message(get_lang('NoStudentsFoundForSession') . ' #' . $sessionInfo['name'], 'warning'); $messages[] = Display::return_message(
get_lang('NoStudentsFoundForSession').' #'.$sessionInfo['name'],
'warning'
);
} }
} }
} else { } else {
@ -5004,7 +5039,10 @@ class SessionManager
if (!empty($result)) { if (!empty($result)) {
foreach ($result as $courseCode => $data) { foreach ($result as $courseCode => $data) {
$url = api_get_course_url($courseCode); $url = api_get_course_url($courseCode);
$htmlResult .= sprintf(get_lang('CoachesSubscribedAsATeacherInCourseX'), Display::url($courseCode, $url, array('target' => '_blank'))); $htmlResult .= sprintf(
get_lang('CoachesSubscribedAsATeacherInCourseX'),
Display::url($courseCode, $url, array('target' => '_blank'))
);
foreach ($data as $sessionId => $coachList) { foreach ($data as $sessionId => $coachList) {
$sessionInfo = self::fetch($sessionId); $sessionInfo = self::fetch($sessionId);
$htmlResult .= '<br />'; $htmlResult .= '<br />';
@ -5321,6 +5359,8 @@ class SessionManager
/** /**
* @param array $userSessionList format see self::importSessionDrhCSV() * @param array $userSessionList format see self::importSessionDrhCSV()
*
* @return string
*/ */
public static function checkSubscribeDrhToSessionList($userSessionList) public static function checkSubscribeDrhToSessionList($userSessionList)
{ {
@ -5368,6 +5408,8 @@ class SessionManager
* @param string $file * @param string $file
* @param bool $sendEmail * @param bool $sendEmail
* @param bool $removeOldRelationShips * @param bool $removeOldRelationShips
*
* @return string
*/ */
public static function importSessionDrhCSV($file, $sendEmail, $removeOldRelationShips) public static function importSessionDrhCSV($file, $sendEmail, $removeOldRelationShips)
{ {
@ -5564,6 +5606,7 @@ class SessionManager
* Gets one row from the session_rel_user table * Gets one row from the session_rel_user table
* @param int $userId * @param int $userId
* @param int $sessionId * @param int $sessionId
*
* @return array * @return array
*/ */
public static function getUserSession($userId, $sessionId) public static function getUserSession($userId, $sessionId)
@ -5985,7 +6028,7 @@ class SessionManager
); );
$sessionCategoryId = intval($sessionCategoryId); $sessionCategoryId = intval($sessionCategoryId);
// Check if sesssion category id is valid // Check if session category id is valid
if ($sessionCategoryId > 0) { if ($sessionCategoryId > 0) {
// Get table names // Get table names
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION); $sessionTable = Database::get_main_table(TABLE_MAIN_SESSION);
@ -6296,15 +6339,16 @@ class SessionManager
$accessUrlId = api_get_current_access_url_id(); $accessUrlId = api_get_current_access_url_id();
if ($accessUrlId != -1) { if ($accessUrlId != -1) {
$sql = "SELECT DISTINCT s.* " $sql = "SELECT DISTINCT s.*
. "FROM $sessionTable s " FROM $sessionTable s
. "INNER JOIN $sessionUserTable sru ON s.id = sru.id_session " INNER JOIN $sessionUserTable sru ON s.id = sru.id_session
. "INNER JOIN $sessionAccessUrlTable srau ON s.id = srau.session_id " INNER JOIN $sessionAccessUrlTable srau ON s.id = srau.session_id
. "WHERE srau.access_url_id = $accessUrlId " WHERE
. "AND ( " srau.access_url_id = $accessUrlId
. "sru.id_user IN (" . implode(', ', $userIdList) . ") " AND (
. "AND sru.relation_type = 0" sru.id_user IN (" . implode(', ', $userIdList) . ")
. ")"; AND sru.relation_type = 0
)";
} }
} }
@ -7277,7 +7321,7 @@ class SessionManager
public static function isSessionDateOkForCoach($sessionId) public static function isSessionDateOkForCoach($sessionId)
{ {
return api_get_session_visibility($sessionId); return api_get_session_visibility($sessionId);
/*
$listSessionInfo = api_get_session_info($sessionId); $listSessionInfo = api_get_session_info($sessionId);
$dateStart = $listSessionInfo['date_start']; $dateStart = $listSessionInfo['date_start'];
$dateEnd = $listSessionInfo['date_end']; $dateEnd = $listSessionInfo['date_end'];
@ -7306,7 +7350,7 @@ class SessionManager
} }
} }
return false; return false;*/
} }
/** /**
@ -7390,6 +7434,7 @@ class SessionManager
* sessionName * sessionName
* *
* @param $userId * @param $userId
*
* @return array * @return array
* *
*/ */

@ -66,7 +66,7 @@ function edit_specific_field($id, $name)
} }
$sql = 'UPDATE %s SET name = \'%s\' WHERE id = %s LIMIT 1'; $sql = 'UPDATE %s SET name = \'%s\' WHERE id = %s LIMIT 1';
$sql = sprintf($sql, $table_sf, $name, $id); $sql = sprintf($sql, $table_sf, $name, $id);
$result = Database::query($sql); Database::query($sql);
} }
/** /**
@ -283,20 +283,27 @@ function get_specific_field_code_from_name($name) {
$res = Database::query($sql); $res = Database::query($sql);
$code = strtoupper(substr($name, 0, 1)); $code = strtoupper(substr($name, 0, 1));
//if no code exists in DB, return current one //if no code exists in DB, return current one
if (Database::num_rows($res)<1) { return $code;} if (Database::num_rows($res) < 1) {
return $code;
}
$existing_list = array(); $existing_list = array();
while ($row = Database::fetch_array($res)) { while ($row = Database::fetch_array($res)) {
$existing_list[] = $row['code']; $existing_list[] = $row['code'];
} }
//if the current code doesn't exist in DB, return current one //if the current code doesn't exist in DB, return current one
if (!in_array($code,$existing_list)) { return $code;} if (!in_array($code, $existing_list)) {
return $code;
}
$idx = array_search($code, $list); $idx = array_search($code, $list);
$c = count($list); $c = count($list);
for ($i = $idx + 1, $j = 0; $j < $c; $i++, $j++) { for ($i = $idx + 1, $j = 0; $j < $c; $i++, $j++) {
if (!in_array($list[$i],$existing_list)) { return $idx[$i]; } if (!in_array($list[$i], $existing_list)) {
return $idx[$i];
}
} }
// all 26 codes are used // all 26 codes are used
return false; return false;
} }

@ -115,13 +115,17 @@ if (isset($_GET['f']) && $_GET['f'] == 'social' || api_get_setting('allow_social
$actions = null; $actions = null;
//Comes from normal profile //Comes from normal profile
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
} }
if (api_get_setting('allow_message_tool') == 'true') { if (api_get_setting('allow_message_tool') == 'true') {
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
} }
} }
@ -137,8 +141,10 @@ $social_right_content = null;
if (api_get_setting('allow_social_tool') == 'true') { if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '<div class="col-md-12">'; $social_right_content .= '<div class="col-md-12">';
$social_right_content .= '<div class="actions">'; $social_right_content .= '<div class="actions">';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?f=social">'.Display::return_icon('compose_message.png', get_lang('ComposeMessage'), array(), 32).'</a>'; $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?f=social">'.
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php?f=social">'.Display::return_icon('outbox.png', get_lang('Outbox'), array(), 32).'</a>'; Display::return_icon('compose_message.png', get_lang('ComposeMessage'), array(), 32).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php?f=social">'.
Display::return_icon('outbox.png', get_lang('Outbox'), array(), 32).'</a>';
$social_right_content .= '</div>'; $social_right_content .= '</div>';
$social_right_content .= '</div>'; $social_right_content .= '</div>';
$social_right_content .= '<div class="col-md-12">'; $social_right_content .= '<div class="col-md-12">';

@ -286,10 +286,16 @@ $socialToolIsActive = isset($_GET['f']) && $_GET['f'] == 'social';
/* MAIN SECTION */ /* MAIN SECTION */
if ($socialToolIsActive) { if ($socialToolIsActive) {
$this_section = SECTION_SOCIAL; $this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('SocialNetwork')); $interbreadcrumb[] = array(
'url' => api_get_path(WEB_PATH).'main/social/home.php',
'name' => get_lang('SocialNetwork'),
);
} else { } else {
$this_section = SECTION_MYPROFILE; $this_section = SECTION_MYPROFILE;
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); $interbreadcrumb[] = array(
'url' => api_get_path(WEB_PATH).'main/auth/profile.php',
'name' => get_lang('Profile'),
);
} }
$group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null;
@ -339,7 +345,10 @@ if (api_get_setting('allow_social_tool') == 'true') {
// MAIN CONTENT // MAIN CONTENT
if (!isset($_POST['compose'])) { if (!isset($_POST['compose'])) {
if(isset($_GET['re_id'])) { if(isset($_GET['re_id'])) {
$social_right_content .= show_compose_reply_to_message($_GET['re_id'], api_get_user_id()); $social_right_content .= show_compose_reply_to_message(
$_GET['re_id'],
api_get_user_id()
);
} elseif(isset($_GET['send_to_user'])) { } elseif(isset($_GET['send_to_user'])) {
$social_right_content .= show_compose_to_user($_GET['send_to_user']); $social_right_content .= show_compose_to_user($_GET['send_to_user']);
} else { } else {

Loading…
Cancel
Save