Changeset 506


Ignore:
Timestamp:
Apr 1, 2013, 10:17:42 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Aktuality přepracovány na aplikační modul.
Location:
trunk
Files:
3 added
6 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r505 r506  
    2222include_once(dirname(__FILE__).'/Page.php');
    2323include_once(dirname(__FILE__).'/Form/Form.php');
    24 include_once(dirname(__FILE__).'/../aktuality/news.php');
    2524include_once(dirname(__FILE__).'/../finance/bills.php');
    2625include_once(dirname(__FILE__).'/../finance/finance.php');
     
    4342include_once(dirname(__FILE__).'/../Modules/FinanceBankAPI/FinanceBankAPI.php');
    4443include_once(dirname(__FILE__).'/../Modules/NetworkShare/NetworkShare.php');
     44include_once(dirname(__FILE__).'/../Modules/News/News.php');
    4545
    4646class System extends Module
     
    194194  $System->AddModule(new User());
    195195  if(isset($_SERVER['REMOTE_ADDR'])) $System->Modules['User']->Check();
    196   $System->AddModule(new News());
    197196  $System->AddModule(new Bill());
    198197  $System->AddModule(new Finance());
     
    215214  $System->ModuleManager->RegisterModule(new ModuleFinanceBankAPI($System));
    216215  $System->ModuleManager->RegisterModule(new ModuleNetworkShare($System));
     216  $System->ModuleManager->RegisterModule(new ModuleNews($System));
    217217  $System->ModuleManager->StartAll();
    218218}
  • trunk/Modules/File/File.php

    r505 r506  
    1313  function Delete($Id)
    1414  {
    15     global $Config;
    16    
    1715    $DbResult = $this->Database->select('File', 'Name', 'Id='.$Id);
    1816    if($DbResult->num_rows > 0)
     
    2624  function CreateFromUpload($Name)
    2725  {
    28     global $Config;
    29    
    3026    // Submited form with file input have to be enctype="multipart/form-data"
    3127    $Result = 0;
     
    3733        $this->Database->query('INSERT INTO File (`Name`, `Size`) VALUES ("'.$FileName.'", '.filesize($_FILES[$Name]['tmp_name']).')');
    3834        $InsertId = $this->Database->insert_id;
    39         if(move_uploaded_file($_FILES[$Name]['tmp_name'], $Config['Web']['UploadFileFolder'].'/'.$InsertId.'_'.$FileName)) $Result = $InsertId;
     35        if(move_uploaded_file($_FILES[$Name]['tmp_name'], $this->FilesDir.'/'.$InsertId.'_'.$FileName)) $Result = $InsertId;
    4036      }
    4137    }
     
    5450  function Download($Id)
    5551  {
    56     global $Config;
    57    
    5852    $DbResult = $this->Database->select('File', '*', 'Id='.addslashes($Id));
    5953    if($DbResult->num_rows > 0)
    6054    {
    6155      $DbRow = $DbResult->fetch_assoc();
    62       //Header('Content-Type: '.$this->DetectMimeType($this->FilesDir.'/'.$DbRow['Name']));
    63       //Header('Content-Disposition: attachment; filename="'.$DbRow['Name'].'"');
    64       print_r($this);
    65       echo(file_get_contents($this->FilesDir.'/'.$DbRow['Name']));
     56      if(file_exists($this->FilesDir.'/'.$DbRow['Name']))
     57      {
     58        Header('Content-Type: '.$this->DetectMimeType($this->FilesDir.'/'.$DbRow['Name']));
     59        Header('Content-Disposition: attachment; filename="'.$DbRow['Name'].'"');
     60        echo(file_get_contents($this->FilesDir.'/'.$DbRow['Name']));
     61      } else echo('Soubor nenalezen!');
    6662    } else echo('Soubor nenalezen!');
    6763  }
  • trunk/Modules/FinanceBankAPI/FioDemo.php

    r505 r506  
    44 
    55$Fio = new FioAPI();
    6 $Fio->Token = 'YEEd9LlZ5SJ5VcxFcdbAwCji6UTtxve2ns5sClfCbii8Taq63uP7JNsa7OeN1Oum';
     6$Fio->Token = '';
    77$Records = $Fio->Import(time() - 3600 * 24 * 31 * 2, time());
    88//print_r($Records);
  • trunk/Modules/Portal/Portal.php

    r501 r506  
    55class PagePortal extends Page
    66{
    7   var $Dependencies = array('News');
    87  var $FullTitle = 'Zděchovský rozcestník';
    98  var $ShortTitle = '';
     
    141140      if($_GET['Action'] == 'CustomizeNewsSave')
    142141      {
    143         $Output .= $this->System->Modules['News']->CustomizeSave();
     142        $Output .= $this->System->ModuleManager->Modules['News']->CustomizeSave();
    144143      } else
    145144      if($_GET['Action'] == 'LoginForm')
     
    334333        } else
    335334        if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());
    336         else if($Panel['Module'] == 'NewsGroupList') $Output .= $this->Panel('Aktuality', $this->System->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>'));
     335        else if($Panel['Module'] == 'NewsGroupList')
     336          $Output .= $this->Panel('Aktuality', $this->System->ModuleManager->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>'));
    337337      }
    338338      $Output .= '</td>';
     
    353353    $this->License = 'GNU/GPLv3';
    354354    $this->Description = 'Community portal.';
    355     $this->Dependencies = array();
     355    $this->Dependencies = array('News');
    356356  } 
    357357
Note: See TracChangeset for help on using the changeset viewer.