Öffentliche Methoden | |
| __construct ($isXmlHttpRequest=false) | |
| Initialisiert Klassenvariablen und bereitet Smarty vor. | |
| addConfirmationTemplate ($question, $uri) | |
| Fügt ein Besätigungstemplate hinzu. | |
| addJsFile ($file) | |
| Neue JavaScript-Datei hinzufuegen. | |
| addJsTexts ($messageIds) | |
| Hinzufügen von JavaScript-Texten. | |
| addScriptaculousFiles (array $files=array()) | |
| Script.aculo.us-Dateien hinzufügen. | |
| addTemplate ($template=null, $templatePosition=self::CONTENT) | |
| Neues Template zur Anzeige hinzufuegen. | |
| getAjaxResponse () | |
| Gibt die Ajax-Antwort zurueck. | |
| getLayoutDefault () | |
| Gibt Standardlayout zurueck. | |
| getLayouts () | |
| Liest alle vorhandenen Layouts aus und gibt sie in einem Array zurueck. | |
| render () | |
| Erzeugt HTML-Output für Browser. | |
| setModuleNavigation (array $navigation=array()) | |
| Setzt die Modulnavigation. | |
Öffentliche, statische Methoden | |
| static | debug ($debugVariable, $value=null, $metaInfo=null) |
| Debugging einer Variable. | |
| static | sprintf ($string=null, array $variables=array(), $translateVariables=false, $translateString=true) |
| Ersetzen von Variablen in einem String. | |
Öffentliche Attribute | |
| const | CONTENT = 'content' |
| string, Inhalt | |
| const | POST_CONTENT = 'postContent' |
| string, Nach dem Inhalt einzufuegen | |
| const | PRE_CONTENT = 'preContent' |
| string, Vor dem Inhalt einzufuegen | |
Geschützte Methoden | |
| _getTemplatePath ($template, $prefix=null) | |
| Versucht, korrekten Pfad zum gesuchten Template zu finden. | |
| _init () | |
| Initialisiert Smarty. | |
| _setModuleCssFile () | |
| Modulspezifische CSS-Datei hinzufügen. | |
Geschützte Attribute | |
| $_addDefaultTemplate = true | |
| bool, Ob beim Rendern Standardtemplate der aktuellen Aktion hinzugefuegt werden soll | |
| $_ajaxResponse = null | |
| Dsao_Ajax_Response, Objekt, das die Antwort auf Ajax-Anfrage erzeugt. | |
| $_initialised = false | |
| bool, ob self::_init() bereits ausgefuehrt wurde | |
| $_isXmlHttpRequest = null | |
| bool, ob Ajax-Anfrage vorliegt | |
| $_layouts = null | |
| array, Array aller vorhandener Layouts | |
| $_layoutsDefault = array() | |
| array, Namen der Standardlayouts; Existenz der Templates in den entsprechenden Ordnern wird in der umgekehrter Reihenfolge ueberprueft | |
| $_jsFiles = false | |
| array|bool, ob / Welche JavaScript-Dateien eingebunden werden sollen | |
| $_jsMessages = array() | |
| array, Strings, die ueber JS abrufbar sein sollen | |
| $_request = null | |
| Zend_Controller_Request_Abstract, Request-Objekt. | |
| $_scriptaculous = null | |
| stdClass, Objekt, das Informationen ueber script.aculo.us enthaelt. | |
| $_templateDirController = null | |
| string, Templateordner des aktuellen Controllers, relativ zum Layoutordner | |
| $_templates = null | |
| stdClass, Objekt, das die verschiedenen Templates für Smarty enthält | |
| $_translate = null | |
| Zend_Translate, Sprachverwatung. | |
Statische geschützte Attribute | |
| static | $_debug = array() |
| array, enthaelt Debug-Informationen | |
Definiert in Zeile 16 der Datei Smarty.php.
| Dsao_View_Smarty::__construct | ( | $ | isXmlHttpRequest = false |
) |
Initialisiert Klassenvariablen und bereitet Smarty vor.
| $isXmlHttpRequest | bool, ob Ajax-Anfrage vorliegt |
Definiert in Zeile 123 der Datei Smarty.php.
Benutzt Dsao_Registry::get().
00124 { 00125 $this->_messages = new ArrayObject(); 00126 00127 $this->_translate = Dsao_Registry::get('translate'); 00128 00129 $config = Dsao_Registry::get('config'); 00130 00131 // Falls Ajax-Anfrage vorliegt, an dieser Stelle abbrechen 00132 if ($this->_isXmlHttpRequest = $isXmlHttpRequest) 00133 { 00134 $this->_ajaxResponse = new Dsao_Ajax_Response(); 00135 00136 return; 00137 } 00138 00139 $this->_request = Zend_Controller_Front::getInstance()->getRequest(); 00140 00141 // Standardlayouts 00142 $this->_layoutsDefault = explode(',', $config->smarty->layoutsDefault); 00143 00144 // Templateobjekt initialisieren 00145 $this->_templates = new stdClass(); 00146 // Inhaltstemplates 00147 $this->_templates->content = new ArrayObject(); 00148 // Haupttemplate 00149 $this->_templates->main = null; 00150 // Nach dem Inhalt anzuzeigende Templates 00151 $this->_templates->postContent = new ArrayObject(); 00152 // Vor dem Inhalt anzuzeigende Templates 00153 $this->_templates->preContent = new ArrayObject(); 00154 00155 // Smartyverzeichnisse aus Konfiguration holen 00156 $this->template_dir = $config->smarty->templateDir; 00157 00158 $this->compile_dir = $config->smarty->compileDir; 00159 00160 // Templateordner 00161 $this->_templateDirController = $this->_request->getModuleName().'/'. 00162 $this->_request->getControllerName().'/'; 00163 00164 // Falls Debug-Konsole angezeigt werden soll 00165 if ($config->smarty->debug->console) 00166 { 00167 $this->debugging = true; 00168 } 00169 }
| Dsao_View_Smarty::_getTemplatePath | ( | $ | template, | |
| $ | prefix = null | |||
| ) | [protected] |
Versucht, korrekten Pfad zum gesuchten Template zu finden.
| $template | string, Name des Templates | |
| $prefix | string, Pfad zum Template, relativ zum Template-Ordner |
Definiert in Zeile 179 der Datei Smarty.php.
Wird benutzt von _init() und addTemplate().
00180 { 00181 // string, Pfad des Templates relativ zum Templateordner 00182 $templatePath = $prefix.$template.'.tpl'; 00183 00184 // Layouts durchgehen und passenden Pfad zurueckgeben 00185 foreach ($this->_layoutsDefault as $layout) 00186 { 00187 // string, Resultierender, korrekter Pfad des Templates 00188 $resultPath = $layout.'/'.$templatePath; 00189 00190 // Falls Template vorhanden, dieses zurueckgeben 00191 if (is_file($this->template_dir.$resultPath)) 00192 { 00193 return $resultPath; 00194 } 00195 } 00196 00197 return false; 00198 }
| Dsao_View_Smarty::_init | ( | ) | [protected] |
Initialisiert Smarty.
Initialisiert von benutzerbezogenen Einstellungen abhaengige Komponenten des Templatesystems, wird beim ersten Aufruf von self::addTemplate() aufgerufen
Definiert in Zeile 209 der Datei Smarty.php.
Benutzt _getTemplatePath(), _setModuleCssFile() und Dsao_Registry::get().
Wird benutzt von addTemplate() und render().
00210 { 00211 // Falls bereits initialisiert 00212 if ($this->_initialised) 00213 { 00214 return; 00215 } 00216 00217 // Layouts initialisieren 00218 00219 // Falls Benutzer ein Layout gewaehlt hat, dieses zu Array hinzufuegen 00220 if (Dsao_Registry::get('user')->layout) 00221 { 00222 $this->_layoutsDefault[] = Dsao_Registry::get('user')->layout; 00223 } 00224 00225 // Reihenfolge der Layouts umkehren 00226 $this->_layoutsDefault = array_reverse($this->_layoutsDefault); 00227 00228 // Haupttemplate setzen 00229 $this->_templates->main = $this->_getTemplatePath('index'); 00230 00231 // Ggf. modulspefische CSS-Datei / JS-Datei uebergeben 00232 $this->_setModuleCssFile(); 00233 00234 // Ausgabefilter 00235 if (Dsao_Registry::get('config')->smarty->stripOutput) 00236 { 00237 $this->load_filter('output','trimwhitespace'); 00238 } 00239 00240 // Templatesystem ist initialisiert 00241 $this->_initialised = true; 00242 }
| Dsao_View_Smarty::_setModuleCssFile | ( | ) | [protected] |
Modulspezifische CSS-Datei hinzufügen.
Versucht, modulspezifische CSS-Datei zu finden und uebergibt ggf. ihren Pfad an Smarty.
string, Relativer Pfad zur CSS-Datei auf Dateisystemebene
Definiert in Zeile 252 der Datei Smarty.php.
Wird benutzt von _init().
00253 { 00254 // Layouts durchgehen 00255 foreach ($this->_layoutsDefault as $layout) 00256 { 00260 $cssFileSystemPath = 'htdocs/css/'.$layout.'/'. 00261 $this->_request->getModuleName().'.css'; 00262 00263 // Falls CSS-Datei in aktuellem Layout vorhanden, diese uebergeben 00264 if (is_file(BASE_DIR.$cssFileSystemPath)) 00265 { 00266 $cssFilePath = '/css/'.$layout.'/'.$this->_request->getModuleName(); 00267 00268 $this->assign('moduleCssFile', $cssFilePath); 00269 00270 return true; 00271 } 00272 } 00273 00274 return false; 00275 }
| Dsao_View_Smarty::addConfirmationTemplate | ( | $ | question, | |
| $ | uri | |||
| ) |
Fügt ein Besätigungstemplate hinzu.
| $question | string, Frage (Parameter wie bei Dsao_View_Smarty::sprintf(), ggf. als Array) | |
| $uri | Dsao_Uri_Http|string URI |
Definiert in Zeile 285 der Datei Smarty.php.
Benutzt addTemplate() und sprintf().
00286 { 00287 // Falls Array übergeben wurde, diesen an sprintf übergeben 00288 if (is_array($question)) 00289 { 00290 $question = call_user_func_array('Dsao_View_Smarty::sprintf', $question); 00291 } 00292 // Ansonsten einfach Frage übersetzen lassen 00293 else 00294 { 00295 $question = self::sprintf($question); 00296 } 00297 00298 if (!is_object($uri)) 00299 { 00300 $uri = new Dsao_Uri_Http($uri); 00301 } 00302 00303 // Informationen fuer das Abfragentemplate 00304 $globalConfirm = array 00305 ( 00306 'question' => $question, 00307 'uri' => $uri, 00308 ); 00309 00310 $this->addTemplate('/global/confirm') 00311 ->assign_by_ref('globalConfirm', $globalConfirm); 00312 }
| Dsao_View_Smarty::addJsFile | ( | $ | file | ) |
Neue JavaScript-Datei hinzufuegen.
Im Controller sollte die Methode _addJsFile() benutzt werden. Der Controller fügt die so hinzugefügten Dateien dann später über diese Methode hinzu
| $file | string, Datei, die geladen werden soll, relativ zu /htdocs/js |
Definiert in Zeile 324 der Datei Smarty.php.
00325 { 00326 // Falls Ajax-Anfrage, abbrechen 00327 if ($this->_isXmlHttpRequest) 00328 { 00329 return $this; 00330 } 00331 00332 // string, Relativer Pfad zur JS-Datei auf Dateisystemebene 00333 $jsFileSystemPath = 'htdocs/js'.$file.'.js'; 00334 00335 // Falls JS-Datei vorhanden, diese uebergeben 00336 if (is_file(BASE_DIR.$jsFileSystemPath)) 00337 { 00338 // Falls noch keine JavaScript-Dateien hinzugefügt wurden 00339 if (false === $this->_jsFiles) 00340 { 00341 $this->_jsFiles = array(); 00342 } 00343 00344 $this->_jsFiles[] = '/js'.$file; 00345 } 00346 00347 return $this; 00348 }
| Dsao_View_Smarty::addJsTexts | ( | $ | messageIds | ) |
Hinzufügen von JavaScript-Texten.
Fuegt eine oder mehrere Meldungen bzw. sonstige Texte hinzu, die ueber JS anhand ihrer Message-ID aufgerufen werden koennen.
| $messageIds | array|string, ID der Nachricht oder Array von IDs |
Definiert in Zeile 359 der Datei Smarty.php.
00360 { 00361 // Ggf. in Array umwandeln 00362 $messageIds = (array) $messageIds; 00363 00364 foreach ($messageIds as $messageId) 00365 { 00366 // Falls keine Uebersetzung existiert, gueltigen Index erstellen 00367 if (($translation = $this->_translate->_($messageId)) == $messageId) 00368 { 00369 $messageId = preg_replace('/\W/', '_', $messageId); 00370 } 00371 00372 $this->_jsMessages[$messageId] = $translation; 00373 } 00374 00375 return $this; 00376 }
| Dsao_View_Smarty::addScriptaculousFiles | ( | array $ | files = array() |
) |
Script.aculo.us-Dateien hinzufügen.
Fuegt eine oder mehrere Dateien (ohne .js) hinzu, die vom zentralen script.aculo.us-Script geladen werden sollen
| $files | array, hinzuzfuegende Dateien |
Definiert in Zeile 388 der Datei Smarty.php.
00389 { 00390 // Falls Objekt noch nicht initialisiert wurde 00391 if (null === $this->_scriptaculous) 00392 { 00393 $this->_scriptaculous = new stdClass(); 00394 00395 $this->_scriptaculous->files = array 00396 ( 00397 'builder' => true, 00398 'effects' => true, 00399 'dragdrop' => true, 00400 'controls' => true, 00401 'slider' => true, 00402 ); 00403 00404 $this->_scriptaculous->loadScriptaculous = false; 00405 $this->_scriptaculous->queryString = null; 00406 } 00407 00408 // Falls nichts übergeben wurde, alle Dateien übernehmen 00409 if (empty($files)) 00410 { 00411 $files = $this->_scriptaculous->files; 00412 } 00413 00414 foreach ($files as $file) 00415 { 00416 // Falls Schluessel vorhanden 00417 if (array_key_exists($file, $this->_scriptaculous->files)) 00418 { 00419 unset($this->_scriptaculous->files[$file]); 00420 00421 // Falls Query-String noch leer ist 00422 if (null === $this->_scriptaculous->queryString) 00423 { 00424 $this->_scriptaculous->queryString = '?load='.$file; 00425 $this->_scriptaculous->loadScriptaculous = true; 00426 } 00427 else 00428 { 00429 $this->_scriptaculous->queryString .= ','.$file; 00430 } 00431 } 00432 } 00433 00434 // Falls bereits alle Dateien zum Laden ausgewählt wurden 00435 if (empty($this->_scriptaculous->files)) 00436 { 00437 $this->_scriptaculous->loadScriptaculous = true; 00438 $this->_scriptaculous->queryString = null; 00439 } 00440 }
| Dsao_View_Smarty::addTemplate | ( | $ | template = null, |
|
| $ | templatePosition = self::CONTENT | |||
| ) |
Neues Template zur Anzeige hinzufuegen.
| $template | string, Templatename ohne .tpl | |
| $templatePosition | string, Position des Templates |
Definiert in Zeile 449 der Datei Smarty.php.
Benutzt _getTemplatePath() und _init().
Wird benutzt von addConfirmationTemplate() und render().
00450 { 00451 // Falls kein Standardtemplate hinzugefuegt werden soll oder Ajax-Anfrage 00452 // vorliegt, abbrechen 00453 if (false === $template || $this->_isXmlHttpRequest) 00454 { 00455 $this->_addDefaultTemplate = false; 00456 00457 return $this; 00458 } 00459 00460 // Falls noch nicht geschehen, initialisieren 00461 $this->_init(); 00462 00463 // Falls $_templates->{$templatePosition} nicht existiert oder kein Objekt 00464 // ist, abbrechen 00465 if (!isset($this->_templates->$templatePosition) 00466 || !is_object($this->_templates->$templatePosition)) 00467 { 00468 return $this; 00469 } 00470 00471 // Falls Template nicht uebergeben, Aktionnamen nehmen 00472 if (!$template) 00473 { 00474 $template = $this->_request->getActionName(); 00475 } 00476 00477 // string, bei relativen Angaben wird als Praefix der Pfad zum Verzeichnis 00478 // des Controllers uebergeben 00479 $prefix = null; 00480 00481 // Falls absolute Angabe 00482 if (substr($template, 0, 1) == '/') 00483 { 00484 // Slash entfernen 00485 $template = substr($template, 1); 00486 } 00487 // Ansonsten Praefix setzen 00488 else 00489 { 00490 $prefix = $this->_templateDirController; 00491 } 00492 00493 // bool|string, der Pfad zum Template, relativ zum /templates-Ordner oder 00494 // false 00495 $templateFile = $this->_getTemplatePath($template, $prefix); 00496 00497 // Falls Template existiert 00498 if ($templateFile) 00499 { 00500 // Vor oder nach Inhalt 00501 $this->_templates->$templatePosition->append($templateFile); 00502 } 00503 00504 return $this; 00505 }
| static Dsao_View_Smarty::debug | ( | $ | debugVariable, | |
| $ | value = null, |
|||
| $ | metaInfo = null | |||
| ) | [static] |
Debugging einer Variable.
Fuegt einen Debug-String hinzu, der ggf. ueber die Smarty-Debug-Konsole ausgegeben wird
| $debugVariable | array|string, Variablenname oder Array | |
| $value | mixed, Wert | |
| $metaInfo | string, Meta-Informationen (Datei/Zeile etc.) |
Definiert in Zeile 518 der Datei Smarty.php.
Benutzt $_debug.
Wird benutzt von Dsao_Mail::send().
00519 { 00520 // Falls Array uebergeben wurde, Methode rekursiv aufrufen 00521 if (is_array($debugVariable)) 00522 { 00523 foreach ($debugVariable as $variable => $value) 00524 { 00525 self::debug($variable, $value, $metaInfo); 00526 } 00527 00528 return; 00529 } 00530 00531 // Falls Debug-Array noch nicht initialisiert wurde 00532 if (null === Dsao_View_Smarty::$_debug) 00533 { 00534 self::$_debug = array(); 00535 self::$_debug['metaInfo'] = array(); 00536 } 00537 00538 self::$_debug[$debugVariable] = print_r($value, true); 00539 00540 // Falls Meta-Informationen übergeben wurden 00541 if ($metaInfo) 00542 { 00543 self::$_debug[$debugVariable.':metaInfo'] = print_r($metaInfo, true); 00544 } 00545 }
| Dsao_View_Smarty::getAjaxResponse | ( | ) |
Gibt die Ajax-Antwort zurueck.
Definiert in Zeile 552 der Datei Smarty.php.
| Dsao_View_Smarty::getLayoutDefault | ( | ) |
Gibt Standardlayout zurueck.
Definiert in Zeile 562 der Datei Smarty.php.
| Dsao_View_Smarty::getLayouts | ( | ) |
Liest alle vorhandenen Layouts aus und gibt sie in einem Array zurueck.
Definiert in Zeile 572 der Datei Smarty.php.
Benutzt Dsao_Registry::get().
00573 { 00574 // Falls Ajax-Anfrage vorliegt, abbrechen 00575 if ($this->_isXmlHttpRequest) 00576 { 00577 return array(); 00578 } 00579 00580 // Falls Layouts bereits initialisiert wurden, diese zurueckgeben 00581 if ($this->_layouts) 00582 { 00583 return $this->_layouts; 00584 } 00585 00586 // Ansonsten $_layout initialisieren 00587 $this->_layouts = array(); 00588 00589 // DirectoryIterator, Ordner, der alle Layouts enthaelt (/templates) 00590 $layoutDir = new DirectoryIterator(Dsao_Registry::get('config')->smarty->templateDir); 00591 00592 // Eintraege durchlaufen 00593 while ($layoutDir->valid()) 00594 { 00595 // Falls Verzeichnis gueltiges Layoutverzeichnis 00596 if (!$layoutDir->isDot() 00597 && $layoutDir->isDir() 00598 // Keine Verzeichnisse, die mit einem Punkt beginnen ('.svn' etc.) 00599 && substr($layoutDir->getFilename(), 0, 1) != '.' 00600 // Temporär, um Default-Layout zu 'verstecken' 00601 && $layoutDir->getFilename() != 'default') 00602 { 00603 $this->_layouts[] = $layoutDir->getFilename(); 00604 } 00605 00606 $layoutDir->next(); 00607 } 00608 00609 return $this->_layouts; 00610 }
| Dsao_View_Smarty::render | ( | ) |
Erzeugt HTML-Output für Browser.
Bereitet Erzeugung von HTML-Code vor und ruft abschliessend die Funktion Smarty::display() auf.
Definiert in Zeile 621 der Datei Smarty.php.
Benutzt _init(), addTemplate(), Dsao_Registry::get() und Dsao_Ajax_Response::JSON.
00622 { 00623 $config = Dsao_Registry::get('config'); 00624 00625 // Ggf. Debug-Informationen uebergeben 00626 if ($config->smarty->debug->output) 00627 { 00628 $this->assign('debug', self::$_debug); 00629 } 00630 00631 // Falls Ajax-Anfrage vorliegt, nur bis hierhin ausführen 00632 if ($this->_isXmlHttpRequest) 00633 { 00634 // Daten ausgeben (u.U werden Nachrichten und Variablen nicht uebergeben) 00635 return $this->_ajaxResponse->setData 00636 ($this->get_template_vars(), Dsao_Ajax_Response::JSON, false); 00637 } 00638 00639 // Nachrichten und Templatedateien uebergeben 00640 $this->assign(array 00641 ( 00642 'jsFiles' => $this->_jsFiles, 00643 'jsMessages' => $this->_jsMessages, 00644 'scriptaculous' => $this->_scriptaculous, 00645 'templates' => $this->_templates, 00646 )); 00647 00648 // Falls noch kein Inhaltstemplate uebergeben wurde, Standardtemplate 00649 // hinzufuegen 00650 if (!count($this->_templates->content) && $this->_addDefaultTemplate) 00651 { 00652 $this->addTemplate(); 00653 } 00654 00655 // Falls Smarty noch nicht initialisiert wurde 00656 if (!$this->_initialised) 00657 { 00658 $this->_init(); 00659 } 00660 00661 // Profiling 00662 $profiler = Dsao_Registry::get('db')->getProfiler(); 00663 00664 // Falls Profiler aktiviert 00665 if ($profiler->getEnabled()) 00666 { 00667 $this->assign('footerProfiling', self::sprintf('footer_profiling', 00668 array( 00669 'count' => $profiler->getTotalNumQueries(), 00670 'time' => $profiler->getTotalElapsedSecs()) 00671 )); 00672 00673 // Falls ausführliches Profiling aktiviert wurde 00674 if ($config->db->profiler == 'verbose' 00675 && false !== $profiler->getQueryProfiles()) 00676 { 00677 $queries = ''; 00678 00679 foreach ($profiler->getQueryProfiles() as $queryProfile) 00680 { 00681 $queries .= '<br />'.$queryProfile->getQuery(); 00682 } 00683 00684 $this->assign_by_ref('footerProfilingQueries', $queries); 00685 } 00686 } 00687 00688 // Nun darf Smarty loslegen 00689 $this->display($this->_templates->main); 00690 00691 return $this; 00692 }
| Dsao_View_Smarty::setModuleNavigation | ( | array $ | navigation = array() |
) |
Setzt die Modulnavigation.
Erwartet einen assoziatives Array mit den Message-IDs der Links als Schluessel und dem Link (/module/controller/action) als Wert
| $navigation | mixed, Navigation |
Definiert in Zeile 704 der Datei Smarty.php.
| static Dsao_View_Smarty::sprintf | ( | $ | string = null, |
|
| array $ | variables = array(), |
|||
| $ | translateVariables = false, |
|||
| $ | translateString = true | |||
| ) | [static] |
Ersetzen von Variablen in einem String.
Ersetzt in $string die Vorkommen von $char, gefolgt von Indizes im Array $variables durch die Werte des Arrays
| $string | string | |
| $variables | array, Array mit Variablen | |
| $translateVariables | bool, Ob Werte der Variablen uebersetzt werden sollen | |
| $translateString | bool, Ob String noch uebersetzt werden muss |
Definiert in Zeile 723 der Datei Smarty.php.
Benutzt Dsao_Registry::get().
Wird benutzt von Dsao_Exception::__construct(), Dsao_Model_User_Register::_sendActivationMail(), Dsao_Model_Scroll_Scroll::_sendScrollNotificationMail(), addConfirmationTemplate(), Dsao_Controller_Action_Helper_Renderer::postDispatch(), Dsao_Model_User_Login::sendNewPasswordMail() und Dsao_Mail::setBodyText().
00724 { 00725 // Falls leerer String uebergeben 00726 if (!$string) 00727 { 00728 return ''; 00729 } 00730 00731 $translate = Dsao_Registry::get('translate'); 00732 00733 if ($translateString) 00734 { 00735 $string = $translate->_($string); 00736 } 00737 00738 // Zu ersetzende Variablen durchgehen 00739 if (count($variables) > 0) 00740 { 00741 // array, Schluessel, also zu ersetzende Variablen 00742 $keys = array_keys($variables); 00743 00744 // Schluessel durchgehen und '%' voranstellen 00745 foreach ($keys as &$key) 00746 { 00747 $key = '%'.$key; 00748 } 00749 00750 // array, die einzusetzenden Werte 00751 $values = array_values($variables); 00752 00753 // Falls Variablen uebersetzt werden sollen, durchgehen und uebersetzen 00754 if ($translateVariables) 00755 { 00756 foreach ($values as &$value) 00757 { 00758 $value = $translate->_($value); 00759 } 00760 } 00761 00762 // Variablen durch Werte ersetzen 00763 $string = str_replace($keys, $values, $string); 00764 } 00765 00766 return $string; 00767 }
Dsao_View_Smarty::$_jsFiles = false [protected] |
array|bool, ob / Welche JavaScript-Dateien eingebunden werden sollen
Definiert in Zeile 78 der Datei Smarty.php.
Dsao_View_Smarty::$_jsMessages = array() [protected] |
array, Strings, die ueber JS abrufbar sein sollen
Definiert in Zeile 84 der Datei Smarty.php.
Dsao_View_Smarty::$_layouts = null [protected] |
array, Array aller vorhandener Layouts
Definiert in Zeile 66 der Datei Smarty.php.
Dsao_View_Smarty::$_scriptaculous = null [protected] |
stdClass, Objekt, das Informationen ueber script.aculo.us enthaelt.
Definiert in Zeile 100 der Datei Smarty.php.
| const Dsao_View_Smarty::CONTENT = 'content' |
| const Dsao_View_Smarty::POST_CONTENT = 'postContent' |
string, Nach dem Inhalt einzufuegen
Definiert in Zeile 28 der Datei Smarty.php.
| const Dsao_View_Smarty::PRE_CONTENT = 'preContent' |
string, Vor dem Inhalt einzufuegen
Definiert in Zeile 34 der Datei Smarty.php.
1.5.7.1