Format code, remove var_dumps, update docs

1.10.x
Julio Montoya 10 years ago
parent f28384fbac
commit 9e234ee1aa
  1. 1
      main/admin/index.php
  2. 16
      main/admin/skills_profile.php
  3. 2
      main/document/download_scorm.php
  4. 51
      main/exercice/addlimits.php
  5. 4
      main/inc/ajax/timeline.ajax.php
  6. 4
      main/inc/lib/social.lib.php

@ -481,7 +481,6 @@ if (api_is_platform_admin()) {
if (!empty($extraData['block'])) { if (!empty($extraData['block'])) {
if (!is_dir($adminExtraContentDir)) { if (!is_dir($adminExtraContentDir)) {
var_dump($adminExtraContentDir);
mkdir( mkdir(
$adminExtraContentDir, $adminExtraContentDir,
api_get_permissions_for_new_directories(), api_get_permissions_for_new_directories(),

@ -15,7 +15,10 @@ if (api_get_setting('allow_skills_tool') != 'true') {
api_not_allowed(); api_not_allowed();
} }
$interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array(
'url' => 'index.php',
"name" => get_lang('PlatformAdmin'),
);
$skill = new Skill(); $skill = new Skill();
$skill_profile = new SkillProfile(); $skill_profile = new SkillProfile();
@ -71,13 +74,15 @@ if (!empty($users)) {
$user_skills = array(); $user_skills = array();
$found_counts = 0 ; $found_counts = 0 ;
foreach ($my_user_skills as $my_skill) { foreach ($my_user_skills as $my_skill) {
$found = false; $found = false;
if (in_array($my_skill['skill_id'], $skills)) { if (in_array($my_skill['skill_id'], $skills)) {
$found = true; $found = true;
$found_counts++; $found_counts++;
} }
$user_skills[] = array('skill_id' => $my_skill['skill_id'], 'found' => $found); $user_skills[] = array(
'skill_id' => $my_skill['skill_id'],
'found' => $found,
);
$total_skills_to_search[$my_skill['skill_id']] = $my_skill['skill_id']; $total_skills_to_search[$my_skill['skill_id']] = $my_skill['skill_id'];
} }
$user_list[$user['user_id']]['skills'] = $user_skills; $user_list[$user['user_id']]['skills'] = $user_skills;
@ -140,14 +145,9 @@ foreach ($total_skills_to_search as $skill_info) {
$tpl->assign('skill_list', $skill_list); $tpl->assign('skill_list', $skill_list);
$tpl->assign('search_skill_list', $skills); $tpl->assign('search_skill_list', $skills);
$form_to_html = $form->return_form(); $form_to_html = $form->return_form();
//var_dump($total_skills_to_search);
$tpl->assign('form', $form_to_html); $tpl->assign('form', $form_to_html);
$tpl->assign('url', $url); $tpl->assign('url', $url);
$content = $tpl->fetch('default/skill/profile.tpl'); $content = $tpl->fetch('default/skill/profile.tpl');
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

@ -45,8 +45,6 @@ if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) {
$sys_course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm'; $sys_course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm';
//var_dump($sys_course_path);
if (is_dir($sys_course_path.$doc_url)) { if (is_dir($sys_course_path.$doc_url)) {
api_not_allowed(); api_not_allowed();
} }

@ -3,15 +3,10 @@
/** /**
* Adding limits * Adding limits
* @package chamilo.exercise * @package chamilo.exercise
* @author * @deprecated ?
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
*/
/**
* including the global file
*/ */
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
/* section (for the tabs) */
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
api_protect_course_script(); api_protect_course_script();
@ -19,50 +14,40 @@ api_protect_course_script();
$dsp_percent = false; $dsp_percent = false;
$debug = 0; $debug = 0;
if ($debug > 0) { if ($debug > 0) {
echo str_repeat('&nbsp;',0).'Entered exercise_result.php'."<br />\n";var_dump($_POST); echo str_repeat('&nbsp;', 0).'Entered exercise_result.php'."<br />\n";
} }
// general parameters passed via POST/GET // general parameters passed via POST/GET
if ( empty ( $origin ) ) if (empty ($origin)) {
{
$origin = $_REQUEST['origin']; $origin = $_REQUEST['origin'];
} }
if ( empty ( $learnpath_id ) ) if (empty ($learnpath_id)) {
{
$learnpath_id = $_REQUEST['learnpath_id']; $learnpath_id = $_REQUEST['learnpath_id'];
} }
if ( empty ( $learnpath_item_id ) ) if (empty ($learnpath_item_id)) {
{
$learnpath_item_id = $_REQUEST['learnpath_item_id']; $learnpath_item_id = $_REQUEST['learnpath_item_id'];
} }
if ( empty ( $formSent ) ) if (empty ($formSent)) {
{
$formSent = $_REQUEST['formSent']; $formSent = $_REQUEST['formSent'];
} }
if ( empty ( $exerciseResult ) ) if (empty ($exerciseResult)) {
{
$exerciseResult = $_SESSION['exerciseResult']; $exerciseResult = $_SESSION['exerciseResult'];
} }
if ( empty ( $questionId ) ) if (empty ($questionId)) {
{
$questionId = $_REQUEST['questionId']; $questionId = $_REQUEST['questionId'];
} }
if (empty ($choice)) { if (empty ($choice)) {
$choice = $_REQUEST['choice']; $choice = $_REQUEST['choice'];
} }
if ( empty ( $questionNum ) ) if (empty ($questionNum)) {
{
$questionNum = $_REQUEST['questionNum']; $questionNum = $_REQUEST['questionNum'];
} }
if ( empty ( $nbrQuestions ) ) if (empty ($nbrQuestions)) {
{
$nbrQuestions = $_REQUEST['nbrQuestions']; $nbrQuestions = $_REQUEST['nbrQuestions'];
} }
if ( empty ( $questionList ) ) if (empty ($questionList)) {
{
$questionList = $_SESSION['questionList']; $questionList = $_SESSION['questionList'];
} }
if ( empty ( $objExercise ) ) if (empty ($objExercise)) {
{
$objExercise = $_SESSION['objExercise']; $objExercise = $_SESSION['objExercise'];
} }
$exercise_id = intval($_GET['exercise_id']); $exercise_id = intval($_GET['exercise_id']);
@ -79,7 +64,10 @@ if (!empty($gradebook) && $gradebook=='view') {
); );
} }
$nameTools=get_lang('Exercises'); $nameTools=get_lang('Exercises');
$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises')); $interbreadcrumb[] = array(
"url" => "exercise.php",
"name" => get_lang('Exercises'),
);
Display::display_header($nameTools,"Exercises"); Display::display_header($nameTools,"Exercises");
if (isset($_POST['ok'])) { if (isset($_POST['ok'])) {
@ -88,12 +76,10 @@ if (isset($_POST['ok'])) {
} }
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function selectlimited() function selectlimited() {
{
document.getElementById('limited').checked="checked"; document.getElementById('limited').checked="checked";
} }
function selectattempts() function selectattempts() {
{
document.getElementById('attemptlimited').checked="checked"; document.getElementById('attemptlimited').checked="checked";
} }
</script> </script>
@ -172,4 +158,3 @@ if (isset($_POST['ok'])) {
Database::query($query); Database::query($query);
} }
} }
?>

@ -11,9 +11,5 @@ switch ($action) {
case 'get_timeline_content': case 'get_timeline_content':
$items = $timeline->get_timeline_content($_GET['id']); $items = $timeline->get_timeline_content($_GET['id']);
echo json_encode($items); echo json_encode($items);
/*echo '<pre>';
echo json_encode($items);
echo '</pre>';
var_dump($items);*/
break; break;
} }

@ -1019,7 +1019,6 @@ class SocialManager extends UserManager
} }
$column_size = '12'; $column_size = '12';
$add_row = false; $add_row = false;
//var_dump(api_set_anonymous());
if (api_is_anonymous()) { if (api_is_anonymous()) {
$add_row = true; $add_row = true;
} }
@ -1058,10 +1057,8 @@ class SocialManager extends UserManager
} else { } else {
$url = '?id='.$uid.$course_url; $url = '?id='.$uid.$course_url;
} }
} else { } else {
$url = null; $url = null;
} }
$name = '<a href="'.$url.'">'.$firstname.'<br>'.$lastname.'</a>'; $name = '<a href="'.$url.'">'.$firstname.'<br>'.$lastname.'</a>';
@ -1088,6 +1085,7 @@ class SocialManager extends UserManager
if ($wrap && $add_row) { if ($wrap && $add_row) {
$html .= '</div>'; $html .= '</div>';
} }
return $html; return $html;
} }

Loading…
Cancel
Save