00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 include_once( "lib/ezi18n/classes/eztranslatorhandler.php" );
00042
00043 class eZTranslatorGroup extends eZTranslatorHandler
00044 {
00045
00046
00047
00048 function eZTranslatorGroup( $is_key_based )
00049 {
00050 $this->eZTranslatorHandler( $is_key_based );
00051 $this->Handlers = array();
00052 }
00053
00054
00055
00056
00057
00058
00059
00060 function findKey( $key )
00061 {
00062 $num = $this->keyPick( $key );
00063 if ( $num >=0 and $num <= count( $this->Handlers ) )
00064 {
00065 $handler = $this->Handlers[$num];
00066 return $handler->findKey( $key );
00067 }
00068 $retValue = null;
00069 return $retValue;
00070 }
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 function findMessage( $context, $source, $comment = null )
00081 {
00082 $num = $this->pick( $context, $source, $comment );
00083 if ( $num >=0 and $num <= count( $this->Handlers ) )
00084 {
00085 $handler = $this->Handlers[$num];
00086 return $handler->findMessage( $context, $source, $comment );
00087 }
00088 $retValue = null;
00089 return $retValue;
00090 }
00091
00092
00093
00094
00095
00096
00097
00098 function translate( $context, $source, $comment = null )
00099 {
00100 $num = $this->pick( $context, $source, $comment );
00101 if ( $num >=0 and $num <= count( $this->Handlers ) )
00102 {
00103 $handler = $this->Handlers[$num];
00104 return $handler->translate( $context, $source, $comment );
00105 }
00106
00107 return null;
00108 }
00109
00110
00111
00112
00113
00114
00115
00116 function keyTranslate( $key )
00117 {
00118 $num = $this->keyPick( $key );
00119 if ( $num >=0 and $num <= count( $this->Handlers ) )
00120 {
00121 $handler = $this->Handlers[$num];
00122 return $handler->keyTranslate( $key );
00123 }
00124
00125 return null;
00126 }
00127
00128
00129
00130
00131
00132
00133
00134 function keyPick( $key )
00135 {
00136 }
00137
00138
00139
00140
00141
00142
00143
00144 function pick( $context, $source, $comment )
00145 {
00146 }
00147
00148
00149
00150
00151 function handlerCount()
00152 {
00153 return count( $this->Handlers );
00154 }
00155
00156
00157
00158
00159 function registerHandler( &$handler )
00160 {
00161 if ( !$this->isKeyBased() and $handler->isKeyBased() )
00162 {
00163 eZDebug::writeError( "Cannot register keybased handler for non-keybased group", "eZTranslatorGroup" );
00164 return false;
00165 }
00166 $this->Handlers[] =& $handler;
00167 return true;
00168 }
00169
00170
00171
00172 var $Handlers;
00173 }
00174
00175 ?>