Пример #1
0
function main_default($eventData)
{
    global $gEnv, $gLocale, $gPage_content;
    $jp_cfg = new ConfigFile(CONFIG_PATH . 'jpcache.cfg', true);
    $xml_def = '<vertgroup><name>prefs</name><children>
  <form><name>prefs</name><args><method>post</method><action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', ''), array('action', 'setprefs', '')))) . '</action></args><children>
    <grid><name>prefs</name><children>
      <label row="0" col="0"><name>cachetime</name><args><label type="encoded">' . urlencode($gLocale->GetStr('cachetime.label')) . '</label></args></label>
      <string row="0" col="1"><name>cachetime</name><args><disp>action</disp><size>5</size><value>' . $jp_cfg->Value('CACHE_TIME') . '</value></args></string>
      <label row="1" col="0"><name>cacheon</name><args><label type="encoded">' . urlencode($gLocale->GetStr('cacheon.label')) . '</label></args></label>
      <checkbox row="1" col="1"><name>cacheon</name><args><disp>action</disp><checked>' . ($jp_cfg->Value('CACHE_ON') == '1' ? 'true' : 'false') . '</checked></args></checkbox>
      <label row="2" col="0"><name>usegzip</name><args><label type="encoded">' . urlencode($gLocale->GetStr('usegzip.label')) . '</label></args></label>
      <checkbox row="2" col="1"><name>usegzip</name><args><disp>action</disp><checked>' . ($jp_cfg->Value('USE_GZIP') == '1' ? 'true' : 'false') . '</checked></args></checkbox>
      <label row="3" col="0"><name>cachepost</name><args><label type="encoded">' . urlencode($gLocale->GetStr('cachepost.label')) . '</label></args></label>
      <checkbox row="3" col="1"><name>cachepost</name><args><disp>action</disp><checked>' . ($jp_cfg->Value('CACHE_POST') == '1' ? 'true' : 'false') . '</checked></args></checkbox>
    </children></grid>
  </children></form>
  <horizbar><name>hb</name></horizbar>
  <button><name>submit</name>
    <args>
      <label type="encoded">' . urlencode($gLocale->GetStr('setprefs.submit')) . '</label>
      <themeimage>button_ok</themeimage>
      <horiz>true</horiz>
      <frame>true</frame>
      <formsubmit>prefs</formsubmit>
      <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', ''), array('action', 'setprefs', '')))) . '</action>
    </args>
  </button>
</children></vertgroup>';
    $gPage_content = new HuiXml('page', array('definition' => $xml_def));
}
Пример #2
0
function main_default($eventData)
{
    global $gXml_def;
    $gXml_def = '<vertgroup>
  <children>

    <label>
      <args>
        <label>Prova</label>
      </args>
    </label>

    <form><name>testo</name>
      <args>
        <action type="encoded">' . build_events_call_string('', array(array('view', 'default'))) . '</action>
      </args>
      <children>

    <fckeditor><name>pino</name>
      <args>
        <height>400</height>
        <width>600</width>
        <disp>view</disp>
        <value type="encoded">' . urlencode($eventData['pino']) . '</value>
      </args>
    </fckeditor>

      </children>
    </form>

    <horizbar/>

    <button>
      <args>
        <formsubmit>testo</formsubmit>
        <label>Invia</label>
        <themeimage>button_ok</themeimage>
        <horiz>true</horiz>
        <action type="encoded">' . build_events_call_string('', array(array('view', 'default'))) . '</action>
      </args>
    </button>

  </children>
</vertgroup>';
}
Пример #3
0
function main_default($eventData)
{
    global $gXml_def;
    $gXml_def = '<vertgroup>
  <children>

    <label>
      <args>
        <label>Prova</label>
      </args>
    </label>

    <form><name>testo</name>
      <args>
        <action type="encoded">' . build_events_call_string('', array(array('main', 'default'))) . '</action>
      </args>
      <children>

    <htmlarea><name>pino</name>
      <args>
        <rows>10</rows>
        <cols>80</cols>
        <disp>main</disp>
        <content type="encoded">' . urlencode($eventData['pino']) . '</content>
      </args>
    </htmlarea>

      </children>
    </form>

    <horizbar/>

    <button>
      <args>
        <formsubmit>testo</formsubmit>
        <label>Invia</label>
        <themeimage>button_ok</themeimage>
        <horiz>true</horiz>
        <action type="encoded">' . build_events_call_string('', array(array('main', 'default'))) . '</action>
      </args>
    </button>

  </children>
</vertgroup>';
}
Пример #4
0
function main_default($eventData)
{
    global $env, $gYaps_locale, $gTitle, $gPage_content;
    $mod_settings = new ModuleConfig($env['ampdb'], 'yaps');
    $gs_exec = $mod_settings->GetKey('gs_exec');
    if (!strlen($gs_exec)) {
        $gs_exec = '/usr/bin/gs';
    }
    $xml_def = '<vertgroup><name>prefs</name><children>
  <form><name>settings</name><args><action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', ''), array('action', 'setsettings', '')))) . '</action></args><children>
    <grid><name>settingsgrid</name><children>
      <label row="0" col="0"><name>gsexec</name><args><label>' . $gYaps_locale->GetStr('gsexec_label') . '</label></args></label>
      <string row="0" col="1"><name>gsexec</name><args><disp>action</disp><value type="encoded">' . urlencode($gs_exec) . '</value><size>20</size></args></string>
    </children></grid>
    <submit><name>submit</name><args><caption>' . $gYaps_locale->GetStr('savesettings_submit') . '</caption></args></submit>
  </children></form>
</children></vertgroup>';
    $gPage_content = new HuiXml('page', array('definition' => $xml_def));
    $gTitle = $gYaps_locale->GetStr('yaps_title');
}
Пример #5
0
 function main_motd($eventData)
 {
     global $gEnv, $hui_titlebar, $hui_mainframe, $amp_locale;
     OpenLibrary('sites.library');
     $site = new Site($gEnv['root']['db'], $gEnv['site']['id'], $gEnv['site']['db']);
     $xml_def = '<vertgroup><name>motd</name>
       <children>
     
         <form><name>motd</name>
           <args>
             <method>post</method>
             <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'motd', ''), array('pass', 'setmotd', '')))) . '</action>
           </args>
           <children>
     
             <grid><name>motd</name>
     
               <children>
     
                 <label row="0" col="0" halign="" valign="top"><name>label</name>
                   <args>
                     <label type="encoded">' . urlencode($amp_locale->GetStr('motd.label')) . '</label>
                   </args>
                 </label>
     
                 <text row="0" col="1"><name>motd</name>
                   <args>
                     <rows>10</rows>
                     <cols>80</cols>
                     <disp>pass</disp>
                     <value type="encoded">' . urlencode($site->GetMotd()) . '</value>
                   </args>
                 </text>
     
               </children>
     
             </grid>
     
           </children>
         </form>
     
         <horizbar><name>hb</name></horizbar>
     
         <button>
           <name>apply</name>
           <args>
             <horiz>true</horiz>
             <frame>false</frame>
             <themeimage>button_ok</themeimage>
             <label type="encoded">' . urlencode($amp_locale->GetStr('set_motd.submit')) . '</label>
             <formsubmit>motd</formsubmit>
             <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'motd', ''), array('pass', 'setmotd', '')))) . '</action>
           </args>
         </button>
     
       </children>
     </vertgroup>';
     $hui_mainframe->AddChild(new HuiXml('page', array('definition' => $xml_def)));
     $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('motd.title');
 }
Пример #6
0
function main_settings($eventData)
{
    global $gEnv, $gXml_def, $gLocale, $gPage_title;
    $amp_security = new SecurityLayer();
    $session_lifetime = $amp_security->GetSessionLifetime();
    $max_wrong_logins = $amp_security->GetMaxWrongLogins();
    $wrong_login_delay = $amp_security->GetWrongLoginDelay();
    $lock_unsecure_webservices = $amp_security->GetUnsecureWebServicesLock();
    $only_https_root = $amp_security->GetOnlyHttpsRootAccess();
    $only_https_site = $amp_security->GetOnlyHttpsSiteAccess();
    $alerts_on = $amp_security->GetAlertEvents();
    $wrong_local_root_login = $alerts_on['wronglocalrootlogin'] ? 'true' : 'false';
    $wrong_local_user_login = $alerts_on['wronglocaluserlogin'] ? 'true' : 'false';
    $wrong_remote_login = $alerts_on['wrongremotelogin'] ? 'true' : 'false';
    $module_operation = $alerts_on['moduleoperation'] ? 'true' : 'false';
    $sitemodule_operation = $alerts_on['modulesiteoperation'] ? 'true' : 'false';
    $site_operation = $alerts_on['siteoperation'] ? 'true' : 'false';
    $reports_interval = $amp_security->GetReportsInterval();
    $reports_enabled = $reports_interval ? 'true' : 'false';
    $report_destination_email = $amp_security->GetReportsEmail();
    $alert_destination_email = $amp_security->GetAlertsEmail();
    $tabs[0]['label'] = $gLocale->GetStr('security_presets.tab');
    $tabs[1]['label'] = $gLocale->GetStr('access_settings.tab');
    $tabs[2]['label'] = $gLocale->GetStr('alerts_settings.tab');
    $tabs[3]['label'] = $gLocale->GetStr('reports_settings.tab');
    $gXml_def = '<tab><name>security</name>
      <args>
        <tabs type="array">' . huixml_encode($tabs) . '</tabs>
        <tabactionfunction>settings_tab_builder</tabactionfunction>
        <activetab>' . (isset($eventData['tab']) ? $eventData['tab'] : '') . '</activetab>
      </args>
      <children>
    
        <vertgroup><name></name>
          <children>
    
            <table><name>presets</name>
              <args>
                <headers type="array">' . huixml_encode(array(0 => array('label' => $gLocale->GetStr('security_presets.label')))) . '</headers>
              </args>
              <children>
    
              <button row="0" col="0"><name>preset</name>
                <args>
                  <themeimage>decrypted</themeimage>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_low.label')) . '</label>
                  <horiz>true</horiz>
                  <frame>false</frame>
                  <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_security_preset', array('preset' => AMPOLIROS_SECURITY_PRESET_LOW))))) . '</action>
                </args>
              </button>
    
              <label row="0" col="1"><name>details</name>
                <args>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_low.text')) . '</label>
                  <nowrap>false</nowrap>
                </args>
              </label>
    
              <button row="1" col="0"><name>preset</name>
                <args>
                  <themeimage>encrypted</themeimage>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_normal.label')) . '</label>
                  <horiz>true</horiz>
                  <frame>false</frame>
                  <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_security_preset', array('preset' => AMPOLIROS_SECURITY_PRESET_NORMAL))))) . '</action>
                </args>
              </button>
    
              <label row="1" col="1"><name>details</name>
                <args>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_normal.text')) . '</label>
                  <nowrap>false</nowrap>
                </args>
              </label>
    
              <button row="2" col="0"><name>preset</name>
                <args>
                  <themeimage>encrypted</themeimage>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_high.label')) . '</label>
                  <horiz>true</horiz>
                  <frame>false</frame>
                  <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_security_preset', array('preset' => AMPOLIROS_SECURITY_PRESET_HIGH))))) . '</action>
                </args>
              </button>
    
              <label row="2" col="1"><name>details</name>
                <args>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_high.text')) . '</label>
                  <nowrap>false</nowrap>
                </args>
              </label>
    
              <button row="3" col="0"><name>preset</name>
                <args>
                  <themeimage>encrypted</themeimage>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_paranoid.label')) . '</label>
                  <horiz>true</horiz>
                  <frame>false</frame>
                  <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_security_preset', array('preset' => AMPOLIROS_SECURITY_PRESET_PARANOID))))) . '</action>
                </args>
              </button>
    
              <label row="3" col="1"><name>details</name>
                <args>
                  <label type="encoded">' . urlencode($gLocale->GetStr('level_paranoid.text')) . '</label>
                  <nowrap>false</nowrap>
                </args>
              </label>
    
              </children>
            </table>
    
          </children>
        </vertgroup>
    
        <vertgroup><name></name>
          <children>
    
            <table><name>access</name>
              <args>
                <headers type="array">' . huixml_encode(array(0 => array('label' => $gLocale->GetStr('access_settings.label')))) . '</headers>
              </args>
              <children>
    
                <form row="0" col="0"><name>access</name>
                  <args>
                    <method>post</method>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_access_prefs', '')))) . '</action>
                  </args>
                  <children>
                    <grid>
                      <children>
    
                        <label row="0" col="0"><name>sessionlifetime</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('session_lifetime.label')) . '</label>
                          </args>
                        </label>
    
                        <string row="0" col="1"><name>sessionlifetime</name>
                          <args>
                            <value>' . $session_lifetime . '</value>
                            <disp>action</disp>
                            <size>10</size>
                          </args>
                        </string>
    
                        <label row="1" col="0"><name>maxwronglogins</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('max_wrong_logins.label')) . '</label>
                          </args>
                        </label>
    
                        <string row="1" col="1"><name>maxwronglogins</name>
                          <args>
                            <value>' . $max_wrong_logins . '</value>
                            <disp>action</disp>
                            <size>4</size>
                          </args>
                        </string>
    
                        <label row="2" col="0"><name>wronglogindelay</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('wrong_login_delay.label')) . '</label>
                          </args>
                        </label>
    
                        <string row="2" col="1"><name>wronglogindelay</name>
                          <args>
                            <value>' . $wrong_login_delay . '</value>
                            <disp>action</disp>
                            <size>3</size>
                          </args>
                        </string>
    
                        <label row="3" col="0"><name>lockunsecurewebservices</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('block_unsecure_webservices.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="3" col="1"><name>lockunsecurewebservices</name>
                          <args>
                            <checked>' . ($lock_unsecure_webservices ? 'true' : 'false') . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="4" col="0"><name>onlyhttpsroot</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('only_https_root.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="4" col="1"><name>onlyhttpsroot</name>
                          <args>
                            <checked>' . ($only_https_root ? 'true' : 'false') . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="5" col="0"><name>onlyhttpssite</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('only_https_site.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="5" col="1"><name>onlyhttpssite</name>
                          <args>
                            <checked>' . ($only_https_site ? 'true' : 'false') . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                      </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>access</formsubmit>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_access_prefs', '')))) . '</action>
                  </args>
                </button>
              </children>
            </table>
    
          </children>
        </vertgroup>
    
        <vertgroup><name></name>
          <children>
    
            <table><name>alerts</name>
              <args>
                <headers type="array">' . huixml_encode(array(0 => array('label' => $gLocale->GetStr('alerts_settings.label')))) . '</headers>
              </args>
              <children>
    
                <form row="0" col="0"><name>alerts</name>
                  <args>
                    <method>post</method>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_alerts_prefs', '')))) . '</action>
                  </args>
                  <children>
                    <grid>
                      <children>
    
                        <label row="0" col="0"><name>alertonevents</name>
                          <args>
                            <bold>true</bold>
                            <label type="encoded">' . urlencode($gLocale->GetStr('alert_on_events.label')) . '</label>
                          </args>
                        </label>
    
                        <label row="1" col="0"><name>wronglocalrootlogin</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('wrong_local_root_login.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="1" col="1"><name>wronglocalrootlogin</name>
                          <args>
                            <checked>' . $wrong_local_root_login . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="2" col="0"><name>wronglocaluserlogin</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('wrong_local_user_login.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="2" col="1"><name>wronglocaluserlogin</name>
                          <args>
                            <checked>' . $wrong_local_user_login . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="3" col="0"><name>wrongremotelogin</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('wrong_remote_login.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="3" col="1"><name>wrongremotelogin</name>
                          <args>
                            <checked>' . $wrong_remote_login . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="4" col="0"><name>moduleoperation</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('module_operation.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="4" col="1"><name>moduleoperation</name>
                          <args>
                            <checked>' . $module_operation . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="5" col="0"><name>sitemoduleoperation</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('sitemodule_operation.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="5" col="1"><name>sitemoduleoperation</name>
                          <args>
                            <checked>' . $sitemodule_operation . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="6" col="0"><name>siteoperation</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('site_operation.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="6" col="1"><name>siteoperation</name>
                          <args>
                            <checked>' . $site_operation . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="7" col="0"><name>alertdestinationemail</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('alert_destination_email.label')) . '</label>
                          </args>
                        </label>
    
                        <string row="7" col="1"><name>alertdestinationemail</name>
                          <args>
                            <value type="encoded">' . urlencode($alert_destination_email) . '</value>
                            <disp>action</disp>
                            <size>25</size>
                          </args>
                        </string>
    
                      </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_alerts_prefs', '')))) . '</action>
                  </args>
                </button>
              </children>
            </table>
    
          </children>
        </vertgroup>
    
        <vertgroup><name></name>
          <children>
    
            <table><name>alerts</name>
              <args>
                <headers type="array">' . huixml_encode(array(0 => array('label' => $gLocale->GetStr('reports_settings.label')))) . '</headers>
              </args>
              <children>
    
                <form row="0" col="0"><name>alerts</name>
                  <args>
                    <method>post</method>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'settings', ''), array('action', 'set_reports_prefs', '')))) . '</action>
                  </args>
                  <children>
                    <grid>
                      <children>
    
                        <label row="0" col="0"><name>enablereports</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('enable_reports.label')) . '</label>
                          </args>
                        </label>
    
                        <checkbox row="0" col="1"><name>enablereports</name>
                          <args>
                            <checked>' . $reports_enabled . '</checked>
                            <disp>action</disp>
                          </args>
                        </checkbox>
    
                        <label row="1" col="0"><name>reportsinterval</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('reports_interval.label')) . '</label>
                          </args>
                        </label>
    
                        <string row="1" col="1"><name>reportsinterval</name>
                          <args>
                            <value>' . $reports_interval . '</value>
                            <disp>action</disp>
                            <size>3</size>
                          </args>
                        </string>
    
                        <label row="2" col="0"><name>reportdestinationemail</name>
                          <args>
                            <label type="encoded">' . urlencode($gLocale->GetStr('report_destination_email.label')) . '</label>
                          </args>
                        </label>
    
                        <string row="2" col="1"><name>reportdestinationemail</name>
                          <args>
                            <value type="encoded">' . urlencode($report_destination_email) . '</value>
                            <disp>action</disp>
                            <size>25</size>
                          </args>
                        </string>
    
                      </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');
}
Пример #7
0
function methods_list_action_builder($pageNumber)
{
    $tmp_main_disp = new HuiDispatcher('main');
    $event_data = $tmp_main_disp->GetEventData();
    return build_events_call_string('', array(array('main', 'showmethods', array('methodspage' => $pageNumber, 'accountid' => $event_data['accountid']))));
}
Пример #8
0
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: index.php,v 1.10 2004-07-08 15:04:25 alex Exp $
require './auth.php';
OpenLibrary('hui.library');
if (strlen($_SESSION['AMP_AUTH_USER'])) {
    OpenLibrary('sessionkey.hui', HANDLER_PATH);
    $empty = new HuiSessionKey('mainpage', array('sessionobjectnopage' => 'true'));
    if (!strlen($empty->mValue) or !file_exists($empty->mValue)) {
        $main_page_url = 'main.php';
    } else {
        $main_page_url = build_events_call_string($empty->mValue, array(array('main', 'default', ''))) . '&amp;act=def';
    }
    header('P3P: CP="CUR ADM OUR NOR STA NID"');
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Ampoliros - <?php 
    echo $env["sitedata"]["sitename"];
    ?>
</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
</head>

<frameset cols="150,*" framespacing="0" border="0" frameborder="0">
	<frameset rows="175,*" framespacing="0" border="0">
Пример #9
0
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');
}
function main_moduleversions($eventData)
{
    global $gEnv, $gLocale, $gPage_title, $gXml_def, $gStatus;
    $module = new AmpCentralModule($gEnv['root']['db'], $eventData['id']);
    $versions = $module->GetVersionsList(true);
    $headers[0]['label'] = $gLocale->GetStr('version.header');
    $headers[1]['label'] = $gLocale->GetStr('date.header');
    $headers[2]['label'] = $gLocale->GetStr('dependencies.header');
    $gXml_def = '<vertgroup><name>versions</name>
	  <children>
	    <label><name>module</name>
	      <args>
	        <bold>true</bold>
	        <label type="encoded">' . urlencode($module->mModule) . '</label>
	      </args>
	    </label>
	    <table><name>versions</name>
	      <args>
	        <headers type="array">' . huixml_encode($headers) . '</headers>
	        <rowsperpage>15</rowsperpage>
	        <pagesactionfunction>versions_list_action_builder</pagesactionfunction>
	        <pagenumber>' . (isset($eventData['pagenumber']) ? $eventData['pagenumber'] : '') . '</pagenumber>
	      </args>
	      <children>';
    $row = 0;
    while (list(, $version) = each($versions)) {
        $vers_data = $module->GetVersionData($version);
        $gXml_def .= '<label row="' . $row . '" col="0"><name>version</name>
		  <args>
		    <label type="encoded">' . urlencode($version) . '</label>
		  </args>
		</label>
		<label row="' . $row . '" col="1"><name>date</name>
		  <args>
		    <label type="encoded">' . urlencode($vers_data['date']) . '</label>
		  </args>
		</label>
		<label row="' . $row . '" col="2"><name>dependencies</name>
		  <args>
		    <label type="encoded">' . urlencode($vers_data['dependencies'] . (strlen($vers_data['suggestions']) ? '<br>(' . $vers_data['suggestions'] . ')' : '')) . '</label>
		  </args>
		</label>
		<amptoolbar row="' . $row . '" col="3"><name>tb</name>
		  <args>
		    <toolbars type="array">' . huixml_encode(array('main' => array('remove' => array('label' => $gLocale->GetStr('remove_version.button'), 'needconfirm' => 'true', 'confirmmessage' => $gLocale->GetStr('remove_version.confirm'), 'themeimage' => 'edittrash', 'action' => build_events_call_string('', array(array('main', count($versions) == 1 ? 'modules' : 'moduleversions', array('id' => $eventData['id'])), array('action', 'removeversion', array('id' => $eventData['id'], 'version' => $version)))))))) . '</toolbars>
		    <frame>false</frame>
		  </args>
		</amptoolbar>';
        $row++;
    }
    $gXml_def .= '      </children>
	    </table>
	  </children>
	</vertgroup>';
    $gPage_title .= ' - ' . $module->mModule . ' - ' . $gLocale->GetStr('moduleversions.title');
}
Пример #11
0
function main_default($eventData)
{
    global $gXml_def;
    $example_data = array(array("80", 0.0, 20, 4, 5, 6), array("81", 2.0, 30, 5, 6, 7), array("82", 3.0, 40, 5, 7, 8), array("83", 4.0, 50, 3, 6, 3), array("84", 4.4, 40, 3, 6, 5), array("85", 5.4, 40, 5, 6, 5), array("86", 5.5, 40, 7, 6, 5), array("87", 7, 35, 0.0, 0.0, ""), array("88", 7.4, 40, 14, 16, 25), array("89", 7.6, 40, 6, 6, 5), array("90", 8.199999999999999, 40, 3, 6, 5), array("91", 8.5, 40, 8, 6, 9), array("92", 9.300000000000001, 40, 5, 6, 5), array("93", 9.6, 40, 9, 6, 7), array("94", 9.9, 40, 2, 6, 5), array("95", 10.0, 40, 3, 6, 8), array("96", 10.4, 40, 3, 6, 5), array("97", 10.5, 40, 3, 6, 5), array("98", 10.8, 40, 3, 6, 5), array("99", 11.4, 40, 3, 6, 5), array("00", 12.0, 40, 3, 7, 5), array("01", 13.4, 40, 3, 5, 3), array("02", 14.0, 30, 3, 5, 6));
    $legend = array('Prodotto A', 'Prodotto B', 'Prodotto C', 'Prodotto D', 'Prodotto E');
    $gXml_def = '<vertgroup>
  <children>

    <label>
      <args>
        <label>Grafico</label>
      </args>
    </label>

    <vertframe>
      <children>

        <phplot>
          <args>
            <data type="array">' . huixml_encode($example_data) . '</data>
            <width>600</width>
            <height>350</height>
            <legend type="array">' . huixml_encode($legend) . '</legend>
            <plottype>' . $eventData['plottype'] . '</plottype>
            <title>Elaborazione fatturato</title>
          </args>
        </phplot>

      </children>
    </vertframe>

    <horizbar/>

    <horizgroup>
      <children>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Bars</label>
            <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', array('plottype' => 'bars'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Lines</label>
            <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', array('plottype' => 'lines'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Linepoints</label>
            <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', array('plottype' => 'linepoints'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Area</label>
            <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', array('plottype' => 'area'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Points</label>
            <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', array('plottype' => 'points'))))) . '</action>
          </args>
        </button>

        <button>
          <args>
            <themeimage>button_ok</themeimage>
            <horiz>true</horiz>
            <themeimagetype>mini</themeimagetype>
            <label>Pie</label>
            <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', array('plottype' => 'pie'))))) . '</action>
          </args>
        </button>

      </children>
    </horizgroup>

  </children>
</vertgroup>';
}
Пример #12
0
function main_sitemodules($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar;
    $site_query =& $env['ampdb']->execute('SELECT * FROM sites WHERE id=' . $eventData['siteid']);
    $site_data = $site_query->Fields();
    $modules_query =& $env['ampdb']->Execute('SELECT * FROM modules WHERE onlyextension <> ' . $env['ampdb']->Format_Text($env['ampdb']->fmttrue) . ' ORDER BY modid');
    if ($modules_query) {
        if ($modules_query->NumRows()) {
            $headers[0]['label'] = $amp_locale->GetStr('status_header');
            $headers[1]['label'] = $amp_locale->GetStr('moduleid_header');
            $headers[2]['label'] = $amp_locale->GetStr('modactivationdate_header');
            $headers[4]['label'] = $amp_locale->GetStr('moddeps_header');
            $row = 0;
            $hui_sitemodules_table = new HuiTable('sitemodulestable', array('headers' => $headers));
            OpenLibrary('modulesbase.library');
            while (!$modules_query->eof) {
                $modules_data = $modules_query->Fields();
                if ($modules_data['modid'] != 'ampoliros') {
                    $act_query =& $env['ampdb']->Execute('SELECT * FROM activemodules WHERE siteid = ' . $eventData['siteid'] . ' AND moduleid = ' . $modules_data['id']);
                    $hui_en_group[$row] = new HuiVertGroup('enable');
                    $hui_sitemodules_toolbar[$row] = new HuiToolBar('sitemodulestoolbar' . $row);
                    $mod_dep = new ModuleDep($env['ampdb']);
                    if ($act_query->NumRows()) {
                        // Module is enabled
                        //
                        $act_data = $act_query->Fields();
                        $hui_sitemodules_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $hui_mainframe->mThemeHandler->mStyle['greenball'])), $row, 0);
                        $hui_sitemodules_table->AddChild(new HuiLabel('modid' . $row, array('label' => $modules_data['modid'], 'compact' => 'true')), $row, 1);
                        $hui_sitemodules_table->AddChild(new HuiLabel('actdate' . $row, array('label' => $act_data['activationdate'], 'compact' => 'true')), $row, 2);
                        $site_depending_modules = $mod_dep->CheckSiteDependingModules($modules_data['modid'], $site_data['siteid']);
                        $module = new Module($env['ampdb'], $modules_data['id']);
                        $sub_modules = $module->GetSubModules();
                        if (!$site_depending_modules) {
                            // No modules depends on this one
                            //
                            $disable_action[$row] = new HuiEventsCall();
                            $disable_action[$row]->AddEvent(new HuiEvent('main', 'sitemodules', array('siteid' => $eventData['siteid'])));
                            $disable_action[$row]->AddEvent(new HuiEvent('pass', 'deactivatemodule', array('siteid' => $eventData['siteid'], 'modid' => $modules_data['id'])));
                            $hui_disable_button[$row] = new HuiButton('disablebutton' . $row, array('label' => $amp_locale->GetStr('deactivatemodule_label'), 'compact' => 'true', 'horiz' => 'true', 'themeimage' => 'stop', 'themeimagetype' => 'mini', 'action' => $disable_action[$row]->GetEventsCallString()));
                            $hui_sitemodules_toolbar[$row]->AddChild($hui_disable_button[$row]);
                            $hui_en_group[$row]->AddChild($hui_sitemodules_toolbar[$row]);
                        } else {
                            // At least one module depends on this one
                            //
                            $mod_dep_list_str = '';
                            while (list(, $dep) = each($site_depending_modules)) {
                                $mod_dep_list_str .= $dep . '<br>';
                            }
                            $hui_sitemodules_table->AddChild(new HuiLabel('moddeps' . $row, array('label' => $mod_dep_list_str)), $row, 4);
                        }
                        if (count($sub_modules)) {
                            $toolbar = array();
                            while (list(, $name) = each($sub_modules)) {
                                $enabled = $module->CheckIfSubModuleEnabled($name, $eventData['siteid']);
                                $toolbar['main']['enable'] = array('label' => sprintf($amp_locale->GetStr(($enabled ? 'disable' : 'enable') . '_submodule.button'), ucfirst($name)), 'themeimage' => $enabled ? 'stop' : 'reload', 'compact' => 'true', 'themeimagetype' => 'mini', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'sitemodules', array('siteid' => $eventData['siteid'])), array('pass', $enabled ? 'disablesubmodule' : 'enablesubmodule', array('moduleid' => $modules_data['id'], 'siteid' => $eventData['siteid'], 'submodule' => $name)))));
                                $hui_en_group[$row]->AddChild(new HuiAmpToolBar('main', array('frame' => 'false', 'toolbars' => $toolbar)));
                            }
                        }
                        $hui_sitemodules_table->AddChild($hui_en_group[$row], $row, 3);
                    } else {
                        // Module is not enabled
                        //
                        $hui_sitemodules_table->AddChild(new HuiImage('status' . $row, array('imageurl' => $hui_mainframe->mThemeHandler->mStyle['redball'])), $row, 0);
                        $hui_sitemodules_table->AddChild(new HuiLabel('modid' . $row, array('label' => $modules_data['modid'])), $row, 1);
                        $site_module_deps = $mod_dep->CheckSiteModuleDeps($modules_data['modid'], $site_data['siteid'], DEPTYPE_DEP);
                        if (!is_array($site_module_deps)) {
                            // All module dependecies are met
                            //
                            $enable_action[$row] = new HuiEventsCall();
                            $enable_action[$row]->AddEvent(new HuiEvent('main', 'sitemodules', array('siteid' => $eventData['siteid'])));
                            $enable_action[$row]->AddEvent(new HuiEvent('pass', 'activatemodule', array('siteid' => $eventData['siteid'], 'modid' => $modules_data['id'])));
                            $hui_enable_button[$row] = new HuiButton('enablebutton' . $row, array('label' => $amp_locale->GetStr('activatemodule_label'), 'compact' => 'true', 'horiz' => 'true', 'themeimage' => 'reload', 'themeimagetype' => 'mini', 'action' => $enable_action[$row]->GetEventsCallString()));
                            $hui_sitemodules_toolbar[$row]->AddChild($hui_enable_button[$row]);
                        } else {
                            // At least one module dependency is not met
                            //
                            $mod_dep_list_str = '';
                            while (list(, $dep) = each($site_module_deps)) {
                                $mod_dep_list_str .= $dep . '<br>';
                            }
                            $hui_sitemodules_table->AddChild(new HuiLabel('moddeps' . $row, array('label' => $mod_dep_list_str)), $row, 4);
                        }
                        $hui_sitemodules_table->AddChild($hui_sitemodules_toolbar[$row], $row, 3);
                    }
                    $row++;
                }
                $modules_query->MoveNext();
            }
            $xml_def = '<toolbar>
              <children>
            
                <button>
                  <args>
                    <themeimage>reload</themeimage>
                    <label type="encoded">' . urlencode($amp_locale->GetStr('enable_all_modules.button')) . '</label>
                    <horiz>true</horiz>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'sitemodules', array('siteid' => $eventData['siteid'])), array('pass', 'activateallmodules', array('siteid' => $eventData['siteid']))))) . '</action>
                  </args>
                </button>
            
                <button>
                  <args>
                    <themeimage>stop</themeimage>
                    <label type="encoded">' . urlencode($amp_locale->GetStr('disable_all_modules.button')) . '</label>
                    <horiz>true</horiz>
                    <needconfirm>true</needconfirm>
                    <confirmmessage type="encoded">' . urlencode($amp_locale->GetStr('disable_all_modules.confirm')) . '</confirmmessage>
                    <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'sitemodules', array('siteid' => $eventData['siteid'])), array('pass', 'deactivateallmodules', array('siteid' => $eventData['siteid']))))) . '</action>
                  </args>
                </button>
            
              </children>
            </toolbar>';
            $hui_mainvgroup = new HuiVertGroup();
            $hui_mainvgroup->AddChild($hui_sitemodules_table);
            $hui_mainvgroup->AddChild(new HuiHorizBar());
            $hui_mainvgroup->AddChild(new HuiXml('', array(definition => $xml_def)));
            $hui_mainframe->AddChild($hui_mainvgroup);
        }
    }
    $hui_titlebar->mTitle .= ' - ' . $site_data['siteid'] . ' (' . $site_data['sitename'] . ') - ' . $amp_locale->GetStr('sitemodules_title');
}
Пример #13
0
function main_debug($eventData)
{
    global $gEnv, $gLocale, $gPage_content;
    $amp = Ampoliros::instance('Ampoliros');
    if ($amp->getState == Ampoliros::STATE_DEBUG) {
        $amp->setState(Ampoliros::STATE_DEVELOPMENT);
    }
    $debugger = new Debugger($eventData['pid']);
    if ($debugger->CheckPidFile()) {
        $debugger->ReadPidFile();
        $moddata = $debugger->GuessModule();
        $country = new LocaleCountry($gEnv['root']['locale']['country']);
        $rowa = 0;
        $rowb = 0;
        $rowc = 0;
        $rowd = 0;
        $rowe = 0;
        $rowf = 0;
        $log_events = '';
        while (list(, $log_event) = each($debugger->mLogEvents)) {
            $log_events .= $log_event . "\n";
        }
        $hui_events = array();
        while (list($dispatcher, $event) = each($debugger->mHuiEvents)) {
            $hui_events[] = $dispatcher . '::' . $event['eventname'];
            if (is_array($event['eventdata'])) {
                while (list($eventdata_name, $eventdata_value) = each($event['eventdata'])) {
                    $hui_events[] = '- ' . $eventdata_name . ' -> ' . $eventdata_value;
                }
            }
        }
        $tabs[0]['label'] = $gLocale->GetStr('instance.label');
        $tabs[1]['label'] = $gLocale->GetStr('environment.label');
        $tabs[2]['label'] = $gLocale->GetStr('runtime.label');
        $tabs[3]['label'] = $gLocale->GetStr('source.label');
        $tabs[4]['label'] = $gLocale->GetStr('profiler.label');
        $tabs[5]['label'] = $gLocale->GetStr('bugreport.label');
        arsort($debugger->mDbProfiler);
        $xml_def = '<tab><name>debugger</name><args>' . (isset($eventData['activetab']) ? '<activetab>' . $eventData['activetab'] . '</activetab>' : '') . '<tabactionfunction>debugger_tab_action_builder</tabactionfunction><tabs type="array">' . huixml_encode($tabs) . '</tabs></args><children>
                
                  <grid><name>debugger</name><children>
                
                    <label row="' . $rowa++ . '" col="0"><name>instance</name><args><label type="encoded">' . urlencode($gLocale->GetStr('instance.label')) . '</label><bold>true</bold></args></label>
                
                    <label row="' . $rowa . '" col="0"><name>pid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('pid.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>pid</name><args><readonly>true</readonly><value>' . $eventData['pid'] . '</value><size>32</size></args></string>
                
                    <label row="' . $rowa . '" col="0"><name>sessionid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('sessionid.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>sessionid</name><args><readonly>true</readonly><value>' . $debugger->mSessionId . '</value><size>32</size></args></string>
                
                    <label row="' . $rowa . '" col="0"><name>state</name><args><label type="encoded">' . urlencode($gLocale->GetStr('state.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>state</name><args><readonly>true</readonly><value>' . $debugger->mState . '</value><size>15</size></args></string>
                
                    <label row="' . $rowa . '" col="0"><name>interface</name><args><label type="encoded">' . urlencode($gLocale->GetStr('interface.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>interface</name><args><readonly>true</readonly><value>' . $debugger->mInterface . '</value><size>15</size></args></string>
                
                    <label row="' . $rowa . '" col="0"><name>mode</name><args><label type="encoded">' . urlencode($gLocale->GetStr('mode.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>mode</name><args><readonly>true</readonly><value>' . $debugger->mMode . '</value><size>15</size></args></string>
                
                    <label row="' . $rowa . '" col="0"><name>pagename</name><args><label type="encoded">' . urlencode($gLocale->GetStr('pagename.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>pagename</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['runtime']['pagename'] . '</value><size>20</size></args></string>
                
                    <label row="' . $rowa . '" col="0"><name>siteid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('siteid.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>siteid</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['site']['id'] . '</value><size>20</size></args></string>
                
                    <label row="' . $rowa . '" col="0"><name>userid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('userid.label')) . '</label></args></label>
                    <string row="' . $rowa++ . '" col="1"><name>userid</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['user']['id'] . '</value><size>20</size></args></string>
                
                  </children></grid>
                
                  <grid><name>environment</name><children>
                
                    <label row="' . $rowb++ . '" col="0"><name>environment</name><args><label type="encoded">' . urlencode($gLocale->GetStr('environment.label')) . '</label><bold>true</bold></args></label>
                
                    <label row="' . $rowb . '" col="0"><name>memory</name><args><label type="encoded">' . urlencode($gLocale->GetStr('memorylimit.label')) . '</label></args></label>
                    <string row="' . $rowb++ . '" col="1"><name>memory</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['core']['php']['memorylimit'] . '</value><size>15</size></args></string>
                
                    <label row="' . $rowb . '" col="0"><name>timelimit</name><args><label type="encoded">' . urlencode($gLocale->GetStr('timelimit.label')) . '</label></args></label>
                    <string row="' . $rowb++ . '" col="1"><name>timelimit</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['core']['php']['timelimit'] . '</value><size>15</size></args></string>
                
                    <label row="' . $rowb . '" col="0"><name>sessionlifetime</name><args><label type="encoded">' . urlencode($gLocale->GetStr('sessionlifetime.label')) . '</label></args></label>
                    <string row="' . $rowb++ . '" col="1"><name>sessionlifetime</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['core']['session']['lifetime'] . '</value><size>15</size></args></string>
                
                    <label row="' . $rowb . '" col="0"><name>extensions</name><args><label type="encoded">' . urlencode($gLocale->GetStr('extensions.label')) . '</label></args></label>
                    <listbox row="' . $rowb++ . '" col="1"><name>extensions</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mLoadedExtensions) . '</elements><size>10</size></args></listbox>
                
                  </children></grid>
                
                  <grid><name>runtime</name><children>
                
                    <label row="' . $rowc++ . '" col="0"><name>runtime</name><args><label type="encoded">' . urlencode($gLocale->GetStr('runtime.label')) . '</label><bold>true</bold></args></label>
                
                    <label row="' . $rowc . '" col="0"><name>libraries</name><args><label type="encoded">' . urlencode($gLocale->GetStr('libraries.label')) . '</label></args></label>
                    <listbox row="' . $rowc++ . '" col="1"><name>libraries</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mLibraries) . '</elements><size>10</size></args></listbox>
                
                    <label row="' . $rowc . '" col="0"><name>logevents</name><args><label type="encoded">' . urlencode($gLocale->GetStr('logevents.label')) . '</label></args></label>
                    <text row="' . $rowc++ . '" col="1"><name>logevents</name><args><readonly>true</readonly><value type="encoded">' . urlencode($log_events) . '</value><rows>15</rows><cols>100</cols></args></text>
                
                    <label row="' . $rowc . '" col="0"><name>calledhooks</name><args><label type="encoded">' . urlencode($gLocale->GetStr('calledhooks.label')) . '</label></args></label>
                    <listbox row="' . $rowc++ . '" col="1"><name>calledhooks</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mCalledHooks) . '</elements><size>5</size></args></listbox>
                
                    <label row="' . $rowc . '" col="0"><name>huievents</name><args><label type="encoded">' . urlencode($gLocale->GetStr('huievents.label')) . '</label></args></label>
                    <listbox row="' . $rowc++ . '" col="1"><name>huievents</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($hui_events) . '</elements><size>5</size></args></listbox>
                
                    <label row="' . $rowc . '" col="0"><name>queries</name><args><label type="encoded">' . urlencode($gLocale->GetStr('queries.label')) . '</label></args></label>
                    <listbox row="' . $rowc++ . '" col="1"><name>queries</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mExecutedQueries) . '</elements><size>10</size></args></listbox>
                
                    <label row="' . $rowc . '" col="0"><name>includedfiles</name><args><label type="encoded">' . urlencode($gLocale->GetStr('includedfiles.label')) . '</label></args></label>
                    <listbox row="' . $rowc++ . '" col="1"><name>includedfiles</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mIncludedFiles) . '</elements><size>5</size></args></listbox>
                ';
        if (function_exists('memory_get_usage')) {
            $xml_def .= '    <label row="' . $rowc . '" col="0">
                              <args>
                                <label type="encoded">' . urlencode($gLocale->GetStr('memoryusage.label')) . '</label>
                              </args>
                            </label>';
        }
        $xml_def .= '    <string row="' . $rowc++ . '" col="1">
                      <args>
                        <value type="encoded">' . urlencode($country->FormatNumber($debugger->mMemoryUsage)) . '</value>
                        <readonly>true</readonly>
                        <size>15</size>
                      </args>
                    </string>
                
                  </children></grid>
                
                  <grid><name>source</name><children>
                
                    <label row="' . $rowe++ . '" col="0"><name>source</name><args><label type="encoded">' . urlencode($gLocale->GetStr('source.label')) . '</label><bold>true</bold></args></label>
                
                    <label row="' . $rowe . '" col="0"><name>classes</name><args><label type="encoded">' . urlencode($gLocale->GetStr('classes.label')) . '</label></args></label>
                    <listbox row="' . $rowe++ . '" col="1"><name>classes</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mDefinedClasses) . '</elements><size>10</size></args></listbox>
                
                    <label row="' . $rowe . '" col="0"><name>functions</name><args><label type="encoded">' . urlencode($gLocale->GetStr('functions.label')) . '</label></args></label>
                    <listbox row="' . $rowe++ . '" col="1"><name>functions</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mDefinedFunctions) . '</elements><size>5</size></args></listbox>
                
                  </children></grid>
                
                  <grid><name>profiler</name><children>
                
                    <label row="' . $rowd++ . '" col="0"><name>profiler</name><args><label type="encoded">' . urlencode($gLocale->GetStr('profiler.label')) . '</label><bold>true</bold></args></label>
                
                    <label row="' . $rowd . '" col="0"><name>markers</name><args><label type="encoded">' . urlencode($gLocale->GetStr('markers.label')) . '</label></args></label>
                    <listbox row="' . $rowd++ . '" col="1"><name>markers</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mProfiler) . '</elements><size>20</size></args></listbox>
                
                    <label row="' . $rowd . '" col="0"><name>markers</name><args><label type="encoded">' . urlencode($gLocale->GetStr('dbmarkers.label')) . '</label></args></label>
                    <listbox row="' . $rowd++ . '" col="1"><name>markers</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mDbProfiler) . '</elements><size>20</size></args></listbox>
                    
                    <label row="' . $rowd . '" col="0"><name>dbload</name><args><label type="encoded">' . urlencode($gLocale->GetStr('dbload.label')) . '</label></args></label>
                    <string row="' . $rowd++ . '" col="1"><name>dbload</name><args><readonly>true</readonly><value>' . $debugger->mDbTotalLoad . '</value><size>20</size></args></string>
                
                    <label row="' . $rowd . '" col="0"><args><label type="encoded">' . urlencode($gLocale->GetStr('executedqueries.label')) . '</label></args></label>
                    <string row="' . $rowd++ . '" col="1"><name>executedqueries</name><args><readonly>true</readonly><value>' . count($debugger->mDbProfiler) . '</value><size>6</size></args></string>
                
                  </children></grid>
                
                  <form><name>bugreport</name><args><method>post</method><action type="encoded"></action></args><children>
                
                    <vertgroup><name>bugreport</name><children>
                
                      <grid><name>bugreport</name><children>
                
                        <label row="' . $rowf++ . '" col="0"><name>bugreport</name><args><label type="encoded">' . urlencode($gLocale->GetStr('bugreport.label')) . '</label><bold>true</bold></args></label>
                
                        <label row="' . $rowf . '" col="0"><name>module</name><args><label type="encoded">' . urlencode($gLocale->GetStr('module.label')) . '</label></args></label>
                        <label row="' . $rowf++ . '" col="1"><name>module</name><args><label type="encoded">' . urlencode($moddata['module']) . '</label></args></label>
                
                        <label row="' . $rowf . '" col="0"><name>bugsemail</name><args><label type="encoded">' . urlencode($gLocale->GetStr('bugsemail.label')) . '</label></args></label>
                        <label row="' . $rowf++ . '" col="1"><name>to</name><args><label type="encoded">' . urlencode($moddata['email']) . '</label></args></label>';
        if ($moddata['ampolirosemail'] != $moddata['email']) {
            $xml_def .= '        <label row="' . $rowf . '" col="0"><name>notify</name><args><label type="encoded">' . urlencode($gLocale->GetStr('sendnotify.label')) . '</label></args></label>
                                <checkbox row="' . $rowf++ . '" col="1"><name>notify</name><args><disp>pass</disp></args></checkbox>';
        }
        $xml_def .= '        <label row="' . $rowf . '" col="0"><name>email</name><args><label type="encoded">' . urlencode($gLocale->GetStr('submitteremail.label')) . '</label></args></label>
                        <string row="' . $rowf++ . '" col="1"><name>email</name><args><size>25</size><disp>pass</disp></args></string>
                
                        <label row="' . $rowf . '" col="0"><name>message</name><args><label type="encoded">' . urlencode($gLocale->GetStr('message.label')) . '</label></args></label>
                        <text row="' . $rowf++ . '" col="1"><name>message</name><args><cols>80</cols><rows>10</rows><disp>pass</disp></args></text>
                
                      </children></grid>
                
                      <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));
}
Пример #14
0
function main_ampoliros($eventData)
{
    global $gEnv, $gXml_def, $gLocale, $gPage_title;
    OpenLibrary('ampoliros_cache.maintenance', HANDLER_PATH);
    OpenLibrary('ampoliros_logs.maintenance', HANDLER_PATH);
    $country = new LocaleCountry($GLOBALS['gEnv']['root']['locale']['country']);
    $tabs[0]['label'] = $gLocale->GetStr('ampoliros_status.tab');
    $tabs[1]['label'] = $gLocale->GetStr('ampoliros_settings.tab');
    $logs_main = new AmpolirosLogsMaintenance();
    $cache_main = new AmpolirosCacheMaintenance();
    $gXml_def = '<tab><name>ampoliros</name>
      <args>
        <tabs type="array">' . huixml_encode($tabs) . '</tabs>
        <tabactionfunction>ampoliros_tab_builder</tabactionfunction>
        <activetab>' . (isset($eventData['tab']) ? $eventData['tab'] : '') . '</activetab>
      </args>
      <children>
    
        <vertgroup><name></name>
          <children>
    
            <label><name>tabtitle</name>
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('ampoliros_status.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
        <grid>
          <children>
    
            <label row="0" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('systemlogs_size.label')) . '</label>
              </args>
            </label>
    
            <string row="0" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetSystemLogsSize())) . '</value>
              </args>
            </string>
    
            <button row="0" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_systemlogs')))) . '</action>
              </args>
            </button>
    
            <label row="1" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('siteslogs_size.label')) . '</label>
              </args>
            </label>
    
            <string row="1" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetSitesLogsSize())) . '</value>
              </args>
            </string>
    
            <button row="1" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_siteslogs')))) . '</action>
              </args>
            </button>
    
            <label row="2" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('cache_size.label')) . '</label>
              </args>
            </label>
    
            <string row="2" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetCacheSize())) . '</value>
              </args>
            </string>
    
            <button row="2" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_cache')))) . '</action>
              </args>
            </button>
    
            <label row="3" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('sessions_size.label')) . '</label>
              </args>
            </label>
    
            <string row="3" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetSessionsSize())) . '</value>
              </args>
            </string>
    
            <button row="3" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_sessions')))) . '</action>
              </args>
            </button>
    
            <label row="4" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('pidfiles_size.label')) . '</label>
              </args>
            </label>
    
            <string row="4" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetPidFilesSize())) . '</value>
              </args>
            </string>
    
            <button row="4" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_pidfiles')))) . '</action>
              </args>
            </button>
    
            <label row="5" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('tempdirs_size.label')) . '</label>
              </args>
            </label>
    
            <string row="5" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetAmpTempDirsSize())) . '</value>
              </args>
            </string>
    
            <button row="5" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_tempdirs')))) . '</action>
              </args>
            </button>
    
            <label row="6" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('clipboard_size.label')) . '</label>
              </args>
            </label>
    
            <string row="6" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetClipboardSize())) . '</value>
              </args>
            </string>
    
            <button row="6" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_clipboard')))) . '</action>
              </args>
            </button>
    
            <label row="7" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('cleanable_size.label')) . '</label>
              </args>
            </label>
    
            <string row="7" col="1">
              <args>
                <size>15</size>
                <readonly>true</readonly>
                <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetCleanableDiskSize() + $cache_main->GetCleanableDiskSize())) . '</value>
              </args>
            </string>
    
            <button row="7" col="2">
              <args>
                <themeimage>editdelete</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('clearall.label')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_all')))) . '</action>
              </args>
            </button>
    
          </children>
        </grid>
    
          </children>
        </vertgroup>
    
        <vertgroup><name></name>
          <children>
    
            <label><name>tabtitle</name>
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('ampoliros_settings.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <form><name>settings</name>
              <args>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'set_ampoliros')))) . '</action>          </args>
              <children>
        <vertgroup>
          <children>
        <grid>
          <children>
    
            <label row="0" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('action_clean.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <label row="0" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('action_rotate.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <label row="0" col="2">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('action_none.label')) . '</label>
                <bold>true</bold>
              </args>
            </label>
    
            <radio row="1" col="0" halign="center"><name>amplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanAmpLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="1" col="1" halign="center"><name>amplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateAmpLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="1" col="2" halign="center"><name>amplog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanAmpLog() or $logs_main->GetRotateAmpLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="1" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('amplog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="2" col="0" halign="center"><name>ampdblog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanAmpDbLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="2" col="1" halign="center"><name>ampdblog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateAmpDbLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="2" col="2" halign="center"><name>ampdblog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanAmpDbLog() or $logs_main->GetRotateAmpDbLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="2" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('ampdblog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="3" col="0" halign="center"><name>accesslog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanAccessLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="3" col="1" halign="center"><name>accesslog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateAccessLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="3" col="2" halign="center"><name>accesslog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanAccessLog() or $logs_main->GetRotateAccessLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="3" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('accesslog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="4" col="0" halign="center"><name>remotelog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanRemoteLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="4" col="1" halign="center"><name>remotelog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateRemoteLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="4" col="2" halign="center"><name>remotelog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanRemoteLog() or $logs_main->GetRotateRemoteLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="4" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('remotelog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="5" col="0" halign="center"><name>phplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanPhpLog() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="5" col="1" halign="center"><name>phplog</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotatePhpLog() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="5" col="2" halign="center"><name>phplog</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanPhpLog() or $logs_main->GetRotatePhpLog()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="5" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('phplog_size.label')) . '</label>
              </args>
            </label>
    
            <radio row="6" col="0" halign="center"><name>siteslogs</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetCleanSitesLogs() ? 'true' : 'false') . '</checked>
                <value>clean</value>
              </args>
            </radio>
    
            <radio row="6" col="1" halign="center"><name>siteslogs</name>
              <args>
                <disp>action</disp>
                <checked>' . ($logs_main->GetRotateSitesLogs() ? 'true' : 'false') . '</checked>
                <value>rotate</value>
              </args>
            </radio>
    
            <radio row="6" col="2" halign="center"><name>siteslogs</name>
              <args>
                <disp>action</disp>
                <checked>' . (($logs_main->GetCleanSitesLogs() or $logs_main->GetRotateSitesLogs()) ? 'false' : 'true') . '</checked>
                <value>leave</value>
              </args>
            </radio>
    
            <label row="6" col="3">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('siteslogs_size.label')) . '</label>
              </args>
            </label>
    
          </children>
        </grid>
    
        <horizbar/>
    
        <grid>
          <children>
            <checkbox row="0" col="0"><name>cache</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanCache() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="0" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('cache_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="1" col="0"><name>sessions</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanSessions() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="1" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('sessions_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="2" col="0"><name>pidfiles</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanPidFiles() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="2" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('pidfiles_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="3" col="0"><name>amptempdirs</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanAmpTempDirs() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="3" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('tempdirs_size.label')) . '</label>
              </args>
            </label>
    
            <checkbox row="4" col="0"><name>clipboard</name>
              <args>
                <disp>action</disp>
                <checked>' . ($cache_main->GetCleanClipboard() ? 'true' : 'false') . '</checked>
              </args>
            </checkbox>
    
            <label row="4" col="1">
              <args>
                <label type="encoded">' . urlencode($gLocale->GetStr('clipboard_size.label')) . '</label>
              </args>
            </label>
    
          </children>
        </grid>
    
          </children>
        </vertgroup>
    
              </children>
            </form>
    
            <horizbar/>
    
            <button>
              <args>
                <themeimage>button_ok</themeimage>
                <label type="encoded">' . urlencode($gLocale->GetStr('apply.button')) . '</label>
                <horiz>true</horiz>
                <frame>false</frame>
                <formsubmit>settings</formsubmit>
                <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'set_ampoliros')))) . '</action>
              </args>
            </button>
    
          </children>
        </vertgroup>
    
      </children>
    </tab>';
    $gPage_title .= ' - ' . $gLocale->GetStr('ampoliros.title');
}
function main_moduleversions($eventData)
{
    global $gEnv, $gLocale, $gXml_def, $gPage_title, $gToolbars;
    OpenLibrary('modules.library');
    $ac_remote = new AmpCentralRemoteServer($gEnv['root']['db'], $eventData['id']);
    $avail_reps = $ac_remote->ListAvailableRepositories(isset($eventData['refresh']) ? true : false);
    $avail_mods = $ac_remote->ListAvailableModules($eventData['repid'], isset($eventData['refresh']) ? true : false);
    $mod_versions = $ac_remote->ListAvailableModuleVersions($eventData['repid'], $eventData['moduleid'], isset($eventData['refresh']) ? true : false);
    $x_account = new XmlRpcAccount($gEnv['root']['db'], $ac_remote->mAccountId);
    $headers[0]['label'] = $gLocale->GetStr('version.header');
    $headers[1]['label'] = $gLocale->GetStr('dependencies.header');
    $headers[2]['label'] = $gLocale->GetStr('installed_version.header');
    $gXml_def = '<vertgroup><name>modules</name>
  <children>
    <label><name>title</name>
      <args>
        <bold>true</bold>
        <label type="encoded">' . urlencode($x_account->mName . ' - ' . $avail_reps[$eventData['repid']]['name'] . ' - ' . $avail_mods[$eventData['moduleid']]['modid']) . '</label>
      </args>
    </label>
    <table><name>modules</name>
      <args>
        <headers type="array">' . huixml_encode($headers) . '</headers>
        <rowsperpage>10</rowsperpage>
        <pagesactionfunction>repmodules_list_action_builder</pagesactionfunction>
        <pagenumber>' . (isset($eventData['pagenumber']) ? $eventData['pagenumber'] : '') . '</pagenumber>
        <sessionobjectusername>' . $eventData['id'] . '-' . $eventData['repid'] . '-' . $eventData['moduleid'] . '</sessionobjectusername>
      </args>
      <children>';
    $row = 0;
    $mod_query =& $gEnv['root']['db']->Execute('SELECT modversion ' . 'FROM modules ' . 'WHERE modid=' . $gEnv['root']['db']->Format_Text($avail_mods[$eventData['moduleid']]['modid']));
    while (list($version, $data) = each($mod_versions)) {
        if (strlen($data['dependencies'])) {
            $mod_deps = new ModuleDep($gEnv['root']['db']);
            $dep_check = $mod_deps->CheckModuleDeps(0, '', $mod_deps->ExplodeDeps($data['dependencies']));
        } else {
            $dep_check = false;
        }
        if ($mod_query->NumRows()) {
            $current_version = $mod_query->Fields('modversion');
        } else {
            $current_version = $gLocale->GetStr('none_version.label');
        }
        if ($dep_check == false) {
            $mod_installable = true;
            $missing_deps = '';
            if ($mod_query->NumRows()) {
                switch (CompareVersionNumbers($version, $current_version)) {
                    case AMPOLIROS_VERSIONCOMPARE_EQUAL:
                        $label = $gLocale->GetStr('reinstall_module.button');
                        $icon = 'reload';
                        break;
                    case AMPOLIROS_VERSIONCOMPARE_MORE:
                        $label = $gLocale->GetStr('update_module.button');
                        $icon = 'folder_new';
                        break;
                    case AMPOLIROS_VERSIONCOMPARE_LESS:
                        $label = $gLocale->GetStr('downgrade_module.button');
                        $icon = 'down';
                        break;
                }
            } else {
                $label = $gLocale->GetStr('install_module.button');
                $icon = 'folder';
            }
        } else {
            $mod_installable = false;
            $missing_deps = '<br><strong>' . $gLocale->GetStr('missing_deps.label') . '</strong>';
            while (list(, $dep) = each($dep_check)) {
                $missing_deps .= '<br>' . $dep;
            }
        }
        $toolbars = array();
        if ($mod_installable) {
            $toolbars['main']['install'] = array('label' => $label, 'themeimage' => $icon, 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'repositorymodules', array('id' => $eventData['id'], 'repid' => $eventData['repid'])), array('action', 'installmodule', array('id' => $eventData['id'], 'repid' => $eventData['repid'], 'moduleid' => $eventData['moduleid'], 'version' => $version)))));
        }
        $gXml_def .= '<label row="' . $row . '" col="0"><name>version</name>
  <args>
    <label type="encoded">' . urlencode($version) . '</label>
  </args>
</label>

<label row="' . $row . '" col="1"><name>dependencies</name>
  <args>
    <label type="encoded">' . urlencode(str_replace(',', '<br>', $data['dependencies']) . (strlen($data['suggestions']) ? '<br><br><strong>' . $gLocale->GetStr('suggestions.label') . '</strong><br>' . str_replace(',', '<br>', $data['suggestions']) . '<br>' : '') . $missing_deps) . '</label>
  </args>
</label>

<label row="' . $row . '" col="2"><name>current</name>
  <args>
    <label type="encoded">' . urlencode($current_version) . '</label>
  </args>
</label>

<amptoolbar row="' . $row . '" col="3"><name>tb</name>
  <args>
    <frame>false</frame>
    <toolbars type="array">' . huixml_encode($toolbars) . '</toolbars>
  </args>
</amptoolbar>';
        $row++;
    }
    $gXml_def .= '      </children>
    </table>
  </children>
</vertgroup>';
    $gToolbars['reptools'] = array('refresh' => array('label' => $gLocale->GetStr('refresh.button'), 'themeimage' => 'reload', 'horiz' => 'true', 'action' => build_events_call_string('', array(array('main', 'moduleversions', array('id' => $eventData['id'], 'repid' => $eventData['repid'], 'moduleid' => $eventData['moduleid'], 'refresh' => '1'))))));
    $gPage_title .= ' - ' . $gLocale->GetStr('moduleversions.title');
}
Пример #16
0
function show_module_action_builder($pageNumber)
{
    $tmp_main_disp = new HuiDispatcher('main');
    $event_data = $tmp_main_disp->GetEventData();
    return build_events_call_string('', array(array('main', 'showmodule', array('pagenumber' => $pageNumber, 'modid' => $event_data['modid']))));
}