Changeset 579


Ignore:
Timestamp:
Oct 11, 2013, 11:28:10 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Vylepšena třída Config. Měla by později umět ukládat jak do souborů tak do databáze.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/AppModule.php

    r576 r579  
    4242  function Install()
    4343  {
     44        $this->Installed = true;
    4445  }
    4546 
    4647  function Uninstall()
    4748  {
     49        $this->Installed = false;
    4850  }
    4951 
    5052  function Start()
    5153  {
     54        $this->Running = true;
    5255  }
    5356 
    5457  function Stop()
    5558  {
     59        $this->Running = false;
    5660  }
    5761}
     
    7478    {
    7579      //DebugLog('Init module '.$Module->Name);
    76       $this->Modules[$Index]->Start();
     80      if($this->Modules[$Index]->Running == false)
     81        $this->Modules[$Index]->Start();
    7782    }
    7883  }
     
    8388    {
    8489      //DebugLog('Init module '.$Module->Name);
    85       $this->Modules[$Index]->Stop();
     90      if($this->Modules[$Index]->Running == true)
     91        $this->Modules[$Index]->Stop();
    8692    }
    8793  }
  • trunk/Common/Config.php

    r565 r579  
    77  function ReadValue($Name)
    88  {
    9     return($this->Data[$Name]); 
     9        if(!is_array($Name)) $Name = explode('/', $Name);
     10        $Last = array_pop($Name);
     11        $Data = &$this->Data;
     12        foreach($Name as $Item)
     13        {
     14                $Data = &$Data[$Item];
     15        }
     16    return($Data[$Last]); 
    1017  }
    1118 
    1219  function WriteValue($Name, $Value)
    1320  {
    14     $this->Data[$Name] = $Value;
     21        if(!is_array($Name)) $Name = explode('/', $Name);
     22        $Last = array_pop($Name);
     23        $Data = &$this->Data;
     24        foreach($Name as $Item)
     25        {
     26                $Data = &$Data[$Item];
     27        }
     28    $Data[$Item] = $Value;
    1529  }
    1630 
    1731  function OpenFile($FileName)
    1832  {
     33        $ConfigData = array();
    1934    include $FileName;
    20     $this->Data = $ConfigData;
     35    foreach($this->Data as $Index => $Item)
     36    {
     37        if(array_key_exits($Index, $ConfigData))
     38        $this->Data[$Index] = $ConfigData[$Index];
     39    }
    2140  }
    2241 
     
    2544    file_put_content("<?php \n\n\$ConfigData = ".var_export($this->Data).";\n");
    2645  }
     46 
     47  function GetAsArray()
     48  {
     49        return($this->Data);
     50  }
    2751}
  • trunk/Common/Mail.php

    r548 r579  
    5656  }
    5757
    58   function AddBcc($bcc)
     58  function AddBcc($Address, $Name)
    5959  {
    6060    $this->Recipients[] = array('Address' => $Address, 'Name' => $Name, 'Type' => 'HiddenCopy');
  • trunk/Modules/WebCam/WebCam.php

    r577 r579  
    2828
    2929        // Reload the image every defined period
    30         theTimer = setTimeout("reloadImage()", '.($Config['Web']['WebcamRefresh'] * 1000).');
     30        theTimer = setTimeout("reloadImage()", '.($this->System->Config['Web']['WebcamRefresh'] * 1000).');
    3131      }
    3232      </script>';
    3333
    34       $Output .= '<br /><div align="center"><img name="theImage" src="" idth="640" height="480" alt="Webcam image"><br>Poslední aktualizace: '.date('j.n.Y G:i', filemtime($this->System->Modules['Webcam']->ImageFileName)).'<br>Obnovování po '.$Config['Web']['WebcamRefresh'].' sekundách</div><br />';
     34      $Output .= '<br /><div align="center"><img name="theImage" src="" idth="640" height="480" alt="Webcam image"><br>Poslední aktualizace: '.date('j.n.Y G:i', filemtime($this->System->Modules['Webcam']->ImageFileName)).'<br>Obnovování po '.$this->System->Config['Web']['WebcamRefresh'].' sekundách</div><br />';
    3535    } else $Output = '<br />Obrázek nenalezen.<br /><br />';
    3636
  • trunk/Modules/WebCam/webcam_refresh.php

    r548 r579  
    11<?php
    2 include('../global.php');
     2include('../../Common/Global.php');
    33
    44$Config['Web']['ShowPHPError'] = true;
Note: See TracChangeset for help on using the changeset viewer.