Changeset 893 for trunk/includes


Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (21 months ago)
Author:
chronos
Message:
  • Fixed: Class types casting for better type checking.
  • Fixed: XML direct export.
  • Modified: User class instance moved from Core class to ModuleUser class.
Location:
trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/Global.php

    r891 r893  
    118118}
    119119
    120 function GetTranslateGoogle($text, $withouttitle = false)
    121 {
    122   global $System;
    123 
     120function GetTranslateGoogle($System, $text, $withouttitle = false)
     121{
    124122//  $text = 'Balthule\'s letter is dire. This Cult of the Dark Strand is a thorn in my side that must be removed. I have been dealing with some of the Dark Strand scum northeast of here at Ordil\'Aran. One of their number possesses a soul gem that I believe holds the secret to the cult\'s power.$b$bBring it to me, and I will be able to decipher the secrets held within.';
    125123 // $text = htmlspecialchars($text);
     
    130128//  $text = str_replace('&','',$text);
    131129//  $text = str_replace(' ','%20',$text);
    132   $DbResult = $System->Database->select('Language', '`Code`', '`Id`='.$System->User->Language);
     130  $User = ModuleUser::Cast($System->GetModule('User'))->User;
     131  $DbResult = $System->Database->select('Language', '`Code`', '`Id`='.$User->Language);
    133132  $DbRow = $DbResult->fetch_assoc();
    134133  $lang = $DbRow['Code'];
     
    413412{
    414413  global $System;
    415   $TranslationTree = $System->ModuleManager->Modules['Translation']->GetTranslationTree();
     414  $TranslationTree = ModuleTranslation::Cast($System->ModuleManager->GetModule('Translation'))->GetTranslationTree();
    416415
    417416  if (array_key_exists('group', $_GET)) $GroupId = $_GET['group'] * 1;
     
    512511  global $System;
    513512
    514   $TranslationTree = $System->ModuleManager->Modules['Translation']->GetTranslationTree();
     513  $TranslationTree = ModuleTranslation::Cast($System->ModuleManager->GetModule('Translation'))->GetTranslationTree();
    515514
    516515  foreach ($TranslationTree as $TableID => $Value)
  • trunk/includes/PageEdit.php

    r888 r893  
    33class PageEdit extends Page
    44{
    5   var $Table;
    6   var $Definition;
    7   var $ItemActions;
     5  public string $Table;
     6  public string $TableSQL;
     7  public array $Definition;
     8  public array $ItemActions;
     9  public bool $AllowEdit;
    810
    911  function __construct($System)
     
    109111  {
    110112    $Output = '';
    111     if ($this->System->User->Licence(LICENCE_USER))
     113    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
     114    if ($User->Licence(LICENCE_USER))
    112115    {
    113116      if (array_key_exists('finish', $_GET))
     
    140143  function DeleteItem()
    141144  {
    142     if ($this->System->User->Licence(LICENCE_USER))
     145    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
     146    if ($User->Licence(LICENCE_USER))
    143147    {
    144       $this->Database->query('DELETE FROM `'.$this->Table.'` WHERE (`User`='.$this->System->User->Id.') AND (`Id`='.($_GET['id'] * 1).')');
     148      $this->Database->query('DELETE FROM `'.$this->Table.'` WHERE (`User`='.$User->Id.') AND (`Id`='.($_GET['id'] * 1).')');
    145149      $Output = ShowMessage(T('Record removed'));
    146150    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
Note: See TracChangeset for help on using the changeset viewer.