Example #1
0
            $result2 = claro_sql_query($sql);
            list($orderMax) = mysql_fetch_row($result2);
            $order = $orderMax + 1;
            //create and call the insertquery on the DB to add the checked module to the learning path
            $insertquery = "INSERT INTO `" . $TABLELEARNPATHMODULE . "`\n                          (`learnPath_id`, `module_id`, `specificComment`, `rank`, `lock` )\n                          VALUES (" . (int) $_SESSION['path_id'] . ", " . (int) $list['module_id'] . ", ''," . $order . ", 'OPEN')";
            claro_sql_query($insertquery);
            $atleastOne = TRUE;
            $nb++;
        }
    }
}
//end if ADD command
//STEP ONE : display form to add module of the course that are not in this path yet
// this is the same SELECT as "select all 'addable' modules of this course for this learning path"
// **BUT** normally there is less 'addable' modules here than in the first one
$result = claro_sql_query(buildRequestModules());
// Display available modules
$out .= '<form name="addmodule" action="' . $_SERVER['PHP_SELF'] . '?cmdglobal=add">' . "\n" . claro_form_relay_context() . "\n" . '<table class="claroTable">' . "\n" . '<thead>' . "\n" . '<tr align="center" valign="top">' . "\n" . '<th width="10%">' . get_lang('Add module(s)') . '</th>' . "\n" . '<th>' . get_lang('Module') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n\n" . '<tbody>' . "\n\n";
$atleastOne = false;
while ($list = mysql_fetch_array($result)) {
    //CHECKBOX, NAME, RENAME, COMMENT
    if ($list['contentType'] == CTEXERCISE_) {
        $moduleImg = get_icon_url('quiz', 'CLQWZ');
    } else {
        $moduleImg = get_icon_url(choose_image(basename($list['path'])));
    }
    $contentType_alt = selectAlt($list['contentType']);
    $out .= '<tr>' . "\n" . '<td style="vertical-align:top; text-align: center;">' . "\n" . '<input type="checkbox" name="check_' . $list['module_id'] . '" id="check_' . $list['module_id'] . '" />' . "\n" . '</td>' . "\n" . '<td align="left">' . "\n" . '<label for="check_' . $list['module_id'] . '" >' . '<img hspace="5" src="' . $moduleImg . '" alt="' . $contentType_alt . '" /> ' . $list['name'] . '</label>' . "\n" . ($list['comment'] != null ? '<div class="comment">' . $list['comment'] . '</small>' . '</div>' . "\n\n" : '') . '</td>' . "\n" . '</tr>' . "\n\n";
    $atleastOne = true;
}
//end while another module to display
Example #2
0
            //create and call the insertquery on the DB to add the checked module to the learning path
            Database::get()->query("INSERT INTO `lp_rel_learnPath_module`
                          (`learnPath_id`, `module_id`, `specificComment`, `rank`, `lock`, `visible` )
                          VALUES (?d, ?d, '', ?d, 'OPEN', 1)", $_SESSION['path_id'], $list->module_id, $order);

            $atleastOne = TRUE;
            $nb++;
        }
    }
} //end if ADD command
//STEP ONE : display form to add module of the course that are not in this path yet
// this is the same SELECT as "select all 'addable' modules of this course for this learning path"
// **BUT** normally there is less 'addable' modules here than in the first one

$result = Database::get()->queryArray(buildRequestModules());

$tool_content .= '<form name="addmodule" action="' . $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code . '&amp;cmdglobal=add">' . "\n\n";
$tool_content .= '<table class="table-default">'
        . '<tr>'
        . '<th class="text-left">'.$langLearningModule.'</th>'
        . '<th width="10"><div align="center">'
        . $langSelection
        . '</div></th>'
        . '</tr>';

// Display available modules

$atleastOne = FALSE;