Changeset 838 for trunk/Modules/Export


Ignore:
Timestamp:
Jan 9, 2016, 11:45:01 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Some libraries moved to Common package located at Packages directory.
  • Modified: Application class System renamed to Core. System class is not just basic parent class for application.
  • Fixed: alert file now use same application class as other files.
  • Modified: Error application module.
Location:
trunk/Modules/Export
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/Export.php

    r816 r838  
    1616  function Init()
    1717  {
    18     $this->TempDir = dirname(__FILE__).'/../../'.$this->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
     18    $this->TempDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
    1919    if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
    20     $this->TempDirRelative = $this->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
    21     $this->SourceDir = dirname(__FILE__).'/../../'.$this->Config['Web']['SourceFolder'];
    22     $this->SourceDirRelative = $this->Config['Web']['SourceFolder'];
     20    $this->TempDirRelative = $this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
     21    $this->SourceDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['SourceFolder'];
     22    $this->SourceDirRelative = $this->System->Config['Web']['SourceFolder'];
    2323    if(!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true);
    2424  }
     
    161161      "-- ===========================================\n".
    162162      "--\n".
    163       "-- Web projektu: ".$this->Config['Web']['Host'].$this->System->Link('/')."\n".
     163      "-- Web projektu: ".$this->System->Config['Web']['Host'].$this->System->Link('/')."\n".
    164164      "-- Datum exportu: ".date("j.n.Y  H:i:s")."\n".
    165       "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n".
     165      "-- Znaková sada: ".$this->System->Config['Database']['Charset']." / ".$this->System->Config['Web']['Charset']."\n".
    166166      "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n".
    167167      "-- Vygeneroval uživatel: ".$this->System->User->Name."\n".
     
    229229    /*
    230230    // Data to aowow
    231     $Database2 = new mysqli($this->Config['Database']['Host'], $this->Config['Database']['User'], $this->Config['Database']['Password'], $this->Config['Database']['Database']);
    232     $Database2->query('SET NAMES '.$this->Config['Database']['Charset']);
     231    $Database2 = new mysqli($this->System->Config['Database']['Host'],
     232      $this->System->Config['Database']['User'],
     233      $this->System->Config['Database']['Password'],
     234      $this->System->Config['Database']['Database']);
     235    $Database2->query('SET NAMES '.$this->System->Config['Database']['Charset']);
    233236    $Database2->select_db($AoWoWconf['mangos']['db']);
    234237    $AoWoWTables = array(
     
    256259        {
    257260          $DbResult2 = $Database2->query('SELECT `OptionText` AS `En`,
    258           (SELECT `OptionText` FROM `'.$this->Config['Database']['Database'].'`.`TextNPCOption` AS `TableTran`
     261          (SELECT `OptionText` FROM `'.$this->System->Config['Database']['Database'].'`.`TextNPCOption` AS `TableTran`
    259262           WHERE `TableEn`.`Entry` = `TableTran`.`Entry` AND (`Complete` = 1) AND '.$this->WhereLang.'
    260263            AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `Tran`
    261           FROM `'.$this->Config['Database']['Database'].'`.`TextNPCOption` AS `TableEn` WHERE
     264          FROM `'.$this->System->Config['Database']['Database'].'`.`TextNPCOption` AS `TableEn` WHERE
    262265            `OptionText` = "'.addslashes($Ori_text).'" LIMIT 1');
    263266          $Tran = $DbResult2->fetch_assoc();
     
    646649    "<document>\n".
    647650    "  <meta>\n".
    648     "    <projecturl>".$this->Config['Web']['Host'].$this->System->Link('/')."</projecturl>\n".
     651    "    <projecturl>".$this->System->Config['Web']['Host'].$this->System->Link('/')."</projecturl>\n".
    649652    "    <time>".date('r')."</time>\n".
    650653    "    <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n".
     
    696699class ModuleExport extends AppModule
    697700{
    698   function __construct($System)
     701  function __construct(System $System)
    699702  {
    700703    parent::__construct($System);
     
    707710  }
    708711
    709   function Start()
     712  function DoStart()
    710713  {
    711714    $this->System->RegisterPage('export', 'PageExport');
  • trunk/Modules/Export/Page.php

    r816 r838  
    9696            '<tr><td colspan="2"><input type="submit" value="'.T('Create').'" /></td></tr>'.
    9797            '</table></fieldset></form>';
    98       } else $Output = ShowMessage(T('You can\'t create another export. Max for one user is').$this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);
     98      } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'), $this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL);
    9999    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    100100    return($Output);
     
    117117          $_GET['Filter'] = 'my';
    118118          $this->ExportList();
    119         } else $Output = ShowMessage(T('You can\'t create another export. Max for one user is').' '.$this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);
     119        } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'),$this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL);
    120120      } else $Output = ShowMessage(T('Missing data in form.'), MESSAGE_CRITICAL);
    121121    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
     
    800800            $this->ExportList();
    801801          } else $Output = ShowMessage('Zdrojový export nenalezen', MESSAGE_CRITICAL);
    802         } else $Output = ShowMessage('Nemůžete vytvářet další export. Max. počet na uživatele je '.
    803           $this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);
     802        } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'),
     803          $this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL);
    804804      } else $Output = ShowMessage(T('Export not found.'), MESSAGE_CRITICAL);
    805805    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
  • trunk/Modules/Export/ProcessAoWoWExport.php

    r816 r838  
    88include_once('Page.php');
    99
    10   $System = new System();
    11   $System->DoNotShowPage = true;
    12     $System->Run();
     10$System = new Core();
     11$System->DoNotShowPage = true;
     12$System->Run();
    1313
    1414$Output = '';
  • trunk/Modules/Export/ProcessTask.php

    r826 r838  
    1010
    1111//LoadCommandLineParameters();
    12 $System = new System();
     12$System = new Core();
    1313$System->DoNotShowPage = true;
    1414$System->Run();
  • trunk/Modules/Export/Progress.php

    r818 r838  
    33include_once(dirname(__FILE__).'/../../includes/global.php');
    44
    5 $System = new System();
     5$System = new Core();
    66$System->DoNotShowPage = true;
    77$System->Run();
  • trunk/Modules/Export/cmdmpqexport.php

    r816 r838  
    88include_once('Page.php');
    99
    10   $System = new System();
    11   $System->DoNotShowPage = true;
    12     $System->Run();
     10$System = new Core();
     11$System->DoNotShowPage = true;
     12$System->Run();
    1313$PageExport = new PageExport($System);
    1414
Note: See TracChangeset for help on using the changeset viewer.