Пример #1
0
    $smarty = smarty();
    $missingextensions = array();
    !$xslext && ($missingextensions[] = 'xsl');
    $smarty->assign('missingextensions', $missingextensions);
    $smarty->display('artefact:europass:index.tpl');
    exit;
}
// User's Education history
$artefact_id = get_field('artefact', 'id', 'artefacttype', 'educationhistory', 'owner', $USER->get('id'));
if ($artefact_id !== false) {
    $education_data = get_records_select_array('artefact_resume_educationhistory', "artefact=?", array($artefact_id));
} else {
    $education_data = array();
}
// Locations for various buttons and graphics
$employmentlocation = get_config('wwwroot') . 'artefact/resume/employment.php';
$topbanner = get_config('wwwroot') . 'artefact/europass/images/topbanner.png';
$rightlogo = get_config('wwwroot') . 'artefact/europass/images/rightlogo.png';
$smarty = smarty();
// Check if Mahara release is older than 1.3.0
if (get_config('version') < 2010083102) {
    $SESSION->add_info_msg(get_string('newerversionforcompatibility', 'artefact.europass'));
    $smarty->assign('mahararelease', 1);
}
$smarty->assign('topbanner', $topbanner);
$smarty->assign('rightlogo', $rightlogo);
$smarty->assign('education_data', $education_data);
$smarty->assign('employmentlocation', $employmentlocation);
$smarty->assign('PAGEHEADING', get_string('europass', 'artefact.europass'));
$smarty->assign('SUBPAGENAV', PluginArtefactEuropass::submenu_items());
$smarty->display('artefact:europass:education.tpl');
Пример #2
0
function langcompositeformedit_submit(Pieform $form, $values)
{
    global $SESSION;
    $tabs = PluginArtefactEuropass::composite_tabs();
    $goto = get_config('wwwroot') . 'artefact/europass/';
    if (isset($tabs[$values['compositetype']])) {
        if ($values['compositetype'] == 'languagediploma' || $values['compositetype'] == 'languageexperience') {
            // Find language diploma's or linguistic experience's parent for redirect...
            $sql = 'SELECT aeo.id, aeo.artefact
				FROM {artefact_europass_otherlanguage} aeo 
				JOIN {artefact_europass_' . $values['compositetype'] . '} ar ON ar.languageid = aeo.id
				WHERE ar.id = ? AND ar.artefact = ?';
            $parent = get_record_sql($sql, array($values['id'], $values['artefact']));
            $goto .= 'viewcomposite.php?id=' . $parent->id . '&artefact=' . $parent->artefact;
            if ($values['compositetype'] == 'languagediploma') {
                $okmsg = get_string('languagediplomasaved', 'artefact.europass');
                $errmsg = get_string('languagediplomasavefailed', 'artefact.europass');
            } else {
                $okmsg = get_string('languageexperiencesaved', 'artefact.europass');
                $errmsg = get_string('languageexperiencesavefailed', 'artefact.europass');
            }
        } else {
            $goto .= $tabs[$values['compositetype']] . '.php';
            $okmsg = get_string('languagesaved', 'artefact.europass');
            $errmsg = get_string('languagesavefailed', 'artefact.europass');
        }
    }
    try {
        call_static_method(generate_artefact_class_name($values['compositetype']), 'process_compositeform', $form, $values);
    } catch (Exception $e) {
        $SESSION->add_error_msg($errmsg);
        redirect($goto);
    }
    $SESSION->add_ok_msg($okmsg);
    redirect($goto);
}