Minor style code changes

skala
Julio Montoya 14 years ago
parent 2ab99e1aff
commit 3c2e7cca0b
  1. 3
      main/exercice/admin.php
  2. 20
      main/exercice/exercice.php
  3. 4
      main/glossary/glossary_ajax_request.php
  4. 8
      main/inc/ajax/message.ajax.php
  5. 9
      main/inc/ajax/user_manager.ajax.php

@ -431,6 +431,9 @@ if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GE
echo '<a href="exercice.php?'.api_get_cidReq().'">'.Display::return_icon('back.png', get_lang('BackToExercisesList'),'','32').'</a>';
}
echo '<a href="exercice_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&preview=1">'.Display::return_icon('preview_view.png', get_lang('Preview'),'','32').'</a>';
echo Display::url(Display::return_icon('test_results.png', get_lang('Results'),'','32'), 'exercice.php?'.api_get_cidReq().'&show=result&exerciseId='.$objExercise->id);
if ($show_quiz_edition) {
echo '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'.Display::return_icon('settings.png', get_lang('ModifyExercise'),'','32').'</a>';
} else {

@ -65,12 +65,12 @@ $picturePath = $documentPath . '/images';
$audioPath = $documentPath . '/audio';
// hotpotatoes
$uploadPath = DIR_HOTPOTATOES; //defined in main_api
$exercicePath = api_get_self();
$exfile = explode('/', $exercicePath);
$exfile = strtolower($exfile[sizeof($exfile) - 1]);
$exercicePath = substr($exercicePath, 0, strpos($exercicePath, $exfile));
$exercicePath = $exercicePath . "exercice.php";
$uploadPath = DIR_HOTPOTATOES; //defined in main_api
$exercicePath = api_get_self();
$exfile = explode('/', $exercicePath);
$exfile = strtolower($exfile[sizeof($exfile) - 1]);
$exercicePath = substr($exercicePath, 0, strpos($exercicePath, $exfile));
$exercicePath = $exercicePath . "exercice.php";
if ($show == 'result') {
if (empty($_GET['exerciseId']) && empty($_GET['path']) ) {
@ -114,6 +114,7 @@ if (empty ($file)) {
$learnpath_id = intval($_REQUEST['learnpath_id']);
$learnpath_item_id = intval($_REQUEST['learnpath_item_id']);
$page = intval($_REQUEST['page']);
if ($page < 0) {
$page = 1;
}
@ -197,14 +198,14 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit
Database::query($recording_changes);
}
$qry = 'SELECT DISTINCT question_id, marks FROM ' . $TBL_TRACK_ATTEMPT . ' where exe_id = ' . $id . ' GROUP BY question_id';
$qry = 'SELECT DISTINCT question_id, marks FROM ' . $TBL_TRACK_ATTEMPT . ' where exe_id = '.$id .' GROUP BY question_id';
$res = Database::query($qry);
$tot = 0;
while ($row = Database :: fetch_array($res, 'ASSOC')) {
$tot += $row['marks'];
}
$totquery = "UPDATE $TBL_TRACK_EXERCICES SET exe_result = '" . floatval($tot) . "' WHERE exe_id=" . $id;
$totquery = "UPDATE $TBL_TRACK_EXERCICES SET exe_result = '".floatval($tot)."' WHERE exe_id=".$id;
Database::query($totquery);
//@todo move this somewhere else
@ -561,7 +562,8 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
$alt = get_lang('ExportWithoutUserFields');
$extra_user_fields = '<input type="hidden" name="export_user_fields" value="do_not_export_user_fields">';
}
echo '<a href="' . api_add_url_param($_SERVER['REQUEST_URI'], 'show=test') . '">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'','32').'</a>';
echo '<a href="admin.php?exerciseId='.intval($_GET['exerciseId']).'">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'','32').'</a>';
echo '<a href="javascript: void(0);" onclick="javascript: document.form1a.submit();">'.Display::return_icon('export_csv.png',get_lang('ExportAsCSV'),'','32').'</a>';
echo '<a href="javascript: void(0);" onclick="javascript: document.form1b.submit();">' . Display :: return_icon('export_excel.png', get_lang('ExportAsXLS'),'','32').'</a>';
echo '<form id="form1a" name="form1a" method="post" action="' . api_get_self() . '?show=' . Security :: remove_XSS($_GET['show']) . '" style="display:inline">';

@ -1,11 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/* @todo move this file in the inc/ajax/ folder */
// Including the global initialization file.
require_once '../inc/global.inc.php';
// Including additional libraries.
require_once(api_get_path(LIBRARY_PATH).'glossary.lib.php');
require_once api_get_path(LIBRARY_PATH).'glossary.lib.php';
/*
* Search a term and return description from a glossary.

@ -20,7 +20,7 @@ switch ($action) {
$search = Database::escape_string($_REQUEST['tag']);
$current_date = date('Y-m-d H:i:s',time());
$user_id = api_get_user_id();
$user_id = api_get_user_id();
$is_western_name_order = api_is_western_name_order();
if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool') == 'true') {
@ -34,11 +34,13 @@ switch ($action) {
//only my contacts
$sql = 'SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name
FROM '.$tbl_my_user_friend.' uf INNER JOIN '.$tbl_my_user.' AS u ON uf.friend_user_id = u.user_id ' .
'WHERE u.status <> 6 AND relation_type NOT IN('.USER_RELATION_TYPE_DELETED.', '.USER_RELATION_TYPE_RRHH.') AND uf.user_id = '.$user_id.' AND friend_user_id<>'.$user_id.' AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' LIKE CONCAT("%","'.$search.'","%") ';
'WHERE u.status <> 6 AND relation_type NOT IN('.USER_RELATION_TYPE_DELETED.', '.USER_RELATION_TYPE_RRHH.')
AND uf.user_id = '.$user_id.' AND friend_user_id<>'.$user_id.'
AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' LIKE CONCAT("%","'.$search.'","%") ';
}
} elseif (api_get_setting('allow_social_tool')=='false' && api_get_setting('allow_message_tool')=='true') {
$valid=api_get_setting('time_limit_whosonline');
$valid = api_get_setting('time_limit_whosonline');
$sql='SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name
FROM '.$tbl_my_user.' u INNER JOIN '.$track_online_table.' t ON u.user_id=t.login_user_id

@ -20,14 +20,14 @@ switch ($action) {
}
break;
case 'search_tags':
if (api_is_anonymous()) {
if (api_is_anonymous()) {
echo '';
} else {
$field_id = intval($_GET['field_id']);
$tag = $_GET['tag'];
echo UserManager::get_tags($tag, $field_id,'json','10');
}
break;
break;
case 'generate_api_key':
if (api_is_anonymous()) {
echo '';
@ -50,7 +50,7 @@ switch ($action) {
case 'active_user':
if (api_is_platform_admin()) {
$user_id = intval($_GET['user_id']);
$status = intval($_GET['status']);
$status = intval($_GET['status']);
if (!empty($user_id)) {
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql="UPDATE $user_table SET active='".$status."' WHERE user_id='".Database::escape_string($user_id)."'";
@ -70,8 +70,7 @@ switch ($action) {
//$emailbody.=get_lang('Problem'). "\n\n". get_lang('Formula');
$emailbody.=api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
$result = api_mail($recipient_name, $user_info['mail'], $emailsubject, $emailbody, $sender_name, $email_admin);
}
}
}
} else {
echo '';

Loading…
Cancel
Save