本文整理汇总了PHP中_tr函数的典型用法代码示例。如果您正苦于以下问题:PHP _tr函数的具体用法?PHP _tr怎么用?PHP _tr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_tr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _formatReportForExtension
protected function _formatReportForExtension($smarty, $module_name, $extension, &$respuesta)
{
$voicePath = "/var/spool/asterisk/voicemail/default/{$extension}/INBOX";
$result = is_dir($voicePath) ? glob("{$voicePath}/*.txt") : array();
if (count($result) <= 0) {
$respuesta['status'] = 'error';
$respuesta['message'] = _tr("You don't recibed voicemails");
} else {
$clavesVM = array();
foreach ($result as $archivo) {
/* El archivo es formato ini, pero no estoy seguro de que
* sea completamente parseable por parse_ini_file() */
$content = array();
foreach (file($archivo) as $s) {
$regs = NULL;
if (preg_match('/^(\\w+)\\s*=\\s*(.*)/', trim($s), $regs)) {
$content[$regs[1]] = $regs[2];
}
}
$clavesVM[$content['origtime']] = $content;
}
krsort($clavesVM, SORT_STRING);
$estadoVM = array();
foreach (array_slice($clavesVM, 0, MAX_VM_RECORDS) as $content) {
$estadoVM[] = str_replace(array('{source}', '{date}', '{duration}'), array($content['callerid'] == 'Unknown' ? _tr('unknow') : $content['callerid'], date('Y/m/d H:i:s', $content['origtime']), $content['duration']), _tr('voicemail recived'));
}
$respuesta['html'] = implode(".<br/>\n", $estadoVM) . ".<br/>\n";
}
}
示例2: showApplets_Admin
function showApplets_Admin($module_name)
{
global $smarty;
global $arrLang;
global $arrConf;
$pAppletAdmin = new paloSantoAppletAdmin();
$oForm = new paloForm($smarty, array());
$arrApplets = $pAppletAdmin->getApplets_User($_SESSION["elastix_user"]);
//Codigo para tomar en cuenta el nombre de applets para los archivos de idioma
foreach ($arrApplets as &$applet) {
$applet['name'] = _tr($applet['name']);
}
unset($applet);
//
$smarty->assign("applets", $arrApplets);
$smarty->assign("SAVE", $arrLang["Save"]);
$smarty->assign("CANCEL", $arrLang["Cancel"]);
$smarty->assign("Applet", $arrLang["Applet"]);
$smarty->assign("Activated", $arrLang["Activated"]);
$smarty->assign("checkall", $arrLang["Check All"]);
$smarty->assign("icon", "modules/{$module_name}/images/system_dashboard_applet_admin.png");
//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'];
$htmlForm = $oForm->fetchForm("{$local_templates_dir}/applet_admin.tpl", $arrLang["Dashboard Applet Admin"], $_POST);
$content = "<form method='POST' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
return $content;
}
示例3: listFax
function listFax($smarty, $module_name, $local_templates_dir)
{
$limit = 30;
$oFax = new paloFax();
$total = $oFax->getTotalFax();
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$oGrid->pagingShow(true);
$oGrid->setURL("?menu=faxlist");
$oGrid->setTitle(_tr("Virtual Fax List"));
$oGrid->setIcon("/modules/{$module_name}/images/fax_virtual_fax_list.png");
$arrColumns = array(_tr("Virtual Fax Name"), _tr("Fax Extension"), _tr("Secret"), _tr("Destination Email"), _tr("Caller ID Name"), _tr("Caller ID Number"), _tr("Status"));
$oGrid->setColumns($arrColumns);
$offset = $oGrid->calculateOffset();
$arrFax = $oFax->getFaxList($offset, $limit);
$arrFaxStatus = $oFax->getFaxStatus();
$arrData = array();
foreach ($arrFax as $fax) {
$arrTmp = array();
$arrTmp[0] = " <a href='?menu=faxnew&action=view&id=" . $fax['id'] . "'>" . $fax['name'] . "</a>";
$arrTmp[1] = $fax['extension'];
$arrTmp[2] = $fax['secret'];
$arrTmp[3] = $fax['email'];
$arrTmp[4] = $fax['clid_name'] . " ";
$arrTmp[5] = $fax['clid_number'] . " ";
$arrTmp[6] = $arrFaxStatus['modems']['ttyIAX' . $fax['dev_id']] . ' on ttyIAX' . $fax['dev_id'];
$arrData[] = $arrTmp;
}
$session = getSession();
$session['faxlist']['faxListStatus'] = $arrData;
putSession($session);
$oGrid->setData($arrData);
return $oGrid->fetchGrid();
}
示例4: setFaxMaster
function setFaxMaster($email_account)
{
if (!preg_match("/^[a-z0-9]+([\\._\\-]?[a-z0-9]+[_\\-]?)*@[a-z0-9]+([\\._\\-]?[a-z0-9]+)*(\\.[a-z0-9]{2,6})+\$/", $email_account)) {
$this->errMsg = _tr("Invalid Email Address");
return false;
}
$this->_DB->beginTransaction();
$query = "DELETE from settings WHERE property='fax_master'";
if (!$this->_DB->genQuery($query)) {
$this->_DB->rollBack();
$this->_tr("DATABASE ERROR");
return false;
}
$query = "INSERT INTO settings(property,value) VALUES(?,?)";
if (!$this->_DB->genQuery($query, array('fax_master', $email_account))) {
$this->_DB->rollBack();
$this->_tr("DATABASE ERROR");
return false;
}
//realizamos el cambios en los archivos del email
if (!$this->modificar_archivos_mail($email_account)) {
$this->_DB->rollBack();
$this->errMsg = 'Error in mail configuration. ' . $this->errMsg;
return false;
} else {
$this->_DB->commit();
return true;
}
}
示例5: handleJSON_dirspacereport
function handleJSON_dirspacereport($smarty, $module_name, $appletlist)
{
$respuesta = array('status' => 'success', 'message' => '(no message)');
// Lista de directorios a buscar
$listaReporteDir = array('logs' => array('dir' => '/var/log', 'tag' => _tr('Logs'), 'use' => 'N/A'), 'backups' => array('dir' => '/var/www/backup', 'tag' => _tr('Local Backups'), 'use' => 'N/A'), 'emails' => array('dir' => '/var/spool/imap', 'tag' => _tr('Emails'), 'use' => 'N/A'), 'config' => array('dir' => '/etc', 'tag' => _tr('Configuration'), 'use' => 'N/A'), 'voicemails' => array('dir' => '/var/spool/asterisk/voicemail', 'tag' => _tr('Voicemails'), 'use' => 'N/A'), 'recordings' => array('dir' => '/var/spool/asterisk/monitor', 'tag' => _tr('Recordings'), 'use' => 'N/A'));
/* Se cierra la sesión para quitar el candado sobre la sesión y permitir
* que otras operaciones ajax puedan funcionar mientras se espera el
* reporte de espacio por directorio. */
session_commit();
$pipe_dirspace = popen('/usr/bin/elastix-helper dirspacereport', 'r');
while ($s = fgets($pipe_dirspace)) {
$s = trim($s);
$l = explode(' ', $s);
if (count($l) > 1 && isset($listaReporteDir[$l[0]])) {
$listaReporteDir[$l[0]]['use'] = $l[1];
}
}
pclose($pipe_dirspace);
@session_start();
$smarty->assign('listaReporteDir', $listaReporteDir);
$local_templates_dir = dirname($_SERVER['SCRIPT_FILENAME']) . "/modules/{$module_name}/applets/HardDrives/tpl";
$respuesta['html'] = $smarty->fetch("{$local_templates_dir}/dirspacereport.tpl");
$json = new Services_JSON();
Header('Content-Type: application/json');
return $json->encode($respuesta);
}
示例6: getApplets_User
function getApplets_User($user)
{
global $arrConf;
$dsn = "sqlite3:///{$arrConf['elastix_dbdir']}/dashboard.db";
$pDB = new paloDB($dsn);
$pDB2 = new paloDB($arrConf['elastix_dsn']['elastix']);
$pACL = new paloACL($pDB2);
if ($pACL->isUserSuperAdmin($user)) {
$typeUser = "admin";
} else {
$typeUser = "no_admin";
}
$query = "\n select\n t1.id id,\n t1.name name,\n ifnull(t2.activated,0) activated,\n ifnull(t2.order_no,0) order_no\n from\n (select\n dau.id id,\n a.name name\n from\n applet a\n inner join\n default_applet_by_user dau on a.id=dau.id_applet\n where\n dau.username=?) t1\n left join\n (select\n aau.id_dabu id_dabu,\n aau.id activated,\n aau.order_no order_no\n from\n activated_applet_by_user aau\n where\n aau.username=?) t2\n on\n t1.id=t2.id_dabu\n order by\n t1.id asc;";
$result = $pDB->fetchTable($query, true, array($typeUser, $user));
if ($result == FALSE) {
$this->errMsg = $pDB->errMsg;
return array();
} else {
$applets = array();
foreach ($result as $value) {
$value['name'] = _tr($value['name']);
$applets[] = $value;
}
return $applets;
}
}
示例7: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
require_once "modules/{$module_name}/libs/contentFreePBX.php";
$smarty->assign("title", _tr("PBX Configuration"));
$smarty->assign("icon", "/modules/{$module_name}/images/pbx_configuration.png");
$salida = getContent($smarty, $module_name, true);
return $salida;
}
示例8: viewFormInstant_Messaging
function viewFormInstant_Messaging($smarty, $module_name, $local_templates_dir, $arrConf)
{
$smarty->assign("icon", "modules/{$module_name}/images/instant_messaging.png");
$smarty->assign("imess1_img", "modules/{$module_name}/images/spark.jpg");
$smarty->assign("tag_manuf_description", _tr("Manufacturer Description"));
$smarty->assign("download_link", _tr("Download Link"));
$smarty->assign("tag_manufacturer", _tr("Manufacturer"));
$smarty->assign("imess1_software_description", _tr("spark_software_description"));
$smarty->assign("imess1_manufacturer_description", _tr("spark_manufacturer_description"));
$oForm = new paloForm($smarty, array());
$content = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Instant Messaging"));
return $content;
}
示例9: getFaxExtensionUser
function getFaxExtensionUser($idUser)
{
$query = "SELECT fax_extension FROM acl_user WHERE id=?";
$result = $this->_DB->getFirstRowQuery($query, false, array($idUser));
if ($result === false) {
$this->errMsg = _tr("DATABASE ERROR");
return false;
} elseif (count($result) == 0) {
$this->errMsg = _tr("User does not exist");
return false;
}
return $result[0];
}
示例10: viewFormSoftphones
function viewFormSoftphones($smarty, $module_name, $local_templates_dir, $arrConf)
{
$smarty->assign("icon", "modules/{$module_name}/images/softphones.png");
$smarty->assign("xlite_img", "modules/{$module_name}/images/x-lite-4-lrg.png");
$smarty->assign("zoiper_img", "modules/{$module_name}/images/zoiper.png");
$smarty->assign("tag_manuf_description", _tr("Manufacturer Description"));
$smarty->assign("download_link", _tr("Download Link"));
$smarty->assign("tag_manufacturer", _tr("Manufacturer"));
$smarty->assign("xlite_software_description", _tr("xlite_software_description"));
$smarty->assign("xlite_manufacturer_description", _tr("xlite_manufacturer_description"));
$smarty->assign("zoiper_software_description", _tr("zoiper_software_description"));
$smarty->assign("zoiper_manufacturer_description", _tr("zoiper_manufacturer_description"));
$oForm = new paloForm($smarty, array());
$content = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Softphones"), array());
return $content;
}
示例11: viewFormFax_Utilities
function viewFormFax_Utilities($smarty, $module_name, $local_templates_dir, $arrConf)
{
$smarty->assign("icon", "modules/{$module_name}/images/fax_utilities.png");
$smarty->assign("fax1_img", "modules/{$module_name}/images/jhylafax.jpg");
$smarty->assign("fax2_img", "modules/{$module_name}/images/winprinthylafax.jpg");
$smarty->assign("tag_manuf_description", _tr("Manufacturer Description"));
$smarty->assign("download_link", _tr("Download Link"));
$smarty->assign("tag_manufacturer", _tr("Manufacturer"));
$smarty->assign("fax1_software_description", _tr("jhylafax_software_description"));
$smarty->assign("fax1_manufacturer_description", _tr("jhylafax_manufacturer_description"));
$smarty->assign("fax2_software_description", _tr("winprint_software_description"));
$smarty->assign("fax2_manufacturer_description", _tr("winprint_manufacturer_description"));
$oForm = new paloForm($smarty, array());
$content = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Fax Utilities"), array());
return $content;
}
示例12: handleJSON_getContent
function handleJSON_getContent($smarty, $module_name, $appletlist)
{
$respuesta = array('status' => 'success', 'message' => '(no message)');
// Leer credenciales a partir del usuario y el perfil asociado
global $arrConf;
$dbAcl = new paloDB($arrConf["elastix_dsn"]["acl"]);
$pACL = new paloACL($dbAcl);
$userId = $pACL->getIdUser($_SESSION['elastix_user']);
$listaEventos = $this->_leerRegistrosEventos($userId);
$listaEventosDias = $this->_expandirRegistrosEventos($listaEventos);
$smarty->assign(array('NO_EVENTOS' => _tr("You don't have events"), 'EVENTOS_DIAS' => $listaEventosDias, 'tag_date' => _tr("Date"), 'tag_call' => _tr("Call")));
$local_templates_dir = dirname($_SERVER['SCRIPT_FILENAME']) . "/modules/{$module_name}/applets/Calendar/tpl";
$respuesta['html'] = $smarty->fetch("{$local_templates_dir}/calendar_events.tpl");
$json = new Services_JSON();
Header('Content-Type: application/json');
return $json->encode($respuesta);
}
示例13: themeSetup
function themeSetup(&$smarty, $selectedMenu, $pdbACL, $pACL, $idUser)
{
/* El tema elastixneo muestra hasta 7 items de menú de primer nivel, y
* coloca el resto en una lista desplegable a la derecha del último item.
* Se debe de garantizar que el item actualmente seleccionado aparezca en
* un menú de primer nivel que esté entre los 7 primeros, reordenando los
* items si es necesario. */
$lang = get_language();
$arrMainMenu = $smarty->get_template_vars('arrMainMenu');
foreach ($arrMainMenu as $idMenu => $arrMenuItem) {
$arrMainMenu[$idMenu]['icon'] = setIcon($idMenu);
}
$idMainMenuSelected = $smarty->get_template_vars('idMainMenuSelected');
$MAX_ITEMS_VISIBLES = 7;
if (count($arrMainMenu) > $MAX_ITEMS_VISIBLES) {
// Se transfiere a arreglo numérico para manipular orden de enumeración
$tempMenulist = array();
$idxMainMenu = NULL;
foreach ($arrMainMenu as $key => $value) {
if ($key == $idMainMenuSelected) {
$idxMainMenu = count($tempMenulist);
}
$tempMenulist[] = array($key, $value);
}
if (!is_null($idxMainMenu) && $idxMainMenu >= $MAX_ITEMS_VISIBLES) {
$menuitem = array_splice($tempMenulist, $idxMainMenu, 1);
array_splice($tempMenulist, $MAX_ITEMS_VISIBLES - 1, 0, $menuitem);
$arrMainMenu = array();
foreach ($tempMenulist as $menuitem) {
$arrMainMenu[$menuitem[0]] = $menuitem[1];
}
}
unset($tempMenulist);
}
$smarty->assign('arrMainMenu', $arrMainMenu);
$smarty->assign("LANG", $lang);
$smarty->assign(array("ABOUT_ELASTIX2" => _tr('About Elastix2'), "HELP" => _tr('HELP'), "USER_LOGIN" => $_SESSION['elastix_user'], "USER_ID" => $idUser, "CURRENT_PASSWORD_ALERT" => _tr("Please write your current password."), "NEW_RETYPE_PASSWORD_ALERT" => _tr("Please write the new password and confirm the new password."), "PASSWORDS_NOT_MATCH" => _tr("The new password doesn't match with retype password."), "CHANGE_PASSWORD" => _tr("Change Elastix Password"), "CURRENT_PASSWORD" => _tr("Current Password"), "NEW_PASSWORD" => _tr("New Password"), "RETYPE_PASSWORD" => _tr("Retype New Password"), "CHANGE_PASSWORD_BTN" => _tr("Change"), "MODULES_SEARCH" => _tr("Search modules"), "ADD_BOOKMARK" => _tr("Add Bookmark"), "REMOVE_BOOKMARK" => _tr("Remove Bookmark"), "ADDING_BOOKMARK" => _tr("Adding Bookmark"), "REMOVING_BOOKMARK" => _tr("Removing Bookmark"), "HIDING_IZQTAB" => _tr("Hiding left panel"), "SHOWING_IZQTAB" => _tr("Loading left panel"), "HIDE_IZQTAB" => _tr("Hide left panel"), "SHOW_IZQTAB" => _tr("Load left panel"), 'viewMenuTab' => getStatusNeoTabToggle($pdbACL, $idUser), 'MENU_COLOR' => getMenuColorByMenu($pdbACL, $idUser), 'IMG_BOOKMARKS' => menuIsBookmark($pdbACL, $idUser, $selectedMenu) ? 'bookmarkon.png' : 'bookmark.png', 'SHORTCUT' => loadShortcut($pdbACL, $idUser, $smarty), 'STATUS_STICKY_NOTE' => 'false', 'BREADCRUMB' => setBreadcrumb($arrMainMenu, $selectedMenu)));
// se obtiene si ese menu tiene una nota agregada
$statusStickyNote = getStickyNote($pdbACL, $idUser, $selectedMenu);
if ($statusStickyNote['status'] && $statusStickyNote['data'] != "") {
$smarty->assign('STATUS_STICKY_NOTE', 'true');
if ($statusStickyNote['popup'] == 1) {
$smarty->assign('AUTO_POPUP', '1');
}
}
}
示例14: _sampler_CallsMemoryCPU
private function _sampler_CallsMemoryCPU()
{
$arrayResult = array();
$oSampler = new paloSampler();
//retorna
//Array ( [0] => Array ( [id] => 1 [name] => Sim. calls [color] => #00cc00 [line_type] => 1 )
$arrLines = $oSampler->getGraphLinesById(1);
//retorna
//Array ( [name] => Simultaneous calls, memory and CPU )
$arrGraph = $oSampler->getGraphById(1);
$endtime = time();
$starttime = $endtime - 26 * 60 * 60;
$oSampler->deleteDataBeforeThisTimestamp($starttime);
$arrayResult['ATTRIBUTES'] = array('TITLE' => utf8_decode(_tr($arrGraph['name'])), 'TYPE' => 'lineplot_multiaxis', 'LABEL_X' => 'Etiqueta X', 'LABEL_Y' => 'Etiqueta Y', 'SHADOW' => false, 'SIZE' => "450,260", 'MARGIN' => "50,110,30,120", 'COLOR' => "#fafafa", 'POS_LEYEND' => "0.35,0.85");
$arrayResult['MESSAGES'] = array('ERROR' => 'Error', 'NOTHING_SHOW' => _tr('Nothing to show yet'));
//$oSampler->getSamplesByLineId(1)
//retorna
//Array ( [0] => Array ( [timestamp] => 1230562202 [value] => 2 ), .......
$i = 1;
$arrData = array();
foreach ($arrLines as $num => $line) {
$arraySample = $oSampler->getSamplesByLineId($line['id']);
$arrDat_N = array();
$arrValues = array();
foreach ($arraySample as $num => $time_value) {
$arrValues[$time_value['timestamp']] = (int) $time_value['value'];
}
$arrStyle = array();
$arrStyle['COLOR'] = $line['color'];
$arrStyle['LEYEND'] = utf8_decode(_tr($line['name']));
$arrStyle['STYLE_STEP'] = true;
$arrStyle['FILL_COLOR'] = $i == 1 ? true : false;
$arrDat_N["VALUES"] = $arrValues;
$arrDat_N["STYLE"] = $arrStyle;
if (count($arrValues) > 1) {
$arrData["DAT_{$i}"] = $arrDat_N;
} else {
$arrData["DAT_{$i}"] = array();
}
$i++;
}
$arrayResult['DATA'] = $arrData;
$arrayResult['FORMAT_CALLBACK'] = array($this, 'functionCallback');
return $arrayResult;
}
示例15: _moduleContent
function _moduleContent(&$smarty, $module_name)
{
//folder path for custom templates
$local_templates_dir = getWebDirModule($module_name);
$smarty->assign("title", _tr("Channels Usage Report"));
$smarty->assign("icon", "web/apps/{$module_name}/images/reports_channel_usage.png");
if (isset($_GET['image'])) {
$_GET['image'] = (int) $_GET['image'];
displayGraph($module_name, "paloSantoChannelUsage", "channelsUsage", array($_GET['image']), "functionCallback");
} else {
$listaGraficos = array('img_1' => 2, 'img_2' => 3, 'img_3' => 4, 'img_4' => 5, 'img_5' => 6, 'img_6' => 7);
foreach (array_keys($listaGraficos) as $k) {
$listaGraficos[$k] = "<img alt=\"{$listaGraficos[$k]}\" src=\"?menu={$module_name}&image={$listaGraficos[$k]}&rawmode=yes\" />";
}
$smarty->assign($listaGraficos);
return $smarty->fetch("{$local_templates_dir}/channelusage.tpl");
}
}