/**
 * Creates the HTML for a new tab and its content.
 *
 * @param boolean $contentType  Tab content type
 * @param string  $title        Title of the tab
 * @param string  $tabVariables Template variables
 * @param string  $type         Type of the request: training/review
 *
 * @return string
 */
function createTabHTML($contentType, $title, $tabVariables, $type)
{
    $tpl_data['contentType'] = $contentType;
    $tpl_data['title'] = $title;
    $tpl_data['tabVariables'] = $tabVariables;
    $tpl_data['type'] = $type;
    $smarty = new Smarty_NeuroDB('training');
    $smarty->assign($tpl_data);
    $html = $smarty->fetch('training.tpl');
    return $html;
}
Exemple #2
0
 *
 * PHP Version 5
 *
 * @category Behavioural
 * @package  Loris
 * @author   Tara Campbell <*****@*****.**>
 * @license  http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
 * @link     https://github.com/aces/Loris
 */
$user =& User::singleton();
if (!$user->hasPermission('training')) {
    header("HTTP/1.1 403 Forbidden");
    exit;
}
set_include_path(get_include_path() . ":../project/libraries:../php/libraries:");
ini_set('default_charset', 'utf-8');
require_once __DIR__ . "/../../../vendor/autoload.php";
$DB = Database::singleton();
// Get the ID for the instrument that was selected
$instrumentID = $_REQUEST['instrument'];
$instrumentName = $_REQUEST['instrumentName'];
$type = $_REQUEST['type'];
// Get the tab titles
$tabs = $DB->pselect("SELECT Title, TrainingType, OrderNumber\n     FROM certification_training\n     WHERE TestID=:TID\n     ORDER BY OrderNumber", array('TID' => $instrumentID));
$tpl_data['instrumentName'] = $instrumentName;
$tpl_data['type'] = $type;
$tpl_data['tabs'] = $tabs;
$smarty = new Smarty_NeuroDB('training');
$smarty->assign($tpl_data);
$html = $smarty->fetch('training_tabs.tpl');
print $html;