function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; require_once "modules/{$module_name}/libs/PaloSantoRepositories.class.php"; $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //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']; $contenidoModulo = listRepositories($smarty, $module_name, $local_templates_dir, $arrConf); return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoEmaillist.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDB = new paloDB($arrConf['dsn_conn_database']); //actions $action = getAction(); $content = ""; switch ($action) { case "new_emaillist": $content = viewFormEmaillist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case "save_newList": $content = saveNewList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case "new_memberlist": case "remove_memberlist": $content = viewFormMemberList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case "save_newMember": case "save_removeMember": $content = saveNewMember($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case "delete": $content = deleteEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case "view_memberlist": $content = viewMemberList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case "export": $content = exportMembers($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; default: $content = reportEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { include_once "libs/paloSantoGrid.class.php"; include_once "libs/paloSantoEmail.class.php"; include_once "libs/paloSantoConfig.class.php"; include_once "libs/paloSantoForm.class.php"; include_once "libs/cyradm.php"; include_once "configs/email.conf.php"; //include module files include_once "modules/{$module_name}/configs/default.conf.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $pDB = new paloDB($arrConf['dsn_conn_database']); if (!empty($pDB->errMsg)) { echo "ERROR DE DB: {$pDB->errMsg} <br>"; } $virtual_postfix = FALSE; // indica si se debe escribir el archivo /etc/postfix/virtual $content = ""; $accion = getAction(); switch ($accion) { case "submit_create_domain": $content = newDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang); break; case "save": $content = saveDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang); break; case "delete": $content = deleteDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang, $virtual_postfix); break; case "edit": $content = newDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang); break; case "view": $content = newDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang); break; default: $content = viewFormDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang); break; } return $content; }
/** * Clear all the strings so the raw descriptor strings are displayed */ function developers_clear_strings() { global $CONFIG; $language = get_language(); $CONFIG->translations[$language] = array(); $CONFIG->translations['en'] = array(); }
function _moduleContent(&$smarty, $module_name) { require_once "modules/{$module_name}/libs/paloSantoCallsHour.class.php"; #incluir el archivo de idioma de acuerdo al que este seleccionado #si el archivo de idioma no existe incluir el idioma por defecto $lang = get_language(); $script_dir = dirname($_SERVER['SCRIPT_FILENAME']); load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; global $arrConf; global $arrConfig; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // Conexión a la base de datos CallCenter $pDB = new paloDB($arrConf['cadena_dsn']); // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_campaign'; if (isset($_GET['action'])) { $sAction = $_GET['action']; } switch ($sAction) { case 'graph_histogram': $contenidoModulo = graphHistogram($pDB, $smarty, $module_name, $local_templates_dir); break; case 'list_histogram': default: $contenidoModulo = listHistogram($pDB, $smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent($smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $accion = getAction(); switch ($accion) { case "checkFaxStatus": $contenidoModulo = checkFaxStatus("faxListStatus", $smarty, $module_name, $local_templates_dir, $arrConf, $arrLang); break; default: $contenidoModulo = listFax($smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoSoftphones.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $content = ""; switch ($action) { default: // view_form $content = viewFormSoftphones($smarty, $module_name, $local_templates_dir, $arrConf); break; } return $content; }
function init() { elgg_extend_view('css/elgg', 'css/elgg_recaptcha'); elgg_register_plugin_hook_handler('view', 'all', __NAMESPACE__ . '\\view_hook'); elgg_register_plugin_hook_handler('action', 'all', __NAMESPACE__ . '\\action_hook'); elgg_define_js('google_recaptcha', array('src' => 'https://www.google.com/recaptcha/api.js?render=explicit&onload=elgg_recaptcha_render&hl=' . get_language())); }
function About() { parent::Controller(); $this->load->library('Form_validation'); $this->load->helper('simian_view_helper'); $this->load->helper('simian_facebook_helper'); $this->lang->load('simian_grid', get_language()); }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantobilling_report.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDBSet = new paloDB($arrConf['elastix_dsn']['settings']); $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*"); $arrConfig = $pConfig->leer_configuracion(false); $dsn = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asteriskcdrdb"; $pDB = new paloDB($dsn); $pDBTrunk = new paloDB($arrConf['dsn_conn_database_1']); $total = 0; $oCDR = new paloSantoCDR($pDB); $smarty->assign("menu", "billing_report"); $pDBSQLite = new paloDB($arrConf['dsn_conn_database_2']); //rate if (!empty($pDBSQLite->errMsg)) { echo "ERROR DE DB: {$pDB->errMsg} <br>"; } $pRate = new paloRate($pDBSQLite); if (!empty($pRate->errMsg)) { echo "ERROR DE RATE: {$pRate->errMsg} <br>"; } $smarty->assign("module", $module_name); $smarty->assign("horas", $arrLang['horas']); $smarty->assign("minutos", $arrLang['minutos']); $smarty->assign("segundos", $arrLang['segundos']); //actions $action = getAction(); $content = ""; switch ($action) { default: $content = reportbilling_report($smarty, $module_name, $local_templates_dir, $pDBSet, $pDB, $pRate, $pDBTrunk, $pDBSQLite, $oCDR, $arrConf, $arrLang, $arrConfig); break; } return $content; }
function _moduleContent($smarty, $module_name) { include_once "libs/paloSantoFax.class.php"; include_once "libs/paloSantoForm.class.php"; //include module files include_once "modules/{$module_name}/configs/default.conf.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // Definición del formulario $smarty->assign("REQUIRED_FIELD", $arrLang["Required field"]); $smarty->assign("CANCEL", $arrLang["Cancel"]); $smarty->assign("APPLY_CHANGES", $arrLang["Apply changes"]); $smarty->assign("SAVE", $arrLang["Save"]); $smarty->assign("EDIT", $arrLang["Edit"]); $smarty->assign("EDIT_PARAMETERS", $arrLang["Edit Parameters"]); $smarty->assign("icon", "/modules/{$module_name}/images/fax_email_template.png"); $arrFaxConfig = array("remite" => array("LABEL" => $arrLang['Fax From'], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("style" => "width:240px"), "VALIDATION_TYPE" => "email", "EDITABLE" => "si", "VALIDATION_EXTRA_PARAM" => ""), "remitente" => array("LABEL" => $arrLang["Fax From Name"], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("style" => "width:240px"), "VALIDATION_TYPE" => "name", "EDITABLE" => "si", "VALIDATION_EXTRA_PARAM" => ""), "subject" => array("LABEL" => $arrLang["Fax Suject"], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("style" => "width:240px"), "VALIDATION_TYPE" => "text", "EDITABLE" => "si", "VALIDATION_EXTRA_PARAM" => ""), "content" => array("LABEL" => $arrLang["Fax Content"], "REQUIRED" => "no", "INPUT_TYPE" => "TEXTAREA", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "text", "EDITABLE" => "si", "COLS" => "50", "ROWS" => "4", "VALIDATION_EXTRA_PARAM" => "")); $oForm = new paloForm($smarty, $arrFaxConfig); $contenidoModulo = ""; $action = ""; if (isset($_POST["submit_edit"])) { $action = "submit_edit"; } if (isset($_POST["submit_apply_change"])) { $action = "submit_apply_change"; } switch ($action) { case 'submit_edit': $contenidoModulo = editParameterFaxMail($smarty, $module_name, $local_templates_dir, $oForm); break; case 'submit_apply_change': $contenidoModulo = applyChnageParameterFaxMail($smarty, $module_name, $local_templates_dir, $oForm); break; default: $contenidoModulo = listParameterFaxMail($smarty, $module_name, $local_templates_dir, $oForm); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { //include elastix framework include_once "libs/paloSantoGrid.class.php"; include_once "libs/paloSantoValidar.class.php"; include_once "libs/paloSantoConfig.class.php"; include_once "libs/misc.lib.php"; include_once "libs/paloSantoForm.class.php"; include_once "libs/xajax/xajax.inc.php"; //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoDeleteModule.class.php"; global $arrConf; //include lang local module global $arrLangModule; $lang = get_language(); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); if (file_exists("{$base_dir}/{$lang_file}")) { include_once $lang_file; } else { include_once "modules/{$module_name}/lang/en.lang"; } //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; require_once 'libs/paloSantoDB.class.php'; $pDB_acl = new paloDB($arrConf['elastix_dsn']['acl']); if (!empty($pDB_acl->errMsg)) { echo "ERROR DE DB: {$pDB_acl->errMsg} <br>"; } $pDB_menu = new paloDB($arrConf['elastix_dsn']['menu']); if (!empty($pDB_menu->errMsg)) { echo "ERROR DE DB: {$pDB_menu->errMsg} <br>"; } $xajax = new xajax(); $xajax->registerFunction("mostrar_menu"); $xajax->processRequests(); $content = $xajax->printJavascript("libs/xajax/"); $delete = isset($_POST['delete']) ? $_POST['delete'] : ''; if ($delete != '') { $accion = 'delete_module'; } else { $accion = "report_delete_module"; } switch ($accion) { case 'delete_module': $content .= delete_module($smarty, $module_name, $local_templates_dir, $arrLangModule, $pDB_acl, $pDB_menu); break; default: $content .= report_delete_module($smarty, $module_name, $local_templates_dir, $arrLangModule, $pDB_acl); break; } return $content; }
static function redirectToI18nUrl() { $uri = get_request_uri(); $pos = strpos($uri, "/" . get_sub_root() . get_language()); if ($pos === false || $pos !== false && $pos != 0) { $uri = get_request_uri(false); $uri = preg_replace('/\\/' . str_replace('/', '\\/', get_sub_root()) . '/', get_language() . '/', $uri, 1); HTML::forward($uri); } }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoMyExtension.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $arrConf['dsn_conn_database'] = generarDSNSistema('asteriskuser', 'asterisk'); $pDB = new paloDB($arrConf['dsn_conn_database']); $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']); $pACL = new paloACL($pDBACL); $user = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : ""; $extension = $pACL->getUserExtension($user); $isAdministrator = $pACL->isUserAdministratorGroup($user); if ($extension == "" || is_null($extension)) { if ($isAdministrator) { $smarty->assign("mb_message", "<b>" . $arrLang["no_extension"] . "</b>"); } else { $smarty->assign("mb_message", "<b>" . $arrLang["contact_admin"] . "</b>"); } return ""; } //actions $action = getAction(); $content = ""; switch ($action) { case "save_new": $content = saveNewMyExtension($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang, $extension, $isAdministrator); break; default: // view_form $content = viewFormMyExtension($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang, $extension); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //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']; $formCampos = array(); $txtCommand = isset($_POST['txtCommand']) ? $_POST['txtCommand'] : ''; $oForm = new paloForm($smarty, $formCampos); $smarty->assign("asterisk", "Asterisk CLI"); $smarty->assign("command", $arrLang["Command"]); $smarty->assign("txtCommand", htmlspecialchars($txtCommand)); $smarty->assign("execute", $arrLang["Execute"]); $smarty->assign("icon", "modules/{$module_name}/images/pbx_tools_asterisk_cli.png"); $result = ""; if (!isBlank($txtCommand)) { $result = "<pre>"; putenv("TERM=vt100"); putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"); putenv("SCRIPT_FILENAME=" . strtok(stripslashes($txtCommand), " ")); /* PHP scripts */ $badchars = array("'", "`", "\\", ";", "\""); // Strip off any nasty chars. $fixedcmd = str_replace($badchars, "", $txtCommand); $ph = popen(stripslashes("asterisk -nrx \"{$fixedcmd}\""), "r"); while ($line = fgets($ph)) { $result .= htmlspecialchars($line); } pclose($ph); $result .= "</pre>"; } if ($result == "") { $result = " "; } $smarty->assign("RESPUESTA_SHELL", $result); $contenidoModulo = $oForm->fetchForm("{$local_templates_dir}/new.tpl", $arrLang["Asterisk-Cli"], $_POST); return $contenidoModulo; }
function Region() { parent::Controller(); $this->load->library('table'); $this->load->library('SimianGrid'); $this->load->library('table'); $this->load->helper('form'); $this->load->helper('simian_view_helper'); $this->load->helper('simian_facebook_helper'); $this->lang->load('simian_grid', get_language()); }
function _moduleContent(&$smarty, $module_name) { //include elastix framework include_once "libs/paloSantoGrid.class.php"; include_once "libs/paloSantoForm.class.php"; //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoLanguageAdmin.class.php"; //include lang local module $lang = get_language(); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); if (file_exists("{$base_dir}/{$lang_file}")) { include_once $lang_file; } else { include_once "modules/{$module_name}/lang/en.lang"; } global $arrConf; global $arrLang; global $arrLangModule; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $accion = getAction(); $content = ""; $arrFormConference = createFieldForm($arrLangModule); $oForm = new paloForm($smarty, $arrFormConference); switch ($accion) { case "show": $_POST['nav'] = null; $_POST['start'] = null; $content = showLanguages($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule); break; case "new": $content = newLanguage($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule); break; case "save_language": $content = saveLanguage($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule, $oForm); break; case "cancel_language": $content = showLanguages($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule); break; case "save_all": $content = saveAll($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule, $oForm); break; default: //report_Languages $content = showLanguages($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoReportCall.class.php"; include_once "libs/paloSantoConfig.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*"); $arrConfig = $pConfig->leer_configuracion(false); $dsnAsteriskCdr = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asteriskcdrdb"; $pDB_cdr = new paloDB($dsnAsteriskCdr); //asteriskcdrdb -> CDR $pDB_billing = new paloDB("sqlite3:///{$arrConf['elastix_dbdir']}/rate.db"); //sqlite3 -> rate.db //actions $accion = getAction(); $content = ""; switch ($accion) { case 'graph': $content = graphLinks($smarty, $module_name, $local_templates_dir); break; case 'imageTop10Salientes': case 'imageTop10Entrantes': // The following outputs image data directly and depends on rawmode=yes executeImage($module_name, $accion); $content = ''; break; default: $content = reportReportCall($smarty, $module_name, $local_templates_dir, $pDB_cdr, $pDB_billing, $arrConf, $arrLang); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/Ticket_Delivery.class.php"; require_once "modules/{$module_name}/libs/JSON.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $pDB = new paloDB($arrConf['cadena_dsn']); $pDB_2 = new paloDB($arrConf['elastix_dsn']['acl']); //actions $action = getParameter('action'); switch ($action) { case 'assign': $content = assign_TicketDelivery($pDB, $pDB_2); break; case 'collect': $content = CashCollection($pDB, $pDB_2); break; case 'update_row': $content = updateRow_TicketDelivery($pDB, $pDB_2, $module_name); break; case 'process': $content = TicketProcess(&$pDB); break; case 'expand': $content = TicketExpand($pDB); break; default: $content = report_TicketDelivery($smarty, $module_name, $local_templates_dir, $pDB, $pDB_2); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoRegestion.class.php"; include_once "modules/{$module_name}/libs/paloSantoCrearcampania.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDB = new paloDB($arrConf['dsn_conn_database']); //actions $action = getAction(); $content = ""; switch ($action) { // Ver form con información de la campaña padre para proceder a armar la regestión case 'view_edit': $content = viewFormCrearcampaña($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf); break; // Grabar la regestión // Grabar la regestión case 'save_edit': case 'save_new': saveNewRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); $content = reportRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; // Reporte de campañas padres // Reporte de campañas padres default: $content = reportRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoPortService.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion $pDB = new paloDB($arrConf['dsn_conn_database']); //actions $accion = getAction(); $content = ""; switch ($accion) { case 'save': $content = savePuerto($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case 'new': case 'view': case 'edit': $content = NewViewPuerto($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $accion); break; case 'delete': $content = deletePuertos($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; case 'cancel': $content = reportPuertos($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; default: $content = reportPuertos($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoOverall_setting.class.php"; require_once "modules/{$module_name}/libs/JSON.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDB = new paloDB($arrConf['cadena_dsn']); $pACL = new paloACL($arrConf['elastix_dsn']['acl']); //actions $action = getAction(); switch ($action) { case "update": $content = updateNotification($pDB); break; case 'refresh': $content = refreshNotification($pDB); break; case "update_rate": $content = updateRate($pDB, $pACL); break; case 'refresh_rate': $content = refreshRate($pDB, $pACL); break; default: // view_form $content = viewFormOverall_setting($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; } return $content; }
function Auth() { parent::Controller(); $this->load->library('Openid'); $this->load->library('Form_validation'); $this->load->helper('url'); $this->load->helper('form'); $this->load->helper('simian_openid_helper'); $this->load->helper('simian_facebook_helper'); $this->load->helper('simian_form_helper'); $this->lang->load('simian_grid', get_language()); $this->lang->load('openid', get_language()); $this->lang->load('form_validation', get_language()); }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoMissedCalls.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; // cdr connection $dsn = generarDSNSistema('asteriskuser', 'asteriskcdrdb'); $pDB_cdr = new paloDB($dsn); // call_center connection $pDB_callcenter = new paloDB($arrConf['cadena_dsn']); $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']); if (!empty($pDBACL->errMsg)) { return "ERROR DE DB: {$pDBACL->errMsg}"; } $pACL = new paloACL($pDBACL); if (!empty($pACL->errMsg)) { return "ERROR DE ACL: {$pACL->errMsg}"; } //actions $action = getAction(); switch ($action) { case 'call2phone': $content = call2phone(); break; default: $content = reportMissedCalls($smarty, $module_name, $local_templates_dir, $pDB_callcenter, $pDBACL, $pACL, $arrConf, $pDB_cdr); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //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']; $smarty->assign("icon", "modules/{$module_name}/images/system_shutdown.png"); $smarty->assign("title", $arrLang["Shutdown"]); if (isset($_POST['submit_accept'])) { $smarty->assign("SHUTDOWN_PROGRESS", $arrLang["Shutdown in progress"]); $smarty->assign("MSG_LINK", $arrLang["Continue"]); if ($_POST['shutdown_mode'] == '1') { $smarty->assign("SHUTDOWN_MSG", $arrLang["Your system in shutting down now. Please, try again later."]); exec("sudo -u root /sbin/shutdown -h now", $salida, $retorno); $salida = $smarty->fetch("file:{$local_templates_dir}/shutdown_in_progress.tpl"); } else { if ($_POST['shutdown_mode'] == '2') { $smarty->assign("SHUTDOWN_MSG", $arrLang["The reboot signal has been sent correctly."]); exec("sudo -u root /sbin/shutdown -r now", $salida, $retorno); $salida = $smarty->fetch("file:{$local_templates_dir}/shutdown_in_progress.tpl"); } else { echo "Modo invalido"; } } } else { $smarty->assign("ACCEPT", $arrLang["Accept"]); $smarty->assign("CONFIRM_CONTINUE", $arrLang["Are you sure you wish to continue?"]); $smarty->assign("HALT", $arrLang["Halt"]); $smarty->assign("REBOOT", $arrLang["Reboot"]); $salida = $smarty->fetch("file:{$local_templates_dir}/shutdown.tpl"); } return $salida; }
function load_language_module($module_id, $ruta_base = '') { $lang = get_language($ruta_base); include_once $ruta_base . "modules/{$module_id}/lang/en.lang"; $lang_file_module = $ruta_base . "modules/{$module_id}/lang/{$lang}.lang"; if ($lang != 'en' && file_exists("{$lang_file_module}")) { $arrLangEN = $arrLangModule; include_once "{$lang_file_module}"; $arrLangModule = array_merge($arrLangEN, $arrLangModule); } global $arrLang; global $arrLangModule; $arrLang = array_merge($arrLang, $arrLangModule); }
function CargarIdiomas() { global $arrConf; $module_name = "summary_by_extension"; include_once $arrConf['basePath'] . "/libs/misc.lib.php"; $lang = get_language($arrConf['basePath'] . '/'); if (file_exists($arrConf['basePath'] . "/modules/{$module_name}/lang/{$lang}.lang")) { include_once $arrConf['basePath'] . "/modules/{$module_name}/lang/{$lang}.lang"; } else { include_once $arrConf['basePath'] . "/modules/{$module_name}/lang/en.lang"; } global $arrLangModule; $this->arrLang = $arrLangModule; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoVacations.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $pDB = new paloDB($arrConf['dsn_conn_database']); $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']); //actions $action = getAction(); $content = ""; switch ($action) { case "activate": $content = activateEmailVacations($smarty, $module_name, $local_templates_dir, $pDB, $pDBACL, $arrConf, $arrLang); break; case "disactivate": $content = disactivateEmailVacations($smarty, $module_name, $local_templates_dir, $pDB, $pDBACL, $arrConf, $arrLang); break; case "showAllEmails": $html = showAllEmails($smarty, $module_name, $local_templates_dir, $pDB, $pDBACL, $arrConf, $arrLang); $smarty->assign("CONTENT", $html); $content = $smarty->display("{$local_templates_dir}/emailsGrid.tpl"); break; default: // view_form $content = viewFormVacations($smarty, $module_name, $local_templates_dir, $pDB, $pDBACL, $arrConf, $arrLang); break; } return $content; }
function formLanguage($smarty, $module_name, $local_templates_dir, $arrConf, $pACL, $uid) { global $arrPermission; $lang = get_language(); $error_msg = ''; $archivos = array(); $langElastix = array(); $contenido = ''; $msgError = ''; $arrDefaultRate = array(); $conexionDB = FALSE; include "configs/languages.conf.php"; //este archivo crea el arreglo language que contine los idiomas soportados //por elastix leer_directorio("/usr/share/elastix/lang", $error_msg, $archivos); if (count($archivos) > 0) { foreach ($languages as $lang => $lang_name) { if (in_array("{$lang}.lang", $archivos)) { $langElastix[$lang] = $lang_name; } } } if (count($langElastix) > 0) { $arrFormLanguage = createFieldForm($langElastix); $oForm = new paloForm($smarty, $arrFormLanguage); if (empty($pACL->errMsg)) { $conexionDB = TRUE; } else { $msgError = _tr("You can't change language") . '.-' . _tr("ERROR") . ":" . $pACL->errMsg; } // $arrDefaultRate['language']="es"; $smarty->assign("CAMBIAR", _tr("Save")); $smarty->assign("MSG_ERROR", $msgError); $smarty->assign("conectiondb", $conexionDB); $smarty->assign("icon", "web/apps/{$module_name}/images/system_preferencies_language.png"); if (in_array('edit', $arrPermission)) { $smarty->assign('EDIT_LANG', true); } //obtener el valor del lenguage por defecto $defLang = $pACL->getUserProp($uid, 'language'); if (empty($defLang) || $defLang === false) { $defLang = "en"; } $arrDefault['language'] = $defLang; $htmlForm = $oForm->fetchForm("{$local_templates_dir}/language.tpl", _tr("Language"), $arrDefault); $contenido = "<form method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>"; } return $contenido; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoWeakKeys.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //conexion resource $dsn_asterisk = generarDSNSistema("asteriskuser", "asterisk"); $pDB = new paloDB($dsn_asterisk); $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*"); $arrAMP = $pConfig->leer_configuracion(false); $pConfig = new paloConfig($arrAMP['ASTETCDIR']['valor'], "asterisk.conf", "=", "[[:space:]]*=[[:space:]]*"); $arrAST = $pConfig->leer_configuracion(false); //actions $action = getAction(); $content = ""; switch ($action) { case "change": $content = editWeakKeys($smarty, $module_name, $local_templates_dir, $arrConf, $pDB); break; case "save": $content = saveNewKey($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrAST, $arrAMP); break; default: $content = reportWeakKeys($smarty, $module_name, $local_templates_dir, $pDB, $arrConf); break; } return $content; }