function main_default($eventData) { global $hui_mainframe, $amp_locale, $hui_titlebar; $hui_grid = new HuiGrid('grid', array('rows' => '3', 'cols' => '2')); $hui_grid->AddChild(new HuiLabel('oldpasswordlabel', array('label' => $amp_locale->GetStr('amppasswordold_label'))), 0, 0); $hui_grid->AddChild(new HuiString('oldpassword', array('disp' => 'pass', 'password' => 'true')), 0, 1); $hui_grid->AddChild(new HuiLabel('newpasswordalabel', array('label' => $amp_locale->GetStr('amppassworda_label'))), 1, 0); $hui_grid->AddChild(new HuiString('newpassworda', array('disp' => 'pass', 'password' => 'true')), 1, 1); $hui_grid->AddChild(new HuiLabel('newpasswordblabel', array('label' => $amp_locale->GetStr('amppasswordb_label'))), 2, 0); $hui_grid->AddChild(new HuiString('newpasswordb', array('disp' => 'pass', 'password' => 'true')), 2, 1); $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center')); $hui_vgroup->AddChild($hui_grid); $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('amppasschange_submit')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('main', 'default', '')); $form_events_call->AddEvent(new HuiEvent('pass', 'edit', '')); $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString())); $hui_form->AddChild($hui_vgroup); $hui_mainframe->AddChild($hui_form); }
function main_chprofile($eventData) { global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar; $user_query =& $env['ampdb']->execute('SELECT * ' . 'FROM users ' . 'WHERE id=' . $eventData['userid'] . ' '); $user_data = $user_query->Fields(); $prof_query =& $env['db']->Execute('SELECT * ' . 'FROM groups ' . 'ORDER BY groupname'); $profiles = array(); $profiles[0] = $amp_locale->GetStr('noprofileid_label'); while (!$prof_query->eof) { $prof_data = $prof_query->Fields(); $profiles[$prof_data['id']] = $prof_data['groupname']; $prof_query->MoveNext(); } $hui_vgroup = new HuiVertGroup('vgroup'); $hui_user_grid = new HuiGrid('chprofilegrid', array('rows' => '2', 'cols' => '2')); // User fields // $hui_user_grid->AddChild(new HuiLabel('profilelabel', array('label' => $amp_locale->GetStr('changeprofile_label') . ' (*)')), 0, 0); $hui_user_grid->AddChild(new HuiComboBox('profileid', array('disp' => 'pass', 'elements' => $profiles, 'default' => $user_data['groupid'])), 0, 1); $hui_vgroup->AddChild($hui_user_grid); $hui_vgroup->AddChild(new HuiSubmit('submit1', array('caption' => $amp_locale->GetStr('chprofile_submit')))); $hui_vgroup->AddChild(new HuiHorizBar('horizbar1')); $hui_vgroup->AddChild(new HuiLabel('reqfieldslabel', array('label' => $amp_locale->GetStr('requiredfields_label')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('pass', 'chprofile', array('uid' => $eventData['userid']))); $form_events_call->AddEvent(new HuiEvent('main', 'users', '')); $hui_form = new HuiForm('chprofileform', array('action' => $form_events_call->GetEventsCallString())); $hui_form->AddChild($hui_vgroup); $hui_mainframe->AddChild($hui_form); $hui_titlebar->mTitle .= ' - ' . $user_data['username'] . ' - ' . $amp_locale->GetStr('chprofile_title'); }
function main_showsiteconfig($eventData) { global $env, $dbtypes, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar; $query =& $env['ampdb']->execute('SELECT * ' . 'FROM sites ' . 'WHERE id=' . $eventData['siteid']); if ($query->NumRows()) { $site_data = $query->Fields(); $hui_vgroup = new HuiVertGroup('vgroup'); $hui_site_grid = new HuiGrid('showsitegrid', array('rows' => '7', 'cols' => '4')); // Site fields // $hui_site_grid->AddChild(new HuiLabel('namelabel', array('label' => $amp_locale->GetStr('sitename_label'))), 0, 0); $hui_site_grid->AddChild(new HuiString('sitename', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitename'])), 0, 1); $hui_site_grid->AddChild(new HuiLabel('idlabel', array('label' => $amp_locale->GetStr('siteid_label'))), 1, 0); $hui_site_grid->AddChild(new HuiString('siteid', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['siteid'])), 1, 1); $hui_site_grid->AddChild(new HuiLabel('pathlabel', array('label' => $amp_locale->GetStr('sitepath_label'))), 3, 0); $hui_site_grid->AddChild(new HuiString('sitepath', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitepath'])), 3, 1); $hui_site_grid->AddChild(new HuiLabel('urllabel', array('label' => $amp_locale->GetStr('siteurl_label'))), 4, 0); $hui_site_grid->AddChild(new HuiString('siteurl', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['siteurl'])), 4, 1); $hui_site_grid->AddChild(new HuiLabel('maxuserslabel', array('label' => $amp_locale->GetStr('maxusers_label'))), 5, 0); $hui_site_grid->AddChild(new HuiString('maxusers', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['maxusers'])), 5, 1); // Database fields // $hui_site_grid->AddChild(new HuiLabel('dbtypelabel', array('label' => $amp_locale->GetStr('sitedbtype_label'))), 0, 2); $hui_site_grid->AddChild(new HuiString('sitedbtype', array('disp' => 'pass', 'readonly' => 'true', 'value' => $dbtypes[$site_data['sitedbtype']])), 0, 3); $hui_site_grid->AddChild(new HuiLabel('dbnamelabel', array('label' => $amp_locale->GetStr('sitedbname_label'))), 1, 2); $hui_site_grid->AddChild(new HuiString('sitedbname', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitedbname'])), 1, 3); $hui_site_grid->AddChild(new HuiLabel('dbhostlabel', array('label' => $amp_locale->GetStr('sitedbhost_label'))), 2, 2); $hui_site_grid->AddChild(new HuiString('sitedbhost', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitedbhost'])), 2, 3); $hui_site_grid->AddChild(new HuiLabel('dbportlabel', array('label' => $amp_locale->GetStr('sitedbport_label'))), 3, 2); $hui_site_grid->AddChild(new HuiString('sitedbport', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitedbport'])), 3, 3); $hui_site_grid->AddChild(new HuiLabel('dbuserlabel', array('label' => $amp_locale->GetStr('sitedbuser_label'))), 4, 2); $hui_site_grid->AddChild(new HuiString('sitedbuser', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitedbuser'])), 4, 3); $hui_site_grid->AddChild(new HuiLabel('dbpasswordlabel', array('label' => $amp_locale->GetStr('sitedbpassword_label'))), 5, 2); $hui_site_grid->AddChild(new HuiString('sitedbpassword', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitedbpassword'])), 5, 3); $hui_site_grid->AddChild(new HuiLabel('dbloglabel', array('label' => $amp_locale->GetStr('sitedblog_label'))), 6, 2); $hui_site_grid->AddChild(new HuiString('sitedblog', array('disp' => 'pass', 'readonly' => 'true', 'value' => $site_data['sitedblog'])), 6, 3); $hui_vgroup->AddChild($hui_site_grid); $hui_mainframe->AddChild($hui_vgroup); } $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('showsiteconfig_title'); }
function main_showaccount($eventData) { global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar; $acc_query =& $env['ampdb']->execute('SELECT * ' . 'FROM xmlrpcaccounts ' . 'WHERE id=' . $eventData['accountid']); $acc_data = $acc_query->Fields(); $hui_vgroup = new HuiVertGroup('vgroup'); $hui_form_grid = new HuiGrid('newaccountgrid', array('rows' => '6', 'cols' => '2')); $hui_form_grid->AddChild(new HuiLabel('namelabel', array('label' => $amp_locale->GetStr('accountname_label'))), 0, 0); $hui_form_grid->AddChild(new HuiString('name', array('disp' => 'pass', 'value' => $acc_data['name'])), 0, 1); $hui_form_grid->AddChild(new HuiLabel('hostlabel', array('label' => $amp_locale->GetStr('host_label'))), 1, 0); $hui_form_grid->AddChild(new HuiString('host', array('disp' => 'pass', 'value' => $acc_data['host'])), 1, 1); $hui_form_grid->AddChild(new HuiLabel('cgilabel', array('label' => $amp_locale->GetStr('cgi_label'))), 2, 0); $hui_form_grid->AddChild(new HuiString('cgi', array('disp' => 'pass', 'value' => $acc_data['cgi'])), 2, 1); $hui_form_grid->AddChild(new HuiLabel('portlabel', array('label' => $amp_locale->GetStr('port_label'))), 3, 0); $hui_form_grid->AddChild(new HuiString('port', array('disp' => 'pass', 'value' => $acc_data['port'])), 3, 1); $hui_form_grid->AddChild(new HuiLabel('usernamelabel', array('label' => $amp_locale->GetStr('username_label'))), 4, 0); $hui_form_grid->AddChild(new HuiString('username', array('disp' => 'pass', 'value' => $acc_data['username'])), 4, 1); $hui_form_grid->AddChild(new HuiLabel('passwordlabel', array('label' => $amp_locale->GetStr('password_label'))), 5, 0); $hui_form_grid->AddChild(new HuiString('password', array('disp' => 'pass', 'value' => $acc_data['password'])), 5, 1); $hui_form_grid->AddChild(new HuiLabel('proxylabel', array('label' => $amp_locale->GetStr('proxy_label'))), 6, 0); $hui_form_grid->AddChild(new HuiString('proxy', array('disp' => 'pass', 'value' => $acc_data['proxy'])), 6, 1); $hui_form_grid->AddChild(new HuiLabel('proxyportlabel', array('label' => $amp_locale->GetStr('proxyport_label'))), 7, 0); $hui_form_grid->AddChild(new HuiString('proxyport', array('disp' => 'pass', 'value' => $acc_data['proxyport'])), 7, 1); $hui_vgroup->AddChild($hui_form_grid); $hui_mainframe->AddChild($hui_vgroup); $hui_titlebar->mTitle .= ' - ' . $acc_data['name'] . ' - ' . $amp_locale->GetStr('showaccount_title'); }
function main_edit($eventData) { global $hui_mainframe, $amp_locale, $hui_titlebar; $hui_grid = new HuiGrid('grid', array('rows' => '3', 'cols' => '2')); $hui_grid->AddChild(new HuiLabel('namelabel', array('label' => $amp_locale->GetStr('namedesc'))), 0, 0); $hui_grid->AddChild(new HuiString('name', array('value' => AMP_NAME, 'disp' => 'pass')), 0, 1); $hui_grid->AddChild(new HuiLabel('domainlabel', array('label' => $amp_locale->GetStr('domaindesc'))), 1, 0); $hui_grid->AddChild(new HuiString('domain', array('value' => AMP_DOMAIN, 'disp' => 'pass')), 1, 1); $hui_grid->AddChild(new HuiLabel('dnslabel', array('label' => $amp_locale->GetStr('dnsdesc'))), 2, 0); $hui_grid->AddChild(new HuiString('dns', array('value' => AMP_DNS, 'disp' => 'pass')), 2, 1); $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center')); $hui_vgroup->AddChild($hui_grid); $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('submit')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('main', 'default', '')); $form_events_call->AddEvent(new HuiEvent('pass', 'edit', '')); $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString())); $hui_form->AddChild($hui_vgroup); $hui_mainframe->AddChild($hui_form); $hui_titlebar->mTitle .= ' - Edit'; //$hui_mainframe->AddChild( new HuiLabel( 'mainlabel', array( 'label' => 'Main page' ) ) ); }
function DoAuth($wrong = false, $reason = '') { global $gEnv; $amp_locale = new Locale('amp_misc_auth', AMP_LANG); $amp = Ampoliros::instance('Ampoliros'); $amp->startRoot(); $hui = new Hui($gEnv['root']['db']); $hui->LoadWidget('button'); $hui->LoadWidget('formarg'); $hui->LoadWidget('form'); $hui->LoadWidget('grid'); $hui->LoadWidget('horizbar'); $hui->LoadWidget('horizframe'); $hui->LoadWidget('horizgroup'); $hui->LoadWidget('image'); $hui->LoadWidget('label'); $hui->LoadWidget('link'); $hui->LoadWidget('page'); $hui->LoadWidget('sessionkey'); $hui->LoadWidget('statusbar'); $hui->LoadWidget('string'); $hui->LoadWidget('submit'); $hui->LoadWidget('titlebar'); $hui->LoadWidget('vertframe'); $hui->LoadWidget('vertgroup'); $hui_page = new HuiPage('loginpage', array('title' => $amp_locale->GetStr('amplogin'), 'border' => 'false')); $hui_topgroup = new HuiVertGroup('topgroup', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '100%')); $hui_maingroup = new HuiVertGroup('maingroup', array('align' => 'center')); $hui_titlebar = new HuiTitleBar('titlebar', array('title' => $amp_locale->GetStr('amplogin'), 'closewidget' => 'false', 'newwindowwidget' => 'false')); $hui_mainbframe = new HuiVertFrame('vframe', array('align' => 'center')); $hui_mainframe = new HuiHorizGroup('horizframe'); $hui_mainstatus = new HuiStatusBar('mainstatusbar'); // Main frame // $hui_grid = new HuiGrid('grid', array('rows' => '2', 'cols' => '2')); $hui_grid->AddChild(new HuiLabel('usernamelabel', array('label' => $amp_locale->GetStr('username'))), 0, 0); $hui_grid->AddChild(new HuiString('username', array('disp' => 'login')), 0, 1); $hui_grid->AddChild(new HuiLabel('passwordlabel', array('label' => $amp_locale->GetStr('password'))), 1, 0); $hui_grid->AddChild(new HuiString('password', array('disp' => 'login', 'password' => 'true')), 1, 1); $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center')); //$hui_vgroup->AddChild( new HuiLabel( 'titlelabel', array( 'label' => $amp_locale->GetStr( 'amprootlogin' ) ) ) ); $hui_vgroup->AddChild($hui_grid); $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('enter')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('login', 'login', '')); $form_events_call->AddEvent(new HuiEvent('main', 'default', '')); $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString())); $hui_hgroup = new HuiHorizGroup('horizgroup', array('align' => 'middle')); // $hui_hgroup -> AddChild(new HuiButton('amplogo', array('image' => $hui_page -> mThemeHandler -> mStyle['middot'], 'action' => AMP_URL, 'highlight' => false))); $hui_hgroup->AddChild(new HuiButton('password', array('themeimage' => 'password', 'themeimagetype' => 'big', 'action' => AMP_URL, 'highlight' => false))); $hui_hgroup->AddChild($hui_vgroup); $hui_form->AddChild($hui_hgroup); $hui_mainframe->AddChild($hui_form); // Wrong account check // if ($wrong) { if ($gEnv['core']['config']->Value('ALERT_ON_WRONG_LOCAL_USER_LOGIN') == '1') { Carthag::import('com.solarix.ampoliros.security.SecurityLayer'); global $login_disp; $event_data = $login_disp->GetEventData(); $amp_security = new SecurityLayer(); $amp_security->SendAlert('Wrong user local login for user ' . $event_data['username'] . ' from remote address ' . $_SERVER['REMOTE_ADDR']); $amp_security->LogFailedAccess($event_data['username'], false, $_SERVER['REMOTE_ADDR']); unset($amp_security); } $sleep_time = $gEnv['core']['config']->Value('WRONG_LOGIN_DELAY'); if (!strlen($sleep_time)) { $sleep_time = 1; } $max_attempts = $gEnv['core']['config']->Value('MAX_WRONG_LOGINS'); if (!strlen($max_attempts)) { $max_attempts = 3; } sleep($sleep_time); if (isset($_SESSION['site_login_attempts'])) { $_SESSION['site_login_attempts']++; if ($_SESSION['site_login_attempts'] >= $max_attempts) { AmpDie($amp_locale->GetStr('wrongpwd')); } } else { $_SESSION['site_login_attempts'] = 1; } if ($reason) { $hui_mainstatus->mArgs['status'] = $amp_locale->GetStr($reason); } else { $hui_mainstatus->mArgs['status'] = $amp_locale->GetStr('wrongpwd'); } } else { $_SESSION['site_login_attempts'] = 0; } // Page render // $hui_maingroup->AddChild($hui_titlebar); //$hui_maingroup->AddChild( new HuiButton( 'amplogo', array( 'image' => CGI_URL.'ampbigdot.gif', 'action' => AMP_URL ) ) ); $hui_mainbframe->AddChild($hui_mainframe); $hui_mainbframe->AddChild(new HuiHorizBar('hb')); $hui_mainbframe->AddChild(new HuiLink('copyright', array('label' => $amp_locale->GetStr('auth_copyright.label'), 'link' => 'http://www.solarix.it/', 'target' => '_blank'))); $hui_maingroup->AddChild($hui_mainbframe); $hui_maingroup->AddChild($hui_mainstatus); $hui_topgroup->AddChild($hui_maingroup); $hui_page->AddChild($hui_topgroup); $hui->AddChild($hui_page); $hui->Render(); $carthag = Carthag::instance(); $carthag->halt(); }
$hui_form->AddChild($hui_vgroup); $next_action = new HuiEventSCall(); $next_action->AddEvent(new HuiEvent('pass', 'setpassword', '')); $next_button = new HuiButton('nextbutton', array('label' => $amp_locale->GetStr('next_button'), 'horiz' => 'true', 'formsubmit' => 'password', 'image' => CGI_URL . 'hui-forward.gif', 'action' => $next_action->GetEventsCallString())); $hui_vgroup2 = new HuiVertGroup('vgroup2'); $hui_vgroup2->AddChild($hui_form); $hui_vgroup2->AddChild(new HuiHorizBar('hr')); $hui_vgroup2->AddChild($next_button); setup_check_log($hui_vgroup2); $hui_mainframe->AddChild($hui_vgroup2); $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('password_title'); } else { if (!file_exists(TMP_PATH . '.ampcentralset')) { @touch(TMP_PATH . '.settingampcentral', time()); $hui_vgroup = new HuiVertGroup('vgroup'); $hui_ampcentral_grid = new HuiGrid('grid'); $hui_ampcentral_grid->AddChild(new HuiCheckBox('ampcentral', array('disp' => 'pass', 'checked' => 'true')), 0, 0); $hui_ampcentral_grid->AddChild(new HuiLabel('ampcentrallabel', array('label' => $amp_locale->GetStr('ampcentral_label'))), 0, 1); $hui_vgroup->AddChild($hui_ampcentral_grid); $hui_vgroup->AddChild(new HuiHorizBar('horizbar1')); $hui_vgroup->AddChild(new HuiLabel('ampcentrallabel', array('label' => $amp_locale->GetStr('ampcentral_explain_label'), 'nowrap' => 'false'))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('pass', 'setampcentral', '')); $hui_form = new HuiForm('ampcentral', array('action' => $form_events_call->GetEventsCallString())); $hui_form->AddChild($hui_vgroup); $next_action = new HuiEventSCall(); $next_action->AddEvent(new HuiEvent('pass', 'setampcentral', '')); $next_button = new HuiButton('nextbutton', array('label' => $amp_locale->GetStr('next_button'), 'horiz' => 'true', 'formsubmit' => 'ampcentral', 'image' => CGI_URL . 'hui-forward.gif', 'action' => $next_action->GetEventsCallString())); $hui_vgroup2 = new HuiVertGroup('vgroup2'); $hui_vgroup2->AddChild($hui_form); $hui_vgroup2->AddChild(new HuiHorizBar('hr'));
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'); }
function main_edit($eventData) { global $env, $hui_mainframe, $amp_locale, $hui_titlebar; $site_sets = new SiteSettings($env['db']); $hui_grid = new HuiGrid('grid', array('rows' => '11', 'cols' => '2')); $hui_grid->AddChild(new HuiLabel('sitecompletenamelabel', array('label' => $amp_locale->GetStr('sitecompletename_label'))), 0, 0); $hui_grid->AddChild(new HuiString('sitecompletename', array('value' => $site_sets->GetKey('sitecompletename'), 'disp' => 'pass')), 0, 1); $hui_grid->AddChild(new HuiLabel('siteaddressalabel', array('label' => $amp_locale->GetStr('siteaddressa_label'))), 1, 0); $hui_grid->AddChild(new HuiString('siteaddressa', array('value' => $site_sets->GetKey('siteaddressa'), 'disp' => 'pass')), 1, 1); $hui_grid->AddChild(new HuiLabel('siteaddressblabel', array('label' => $amp_locale->GetStr('siteaddressb_label'))), 2, 0); $hui_grid->AddChild(new HuiString('siteaddressb', array('value' => $site_sets->GetKey('siteaddressb'), 'disp' => 'pass')), 2, 1); $hui_grid->AddChild(new HuiLabel('sitetownlabel', array('label' => $amp_locale->GetStr('sitetown_label'))), 3, 0); $hui_grid->AddChild(new HuiString('sitetown', array('value' => $site_sets->GetKey('sitetown'), 'disp' => 'pass')), 3, 1); $hui_grid->AddChild(new HuiLabel('sitestatelabel', array('label' => $amp_locale->GetStr('sitestate_label'))), 4, 0); $hui_grid->AddChild(new HuiString('sitestate', array('value' => $site_sets->GetKey('sitestate'), 'disp' => 'pass')), 4, 1); $hui_grid->AddChild(new HuiLabel('siteziplabel', array('label' => $amp_locale->GetStr('sitezip_label'))), 5, 0); $hui_grid->AddChild(new HuiString('sitezip', array('value' => $site_sets->GetKey('sitezip'), 'disp' => 'pass')), 5, 1); $hui_grid->AddChild(new HuiLabel('sitecountrylabel', array('label' => $amp_locale->GetStr('sitecountry_label'))), 6, 0); $hui_grid->AddChild(new HuiString('sitecountry', array('value' => $site_sets->GetKey('sitecountry'), 'disp' => 'pass')), 6, 1); $hui_grid->AddChild(new HuiLabel('sitefiscalcodelabel', array('label' => $amp_locale->GetStr('sitefiscalcode_label'))), 7, 0); $hui_grid->AddChild(new HuiString('sitefiscalcode', array('value' => $site_sets->GetKey('sitefiscalcode'), 'disp' => 'pass')), 7, 1); $hui_grid->AddChild(new HuiLabel('siteemaillabel', array('label' => $amp_locale->GetStr('siteemail_label'))), 8, 0); $hui_grid->AddChild(new HuiString('siteemail', array('value' => $site_sets->GetKey('siteemail'), 'disp' => 'pass')), 8, 1); $hui_grid->AddChild(new HuiLabel('sitephonelabel', array('label' => $amp_locale->GetStr('sitephone_label'))), 9, 0); $hui_grid->AddChild(new HuiString('sitephone', array('value' => $site_sets->GetKey('sitephone'), 'disp' => 'pass')), 9, 1); $hui_grid->AddChild(new HuiLabel('sitefaxlabel', array('label' => $amp_locale->GetStr('sitefax_label'))), 10, 0); $hui_grid->AddChild(new HuiString('sitefax', array('value' => $site_sets->GetKey('sitefax'), 'disp' => 'pass')), 10, 1); /* $tmpmod = new moduledep( $env[ampdb] ); if ( $tmpmod->isenabled( 'magellan', $env[sitedata][siteid] ) ) { $data = $sets->getkey( 'sitelogo' ); $query = &$env[db]->Execute( 'select * from medias order by medianame' ); $mvalues[] = 'none'; $mcaptions[] = $adloc->GetStr( 'nomedia' ); while ( !$query->eof ) { $mdata = $query->fields(); $mvalues[] = $mdata[id]; if ( $mdata[id] == $data ) $selected = $mdata[id]; $mcaptions[] = $mdata['medianame']; $query->MoveNext(); } $row++; $table[0][$row] = new htmltext( $adloc->GetStr( 'logodesc' ) ); $table[1][$row] = new htmlformselect( '', 'sitelogo', $selected, $mvalues, $mcaptions ); $row++; $table[0][$row] = new htmltext( $adloc->GetStr( 'logonote' ) ); $table[0][$row]->colspan = 2; } $hui_grid->AddChild( new HuiLabel( 'sitelogolabel', array( 'label' => $amp_locale->GetStr( 'sitelogo_label' ) ) ), 11, 0 ); $hui_grid->AddChild( new HuiString( 'sitelogo', array( 'value' => $site_sets->GetKey( 'sitelogo' ), 'disp' => 'pass' ) ), 11, 1 ); */ $hui_vgroup = new HuiVertGroup('vertgroup', array('align' => 'center')); $hui_vgroup->AddChild($hui_grid); $hui_vgroup->AddChild(new HuiSubmit('submit', array('caption' => $amp_locale->GetStr('editdata_submit')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('main', 'default', '')); $form_events_call->AddEvent(new HuiEvent('pass', 'edit', '')); $hui_form = new HuiForm('form', array('action' => $form_events_call->GetEventsCallString())); $hui_form->AddChild($hui_vgroup); $hui_mainframe->AddChild($hui_form); $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('edit_title'); }
function main_details($eventData) { global $env, $hui_mainframe, $amp_locale, $hui_titlebar; $query =& $env['ampdb']->execute('SELECT * ' . 'FROM modules ' . 'WHERE id=' . $eventData['modid'] . ' '); $module_data = $query->Fields(); $details_vgroup = new HuiVertGroup('vgroup'); $details_grid = new HuiGrid('moduledetailsgrid', array('rows' => '9', 'cols' => '2')); $details_grid->AddChild(new HuiLabel('authorlabel', array('label' => $amp_locale->GetStr('author_label'))), 0, 0); $details_grid->AddChild(new HuiString('author', array('value' => $module_data['author'], 'readonly' => 'true', 'size' => 40)), 0, 1); $details_grid->AddChild(new HuiLabel('authorsitelabel', array('label' => $amp_locale->GetStr('authorsite_label'))), 1, 0); $details_grid->AddChild(new HuiLink('authorsite', array('label' => $module_data['authorsite'], 'link' => $module_data['authorsite'])), 1, 1); $details_grid->AddChild(new HuiLabel('authoremaillabel', array('label' => $amp_locale->GetStr('authoremail_label'))), 2, 0); $details_grid->AddChild(new HuiLink('authoremail', array('label' => $module_data['authoremail'], 'link' => strlen($module_data['authoremail']) ? 'mailto:' . $module_data['authoremail'] : '')), 2, 1); $details_grid->AddChild(new HuiLabel('supportemaillabel', array('label' => $amp_locale->GetStr('supportemail_label'))), 3, 0); $details_grid->AddChild(new HuiLink('supportemail', array('label' => $module_data['supportemail'], 'link' => strlen($module_data['supportemail']) ? 'mailto:' . $module_data['supportemail'] : '')), 3, 1); $details_grid->AddChild(new HuiLabel('bugsemaillabel', array('label' => $amp_locale->GetStr('bugsemail_label'))), 4, 0); $details_grid->AddChild(new HuiLink('bugsemail', array('label' => $module_data['bugsemail'], 'link' => strlen($module_data['bugsemail']) ? 'mailto:' . $module_data['bugsemail'] : '')), 4, 1); $details_grid->AddChild(new HuiLabel('maintainerlabel', array('label' => $amp_locale->GetStr('maintainer_label'))), 5, 0); $details_grid->AddChild(new HuiString('maintainer', array('value' => $module_data['maintainer'], 'readonly' => 'true', 'size' => 40)), 5, 1); $details_grid->AddChild(new HuiLabel('maintaineremaillabel', array('label' => $amp_locale->GetStr('maintaineremail_label'))), 6, 0); $details_grid->AddChild(new HuiLink('maintaineremail', array('label' => $module_data['maintaineremail'], 'link' => strlen($module_data['maintaineremail']) ? 'mailto:' . $module_data['maintaineremail'] : '')), 6, 1); $details_grid->AddChild(new HuiLabel('copyrightlabel', array('label' => $amp_locale->GetStr('copyright_label'))), 7, 0); $details_grid->AddChild(new HuiString('copyright', array('value' => $module_data['copyright'], 'readonly' => 'true', 'size' => 40)), 7, 1); $details_grid->AddChild(new HuiLabel('licenselabel', array('label' => $amp_locale->GetStr('license_label'))), 8, 0); $details_grid->AddChild(new HuiString('license', array('value' => $module_data['license'], 'readonly' => 'true', 'size' => 20)), 8, 1); if (strlen($module_data['licensefile']) and file_exists(MODULE_PATH . $module_data['modid'] . '/' . $module_data['licensefile'])) { $license_text = file_get_contents(MODULE_PATH . $module_data['modid'] . '/' . $module_data['licensefile']); $details_grid->mRows = 10; $details_grid->AddChild(new HuiText('licensetext', array('label' => $module_data['license'], 'value' => $license_text, 'readonly' => 'true', 'cols' => 90, 'rows' => '20')), 9, 1); } $details_vgroup->AddChild($details_grid); $hui_mainframe->AddChild($details_vgroup); $hui_titlebar->mTitle .= ' - ' . $module_data['modid'] . ' - ' . $amp_locale->GetStr('moduledetails_title'); }
function main_default($eventData) { global $env, $hui_mainframe, $hui_titlebar, $amp_locale, $pass_disp, $hui_mainstatus; $mod_cfg = new ModuleConfig($env['ampdb'], 'ampoliros'); // OEM // $oem_frame = new HuiVertFrame('oemframe'); $oem_vgroup = new HuiVertGroup('oemvgroup', array('width' => '100%')); $oem_vgroup->AddChild(new HuiLabel('oemlabel', array('label' => $amp_locale->GetStr('oemframe_label'), 'bold' => 'true'))); $oem_grid = new HuiGrid('oemgrid', array('rows' => '4', 'cols' => '2')); // OEM name // $oem_grid->AddChild(new HuiLabel('oemname_label', array('label' => $amp_locale->GetStr('oemname_label'))), 0, 0); $oem_grid->AddChild(new HuiString('oemname', array('disp' => 'pass', 'size' => '30', 'value' => $mod_cfg->GetKey('oem-name'))), 0, 1); // OEM url // $oem_grid->AddChild(new HuiLabel('oemurl_label', array('label' => $amp_locale->GetStr('oemurl_label'))), 1, 0); $oem_grid->AddChild(new HuiString('oemurl', array('disp' => 'pass', 'size' => '30', 'value' => $mod_cfg->GetKey('oem-url'))), 1, 1); // OEM big logo // $oem_grid->AddChild(new HuiLabel('oembiglogo_label', array('label' => $amp_locale->GetStr('oembiglogo_label'))), 2, 0); $oem_grid->AddChild(new HuiFile('oembiglogo', array('disp' => 'pass')), 2, 1); // OEM link logo // $oem_grid->AddChild(new HuiLabel('oemlogo_label', array('label' => $amp_locale->GetStr('oemlogo_label'))), 3, 0); $oem_grid->AddChild(new HuiFile('oemlinklogo', array('disp' => 'pass')), 3, 1); $oem_vgroup->AddChild($oem_grid); $oem_vgroup->AddChild(new HuiSubmit('oemsubmit', array('caption' => $amp_locale->GetStr('oem_submit')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('pass', 'setoem', '')); $form_events_call->AddEvent(new HuiEvent('main', 'default', '')); $oem_form = new HuiForm('setoemform', array('action' => $form_events_call->GetEventsCallString())); $oem_form->AddChild($oem_vgroup); // Enabled icons // $enable_vgroup = new HuiVertGroup('enablevgroup', array('width' => '100%')); $enable_vgroup->AddChild(new HuiLabel('enablelabel', array('label' => $amp_locale->GetStr('enabled_icons_label'), 'bold' => 'true'))); $enable_grid = new HuiGrid('enablegrid', array('rows' => '5', 'cols' => '2')); // Ampoliros site link // $enable_grid->AddChild(new HuiLabel('ampiconlabel', array('label' => $amp_locale->GetStr('amp_link_enabled_label'))), 0, 1); $enable_grid->AddChild(new HuiCheckBox('ampicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('ampoliros-link-disabled') ? 'false' : 'true')), 0, 0); // Solarix site link // $enable_grid->AddChild(new HuiLabel('solarixiconlabel', array('label' => $amp_locale->GetStr('solarix_link_enabled_label'))), 1, 1); $enable_grid->AddChild(new HuiCheckBox('solarixicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('solarix-link-disabled') ? 'false' : 'true')), 1, 0); // OEM link // $enable_grid->AddChild(new HuiLabel('oemiconlabel', array('label' => $amp_locale->GetStr('oem_link_enabled_label'))), 2, 1); $enable_grid->AddChild(new HuiCheckBox('oemicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('oem-link-disabled') ? 'false' : 'true')), 2, 0); // Ampoliros big logo // $enable_grid->AddChild(new HuiLabel('ampbigiconlabel', array('label' => $amp_locale->GetStr('amp_biglogo_enabled_label'))), 3, 1); $enable_grid->AddChild(new HuiCheckBox('ampbigicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('ampoliros-biglogo-disabled') ? 'false' : 'true')), 3, 0); // OEM logo // $enable_grid->AddChild(new HuiLabel('oemiconlabel', array('label' => $amp_locale->GetStr('oem_biglogo_enabled_label'))), 4, 1); $enable_grid->AddChild(new HuiCheckBox('oembigicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('oem-biglogo-disabled') ? 'false' : 'true')), 4, 0); $enable_vgroup->AddChild($enable_grid); $enable_vgroup->AddChild(new HuiSubmit('enablesubmit', array('caption' => $amp_locale->GetStr('enable_submit')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('pass', 'setenabledicons', '')); $form_events_call->AddEvent(new HuiEvent('main', 'default', '')); $enable_form = new HuiForm('setenableform', array('action' => $form_events_call->GetEventsCallString())); $enable_form->AddChild($enable_vgroup); // Advanced settings // $advanced_vgroup = new HuiVertGroup('enablevgroup', array('width' => '100%')); $advanced_vgroup->AddChild(new HuiLabel('enablelabel', array('label' => $amp_locale->GetStr('advancedsettings_label'), 'bold' => 'true'))); $advanced_grid = new HuiGrid('enablegrid', array('rows' => '2', 'cols' => '2')); // Compressed output buffering // $advanced_grid->AddChild(new HuiLabel('compressed-ob-label', array('label' => $amp_locale->GetStr('compressed-ob_label'))), 0, 1); if (!strlen($compressed_ob)) { if (AMP_COMPRESSED_OB) { $compressed_ob = 'true'; } else { $compressed_ob = 'false'; } } $advanced_grid->AddChild(new HuiCheckBox('compressed-ob', array('disp' => 'pass', 'checked' => $compressed_ob)), 0, 0); // HUI code comments // $advanced_grid->AddChild(new HuiLabel('hui-comments-label', array('label' => $amp_locale->GetStr('hui-comments_label'))), 1, 1); if (!strlen($hui_comments)) { if (AMP_HUI_COMMENTS) { $hui_comments = 'true'; } else { $hui_comments = 'false'; } } $advanced_grid->AddChild(new HuiCheckBox('hui-comments', array('disp' => 'pass', 'checked' => $hui_comments)), 1, 0); $advanced_vgroup->AddChild($advanced_grid); $advanced_vgroup->AddChild(new HuiSubmit('enablesubmit', array('caption' => $amp_locale->GetStr('advanced_submit')))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('pass', 'setadvanced', '')); $form_events_call->AddEvent(new HuiEvent('main', 'default', '')); $advanced_form = new HuiForm('setenableform', array('action' => $form_events_call->GetEventsCallString())); $advanced_form->AddChild($advanced_vgroup); $tab_headers[0]['label'] = $amp_locale->GetStr('oemframe_label'); $tab_headers[1]['label'] = $amp_locale->GetStr('enabled_icons_label'); $tab_headers[2]['label'] = $amp_locale->GetStr('advancedsettings_label'); $tab = new HuiTab('interface', array('tabactionfunction' => 'interface_tab_action_builder', 'activetab' => isset($eventData['activetab']) ? $eventData['activetab'] : '', 'tabs' => $tab_headers)); $tab->AddChild($oem_form); $tab->AddChild($enable_form); $tab->AddChild($advanced_form); $hui_mainframe->AddChild($tab); $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('default_title'); }