Example #1
0
//
require 'auth.php';
OpenLibrary('configman.library');
OpenLibrary('locale.library');
OpenLibrary('hui.library');
OpenLibrary('ampshared.library');
OpenLibrary('jpcache.library');
$gEnv['runtime']['modules']['jpcache']['cacheon'] = 0;
$gLocale = new Locale('jpcache_root_jpcache', $gEnv['root']['locale']['language']);
$gHui = new Hui($gEnv['root']['db']);
$gHui->LoadWidget('amppage');
$gHui->LoadWidget('amptoolbar');
$gHui->LoadWidget('xml');
$gPage_content = $gStatus = $gToolbars = '';
$gTitle = $gLocale->GetStr('jpcache.title');
$gMenu = get_ampoliros_root_menu_def($gEnv['root']['locale']['language']);
$gToolbars['main'] = array('main' => array('label' => $gLocale->GetStr('default.button'), 'themeimage' => 'configure', 'action' => build_events_call_string('', array(array('main', 'default', '')))), 'stats' => array('label' => $gLocale->GetStr('stats.button'), 'themeimage' => 'folder', 'action' => build_events_call_string('', array(array('main', 'stats', '')))), 'erase' => array('label' => $gLocale->GetStr('erasecache.button'), 'themeimage' => 'edittrash', 'action' => build_events_call_string('', array(array('main', 'default', ''), array('action', 'erasecache', ''))), 'needconfirm' => 'true', 'confirmmessage' => $gLocale->GetStr('erase.confirm')));
/*
$gToolbars['help'] = array( 'help' => array(
                                            'label' => $gLocale->GetStr( 'help.button' ),
                                            'themeimage' => 'help',
                                            'action' => build_events_call_string( '', array( array( 'main', 'help', '' ) ) )
                                           ) );
*/
// Action dispatcher
//
$gAction_disp = new HuiDispatcher('action');
$gAction_disp->AddEvent('setprefs', 'action_setprefs');
function action_setprefs($eventData)
{
    global $gEnv, $gStatus, $gLocale;
Example #2
0
$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('xmlrpc_title')));
$hui_mainvertgroup = new HuiVertGroup('mainvertgroup');
$hui_titlebar = new HuiTitleBar('titlebar', array('title' => $amp_locale->GetStr('xmlrpc_title'), 'icon' => 'network'));
$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);
// Profiles bar
//
$hui_profilestoolbar = new HuiToolBar('profilestoolbar');
$home_action = new HuiEventsCall();
$home_action->AddEvent(new HuiEvent('main', 'default', ''));
$hui_homebutton = new HuiButton('homebutton', array('label' => $amp_locale->GetStr('profiles_button'), 'themeimage' => 'view_tree', 'horiz' => 'true', 'action' => $home_action->GetEventsCallString()));
$hui_profilestoolbar->AddChild($hui_homebutton);
$newprofile_action = new HuiEventsCall();
$newprofile_action->AddEvent(new HuiEvent('main', 'newprofile', ''));
$hui_newprofilebutton = new HuiButton('newprofilebutton', array('label' => $amp_locale->GetStr('newprofile_button'), 'themeimage' => 'filenew', 'horiz' => 'true', 'action' => $newprofile_action->GetEventsCallString()));
$hui_profilestoolbar->AddChild($hui_newprofilebutton);
// Users bar
//
$hui_userstoolbar = new HuiToolBar('userstoolbar');
Example #3
0
    
                      </children>
                    </grid>
                  </children>
                </form>
    
                <button row="1" col="0"><name>apply</name>
                  <args>
                    <horiz>true</horiz>
                    <frame>false</frame>
                    <label type="encoded">' . urlencode($gLocale->GetStr('apply.submit')) . '</label>
                    <themeimage>button_ok</themeimage>
                    <formsubmit>alerts</formsubmit>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_reports_prefs', '')))) . '</action>
                  </args>
                </button>
              </children>
            </table>
    
          </children>
        </vertgroup>
    
      </children>
    </tab>';
    $gPage_title .= ' - ' . $gLocale->GetStr('settings.title');
}
$gMain_disp->Dispatch();
// ----- Rendering -----
//
$gHui->AddChild(new HuiAmpPage('page', array('pagetitle' => $gPage_title, 'menu' => get_ampoliros_root_menu_def($gEnv['root']['locale']['language']), 'toolbars' => array(new HuiAmpToolbar('main', array('toolbars' => $gToolbars))), 'maincontent' => new HuiXml('page', array('definition' => $gXml_def)), 'status' => $gPage_status, 'icon' => 'package_utilities')));
$gHui->Render();
Example #4
0
                
                      <horizbar><name>hb</name></horizbar>
                
                      <button><name>submit</name>
                        <args>
                          <formsubmit>bugreport</formsubmit>
                          <themeimage>button_ok</themeimage>
                          <frame>false</frame>
                          <horiz>true</horiz>
                          <label type="encoded">' . urlencode($gLocale->GetStr('bugreport.submit')) . '</label>
                          <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'debug', array('pid' => $eventData['pid'])), array('pass', 'submitbugreport', array('pid' => $eventData['pid']))))) . '</action>
                        </args>
                      </button>
                
                    </children></vertgroup>
                
                  </children></form>
                
                </children></tab>';
    }
    $gPage_content = new HuiXml('page', array('definition' => $xml_def));
}
$gMain_disp->AddEvent('help', 'main_help');
function main_help($eventData)
{
    global $gEnv, $gLocale, $gPage_content;
    $gPage_content = new HuiHelpNode('help', array('language' => AMP_LANG));
}
$gMain_disp->Dispatch();
$gHui->AddChild(new HuiAmpPage('page', array('pagetitle' => $gPage_title, 'menu' => get_ampoliros_root_menu_def($gEnv['root']['locale']['language']), 'toolbars' => $gToolbars, 'maincontent' => $gPage_content, 'status' => $gPage_status, 'icon' => 'exec')));
$gHui->Render();