Changeset 22


Ignore:
Timestamp:
Oct 22, 2008, 11:44:32 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Optimalizace načítání obslužných tříd typů "na požádání".
  • Upraveno: Načítání znakových převodních tabulek "na požádání".
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • base.php

    r21 r22  
    477477function GetTypeDefinition($Id)
    478478{
    479   global $Database, $Types;
     479  global $Database, $Types, $TypeDefinitionList;
    480480
    481481  if(!array_key_exists($Id, $Types))
     
    499499        $DbRow['BaseType'] = $ParentType['Name'];
    500500      }
     501      if(!array_key_exists($DbRow['BaseType'], $TypeDefinitionList))
     502      {
     503        $ClassName = 'Type'.$DbRow['BaseType'];
     504        $TypeDefinitionList[$DbRow['BaseType']] = new $ClassName;
     505      }
     506      $DbRow['Class'] = &$TypeDefinitionList[$DbRow['BaseType']];
    501507      $Types[$DbRow['ItemId']] = $DbRow;
    502508    } else $Types[$DbRow['ItemId']] = NULL;
     
    514520function ExecuteTypeEvent($Type, $Event, $Parameters)
    515521{
    516   global $TypeDefinitionList;
    517 
    518522  $TypeDefinition = GetTypeDefinition($Type);
    519   $TypeObject = $TypeDefinitionList[$TypeDefinition['BaseType']];
     523  $TypeObject = $TypeDefinition['Class'];
    520524  if(is_callable(array($TypeObject, $Event))) return($TypeObject->$Event($Parameters));
    521525    else return($TypeDefinition['BaseType'].'->'.$Event.'('.$Type.')');
  • code.php

    r8 r22  
    3030  character in ISO8859-2/Windows1250 and value is its two byte representation in UTF-8
    3131*/
     32
     33function DefineCharTable()
     34{
     35  global $CharTable;
    3236
    3337$CharTable = array(
     
    520524  ),
    521525);
    522 
     526}
    523527
    524528function ToUTF8($String, $Charset = 'iso2')
     
    526530  global $CharTable;
    527531
     532  if(!isset($CharTable)) DefineCharTable();
    528533  $Result = '';
    529534  for($I = 0; $I < strlen($String); $I++)
     
    542547  global $CharTable;
    543548
     549  if(!isset($CharTable)) DefineCharTable();
    544550  $Result = '';
    545551  $UTFPrefix = '';
  • index.php

    r21 r22  
    100100$System->AddModule(new IndexPage());
    101101$System->Modules['IndexPage']->GetOutput();
     102//var_dump(get_defined_vars());
     103//print_r($_GLOBAL);
    102104
    103105?>
  • types/Boolean.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['Boolean'] = new TypeBoolean;
    24 
    2523?>
  • types/Date.php

    r19 r22  
    5252}
    5353
    54 $TypeDefinitionList['Date'] = new TypeDate;
    55 
    5654?>
  • types/DateTime.php

    r19 r22  
    8181}
    8282
    83 $TypeDefinitionList['DateTime'] = new TypeDateTime;
    84 
    8583?>
  • types/Enumeration.php

    r21 r22  
    2929}
    3030
    31 $TypeDefinitionList['Enumeration'] = new TypeEnumeration;
    32 
    3331?>
  • types/File/File.php

    r19 r22  
    4545}
    4646
    47 $TypeDefinitionList['File'] = new TypeFile;
    48 
    4947?>
  • types/Float.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['Float'] = new TypeFloat;
    24 
    2523?>
  • types/GPS.php

    r19 r22  
    6969}
    7070
    71 $TypeDefinitionList['GPS'] = new TypeGPS;
    72 
    7371?>
  • types/Hidden.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['Hidden'] = new TypeHidden;
    24 
    2523?>
  • types/Hyperlink.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['Hyperlink'] = new TypeHyperlink;
    24 
    2523?>
  • types/IPv4Address.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['TypeIPv4Address'] = new TypeIPv4Address;
    24 
    2523?>
  • types/Integer.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['Integer'] = new TypeInteger;
    24 
    2523?>
  • types/Password.php

    r19 r22  
    3838}
    3939
    40 $TypeDefinitionList['Password'] = new TypePassword;
    41 
    4240?>
  • types/PointerOneToMany.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['PointerOneToMany'] = new TypePointerOneToMany;
    24 
    2523?>
  • types/PointerOneToOne.php

    r21 r22  
    7979}
    8080
    81 $TypeDefinitionList['PointerOneToOne'] = new TypePointerOneToOne;
    82 
    8381?>
  • types/String.php

    r19 r22  
    2121}
    2222
    23 $TypeDefinitionList['String'] = new TypeString;
    24 
    2523?>
Note: See TracChangeset for help on using the changeset viewer.