Esempio n. 1
0
foreach ($HostsIDs as $HostID) {
    #-----------------------------------------------------------------------------
    $Path = SPrintF('%s/hosts/%s/comp/Statistics', SYSTEM_PATH, $HostID);
    #-----------------------------------------------------------------------------
    if (!File_Exists($Path)) {
        continue;
    }
    #-----------------------------------------------------------------------------
    $Files = IO_Scan($Path);
    if (Is_Error($Files)) {
        return ERROR | @Trigger_Error(500);
    }
    #-----------------------------------------------------------------------------
    foreach ($Files as $File) {
        #---------------------------------------------------------------------------
        $StatisticID = SubStr($File, 0, StriPos($File, '.'));
        #---------------------------------------------------------------------------
        $Comp = Comp_Load(SPrintF('Statistics/%s', $StatisticID), $IsCreate);
        if (Is_Error($Comp)) {
            return ERROR | @Trigger_Error(500);
        }
        #---------------------------------------------------------------------------
        $Input = Comp_Load('Form/Input', array('type' => 'checkbox', 'name' => 'StatisticsIDs[]', 'value' => $StatisticID, 'id' => $StatisticID));
        if (Is_Error($Input)) {
            return ERROR | @Trigger_Error(500);
        }
        #---------------------------------------------------------------------------
        $Table[] = array(new Tag('SPAN', array('style' => 'cursor:pointer;', 'onclick' => SPrintF('ChangeCheckBox(\'%s\'); return false;', $StatisticID)), $Comp['Title']), $Input);
    }
}
#-------------------------------------------------------------------------------
Esempio n. 2
0
 foreach ($HostsIDs as $HostID) {
     #---------------------------------------------------------------------------
     $Folder = SPrintF('%s/hosts/%s/comp/Widgets/%s', SYSTEM_PATH, $HostID, $Interface);
     #---------------------------------------------------------------------------
     if (!File_Exists($Folder)) {
         continue;
     }
     #---------------------------------------------------------------------------
     $Files = IO_Scan($Folder);
     if (Is_Error($Files)) {
         return ERROR | @Trigger_Error(500);
     }
     #---------------------------------------------------------------------------
     foreach ($Files as $File) {
         #-------------------------------------------------------------------------
         $WidgetID = SubStr($File, 0, StriPos($File, '.'));
         #-------------------------------------------------------------------------
         $Comp = Comp_Load(SPrintF('Widgets/%s/%s', $Interface, $WidgetID));
         if (Is_Error($Comp)) {
             return ERROR | @Trigger_Error(500);
         }
         #-------------------------------------------------------------------------
         if (Is_Array($Comp)) {
             #-----------------------------------------------------------------------
             $Comp = Comp_Load('Widget', Md5($WidgetID), $Comp['Title'], $Comp['DOM']);
             if (Is_Error($Comp)) {
                 return ERROR | @Trigger_Error(500);
             }
             #-----------------------------------------------------------------------
             $Td->AddChild($Comp);
         }
Esempio n. 3
0
 foreach ($HostsIDs as $HostID) {
     #-------------------------------------------------------------------------------
     $Folder = SPrintF('%s/hosts/%s/comp/Notes/%s', SYSTEM_PATH, $HostID, $Interface);
     #-------------------------------------------------------------------------------
     if (!File_Exists($Folder)) {
         continue;
     }
     #-------------------------------------------------------------------------------
     $Files = IO_Scan($Folder);
     if (Is_Error($Files)) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------------
     foreach ($Files as $File) {
         #-------------------------------------------------------------------------------
         $Path = SPrintF('Notes/%s/%s', $Interface, SubStr($File, 0, StriPos($File, '.')));
         #-------------------------------------------------------------------------------
         $CacheID = Md5($Path . $GLOBALS['__USER']['ID']);
         #-------------------------------------------------------------------------------
         $Result = CacheManager::get($CacheID);
         #-------------------------------------------------------------------------------
         if ($Result) {
             #-------------------------------------------------------------------------------
             $Notes = $Result;
             #-------------------------------------------------------------------------------
         } else {
             #-------------------------------------------------------------------------------
             $Notes = Comp_Load($Path);
             if (Is_Error($Notes)) {
                 return ERROR | @Trigger_Error(500);
             }
Esempio n. 4
0
foreach ($HostsIDs as $HostID) {
    #-------------------------------------------------------------------------------
    $Folder = SPrintF('%s/hosts/%s/comp/Dispatch', SYSTEM_PATH, $HostID);
    #-------------------------------------------------------------------------------
    if (!File_Exists($Folder)) {
        continue;
    }
    #-------------------------------------------------------------------------------
    $Files = IO_Scan($Folder);
    if (Is_Error($Files)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    foreach ($Files as $File) {
        #-------------------------------------------------------------------------------
        $FileID = SubStr($File, 0, StriPos($File, '.'));
        #-------------------------------------------------------------------------------
        $Adding = Comp_Load(SPrintF('Dispatch/%s', $FileID));
        if (Is_Error($Adding)) {
            return ERROR | @Trigger_Error(500);
        }
        #-------------------------------------------------------------------------------
        if ($Adding) {
            #-------------------------------------------------------------------------------
            foreach (Array_Keys($Adding) as $FilterID) {
                #-------------------------------------------------------------------------------
                $Filter =& $Adding[$FilterID];
                #-------------------------------------------------------------------------------
                if (Is_Array($Filter)) {
                    $Filter['Dispatch'] = $FileID;
                }