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; }
saveBaseURL('../'); break; case 'update_config': updateConfig(); break; case 'update_feedback': updateFeedback(); break; case 'update_password': $passwordError = updatePassword($_POST['admin_password']); break; case 'update_translation': updateTranslation(); break; case 'update_theme': updateTheme(); break; case 'update_channels': updateChannels(); break; case 'total_reset': $total_reset = totalReset(); break; } } if (array_key_exists('delete', $_GET) && $_GET['delete'] == 'key') { removeLicenseKey(); } /**************************************************************************** * Template > Header *****************************************************************************/
<?php include 'config/autoload.php'; if (!isset($_GET['id'])) { header('Location: categories.php'); } $theme = getTheme($db, $_GET['id']); if (isset($_POST['title'])) { updateTheme($db, $_GET['id'], $_POST['title']); header('Location: categories.php'); } ?> <h3>Gestion des catégories : domaine, priorité et thème</h3> <form action="editTheme.php?id=<?php echo $_GET['id']; ?> " method="post"> <fieldset> <legend>Edition du thème :</legend> <input type="text" name="title" value="<?php echo $theme['title']; ?> " placeholder="Libellé du thème" required>* <hr> <input type="submit" value="Editer le domaine"> <input type="reset" value="Reset"> <a href="categories.php"><input type="button" value="Retour"></a> </fieldset> </form>