
Öffentliche Methoden | |
| LanguageAction () | |
| add () | |
| addlanguage () | |
| setdefault () | |
| remove () | |
| delete () | |
| save () | |
| listing () | |
| edit () | |
| advanced () | |
| checkmenu ($menu) | |
Öffentliche Attribute | |
| $defaultSubAction = 'listing' | |
| $language | |
| $project | |
Definiert in Zeile 65 der Datei LanguageAction.class.php.
| LanguageAction::add | ( | ) |
Sprache hinzufuegen
Definiert in Zeile 95 der Datei LanguageAction.class.php.
Benutzt $conf und Action::setTemplateVar().
00096 { 00097 global $conf; 00098 $countryList = $conf['countries']; 00099 00100 foreach( $this->project->getLanguageIds() as $id ) 00101 { 00102 if ( $id == $this->language->languageid ) 00103 continue; 00104 00105 $l = new Language( $id ); 00106 $l->load(); 00107 00108 unset( $countryList[$l->isoCode] ); 00109 } 00110 00111 asort( $countryList ); 00112 $this->setTemplateVar('isocodes' ,$countryList ); 00113 }
| LanguageAction::addlanguage | ( | ) |
Definiert in Zeile 116 der Datei LanguageAction.class.php.
Benutzt $conf, $language und Action::getRequestVar().
00117 { 00118 global $conf; 00119 $countryList = $conf['countries']; 00120 00121 // Hinzufuegen einer Sprache 00122 $iso = $this->getRequestVar('isocode'); 00123 $language = new Language(); 00124 $language->projectid = $this->project->projectid; 00125 $language->isoCode = $iso; 00126 $language->name = $countryList[$iso]; 00127 $language->add(); 00128 }
| LanguageAction::advanced | ( | ) |
Definiert in Zeile 257 der Datei LanguageAction.class.php.
Benutzt Action::setTemplateVar().
00258 { 00259 $this->setTemplateVar('isocode',$this->language->isoCode); 00260 $this->setTemplateVar('name' ,$this->language->name ); 00261 }
| LanguageAction::checkmenu | ( | $ | menu | ) |
Definiert in Zeile 267 der Datei LanguageAction.class.php.
Benutzt Session::getProjectLanguage() und Action::userIsAdmin().
00268 { 00269 switch( $menu ) 00270 { 00271 case 'remove': 00272 $actLanguage = Session::getProjectLanguage(); 00273 return 00274 $this->userIsAdmin() && 00275 count( $this->language->getAll() ) >= 2 && 00276 isset($this->language) && 00277 $actLanguage->languageid != $this->language->languageid; 00278 00279 case 'add': 00280 return 00281 $this->userIsAdmin(); 00282 00283 default: 00284 return true; 00285 } 00286 }
| LanguageAction::delete | ( | ) |
Löschen der Sprache.
Definiert in Zeile 155 der Datei LanguageAction.class.php.
Benutzt Action::getRequestVar().
00156 { 00157 if ( $this->getRequestVar('confirm') == '1' ) 00158 $this->language->delete(); 00159 }
| LanguageAction::edit | ( | ) |
Definiert in Zeile 234 der Datei LanguageAction.class.php.
Benutzt $conf und Action::setTemplateVar().
00235 { 00236 global $conf; 00237 $countryList = $conf['countries']; 00238 00239 foreach( $this->project->getLanguageIds() as $id ) 00240 { 00241 if ( $id == $this->language->languageid ) 00242 continue; 00243 00244 $l = new Language( $id ); 00245 $l->load(); 00246 00247 unset( $countryList[$l->isoCode] ); 00248 } 00249 00250 asort( $countryList ); 00251 $this->setTemplateVar('isocodes' ,$countryList ); 00252 $this->setTemplateVar('isocode' ,strtoupper($this->language->isoCode) ); 00253 }
| LanguageAction::LanguageAction | ( | ) |
Konstruktor
Definiert in Zeile 80 der Datei LanguageAction.class.php.
Benutzt Session::getProject() und Action::getRequestId().
00081 { 00082 if ( $this->getRequestId() != 0 ) 00083 { 00084 $this->language = new Language( $this->getRequestId() ); 00085 $this->language->load(); 00086 } 00087 00088 $this->project = Session::getProject(); 00089 }
| LanguageAction::listing | ( | ) |
Definiert in Zeile 187 der Datei LanguageAction.class.php.
Benutzt $conf, Action::forward(), Session::getProjectLanguage(), Action::setTemplateVar(), Html::url() und Action::userIsAdmin().
00188 { 00189 global $conf; 00190 $countryList = $conf['countries']; 00191 00192 $list = array(); 00193 00194 $actLanguage = Session::getProjectLanguage(); 00195 $this->setTemplateVar('act_languageid',$actLanguage->languageid); 00196 00197 foreach( $this->project->getLanguageIds() as $id ) 00198 { 00199 $l = new Language( $id ); 00200 $l->load(); 00201 00202 unset( $countryList[strtoupper($l->isoCode)] ); 00203 00204 $list[$id] = array(); 00205 $list[$id]['name' ] = $l->name; 00206 $list[$id]['isocode'] = $l->isoCode; 00207 00208 if ( $this->userIsAdmin() ) 00209 { 00210 $list[$id]['url' ] = Html::url('main','language',$id, 00211 array(REQ_PARAM_TARGETSUBACTION=>'edit') ); 00212 00213 if ( ! $l->isDefault ) 00214 $list[$id]['default_url'] = Html::url( 'language','setdefault',$id ); 00215 } 00216 00217 if ( $actLanguage->languageid != $l->languageid ) 00218 $list[$id]['select_url'] = Html::url( 'index','language',$id ); 00219 } 00220 00221 // if ( $this->userIsAdmin() ) 00222 // { 00223 // asort($countryList); 00224 // $this->setTemplateVar('isocodes',$countryList); 00225 // } 00226 00227 $this->setTemplateVar('el',$list); 00228 00229 $this->forward('language_list'); 00230 }
| LanguageAction::remove | ( | ) |
Anzeigen der Löschbestätigungs-Maske.
Definiert in Zeile 146 der Datei LanguageAction.class.php.
Benutzt Action::setTemplateVar().
00147 { 00148 $this->setTemplateVar('name' ,$this->language->name ); 00149 }
| LanguageAction::save | ( | ) |
Speichern der Sprache
Definiert in Zeile 165 der Datei LanguageAction.class.php.
Benutzt $conf, Action::getRequestVar() und Action::hasRequestVar().
00166 { 00167 global $conf; 00168 00169 if ( $this->hasRequestVar('name') ) 00170 { 00171 $this->language->name = $this->getRequestVar('name' ); 00172 $this->language->isoCode = $this->getRequestVar('isocode'); 00173 } 00174 else 00175 { 00176 $countryList = $conf['countries']; 00177 $iso = $this->getRequestVar('isocode'); 00178 $this->language->name = $countryList[$iso]; 00179 $this->language->isoCode = strtolower( $iso ); 00180 } 00181 00182 $this->language->save(); 00183 }
| LanguageAction::setdefault | ( | ) |
Setzen der Sprache als Standardsprache. Diese Sprache wird benutzt beim Ausw?hlen des Projektes sowie als Default-Sprache bei mehrsprachigen Webseiten ("content-negotiation")
Definiert in Zeile 136 der Datei LanguageAction.class.php.
| LanguageAction::$defaultSubAction = 'listing' |
Definiert in Zeile 67 der Datei LanguageAction.class.php.
| LanguageAction::$language |
Zu bearbeitende Sprache, wird im Kontruktor instanziiert Language
Definiert in Zeile 73 der Datei LanguageAction.class.php.
Wird benutzt von addlanguage().
| LanguageAction::$project |
Definiert in Zeile 74 der Datei LanguageAction.class.php.
1.5.8