Exemplo n.º 1
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    require_once "modules/{$module_name}/libs/PaloSantoThemes.class.php";
    load_language_module($module_name);
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    // se conecta a la base
    $pDB = new paloDB($arrConf['elastix_dsn']['settings']);
    if (!empty($pDB->errMsg)) {
        $smarty->assign("mb_message", _tr("Error when connecting to database") . "<br/>" . $pDB->errMsg);
    }
    // Definición del formulario de nueva campaña
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CHANGE", _tr("Save"));
    $smarty->assign("icon", "modules/{$module_name}/images/system_preferences_themes.png");
    $oThemes = new PaloSantoThemes($pDB);
    $arr_themes = $oThemes->getThemes("{$base_dir}/themes/");
    $formCampos = array('themes' => array("LABEL" => _tr("Themes"), "REQUIRED" => "yes", "INPUT_TYPE" => "SELECT", "INPUT_EXTRA_PARAM" => $arr_themes, "VALIDATION_TYPE" => "", "VALIDATION_EXTRA_PARAM" => ""));
    $oForm = new paloForm($smarty, $formCampos);
    if (isset($_POST['changeTheme'])) {
        $contenidoModulo = updateTheme($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm);
    } else {
        $contenidoModulo = changeTheme($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm);
    }
    return $contenidoModulo;
}
Exemplo n.º 2
0
// If login form is posted, log the user in
/*if(isset($_POST['login'])) {
		userLogin($_POST['username'], $_POST['password']);
	}*/
if (isset($_POST['signin_student'])) {
    studentSignin($pdo);
}
if (isset($_POST['signin_teacher'])) {
    teacherSignin($pdo);
}
if (isset($_POST['submit_ratings'])) {
    submitRatings($pdo, $_SESSION['user_id'], $_POST['course_id'], $_POST['teacher_id'], $_POST['course_teacher_id'], $_POST['teacher_course_id'], $_POST['t_general'], $_POST['c_general'], $_POST['t_q1'], $_POST['t_q2'], $_POST['t_q3'], $_POST['t_q4'], $_POST['t_q5'], $_POST['teacher_comment'], $_POST['c_q1'], $_POST['c_q2'], $_POST['c_q3'], $_POST['c_q4'], $_POST['c_q5'], $_POST['course_comment']);
}
if (isset($_POST['logout'])) {
    logout();
}
if (isset($_POST['red-theme'])) {
    changeTheme("red");
}
if (isset($_POST['blue-theme'])) {
    changeTheme("blue");
}
if (isset($_POST['orange-theme'])) {
    changeTheme("orange");
}
if (isset($_POST['purple-theme'])) {
    changeTheme("purple");
}
if (isset($_POST['green-theme'])) {
    changeTheme("green");
}
Exemplo n.º 3
0
	}*/
if (isset($_POST['signin_student'])) {
    studentSignin();
}
if (isset($_POST['signin_teacher'])) {
    teacherSignin();
}
if (isset($_POST['rate_course'])) {
    rateCourse($_SESSION['user_id'], $_POST['course_id'], $_POST['like'], $_POST['rating_comment'], $_POST['course_teacher_id']);
}
if (isset($_POST['rate_teacher'])) {
    rateTeacher($_SESSION['user_id'], $_POST['teacher_id'], $_POST['like'], $_POST['rating_comment'], $_POST['teacher_course_id']);
}
if (isset($_POST['logout'])) {
    logout();
}
if (isset($_POST['red'])) {
    changeTheme("red");
}
if (isset($_POST['blue'])) {
    changeTheme("blue");
}
if (isset($_POST['orange'])) {
    changeTheme("orange");
}
if (isset($_POST['purple'])) {
    changeTheme("purple");
}
if (isset($_POST['pink'])) {
    changeTheme("pink");
}