本文整理匯總了PHP中Locale::GetStr方法的典型用法代碼示例。如果您正苦於以下問題:PHP Locale::GetStr方法的具體用法?PHP Locale::GetStr怎麽用?PHP Locale::GetStr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Locale
的用法示例。
在下文中一共展示了Locale::GetStr方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sum_page
function sum_page()
{
global $gEnv;
$amp_locale = new Locale('amp_root_menu', AMP_LANG);
import('com.solarix.ampoliros.module.ModuleConfig');
$mod_cfg = new ModuleConfig($gEnv['root']['db'], 'ampoliros');
$hui = new Hui($gEnv['root']['db'], TRUE);
$hui->LoadWidget('table');
$hui->LoadWidget('page');
$hui->LoadWidget('vertgroup');
$hui->LoadWidget('vertframe');
$hui->LoadWidget('treemenu');
$hui_page = new HuiPage('page', array('title' => 'Ampoliros' . (strlen(AMP_HOST) ? ' - ' . AMP_HOST . (strlen(AMP_DOMAIN) ? '.' . AMP_DOMAIN : '') : ''), 'border' => 'false'));
$hui_page->mArgs['background'] = $hui_page->mThemeHandler->mStyle['menuback'];
$hui_mainvertgroup = new HuiVertGroup('mainvertgroup');
$el[1]['groupname'] = 'Ampoliros';
$cont = 1;
$query =& $gEnv['root']['db']->Execute('SELECT id FROM sites');
if ($query->NumRows()) {
$el[1]['groupelements'][$cont]['name'] = $amp_locale->GetStr('siteadmin');
$el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['siteaccess'];
$el[1]['groupelements'][$cont]['action'] = 'admin/';
$el[1]['groupelements'][$cont]['themesized'] = 'true';
$cont++;
}
$el[1]['groupelements'][$cont]['name'] = $amp_locale->GetStr('rootadmin');
$el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['rootaccess'];
$el[1]['groupelements'][$cont]['action'] = 'root/';
$el[1]['groupelements'][$cont]['themesized'] = 'true';
if ($mod_cfg->GetKey('ampoliros-link-disabled') != '1') {
$el[1]['groupelements'][++$cont]['name'] = $amp_locale->GetStr('amphome');
$el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['ampminilogo'];
$el[1]['groupelements'][$cont]['action'] = 'http://www.ampoliros.com/';
$el[1]['groupelements'][$cont]['target'] = 'op';
$el[1]['groupelements'][$cont]['themesized'] = 'true';
}
if ($mod_cfg->GetKey('solarix-link-disabled') != '1') {
$el[1]['groupelements'][++$cont]['name'] = $amp_locale->GetStr('solarixhome');
$el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['solarixminilogo'];
$el[1]['groupelements'][$cont]['action'] = 'http://www.solarix.biz/';
$el[1]['groupelements'][$cont]['target'] = 'op';
$el[1]['groupelements'][$cont]['themesized'] = 'true';
}
if ($mod_cfg->GetKey('oem-link-disabled') != '1') {
$oem_link_filename = $mod_cfg->GetKey('oem-link-filename');
if (strlen($oem_link_filename) and file_exists(CGI_PATH . $oem_link_filename)) {
$el[1]['groupelements'][++$cont]['name'] = $mod_cfg->GetKey('oem-name');
$el[1]['groupelements'][$cont]['image'] = CGI_URL . $oem_link_filename;
$el[1]['groupelements'][$cont]['action'] = $mod_cfg->GetKey('oem-url');
$el[1]['groupelements'][$cont]['target'] = 'parent';
$el[1]['groupelements'][$cont]['themesized'] = 'false';
}
}
$hui_vertframe = new HuiVertFrame('vertframe');
$hui_vertframe->AddChild(new HuiTreeMenu('treemenu', array('elements' => $el, 'width' => '120', 'target' => 'parent', 'allgroupsactive' => 'true')));
$hui_mainvertgroup->AddChild($hui_vertframe);
$hui_page->AddChild($hui_mainvertgroup);
$hui->AddChild($hui_page);
$hui->Render();
}
示例2: main_editprofile
function main_editprofile($eventData)
{
global $env, $amp_locale, $hui_mainframe, $hui_titlebar, $gEnv;
$prof_query =& $env['ampdb']->execute('SELECT * ' . 'FROM xmlrpcprofiles ' . 'WHERE id=' . $eventData['profileid']);
$prof_data = $prof_query->Fields();
$methods_query =& $env['ampdb']->Execute('SELECT module,name,unsecure,catalog ' . 'FROM xmlrpcmethods ' . 'ORDER BY module, name');
if ($methods_query->NumRows()) {
$nodes = $sec = $desc = array();
$prev_catalog = $tmp_locale = '';
while (!$methods_query->eof) {
$nodes[$methods_query->Fields('module')][] = $methods_query->Fields('name');
$sec[$methods_query->Fields('module')][$methods_query->Fields('name')] = $methods_query->Fields('unsecure') == $env['ampdb']->fmttrue ? false : true;
$tmp_description = '';
if (strlen($methods_query->Fields('catalog'))) {
if ($prev_catalog != $methods_query->Fields('catalog')) {
$tmp_locale = new Locale($methods_query->Fields('catalog'), $gEnv['root']['locale']['language']);
}
$desc[$methods_query->Fields('module')][$methods_query->Fields('name')] = $tmp_locale->GetStr($methods_query->Fields('name'));
$prev_catalog = $methods_query->Fields('catalog');
}
$methods_query->MoveNext();
}
$row = 0;
$headers[0]['label'] = '';
$headers[1]['label'] = $amp_locale->GetStr('xmlrpcmodule_header');
$headers[2]['label'] = '';
$headers[3]['label'] = $amp_locale->GetStr('xmlrpcmethod_header');
$headers[4]['label'] = $amp_locale->GetStr('docstring_header');
$headers[5]['label'] = $amp_locale->GetStr('security_header');
$hui_methods_table = new HuiTable('methodstable', array('headers' => $headers, 'rowsperpage' => '15', 'pagesactionfunction' => 'editprofile_list_action_builder', 'pagenumber' => $eventData['editprofilepage'], 'sessionobjectusername' => $eventData['profileid']));
while (list($module, $methods) = each($nodes)) {
$xprofile = new XmlRpcProfile($env['ampdb'], $eventData['profileid']);
$node_state = $xprofile->NodeCheck(XMLRPCPROFILE_NODETYPE_MODULE, $module);
switch ($node_state) {
case XMLRPCPROFILE_MODULENODE_FULLYENABLED:
$icon = $hui_mainframe->mThemeHandler->mStyle['greenball'];
$enabled = true;
break;
case XMLRPCPROFILE_MODULENODE_PARTIALLYENABLED:
$icon = $hui_mainframe->mThemeHandler->mStyle['goldball'];
$enabled = true;
break;
case XMLRPCPROFILE_MODULENODE_NOTENABLED:
$icon = $hui_mainframe->mThemeHandler->mStyle['redball'];
$enabled = false;
break;
}
$hui_methods_table->AddChild(new HuiImage('statusimage' . $row, array('imageurl' => $icon)), $row, 0);
$hui_methods_table->AddChild(new HuiLabel('modulelabel' . $row, array('label' => $module)), $row, 1);
$hui_module_toolbar[$row] = new HuiToolBar('moduletoolbar' . $row);
if ($enabled) {
$disable_action[$row] = new HuiEventsCall();
$disable_action[$row]->AddEvent(new HuiEvent('main', 'editprofile', array('profileid' => $eventData['profileid'])));
$disable_action[$row]->AddEvent(new HuiEvent('pass', 'disablenode', array('nodetype' => XMLRPCPROFILE_NODETYPE_MODULE, 'module' => $module, 'profileid' => $eventData['profileid'])));
$hui_disable_button[$row] = new HuiButton('disablebutton' . $row, array(label => $amp_locale->GetStr('disablenode_label'), 'horiz' => 'true', 'themeimage' => 'lock', 'action' => $disable_action[$row]->GetEventsCallString()));
$hui_module_toolbar[$row]->AddChild($hui_disable_button[$row]);
}
if (!$enabled or $node_state == XMLRPCPROFILE_MODULENODE_PARTIALLYENABLED) {
$enable_action[$row] = new HuiEventsCall();
$enable_action[$row]->AddEvent(new HuiEvent('main', 'editprofile', array('profileid' => $eventData['profileid'])));
$enable_action[$row]->AddEvent(new HuiEvent('pass', 'enablenode', array('nodetype' => XMLRPCPROFILE_NODETYPE_MODULE, 'module' => $module, 'profileid' => $eventData['profileid'])));
$hui_enable_button[$row] = new HuiButton('enablebutton' . $row, array(label => $amp_locale->GetStr('enablenode_label'), 'horiz' => 'true', 'themeimage' => 'unlock', 'action' => $enable_action[$row]->GetEventsCallString()));
$hui_module_toolbar[$row]->AddChild($hui_enable_button[$row]);
}
$hui_methods_table->AddChild($hui_module_toolbar[$row], $row, 6);
$row++;
while (list(, $method) = each($methods)) {
$node_state = $xprofile->NodeCheck(XMLRPCPROFILE_NODETYPE_METHOD, $module, $method);
switch ($node_state) {
case XMLRPCPROFILE_METHODNODE_ENABLED:
$icon = $hui_mainframe->mThemeHandler->mStyle['greenball'];
$enabled = true;
break;
case XMLRPCPROFILE_METHODNODE_NOTENABLED:
$icon = $hui_mainframe->mThemeHandler->mStyle['redball'];
$enabled = false;
break;
}
$hui_methods_table->AddChild(new HuiImage('statusimage' . $row, array('imageurl' => $icon)), $row, 2);
$hui_methods_table->AddChild(new HuiLabel('methodlabel' . $row, array('label' => $method)), $row, 3);
$img = $sec[$module][$method] == true ? 'button_ok' : 'button_cancel';
$secure_image = $hui_methods_table->mThemeHandler->mIconsBase . $hui_methods_table->mThemeHandler->mIconsSet['actions'][$img]['base'] . '/actions/' . $hui_methods_table->mThemeHandler->mIconsSet['actions'][$img]['file'];
$hui_methods_table->AddChild(new HuiLabel('desclabel' . $row, array('label' => $desc[$module][$method])), $row, 4);
$hui_methods_table->AddChild(new HuiImage('secure' . $row, array('imageurl' => $secure_image)), $row, 5);
$hui_method_toolbar[$row] = new HuiToolBar('methodtoolbar' . $row);
if ($enabled) {
$disable_action[$row] = new HuiEventsCall();
$disable_action[$row]->AddEvent(new HuiEvent('main', 'editprofile', array('profileid' => $eventData['profileid'])));
$disable_action[$row]->AddEvent(new HuiEvent('pass', 'disablenode', array('nodetype' => XMLRPCPROFILE_NODETYPE_METHOD, 'method' => $method, 'module' => $module, 'profileid' => $eventData['profileid'])));
$hui_disable_button[$row] = new HuiButton('disablebutton' . $row, array(label => $amp_locale->GetStr('disablenode_label'), 'horiz' => 'true', 'themeimage' => 'lock', 'action' => $disable_action[$row]->GetEventsCallString()));
$hui_method_toolbar[$row]->AddChild($hui_disable_button[$row]);
} else {
$enable_action[$row] = new HuiEventsCall();
$enable_action[$row]->AddEvent(new HuiEvent('main', 'editprofile', array('profileid' => $eventData['profileid'])));
$enable_action[$row]->AddEvent(new HuiEvent('pass', 'enablenode', array('nodetype' => XMLRPCPROFILE_NODETYPE_METHOD, 'method' => $method, 'module' => $module, 'profileid' => $eventData['profileid'])));
$hui_enable_button[$row] = new HuiButton('enablebutton' . $row, array(label => $amp_locale->GetStr('enablenode_label'), 'horiz' => 'true', 'themeimage' => 'unlock', 'action' => $enable_action[$row]->GetEventsCallString()));
$hui_method_toolbar[$row]->AddChild($hui_enable_button[$row]);
}
$hui_methods_table->AddChild($hui_method_toolbar[$row], $row, 6);
$row++;
//.........這裏部分代碼省略.........
示例3: main_default
function main_default($eventData)
{
global $env, $gEnv, $hui_mainframe, $hui_titlebar, $amp_locale;
//$mod_cfg = new ModuleConfig( $env['ampdb'], 'ampoliros' );
$themes_query =& $env['ampdb']->Execute('SELECT name,catalog ' . 'FROM huithemes ');
while (!$themes_query->eof) {
$tmp_locale = new Locale($themes_query->Fields('catalog'), $gEnv['site']['locale']['language']);
$elements[$themes_query->Fields('name')] = $tmp_locale->GetStr($themes_query->Fields('name'));
$themes_query->MoveNext();
}
asort($elements);
$xml_def = '<vertgroup><name>vgroup</name><args><halign>center</halign></args><children>
<form><name>theme</name><args><action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', ''), array('pass', 'settheme', '')))) . '</action></args><children>
<grid><name>themegrid</name><children>
<label row="0" col="0"><name>themelabel</name><args><label type="encoded">' . urlencode($amp_locale->GetStr('themes_label')) . '</label></args></label>
<listbox row="1" col="0"><name>theme</name><args><elements type="array">' . huixml_encode($elements) . '</elements><default>' . ($env['hui']['theme']['name'] ? $env['hui']['theme']['name'] : $env['hui']['theme']['default']) . '</default><disp>pass</disp><size>10</size></args></listbox>
</children></grid>
<submit><name>submit</name><args><caption type="encoded">' . urlencode($amp_locale->GetStr('settheme_submit')) . '</caption></args></submit>
</children></form>
</children></vertgroup>';
$hui_mainframe->AddChild(new HuiXml('page', array('definition' => $xml_def)));
$hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('themes_title');
}
示例4: action_newrepository
*
*/
// Initialization
//
require 'auth.php';
OpenLibrary('hui.library');
OpenLibrary('ampcentral-server.library');
OpenLibrary('locale.library');
OpenLibrary('ampshared.library');
$gHui = new Hui($gEnv['root']['db']);
$gHui->LoadWidget('xml');
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gLocale = new Locale('ampcentral-server_root_server', $gEnv['root']['locale']['language']);
$gPage_content = $gStatus = $gToolbars = $gXml_def = '';
$gPage_title = $gLocale->GetStr('ampcentral-server.title');
$gMenu = get_ampoliros_root_menu_def($gEnv['root']['locale']['language']);
$gToolbars['repository'] = array('repository' => array('label' => $gLocale->GetStr('repository.toolbar'), 'themeimage' => 'view_text', 'action' => build_events_call_string('', array(array('main', 'default', '')))), 'newrepository' => array('label' => $gLocale->GetStr('newrepository.toolbar'), 'themeimage' => 'filenew', 'action' => build_events_call_string('', array(array('main', 'newrepository', '')))));
$gToolbars['modules'] = array('modules' => array('label' => $gLocale->GetStr('modules.toolbar'), 'themeimage' => 'view_detailed', 'action' => build_events_call_string('', array(array('main', 'modules', '')))), 'newrepository' => array('label' => $gLocale->GetStr('newmodule.toolbar'), 'themeimage' => 'filenew', 'action' => build_events_call_string('', array(array('main', 'newmodule', '')))));
// Action dispatcher
//
$gAction_disp = new HuiDispatcher('action');
// ----- Repositories ------
//
$gAction_disp->AddEvent('newrepository', 'action_newrepository');
function action_newrepository($eventData)
{
global $gEnv, $gLocale, $gStatus;
$rep = new AmpCentralRepository($gEnv['root']['db']);
if ($rep->Create($eventData['name'], $eventData['description'], $eventData['logevents'] == 'on' ? true : false)) {
$gStatus = $gLocale->GetStr('repository_created.status');
示例5: HuiPage
$hui->LoadWidget('progressbar');
$hui->LoadWidget('radio');
$hui->LoadWidget('sessionkey');
$hui->LoadWidget('statusbar');
$hui->LoadWidget('string');
$hui->LoadWidget('submit');
$hui->LoadWidget('tab');
$hui->LoadWidget('table');
$hui->LoadWidget('text');
$hui->LoadWidget('titlebar');
$hui->LoadWidget('toolbar');
$hui->LoadWidget('treemenu');
$hui->LoadWidget('vertframe');
$hui->LoadWidget('vertgroup');
$hui->LoadWidget('xml');
$hui_page = new HuiPage('page', array('title' => $amp_locale->GetStr('sites_title')));
$hui_mainvertgroup = new HuiVertGroup('mainvertgroup');
$hui_titlebar = new HuiTitleBar('titlebar', array('title' => $amp_locale->GetStr('sites_title'), 'icon' => 'package'));
$hui_mainvertgroup->AddChild($hui_titlebar);
$menu_frame = new HuiHorizGroup('menuframe');
$menu_frame->AddChild(new HuiMenu('magellanmainmenu', array('menu' => get_ampoliros_root_menu_def($env['sitelocale']))));
$hui_mainvertgroup->AddChild($menu_frame);
// Main tool bar
//
$hui_maintoolbar = new HuiToolBar('maintoolbar');
$home_action = new HuiEventsCall();
$home_action->AddEvent(new HuiEvent('main', 'default', ''));
$hui_homebutton = new HuiButton('homebutton', array('label' => $amp_locale->GetStr('sites_button'), 'themeimage' => 'view_detailed', 'horiz' => 'true', 'action' => $home_action->GetEventsCallString()));
$hui_maintoolbar->AddChild($hui_homebutton);
if ($gEnv['core']['edition'] == AMP_EDITION_ENTERPRISE) {
$site_query =& $gEnv['root']['db']->Execute('SELECT count(*) AS sites ' . 'FROM sites');
示例6: Locale
*/
require "auth.php";
if (!defined("LOCALE_LIBRARY")) {
include LIBRARY_PATH . "locale.library";
}
if (!defined("OOPHTML_LIBRARY")) {
include LIBRARY_PATH . "oophtml.library";
}
if (!defined("ADMINGUI_LIBRARY")) {
include LIBRARY_PATH . "admingui.library";
}
if (!defined("MODULES_LIBRARY")) {
include LIBRARY_PATH . "modules.library";
}
$adloc = new Locale("xmlrpcgateway", AMP_LOCALE);
$page = new HtmlPage($adloc->GetStr("title"));
$page->add(pagecaption($adloc->GetStr("title")));
$modcfg = new moduleconfig($env["ampdb"], "xmlrpcgateway");
switch ($env["disp"]["pass"]) {
case "setcfg":
$modcfg->setkey("DEST_HOST", $env["disp"]["desthost"]);
$modcfg->setkey("DEST_PORT", $env["disp"]["destport"]);
$modcfg->setkey("DEST_CGI", $env["disp"]["destcgi"]);
break;
}
switch ($env["disp"]["act"]) {
case "def":
$table[0][0] = new htmltext($adloc->GetStr("hostdesc"));
$table[1][0] = new htmlformtext("", "desthost", $modcfg->getkey("DEST_HOST"), "", 20);
$table[0][1] = new htmltext($adloc->GetStr("hostnote"));
$table[0][1]->colspan = 2;
示例7: action_clear_systemlogs
// ----- Initialization -----
//
require './auth.php';
Carthag::import('com.solarix.ampoliros.locale.Locale');
Carthag::import('com.solarix.ampoliros.locale.LocaleCountry');
Carthag::import('com.solarix.ampoliros.hui.Hui');
Carthag::import('com.solarix.ampoliros.hui.HuiEventsCall');
OpenLibrary('ampshared.library');
Carthag::import('com.solarix.ampoliros.maintenance.AmpolirosMaintenanceHandler');
$gLocale = new Locale('amp_root_maintenance', $gEnv['root']['locale']['language']);
$gHui = new Hui($gEnv['root']['db']);
$gHui->LoadWidget('xml');
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gXml_def = $gPage_status = '';
$gPage_title = $gLocale->GetStr('maintenance.title');
$gToolbars['main'] = array('ampoliros' => array('label' => $gLocale->GetStr('general.toolbar'), 'themeimage' => 'configure', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'default', '')))), 'general' => array('label' => $gLocale->GetStr('ampoliros.toolbar'), 'themeimage' => 'configure', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'ampoliros', '')))));
$gToolbars['help'] = array('help' => array('label' => $gLocale->GetStr('help.toolbar'), 'themeimage' => 'help', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'help', '')))));
// ----- Action dispatcher -----
//
$gAction_disp = new HuiDispatcher('action');
$gAction_disp->AddEvent('clear_systemlogs', 'action_clear_systemlogs');
function action_clear_systemlogs($eventData)
{
global $gPage_status, $gLocale;
OpenLibrary('ampoliros_logs.maintenance', HANDLER_PATH);
$maint = new AmpolirosLogsMaintenance();
$maint->mCleanAmpLog = true;
$maint->mCleanAmpDbLog = true;
$maint->mCleanPhpLog = true;
$maint->mCleanRemoteLog = true;
示例8: action_set_security_preset
// $Id: security.php,v 1.21 2004-07-14 13:15:37 alex Exp $
// ----- Initialization -----
//
require './auth.php';
import('com.solarix.ampoliros.locale.Locale');
import('com.solarix.ampoliros.hui.Hui');
import('com.solarix.ampoliros.hui.HuiEventsCall');
import('com.solarix.ampoliros.security.SecurityLayer');
OpenLibrary('ampshared.library');
$gLocale = new Locale('amp_root_security', $gEnv['root']['locale']['language']);
$gHui = new Hui($gEnv['root']['db']);
$gHui->LoadWidget('xml');
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gXml_def = $gPage_status = '';
$gPage_title = $gLocale->GetStr('security.title');
$gToolbars['main'] = array('check' => array('label' => $gLocale->GetStr('check.toolbar'), 'themeimage' => 'viewmag', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'default', '')))), 'settings' => array('label' => $gLocale->GetStr('settings.toolbar'), 'themeimage' => 'configure', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'settings', '')))));
$gToolbars['help'] = array('help' => array('label' => $gLocale->GetStr('help.toolbar'), 'themeimage' => 'help', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'help', '')))));
// ----- Action dispatcher -----
//
$gAction_disp = new HuiDispatcher('action');
$gAction_disp->AddEvent('set_security_preset', 'action_set_security_preset');
function action_set_security_preset($eventData)
{
global $gEnv, $gLocale, $gPage_status;
$amp_security = new SecurityLayer();
$amp_security->SetPredefinedLevel($eventData['preset']);
$gPage_status = $gLocale->GetStr('security_settings_set.status');
}
$gAction_disp->AddEvent('set_access_prefs', 'action_set_access_prefs');
function action_set_access_prefs($eventData)
示例9: DBLayerFactory
$args['dbuser'] = AMP_DBUSER;
$args['dbpass'] = AMP_DBPASS;
$args['dbtype'] = AMP_DBTYPE;
$args['dblog'] = AMP_DBLOG;
$layer = new DBLayerFactory();
$tmpdb = $layer->NewDBLayer($args);
if ($tmpdb->Connect($args)) {
$loc_country = new LocaleCountry($country);
$country_language = $loc_country->Language();
$language_locale = new Locale('amp_misc_locale', AMP_LANG);
$selected_language = $pass_disp->GetEventData();
$selected_language = $selected_language['language'];
$hui_vgroup = new HuiVertGroup('vgroup');
$language_query =& $tmpdb->Execute('SELECT * ' . 'FROM languages');
while (!$language_query->eof) {
$languages[$language_query->Fields('langshort')] = $language_locale->GetStr($language_query->Fields('langname'));
$language_query->MoveNext();
}
$hui_locale_grid = new HuiGrid('localegrid');
$hui_locale_grid->AddChild(new HuiLabel('languagelabel', array('label' => $amp_locale->GetStr('language_label'))), 0, 0);
$hui_locale_grid->AddChild(new HuiComboBox('language', array('disp' => 'pass', 'elements' => $languages, 'default' => $selected_language ? $selected_language : $country_language)), 0, 1);
$hui_vgroup->AddChild($hui_locale_grid);
$hui_vgroup->AddChild(new HuiHorizBar('horizbar1'));
$hui_vgroup->AddChild(new HuiLabel('deflanglabel', array('label' => sprintf($amp_locale->GetStr('countrylanguage_label'), $languages[$country_language]))));
$form_events_call = new HuiEventsCall();
$form_events_call->AddEvent(new HuiEvent('pass', 'setlanguage', ''));
$form_events_call->AddEvent(new HuiEvent('main', 'language', ''));
$hui_form = new HuiForm('language', array('action' => $form_events_call->GetEventsCallString()));
$hui_form->AddChild($hui_vgroup);
$next_action = new HuiEventSCall();
$next_action->AddEvent(new HuiEvent('pass', 'setlanguage', ''));
示例10: action_newrepository
<?php
require 'auth.php';
OpenLibrary('hui.library');
OpenLibrary('ampcentral-client.library');
OpenLibrary('locale.library');
OpenLibrary('ampshared.library');
$gHui = new Hui($gEnv['root']['db']);
$gHui->LoadWidget('xml');
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gLocale = new Locale('ampcentral-client_root_client', $gEnv['root']['locale']['language']);
$gPage_content = $gStatus = $gToolbars = $gXml_def = '';
$gPage_title = $gLocale->GetStr('ampcentral-client.title');
$gMenu = get_ampoliros_root_menu_def($gEnv['root']['locale']['language']);
$gToolbars['repository'] = array('repository' => array('label' => $gLocale->GetStr('repository.toolbar'), 'themeimage' => 'view_text', 'action' => build_events_call_string('', array(array('main', 'default', ''))), 'horiz' => 'true'), 'newrepository' => array('label' => $gLocale->GetStr('newrepository.toolbar'), 'themeimage' => 'filenew', 'action' => build_events_call_string('', array(array('main', 'newrepository', ''))), 'horiz' => 'true'));
// Action dispatcher
//
$gAction_disp = new HuiDispatcher('action');
$gAction_disp->AddEvent('newrepository', 'action_newrepository');
function action_newrepository($eventData)
{
global $gEnv, $gLocale, $gStatus;
$remote_ac = new AmpCentralRemoteServer($gEnv['root']['db']);
if ($remote_ac->Add($eventData['accountid'])) {
$gStatus = $gLocale->GetStr('repository_added.status');
} else {
$gStatus = $gLocale->GetStr('repository_not_added.status');
}
}
$gAction_disp->AddEvent('removerepository', 'action_removerepository');
示例11: main_language
function main_language($eventData)
{
global $env, $hui_mainframe, $hui_titlebar, $amp_locale, $pass_disp, $hui_mainstatus;
$loc_country = new LocaleCountry($env[$env['currentuser'] . '-country']);
$country_language = $loc_country->Language();
$language_locale = new Locale('amp_misc_locale', $env[$env['currentuser'] . '-language']);
$selected_language = $pass_disp->GetEventData();
$selected_language = $selected_language['language'];
$hui_vgroup = new HuiVertGroup('vgroup');
$language_query =& $env['ampdb']->Execute('SELECT * ' . 'FROM languages');
while (!$language_query->eof) {
$languages[$language_query->Fields('langshort')] = $language_locale->GetStr($language_query->Fields('langname'));
$language_query->MoveNext();
}
$hui_locale_grid = new HuiGrid('localegrid', array('rows' => '1', 'cols' => '3'));
$hui_locale_grid->AddChild(new HuiLabel('languagelabel', array('label' => $amp_locale->GetStr('language_label'))), 0, 0);
$hui_locale_grid->AddChild(new HuiComboBox('language', array('disp' => 'pass', 'elements' => $languages, 'default' => $selected_language ? $selected_language : $env[$env['currentuser'] . '-language'])), 0, 1);
$hui_locale_grid->AddChild(new HuiSubmit('submit1', array('caption' => $amp_locale->GetStr('language_submit'))), 0, 2);
$hui_vgroup->AddChild($hui_locale_grid);
$hui_vgroup->AddChild(new HuiHorizBar('horizbar1'));
$hui_vgroup->AddChild(new HuiLabel('deflanglabel', array('label' => sprintf($amp_locale->GetStr('countrylanguage_label'), $languages[$country_language]))));
$form_events_call = new HuiEventsCall();
$form_events_call->AddEvent(new HuiEvent('pass', 'setlanguage', ''));
$form_events_call->AddEvent(new HuiEvent('main', 'language', ''));
$hui_form = new HuiForm('languageform', array('action' => $form_events_call->GetEventsCallString()));
$hui_form->AddChild($hui_vgroup);
$hui_mainframe->AddChild($hui_form);
$hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('language_title');
}
示例12: HuiPage
$hui->LoadWidget('progressbar');
$hui->LoadWidget('radio');
$hui->LoadWidget('sessionkey');
$hui->LoadWidget('statusbar');
$hui->LoadWidget('string');
$hui->LoadWidget('submit');
$hui->LoadWidget('tab');
$hui->LoadWidget('table');
$hui->LoadWidget('text');
$hui->LoadWidget('titlebar');
$hui->LoadWidget('toolbar');
$hui->LoadWidget('treemenu');
$hui->LoadWidget('vertframe');
$hui->LoadWidget('vertgroup');
$hui->LoadWidget('xml');
$hui_page = new HuiPage('page', array('title' => $amp_locale->GetStr('modules_title')));
$hui_mainvertgroup = new HuiVertGroup('mainvertgroup');
$hui_titlebar = new HuiTitleBar('titlebar', array('title' => $amp_locale->GetStr('modules_title'), 'icon' => 'kpackage'));
$hui_mainvertgroup->AddChild($hui_titlebar);
$menu_frame = new HuiHorizGroup('menuframe');
$menu_frame->AddChild(new HuiMenu('magellanmainmenu', array('menu' => get_ampoliros_root_menu_def($env['sitelocale']))));
$hui_mainvertgroup->AddChild($menu_frame);
// Main tool bar
//
$hui_maintoolbar = new HuiToolBar('maintoolbar');
$home_action = new HuiEventsCall();
$home_action->AddEvent(new HuiEvent('main', 'default', ''));
$hui_homebutton = new HuiButton('homebutton', array('label' => $amp_locale->GetStr('modules_button'), 'themeimage' => 'view_detailed', 'horiz' => 'true', 'action' => $home_action->GetEventsCallString()));
$hui_maintoolbar->AddChild($hui_homebutton);
$new_action = new HuiEventsCall();
$new_action->AddEvent(new HuiEvent('main', 'newmodule', ''));
示例13: unset
unset($tmp_eventscall);
$cont_b++;
$pagesquery->MoveNext();
}
}
}
if ($group_data['name'] == 'ampoliros') {
$pagesquery =& $env['db']->execute('SELECT * ' . 'FROM rootpages ' . 'WHERE groupid=0 ' . 'OR groupid IS NULL ' . 'ORDER BY name');
if ($pagesquery) {
$pagesnum = $pagesquery->numrows();
if ($pagesnum > 0) {
while (!$pagesquery->eof) {
$pagedata = $pagesquery->fields();
if (strlen($pagedata['catalog']) > 0) {
$tmploc = new Locale($pagedata['catalog'], AMP_LANG);
$descstr = $tmploc->GetStr($pagedata['name']);
}
$tmp_eventscall = new HuiEventsCall($pagedata['location']);
$tmp_eventscall->AddEvent(new HuiEvent('main', 'default', ''));
$el[$group_data['id']]['groupelements'][$cont_b]['name'] = $descstr;
$el[$group_data['id']]['groupelements'][$cont_b]['image'] = $pagedata['iconfile'];
$el[$group_data['id']]['groupelements'][$cont_b]['action'] = $tmp_eventscall->GetEventsCallString() . '&act=def';
$el[$group_data['id']]['groupelements'][$cont_b]['themesized'] = 'true';
unset($tmp_eventscall);
$cont_b++;
$pagesquery->MoveNext();
}
}
}
}
if ($group_data['name'] == 'tools') {
示例14: startSite
public function startSite($siteId, $userId = '')
{
$result = false;
$this->setMode(Ampoliros::MODE_SITE);
global $env;
if (isset($GLOBALS['gEnv']['runtime']['site']['init']) and $GLOBALS['gEnv']['runtime']['site']['init'] == true) {
return;
}
// Site id
//
$GLOBALS['gEnv']['site']['id'] = $siteId;
$env['currentsite'] =& $GLOBALS['gEnv']['site']['id'];
$env['currentsiteid'] =& $env['currentsite'];
// Site data
//
$sitesquery = $GLOBALS['gEnv']['root']['db']->Execute('SELECT * FROM sites WHERE siteid=' . $GLOBALS['gEnv']['root']['db']->Format_Text($siteId));
if ($sitesquery->NumRows()) {
$GLOBALS['gEnv']['site']['data'] = $sitesquery->Fields();
$env['sitedata'] =& $GLOBALS['gEnv']['site']['data'];
$sitesquery->Free();
// Check if site is active
//
if ($this->getInterface() != Ampoliros::INTERFACE_WEB and $GLOBALS['gEnv']['site']['data']['siteactive'] == $GLOBALS['gEnv']['root']['db']->fmtfalse) {
$this->abort('Site disabled');
}
// Site log
//
define('SITE_LOG', SITESTUFF_PATH . $GLOBALS['gEnv']['site']['data']['siteid'] . '/log/site.log');
$GLOBALS['gEnv']['site']['log'] = SITE_LOG;
// Current site serial number
//
$GLOBALS['gEnv']['site']['serial'] = $GLOBALS['gEnv']['site']['data']['id'];
$env['currentsiteserial'] = $GLOBALS['gEnv']['site']['serial'];
// Site database
//
$dbargs['dbtype'] = $GLOBALS['gEnv']['site']['data']['sitedbtype'];
$dbargs['dbname'] = $GLOBALS['gEnv']['site']['data']['sitedbname'];
$dbargs['dbhost'] = $GLOBALS['gEnv']['site']['data']['sitedbhost'];
$dbargs['dbport'] = $GLOBALS['gEnv']['site']['data']['sitedbport'];
$dbargs['dbuser'] = $GLOBALS['gEnv']['site']['data']['sitedbuser'];
$dbargs['dbpass'] = $GLOBALS['gEnv']['site']['data']['sitedbpassword'];
$dbargs['dblog'] = $GLOBALS['gEnv']['site']['data']['sitedblog'];
$GLOBALS['gEnv']['site']['dblog'] =& $GLOBALS['gEnv']['site']['data']['sitedblog'];
$db_fact = new DBLayerFactory();
$GLOBALS['gEnv']['site']['db'] = $db_fact->NewDBLayer($dbargs);
$env['db'] = $GLOBALS['gEnv']['site']['db'];
if (!$GLOBALS['gEnv']['site']['db']->Connect($dbargs)) {
if (!defined('MISC_LIBRARY')) {
include LIBRARY_PATH . 'misc.library';
}
$adloc = new Locale('amp_misc_auth', $GLOBALS['gEnv']['root']['locale']['language']);
AmpDie($adloc->GetStr('nodb'));
}
// Hui theme
//
$tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text('sitetheme'));
$GLOBALS['gEnv']['site']['theme'] = $tmpquery->Fields('val');
// Site cgi
//
if (strlen($GLOBALS['gEnv']['site']['data']['siteurl'])) {
$tmp = parse_url($GLOBALS['gEnv']['site']['data']['siteurl']);
$GLOBALS['gEnv']['site']['cgi'] = $tmp['scheme'] . '://' . $tmp['host'] . CGI_URL;
} else {
$GLOBALS['gEnv']['site']['cgi'] = CGI_URL;
}
$env['sitecgi'] =& $GLOBALS['gEnv']['site']['cgi'];
unset($tmp);
// Site country
//
$tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text('sitecountry'));
$GLOBALS['gEnv']['site']['locale']['country'] = strlen($tmpquery->Fields('val')) ? $tmpquery->Fields('val') : AMP_COUNTRY;
$env['sitecountry'] = $GLOBALS['gEnv']['site']['locale']['country'];
// Site language
//
$tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text('sitelanguage'));
$GLOBALS['gEnv']['site']['locale']['language'] = strlen($tmpquery->Fields('val')) ? $tmpquery->Fields('val') : AMP_LANG;
$env['sitelanguage'] = $GLOBALS['gEnv']['site']['locale']['language'];
// User
//
if (!strlen($userId)) {
$userId = $siteId;
}
// User id
//
$GLOBALS['gEnv']['user']['id'] = $userId;
$env['currentuser'] =& $GLOBALS['gEnv']['user']['id'];
// Hui theme
//
$tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text($GLOBALS['gEnv']['user']['id'] . '-theme'));
$GLOBALS['gEnv']['user']['theme'] = $tmpquery->Fields('val');
if (!strlen($GLOBALS['gEnv']['user']['theme'])) {
if (!strlen($GLOBALS['gEnv']['site']['theme'])) {
import('com.solarix.ampoliros.module.ModuleConfig');
$mod_cfg = new ModuleConfig($GLOBALS['gEnv']['root']['db'], 'ampoliros');
if (strlen($mod_cfg->GetKey('hui-root-theme'))) {
$GLOBALS['gEnv']['site']['theme'] = $mod_cfg->GetKey('hui-root-theme');
if (!strlen($GLOBALS['gEnv']['site']['theme'])) {
$GLOBALS['gEnv']['site']['theme'] = $GLOBALS['gEnv']['hui']['theme']['default'];
}
} else {
//.........這裏部分代碼省略.........
示例15: pass_setadvanced
$gHui->LoadWidget('radio');
$gHui->LoadWidget('sessionkey');
$gHui->LoadWidget('statusbar');
$gHui->LoadWidget('string');
$gHui->LoadWidget('submit');
$gHui->LoadWidget('tab');
$gHui->LoadWidget('table');
$gHui->LoadWidget('text');
$gHui->LoadWidget('titlebar');
$gHui->LoadWidget('toolbar');
$gHui->LoadWidget('treemenu');
$gHui->LoadWidget('vertframe');
$gHui->LoadWidget('vertgroup');
$gHui->LoadWidget('xml');
$gPage_content = $gPage_status = '';
$gPage_title = $gLocale->GetStr('advanced.title');
$gToolbars_array['main'] = array('main' => array('label' => $gLocale->GetStr('default.button'), 'themeimage' => 'configure', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'default', '')))), 'processes' => array('label' => $gLocale->GetStr('processes.button'), 'themeimage' => 'run', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'processes', '')))));
$gToolbars_array['help'] = array('help' => array('label' => $gLocale->GetStr('help.button'), 'themeimage' => 'help', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'help', '')))));
$gState = '';
// Pass dispatcher
//
$gPass_disp = new HuiDispatcher('pass');
$gPass_disp->AddEvent('setadvanced', 'pass_setadvanced');
function pass_setadvanced($eventData)
{
global $gPage_status, $gLocale, $gEnv, $gState;
$amp_state = '';
switch ($eventData['ampstate']) {
case Ampoliros::STATE_DEBUG:
$amp_state_str = 'DEBUG';
$amp_state = 'debug';