<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="ApiGen 2.7.0" /> <meta name="robots" content="noindex" /> <title>File web/Localizer.php | Picon Framework</title> <script type="text/javascript" src="resources/combined.js?1069802229"></script> <script type="text/javascript" src="elementlist.js?3232593492"></script> <link rel="stylesheet" type="text/css" media="all" href="resources/style.css?1567499433" /> </head> <body> <div id="left"> <div id="menu"> <a href="index.html" title="Overview"><span>Overview</span></a> <div id="groups"> <h3>Namespaces</h3> <ul> <li><a href="namespace-None.html">None</a> </li> <li><a href="namespace-PHP.html">PHP</a> </li> <li class="active"><a href="namespace-picon.html">picon</a> </li> </ul> </div> <hr /> <div id="elements"> <h3>Classes</h3> <ul> <li><a href="class-picon.AbstractAjaxBehaviour.html">AbstractAjaxBehaviour</a></li> <li><a href="class-picon.AbstractAssociatedMarkupSource.html">AbstractAssociatedMarkupSource</a></li> <li><a href="class-picon.AbstractBehaviour.html">AbstractBehaviour</a></li> <li><a href="class-picon.AbstractCallableOption.html">AbstractCallableOption</a></li> <li><a href="class-picon.AbstractChoice.html">AbstractChoice</a></li> <li><a href="class-picon.AbstractColumn.html">AbstractColumn</a></li> <li><a href="class-picon.AbstractContextLoader.html">AbstractContextLoader</a></li> <li><a href="class-picon.AbstractDatabaseDriver.html">AbstractDatabaseDriver</a></li> <li><a href="class-picon.AbstractInjectedDataProvider.html">AbstractInjectedDataProvider</a></li> <li><a href="class-picon.AbstractJQueryBehaviour.html">AbstractJQueryBehaviour</a></li> <li><a href="class-picon.AbstractJQueryUIBehaviour.html">AbstractJQueryUIBehaviour</a></li> <li><a href="class-picon.AbstractLink.html">AbstractLink</a></li> <li><a href="class-picon.AbstractMarkupSource.html">AbstractMarkupSource</a></li> <li><a href="class-picon.AbstractMultipleChoice.html">AbstractMultipleChoice</a></li> <li><a href="class-picon.AbstractOption.html">AbstractOption</a></li> <li><a href="class-picon.AbstractPageClassAuthorisationStrategy.html">AbstractPageClassAuthorisationStrategy</a></li> <li><a href="class-picon.AbstractRepeater.html">AbstractRepeater</a></li> <li><a href="class-picon.AbstractSingleChoice.html">AbstractSingleChoice</a></li> <li><a href="class-picon.AbstractTextComponent.html">AbstractTextComponent</a></li> <li><a href="class-picon.AbstractToolbar.html">AbstractToolbar</a></li> <li><a href="class-picon.AbstractValidator.html">AbstractValidator</a></li> <li><a href="class-picon.AjaxButton.html">AjaxButton</a></li> <li><a href="class-picon.AjaxEventBehaviour.html">AjaxEventBehaviour</a></li> <li><a href="class-picon.AjaxFormComponentUpdateBehavior.html">AjaxFormComponentUpdateBehavior</a></li> <li><a href="class-picon.AjaxFormSubmitBehavior.html">AjaxFormSubmitBehavior</a></li> <li><a href="class-picon.AjaxLink.html">AjaxLink</a></li> <li><a href="class-picon.AjaxRequestTarget.html">AjaxRequestTarget</a></li> <li><a href="class-picon.AllowAllAuthorisationStrategy.html">AllowAllAuthorisationStrategy</a></li> <li><a href="class-picon.AnnotationRule.html">AnnotationRule</a></li> <li><a href="class-picon.ApplicationConfigLoadListener.html">ApplicationConfigLoadListener</a></li> <li><a href="class-picon.ApplicationContext.html">ApplicationContext</a></li> <li><a href="class-picon.ApplicationContextLoadListener.html">ApplicationContextLoadListener</a></li> <li><a href="class-picon.ApplicationInitializer.html">ApplicationInitializer</a></li> <li><a href="class-picon.ApplicationInitializerConfigLoadListenerCollection.html">ApplicationInitializerConfigLoadListenerCollection</a></li> <li><a href="class-picon.ApplicationInitializerContextLoadListenerCollection.html">ApplicationInitializerContextLoadListenerCollection</a></li> <li><a href="class-picon.ApplicationProfile.html">ApplicationProfile</a></li> <li><a href="class-picon.Args.html">Args</a></li> <li><a href="class-picon.ArrayModel.html">ArrayModel</a></li> <li><a href="class-picon.ArrayOption.html">ArrayOption</a></li> <li><a href="class-picon.AttributeAppender.html">AttributeAppender</a></li> <li><a href="class-picon.AttributeModifier.html">AttributeModifier</a></li> <li><a href="class-picon.AutoContextLoader.html">AutoContextLoader</a></li> <li><a href="class-picon.AutoLoader.html">AutoLoader</a></li> <li><a href="class-picon.BasicModel.html">BasicModel</a></li> <li><a href="class-picon.BooleanModel.html">BooleanModel</a></li> <li><a href="class-picon.BooleanOption.html">BooleanOption</a></li> <li><a href="class-picon.Border.html">Border</a></li> <li><a href="class-picon.BorderMarkupSourcingStratagy.html">BorderMarkupSourcingStratagy</a></li> <li><a href="class-picon.BorderResolver.html">BorderResolver</a></li> <li><a href="class-picon.Button.html">Button</a></li> <li><a href="class-picon.CacheManager.html">CacheManager</a></li> <li><a href="class-picon.CallbackAjaxCallDecorator.html">CallbackAjaxCallDecorator</a></li> <li><a href="class-picon.CallbackColumn.html">CallbackColumn</a></li> <li><a href="class-picon.CallbackFunctionOption.html">CallbackFunctionOption</a></li> <li><a href="class-picon.CallbackOption.html">CallbackOption</a></li> <li><a href="class-picon.CallbackRowMapper.html">CallbackRowMapper</a></li> <li><a href="class-picon.Check.html">Check</a></li> <li><a href="class-picon.CheckBox.html">CheckBox</a></li> <li><a href="class-picon.CheckBoxGroup.html">CheckBoxGroup</a></li> <li><a href="class-picon.CheckChoice.html">CheckChoice</a></li> <li><a href="class-picon.ChoiceRenderer.html">ChoiceRenderer</a></li> <li><a href="class-picon.ClassNameRule.html">ClassNameRule</a></li> <li><a href="class-picon.ClassNamespaceRule.html">ClassNamespaceRule</a></li> <li><a href="class-picon.ClassScanner.html">ClassScanner</a></li> <li><a href="class-picon.Comment.html">Comment</a></li> <li><a href="class-picon.ComonDomainBase.html">ComonDomainBase</a></li> <li><a href="class-picon.Component.html">Component</a></li> <li><a href="class-picon.ComponentAfterRenderListenerCollection.html">ComponentAfterRenderListenerCollection</a></li> <li><a href="class-picon.ComponentAuthorisationListener.html">ComponentAuthorisationListener</a></li> <li><a href="class-picon.ComponentBeforeRenderListenerCollection.html">ComponentBeforeRenderListenerCollection</a></li> <li><a href="class-picon.ComponentInitializationListenerCollection.html">ComponentInitializationListenerCollection</a></li> <li><a href="class-picon.ComponentInjector.html">ComponentInjector</a></li> <li><a href="class-picon.ComponentInstantiationListenerCollection.html">ComponentInstantiationListenerCollection</a></li> <li><a href="class-picon.ComponentRenderHeadListenerCollection.html">ComponentRenderHeadListenerCollection</a></li> <li><a href="class-picon.ComponentResolverHelper.html">ComponentResolverHelper</a></li> <li><a href="class-picon.ComponentTag.html">ComponentTag</a></li> <li><a href="class-picon.CompoundPropertyModel.html">CompoundPropertyModel</a></li> <li><a href="class-picon.Config.html">Config</a></li> <li><a href="class-picon.ConfigLoader.html">ConfigLoader</a></li> <li><a href="class-picon.ContextLoaderFactory.html">ContextLoaderFactory</a></li> <li><a href="class-picon.DaoSupport.html">DaoSupport</a></li> <li><a href="class-picon.DataBaseTemplate.html">DataBaseTemplate</a></li> <li><a href="class-picon.DataGridView.html">DataGridView</a></li> <li><a href="class-picon.DataSource.html">DataSource</a></li> <li><a href="class-picon.DataSourceConfig.html">DataSourceConfig</a></li> <li><a href="class-picon.DataSourceFactory.html">DataSourceFactory</a></li> <li><a href="class-picon.DataSourceType.html">DataSourceType</a></li> <li><a href="class-picon.DataTable.html">DataTable</a></li> <li><a href="class-picon.DateField.html">DateField</a></li> <li><a href="class-picon.DatePickerBehaviour.html">DatePickerBehaviour</a></li> <li><a href="class-picon.DefaultDataTable.html">DefaultDataTable</a></li> <li><a href="class-picon.DefaultJQueryUIBehaviour.html">DefaultJQueryUIBehaviour</a></li> <li><a href="class-picon.DefaultMarkupSource.html">DefaultMarkupSource</a></li> <li><a href="class-picon.DefaultNotAuthorisedListener.html">DefaultNotAuthorisedListener</a></li> <li><a href="class-picon.DialogBehavior.html">DialogBehavior</a></li> <li><a href="class-picon.DirectToPageComponentNotAuthorisedListener.html">DirectToPageComponentNotAuthorisedListener</a></li> <li><a href="class-picon.DraggableBehaviour.html">DraggableBehaviour</a></li> <li><a href="class-picon.DropDown.html">DropDown</a></li> <li><a href="class-picon.EmailAddressValidator.html">EmailAddressValidator</a></li> <li><a href="class-picon.EmptyPanel.html">EmptyPanel</a></li> <li><a href="class-picon.Enum.html">Enum</a></li> <li><a href="class-picon.ExceptionPageRequestTarget.html">ExceptionPageRequestTarget</a></li> <li><a href="class-picon.ExtendResolver.html">ExtendResolver</a></li> <li><a href="class-picon.FeedbackMessage.html">FeedbackMessage</a></li> <li><a href="class-picon.FeedbackModel.html">FeedbackModel</a></li> <li><a href="class-picon.FeedbackPanel.html">FeedbackPanel</a></li> <li><a href="class-picon.FileModel.html">FileModel</a></li> <li><a href="class-picon.FileUploadField.html">FileUploadField</a></li> <li><a href="class-picon.Form.html">Form</a></li> <li><a href="class-picon.FormComponent.html">FormComponent</a></li> <li><a href="class-picon.FormComponentLabel.html">FormComponentLabel</a></li> <li><a href="class-picon.FormComponentPanel.html">FormComponentPanel</a></li> <li><a href="class-picon.FunctionOption.html">FunctionOption</a></li> <li><a href="class-picon.GridItem.html">GridItem</a></li> <li><a href="class-picon.GridView.html">GridView</a></li> <li><a href="class-picon.HeaderContainer.html">HeaderContainer</a></li> <li><a href="class-picon.HeaderPartContainer.html">HeaderPartContainer</a></li> <li><a href="class-picon.HeaderResolver.html">HeaderResolver</a></li> <li><a href="class-picon.HeaderResponse.html">HeaderResponse</a></li> <li><a href="class-picon.HeaderToolbar.html">HeaderToolbar</a></li> <li><a href="class-picon.IdenticalValueValidator.html">IdenticalValueValidator</a></li> <li><a href="class-picon.Identifier.html">Identifier</a></li> <li><a href="class-picon.Injector.html">Injector</a></li> <li><a href="class-picon.JQueryRenderHeadListener.html">JQueryRenderHeadListener</a></li> <li><a href="class-picon.JQueryUIRenderHeadListener.html">JQueryUIRenderHeadListener</a></li> <li><a href="class-picon.Label.html">Label</a></li> <li><a href="class-picon.LabeledMarkupContainer.html">LabeledMarkupContainer</a></li> <li><a href="class-picon.Link.html">Link</a></li> <li><a href="class-picon.ListenerCollection.html">ListenerCollection</a></li> <li><a href="class-picon.ListenerRequestResolver.html">ListenerRequestResolver</a></li> <li><a href="class-picon.ListenerRequestTarget.html">ListenerRequestTarget</a></li> <li><a href="class-picon.ListItem.html">ListItem</a></li> <li><a href="class-picon.ListMultiple.html">ListMultiple</a></li> <li><a href="class-picon.ListView.html">ListView</a></li> <li class="active"><a href="class-picon.Localizer.html">Localizer</a></li> <li><a href="class-picon.ManualContextLoader.html">ManualContextLoader</a></li> <li><a href="class-picon.MarkupContainer.html">MarkupContainer</a></li> <li><a href="class-picon.MarkupElement.html">MarkupElement</a></li> <li><a href="class-picon.MarkupLoader.html">MarkupLoader</a></li> <li><a href="class-picon.MarkupParser.html">MarkupParser</a></li> <li><a href="class-picon.MarkupUtils.html">MarkupUtils</a></li> <li><a href="class-picon.MaximumLengthValidator.html">MaximumLengthValidator</a></li> <li><a href="class-picon.MaximumValidator.html">MaximumValidator</a></li> <li><a href="class-picon.MinimumLengthValidator.html">MinimumLengthValidator</a></li> <li><a href="class-picon.MinimumValidator.html">MinimumValidator</a></li> <li><a href="class-picon.ModalWindow.html">ModalWindow</a></li> <li><a href="class-picon.MySqlDriver.html">MySqlDriver</a></li> <li><a href="class-picon.MySqliDriver.html">MySqliDriver</a></li> <li><a href="class-picon.NavigationLink.html">NavigationLink</a></li> <li><a href="class-picon.NavigationToolbar.html">NavigationToolbar</a></li> <li><a href="class-picon.Navigator.html">Navigator</a></li> <li><a href="class-picon.NumbericOption.html">NumbericOption</a></li> <li><a href="class-picon.NumericValidator.html">NumericValidator</a></li> <li><a href="class-picon.Objects.html">Objects</a></li> <li><a href="class-picon.Options.html">Options</a></li> <li><a href="class-picon.PageInstanceRequestResolver.html">PageInstanceRequestResolver</a></li> <li><a href="class-picon.PageInstanceRequestTarget.html">PageInstanceRequestTarget</a></li> <li><a href="class-picon.PageMap.html">PageMap</a></li> <li><a href="class-picon.PageMapInitializationListenerCollection.html">PageMapInitializationListenerCollection</a></li> <li><a href="class-picon.PageNotFoundPage.html">PageNotFoundPage</a></li> <li><a href="class-picon.PageNotFoundRequestTarget.html">PageNotFoundRequestTarget</a></li> <li><a href="class-picon.PageRequestResolver.html">PageRequestResolver</a></li> <li><a href="class-picon.PageRequestTarget.html">PageRequestTarget</a></li> <li><a href="class-picon.PageRequestWithListenerTarget.html">PageRequestWithListenerTarget</a></li> <li><a href="class-picon.PaginatingGridView.html">PaginatingGridView</a></li> <li><a href="class-picon.Panel.html">Panel</a></li> <li><a href="class-picon.PanelMarkupSource.html">PanelMarkupSource</a></li> <li><a href="class-picon.PanelResolver.html">PanelResolver</a></li> <li><a href="class-picon.PasswordField.html">PasswordField</a></li> <li><a href="class-picon.PatternValidator.html">PatternValidator</a></li> <li><a href="class-picon.PiconApplication.html">PiconApplication</a></li> <li><a href="class-picon.PiconErrorHandler.html">PiconErrorHandler</a></li> <li><a href="class-picon.PiconSerializer.html">PiconSerializer</a></li> <li><a href="class-picon.PiconTag.html">PiconTag</a></li> <li><a href="class-picon.PopupSettings.html">PopupSettings</a></li> <li><a href="class-picon.PropertyColumn.html">PropertyColumn</a></li> <li><a href="class-picon.PropertyModel.html">PropertyModel</a></li> <li><a href="class-picon.PropertyOption.html">PropertyOption</a></li> <li><a href="class-picon.PropertyResolver.html">PropertyResolver</a></li> <li><a href="class-picon.Radio.html">Radio</a></li> <li><a href="class-picon.RadioChoice.html">RadioChoice</a></li> <li><a href="class-picon.RadioGroup.html">RadioGroup</a></li> <li><a href="class-picon.RangeLengthValidator.html">RangeLengthValidator</a></li> <li><a href="class-picon.RangeValidator.html">RangeValidator</a></li> <li><a href="class-picon.RedirectRequestTarget.html">RedirectRequestTarget</a></li> <li><a href="class-picon.RepeatingView.html">RepeatingView</a></li> <li><a href="class-picon.RequestCycle.html">RequestCycle</a></li> <li><a href="class-picon.RequestResolverCollection.html">RequestResolverCollection</a></li> <li><a href="class-picon.RequiredTextField.html">RequiredTextField</a></li> <li><a href="class-picon.ResourceReference.html">ResourceReference</a></li> <li><a href="class-picon.ResourceRequestResolver.html">ResourceRequestResolver</a></li> <li><a href="class-picon.ResourceRequestTarget.html">ResourceRequestTarget</a></li> <li><a href="class-picon.SerializableClosure.html">SerializableClosure</a></li> <li><a href="class-picon.SortableBehavior.html">SortableBehavior</a></li> <li><a href="class-picon.StaticTabPanel.html">StaticTabPanel</a></li> <li><a href="class-picon.StringValidator.html">StringValidator</a></li> <li><a href="class-picon.SubClassRule.html">SubClassRule</a></li> <li><a href="class-picon.Tab.html">Tab</a></li> <li><a href="class-picon.TabCollection.html">TabCollection</a></li> <li><a href="class-picon.TabPanel.html">TabPanel</a></li> <li><a href="class-picon.TextArea.html">TextArea</a></li> <li><a href="class-picon.TextElement.html">TextElement</a></li> <li><a href="class-picon.TextField.html">TextField</a></li> <li><a href="class-picon.TransparentMarkupContainer.html">TransparentMarkupContainer</a></li> <li><a href="class-picon.ValidatableFormComponentWrapper.html">ValidatableFormComponentWrapper</a></li> <li><a href="class-picon.ValidationResponse.html">ValidationResponse</a></li> <li><a href="class-picon.WebApplicationSecuritySettings.html">WebApplicationSecuritySettings</a></li> <li><a href="class-picon.WebComponent.html">WebComponent</a></li> <li><a href="class-picon.WebPage.html">WebPage</a></li> <li><a href="class-picon.WebRequest.html">WebRequest</a></li> <li><a href="class-picon.WebResponse.html">WebResponse</a></li> <li><a href="class-picon.WrappedCompoundModel.html">WrappedCompoundModel</a></li> <li><a href="class-picon.XMLDocument.html">XMLDocument</a></li> <li><a href="class-picon.XMLParser.html">XMLParser</a></li> <li><a href="class-picon.XMLTag.html">XMLTag</a></li> <li><a href="class-picon.XmlTagType.html">XmlTagType</a></li> </ul> <h3>Interfaces</h3> <ul> <li><a href="class-picon.AjaxCallDecorator.html">AjaxCallDecorator</a></li> <li><a href="class-picon.ApplicationInitializerConfigLoadListener.html">ApplicationInitializerConfigLoadListener</a></li> <li><a href="class-picon.ApplicationInitializerContextLoadListener.html">ApplicationInitializerContextLoadListener</a></li> <li><a href="class-picon.AuthorisationStrategy.html">AuthorisationStrategy</a></li> <li><a href="class-picon.Behaviour.html">Behaviour</a></li> <li><a href="class-picon.BehaviourListener.html">BehaviourListener</a></li> <li><a href="class-picon.CallDecoratorWrapper.html">CallDecoratorWrapper</a></li> <li><a href="class-picon.ChoiceGroup.html">ChoiceGroup</a></li> <li><a href="class-picon.ClassScannerRule.html">ClassScannerRule</a></li> <li><a href="class-picon.Column.html">Column</a></li> <li><a href="class-picon.ComponentAfterRenderListener.html">ComponentAfterRenderListener</a></li> <li><a href="class-picon.ComponentAwareModel.html">ComponentAwareModel</a></li> <li><a href="class-picon.ComponentBeforeRenderListener.html">ComponentBeforeRenderListener</a></li> <li><a href="class-picon.ComponentInheritedModel.html">ComponentInheritedModel</a></li> <li><a href="class-picon.ComponentInitializationListener.html">ComponentInitializationListener</a></li> <li><a href="class-picon.ComponentInstantiationListener.html">ComponentInstantiationListener</a></li> <li><a href="class-picon.ComponentNotAuthorisedListener.html">ComponentNotAuthorisedListener</a></li> <li><a href="class-picon.ComponentRenderHeadListener.html">ComponentRenderHeadListener</a></li> <li><a href="class-picon.ComponentResolver.html">ComponentResolver</a></li> <li><a href="class-picon.CompoundModel.html">CompoundModel</a></li> <li><a href="class-picon.DatabaseDriver.html">DatabaseDriver</a></li> <li><a href="class-picon.DataBaseOperations.html">DataBaseOperations</a></li> <li><a href="class-picon.DataProvider.html">DataProvider</a></li> <li><a href="class-picon.Detachable.html">Detachable</a></li> <li><a href="class-picon.Equalable.html">Equalable</a></li> <li><a href="class-picon.FormSubmitListener.html">FormSubmitListener</a></li> <li><a href="class-picon.FormSubmitter.html">FormSubmitter</a></li> <li><a href="class-picon.Identifiable.html">Identifiable</a></li> <li><a href="class-picon.InitializingBean.html">InitializingBean</a></li> <li><a href="class-picon.InjectOnWakeup.html">InjectOnWakeup</a></li> <li><a href="class-picon.LinkListener.html">LinkListener</a></li> <li><a href="class-picon.Listener.html">Listener</a></li> <li><a href="class-picon.MarkupSource.html">MarkupSource</a></li> <li><a href="class-picon.Model.html">Model</a></li> <li><a href="class-picon.Pageable.html">Pageable</a></li> <li><a href="class-picon.PageMapInitializationListener.html">PageMapInitializationListener</a></li> <li><a href="class-picon.Request.html">Request</a></li> <li><a href="class-picon.RequestablePage.html">RequestablePage</a></li> <li><a href="class-picon.RequestResolver.html">RequestResolver</a></li> <li><a href="class-picon.RequestTarget.html">RequestTarget</a></li> <li><a href="class-picon.Response.html">Response</a></li> <li><a href="class-picon.RowMapper.html">RowMapper</a></li> <li><a href="class-picon.Validatable.html">Validatable</a></li> <li><a href="class-picon.Validator.html">Validator</a></li> <li><a href="class-picon.XmlElement.html">XmlElement</a></li> </ul> <h3>Exceptions</h3> <ul> <li><a href="class-picon.ConfigException.html">ConfigException</a></li> <li><a href="class-picon.ConversionException.html">ConversionException</a></li> <li><a href="class-picon.RestartRequestOnPageException.html">RestartRequestOnPageException</a></li> <li><a href="class-picon.SQLException.html">SQLException</a></li> <li><a href="class-picon.UnAuthorisdeException.html">UnAuthorisdeException</a></li> </ul> </div> </div> </div> <div id="splitter"></div> <div id="right"> <div id="rightInner"> <form id="search"> <input type="hidden" name="cx" value="" /> <input type="hidden" name="ie" value="UTF-8" /> <input type="text" name="q" class="text" /> <input type="submit" value="Search" /> </form> <div id="navigation"> <ul> <li> <a href="index.html" title="Overview"><span>Overview</span></a> </li> <li> <a href="namespace-picon.html" title="Summary of picon"><span>Namespace</span></a> </li> <li> <a href="class-picon.Localizer.html" title="Summary of picon\Localizer"><span>Class</span></a> </li> </ul> <ul> <li> <a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a> </li> <li> <a href="deprecated.html" title="List of deprecated elements"><span>Deprecated</span></a> </li> <li> <a href="todo.html" title="Todo list"><span>Todo</span></a> </li> </ul> <ul> </ul> </div> <pre><code><a href="#1" id="1" class="l"> 1: </a><span class="xlang"><?php</span> <a href="#2" id="2" class="l"> 2: </a> <a href="#3" id="3" class="l"> 3: </a><span class="php-comment">/** </span><a href="#4" id="4" class="l"> 4: </a><span class="php-comment"> * Picon Framework </span><a href="#5" id="5" class="l"> 5: </a><span class="php-comment"> * http://code.google.com/p/picon-framework/ </span><a href="#6" id="6" class="l"> 6: </a><span class="php-comment"> * </span><a href="#7" id="7" class="l"> 7: </a><span class="php-comment"> * Copyright (C) 2011-2012 Martin Cassidy <martin.cassidy@webquub.com> </span><a href="#8" id="8" class="l"> 8: </a><span class="php-comment"> </span><a href="#9" id="9" class="l"> 9: </a><span class="php-comment"> * Picon Framework is free software: you can redistribute it and/or modify </span><a href="#10" id="10" class="l"> 10: </a><span class="php-comment"> * it under the terms of the GNU General Public License as published by </span><a href="#11" id="11" class="l"> 11: </a><span class="php-comment"> * the Free Software Foundation, either version 3 of the License, or </span><a href="#12" id="12" class="l"> 12: </a><span class="php-comment"> * (at your option) any later version. </span><a href="#13" id="13" class="l"> 13: </a><span class="php-comment"> </span><a href="#14" id="14" class="l"> 14: </a><span class="php-comment"> * Picon Framework is distributed in the hope that it will be useful, </span><a href="#15" id="15" class="l"> 15: </a><span class="php-comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of </span><a href="#16" id="16" class="l"> 16: </a><span class="php-comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the </span><a href="#17" id="17" class="l"> 17: </a><span class="php-comment"> * General Public License for more details. </span><a href="#18" id="18" class="l"> 18: </a><span class="php-comment"> </span><a href="#19" id="19" class="l"> 19: </a><span class="php-comment"> * You should have received a copy of the GNU General Public License </span><a href="#20" id="20" class="l"> 20: </a><span class="php-comment"> * along with Picon Framework. If not, see <http://www.gnu.org/licenses/>. </span><a href="#21" id="21" class="l"> 21: </a><span class="php-comment"> * */</span> <a href="#22" id="22" class="l"> 22: </a> <a href="#23" id="23" class="l"> 23: </a><span class="php-keyword1">namespace</span> picon; <a href="#24" id="24" class="l"> 24: </a> <a href="#25" id="25" class="l"> 25: </a><span class="php-comment">/** </span><a href="#26" id="26" class="l"> 26: </a><span class="php-comment"> * Localizer for a specific component </span><a href="#27" id="27" class="l"> 27: </a><span class="php-comment"> * It is through this method that internationalization support will </span><a href="#28" id="28" class="l"> 28: </a><span class="php-comment"> * be added in the future </span><a href="#29" id="29" class="l"> 29: </a><span class="php-comment"> * </span><a href="#30" id="30" class="l"> 30: </a><span class="php-comment"> * @author Martin Cassidy </span><a href="#31" id="31" class="l"> 31: </a><span class="php-comment"> * @package web </span><a href="#32" id="32" class="l"> 32: </a><span class="php-comment"> */</span> <a href="#33" id="33" class="l"> 33: </a><span class="php-keyword1">class</span> Localizer <a href="#34" id="34" class="l"> 34: </a>{ <a href="#35" id="35" class="l"> 35: </a> <span class="php-keyword1">const</span> EXTENSION = <span class="php-quote">'.properties'</span>; <a href="#36" id="36" class="l"> 36: </a> <span class="php-keyword1">const</span> PROPERTIES_CACHE_NAME = <span class="php-quote">'localizer_properties'</span>; <a href="#37" id="37" class="l"> 37: </a> <a href="#38" id="38" class="l"> 38: </a> <span class="php-keyword1">private</span> <span class="php-var">$component</span>; <a href="#39" id="39" class="l"> 39: </a> <span class="php-keyword1">private</span> <span class="php-var">$properties</span>; <a href="#40" id="40" class="l"> 40: </a> <a href="#41" id="41" class="l"> 41: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> __construct(Component <span class="php-var">$component</span>) <a href="#42" id="42" class="l"> 42: </a> { <a href="#43" id="43" class="l"> 43: </a> <span class="php-var">$this</span>->component = <span class="php-var">$component</span>; <a href="#44" id="44" class="l"> 44: </a> <span class="php-var">$page</span> = <span class="php-var">$component</span>->getPage()==<span class="php-keyword1">null</span>?<span class="php-quote">""</span>:<span class="php-keyword2">get_class</span>(<span class="php-var">$component</span>->getPage()); <a href="#45" id="45" class="l"> 45: </a> <span class="php-var">$resourceName</span> = self::PROPERTIES_CACHE_NAME.<span class="php-quote">'_'</span>.<span class="php-var">$page</span>.<span class="php-quote">'_'</span>.<span class="php-var">$component</span>->getComponentPath(); <a href="#46" id="46" class="l"> 46: </a> <span class="php-keyword1">if</span>(CacheManager::resourceExists(<span class="php-var">$resourceName</span>, CacheManager::APPLICATION_SCOPE)) <a href="#47" id="47" class="l"> 47: </a> { <a href="#48" id="48" class="l"> 48: </a> <span class="php-var">$this</span>->properties = CacheManager::loadResource(<span class="php-var">$resourceName</span>, CacheManager::APPLICATION_SCOPE); <a href="#49" id="49" class="l"> 49: </a> } <a href="#50" id="50" class="l"> 50: </a> <span class="php-keyword1">else</span> <a href="#51" id="51" class="l"> 51: </a> { <a href="#52" id="52" class="l"> 52: </a> <span class="php-var">$this</span>->properties = <span class="php-var">$this</span>->getProperties(<span class="php-var">$this</span>->component); <a href="#53" id="53" class="l"> 53: </a> CacheManager::saveResource(<span class="php-var">$resourceName</span>, <span class="php-var">$this</span>->properties, CacheManager::APPLICATION_SCOPE); <a href="#54" id="54" class="l"> 54: </a> } <a href="#55" id="55" class="l"> 55: </a> } <a href="#56" id="56" class="l"> 56: </a> <a href="#57" id="57" class="l"> 57: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> get(Component <span class="php-var">$component</span>) <a href="#58" id="58" class="l"> 58: </a> { <a href="#59" id="59" class="l"> 59: </a> <span class="php-keyword1">if</span>(<span class="php-var">$component</span>->getParent()==<span class="php-keyword1">null</span> && !(<span class="php-var">$component</span> <span class="php-keyword1">instanceof</span> WebPage)) <a href="#60" id="60" class="l"> 60: </a> { <a href="#61" id="61" class="l"> 61: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">'It is not safe to rely on the localizer until the component hierarchy is complete'</span>, E_USER_WARNING); <a href="#62" id="62" class="l"> 62: </a> } <a href="#63" id="63" class="l"> 63: </a> <a href="#64" id="64" class="l"> 64: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">new</span> self(<span class="php-var">$component</span>); <a href="#65" id="65" class="l"> 65: </a> } <a href="#66" id="66" class="l"> 66: </a> <a href="#67" id="67" class="l"> 67: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> getProperties(Component <span class="php-var">$component</span>) <a href="#68" id="68" class="l"> 68: </a> { <a href="#69" id="69" class="l"> 69: </a> <span class="php-var">$target</span> = <span class="php-var">$component</span>; <a href="#70" id="70" class="l"> 70: </a> <span class="php-var">$properties</span> = <span class="php-keyword1">array</span>(); <a href="#71" id="71" class="l"> 71: </a> <a href="#72" id="72" class="l"> 72: </a> <span class="php-keyword1">while</span>(<span class="php-var">$target</span>!=<span class="php-keyword1">null</span>) <a href="#73" id="73" class="l"> 73: </a> { <a href="#74" id="74" class="l"> 74: </a> <span class="php-var">$reflection</span> = <span class="php-keyword1">new</span> \ReflectionClass(<span class="php-var">$target</span>); <a href="#75" id="75" class="l"> 75: </a> <a href="#76" id="76" class="l"> 76: </a> <span class="php-keyword1">while</span>(<span class="php-var">$reflection</span>!=<span class="php-keyword1">null</span>) <a href="#77" id="77" class="l"> 77: </a> { <a href="#78" id="78" class="l"> 78: </a> <span class="php-var">$fileInfo</span> = <span class="php-keyword1">new</span> \SplFileInfo(<span class="php-var">$reflection</span>->getFileName()); <a href="#79" id="79" class="l"> 79: </a> <span class="php-var">$fileName</span> = <span class="php-var">$fileInfo</span>->getPath().<span class="php-quote">"/"</span>.<span class="php-var">$reflection</span>->getShortName().self::EXTENSION; <a href="#80" id="80" class="l"> 80: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">file_exists</span>(<span class="php-var">$fileName</span>)) <a href="#81" id="81" class="l"> 81: </a> { <a href="#82" id="82" class="l"> 82: </a> <span class="php-var">$loaded</span> = <span class="php-var">$this</span>->loadProperties(<span class="php-var">$fileName</span>); <a href="#83" id="83" class="l"> 83: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$loaded</span> <span class="php-keyword1">as</span> <span class="php-var">$name</span> => <span class="php-var">$value</span>) <a href="#84" id="84" class="l"> 84: </a> { <a href="#85" id="85" class="l"> 85: </a> <span class="php-keyword1">if</span>(!<span class="php-keyword2">array_key_exists</span>(<span class="php-var">$name</span>, <span class="php-var">$properties</span>)) <a href="#86" id="86" class="l"> 86: </a> { <a href="#87" id="87" class="l"> 87: </a> <span class="php-var">$properties</span>[<span class="php-var">$name</span>] = <span class="php-var">$value</span>; <a href="#88" id="88" class="l"> 88: </a> } <a href="#89" id="89" class="l"> 89: </a> } <a href="#90" id="90" class="l"> 90: </a> } <a href="#91" id="91" class="l"> 91: </a> <span class="php-var">$reflection</span> = <span class="php-var">$reflection</span>->getParentClass(); <a href="#92" id="92" class="l"> 92: </a> } <a href="#93" id="93" class="l"> 93: </a> <span class="php-var">$target</span> = <span class="php-var">$target</span>->getParent(); <a href="#94" id="94" class="l"> 94: </a> } <a href="#95" id="95" class="l"> 95: </a> <span class="php-keyword1">return</span> <span class="php-var">$properties</span>; <a href="#96" id="96" class="l"> 96: </a> } <a href="#97" id="97" class="l"> 97: </a> <a href="#98" id="98" class="l"> 98: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> loadProperties(<span class="php-var">$fileName</span>) <a href="#99" id="99" class="l"> 99: </a> { <a href="#100" id="100" class="l">100: </a> <span class="php-var">$properties</span> = <span class="php-keyword1">array</span>(); <a href="#101" id="101" class="l">101: </a> <span class="php-var">$fileHandle</span> = <span class="php-keyword2">fopen</span>(<span class="php-var">$fileName</span>, <span class="php-quote">'r'</span>); <a href="#102" id="102" class="l">102: </a> <span class="php-keyword1">while</span> (!<span class="php-keyword2">feof</span>(<span class="php-var">$fileHandle</span>)) <a href="#103" id="103" class="l">103: </a> { <a href="#104" id="104" class="l">104: </a> <span class="php-var">$raw</span> = <span class="php-keyword2">fgets</span>(<span class="php-var">$fileHandle</span>, <span class="php-num">4096</span>); <a href="#105" id="105" class="l">105: </a> <span class="php-var">$pair</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'='</span>, <span class="php-var">$raw</span>); <a href="#106" id="106" class="l">106: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">count</span>(<span class="php-var">$pair</span>)==<span class="php-num">2</span>) <a href="#107" id="107" class="l">107: </a> { <a href="#108" id="108" class="l">108: </a> <span class="php-var">$name</span> = <span class="php-keyword2">trim</span>(<span class="php-var">$pair</span>[<span class="php-num">0</span>]); <a href="#109" id="109" class="l">109: </a> <span class="php-var">$value</span> = <span class="php-keyword2">trim</span>(<span class="php-var">$pair</span>[<span class="php-num">1</span>]); <a href="#110" id="110" class="l">110: </a> <span class="php-var">$properties</span>[<span class="php-var">$name</span>] = <span class="php-var">$value</span>; <a href="#111" id="111" class="l">111: </a> } <a href="#112" id="112" class="l">112: </a> } <a href="#113" id="113" class="l">113: </a> <span class="php-keyword2">fclose</span>(<span class="php-var">$fileHandle</span>); <a href="#114" id="114" class="l">114: </a> <span class="php-keyword1">return</span> <span class="php-var">$properties</span>; <a href="#115" id="115" class="l">115: </a> } <a href="#116" id="116" class="l">116: </a> <a href="#117" id="117" class="l">117: </a> <span class="php-comment">/** </span><a href="#118" id="118" class="l">118: </a><span class="php-comment"> * Find a key in the localized properties for the component </span><a href="#119" id="119" class="l">119: </a><span class="php-comment"> * If an exact match cannot be located a less acurate one will be used </span><a href="#120" id="120" class="l">120: </a><span class="php-comment"> * for example if Page.Form.Required does not exists Form.Required will be </span><a href="#121" id="121" class="l">121: </a><span class="php-comment"> * used instead. </span><a href="#122" id="122" class="l">122: </a><span class="php-comment"> * @param string $key The key to search for </span><a href="#123" id="123" class="l">123: </a><span class="php-comment"> */</span> <a href="#124" id="124" class="l">124: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> getString(<span class="php-var">$key</span>, <span class="php-var">$model</span> = <span class="php-keyword1">null</span>) <a href="#125" id="125" class="l">125: </a> { <a href="#126" id="126" class="l">126: </a> <span class="php-var">$key</span> = <span class="php-keyword2">str_replace</span>(Component::PATH_SEPERATOR, <span class="php-quote">'.'</span>, <span class="php-var">$this</span>->component->getComponentPath()).<span class="php-var">$key</span>; <a href="#127" id="127" class="l">127: </a> <span class="php-var">$string</span> = <span class="php-keyword1">null</span>; <a href="#128" id="128" class="l">128: </a> <span class="php-keyword1">if</span>(<span class="php-var">$model</span>!=<span class="php-keyword1">null</span> && !(<span class="php-var">$model</span> <span class="php-keyword1">instanceof</span> Model)) <a href="#129" id="129" class="l">129: </a> { <a href="#130" id="130" class="l">130: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> \InvalidArgumentException(<span class="php-keyword2">sprintf</span>(<span class="php-quote">"Localizer::getString() expects argument 2 to be a Model"</span>)); <a href="#131" id="131" class="l">131: </a> } <a href="#132" id="132" class="l">132: </a> <span class="php-var">$string</span> = <span class="php-var">$this</span>->internalGetString(<span class="php-var">$key</span>); <a href="#133" id="133" class="l">133: </a> <a href="#134" id="134" class="l">134: </a> <span class="php-keyword1">if</span>(<span class="php-var">$string</span>!=<span class="php-keyword1">null</span> && <span class="php-var">$model</span>!=<span class="php-keyword1">null</span>) <a href="#135" id="135" class="l">135: </a> { <a href="#136" id="136" class="l">136: </a> <span class="php-var">$string</span> = <span class="php-var">$this</span>->interpolate(<span class="php-var">$string</span>, <span class="php-var">$model</span>); <a href="#137" id="137" class="l">137: </a> } <a href="#138" id="138" class="l">138: </a> <a href="#139" id="139" class="l">139: </a> <span class="php-keyword1">return</span> <span class="php-var">$string</span>; <a href="#140" id="140" class="l">140: </a> } <a href="#141" id="141" class="l">141: </a> <a href="#142" id="142" class="l">142: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> internalGetString(<span class="php-var">$key</span>) <a href="#143" id="143" class="l">143: </a> { <a href="#144" id="144" class="l">144: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">array_key_exists</span>(<span class="php-var">$key</span>, <span class="php-var">$this</span>->properties)) <a href="#145" id="145" class="l">145: </a> { <a href="#146" id="146" class="l">146: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>->properties[<span class="php-var">$key</span>]; <a href="#147" id="147" class="l">147: </a> } <a href="#148" id="148" class="l">148: </a> <span class="php-keyword1">else</span> <a href="#149" id="149" class="l">149: </a> { <a href="#150" id="150" class="l">150: </a> <span class="php-var">$keyHierarchy</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$key</span>); <a href="#151" id="151" class="l">151: </a> <a href="#152" id="152" class="l">152: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">count</span>(<span class="php-var">$keyHierarchy</span>)><span class="php-num">1</span>) <a href="#153" id="153" class="l">153: </a> { <a href="#154" id="154" class="l">154: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$keyHierarchy</span>[<span class="php-num">0</span>]); <a href="#155" id="155" class="l">155: </a> <span class="php-var">$lesserKey</span> = <span class="php-keyword2">implode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$keyHierarchy</span>); <a href="#156" id="156" class="l">156: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>->internalGetString(<span class="php-var">$lesserKey</span>); <a href="#157" id="157" class="l">157: </a> } <a href="#158" id="158" class="l">158: </a> } <a href="#159" id="159" class="l">159: </a> } <a href="#160" id="160" class="l">160: </a> <a href="#161" id="161" class="l">161: </a> <a href="#162" id="162" class="l">162: </a> <span class="php-comment">/** </span><a href="#163" id="163" class="l">163: </a><span class="php-comment"> * @todo extract this out to a helper </span><a href="#164" id="164" class="l">164: </a><span class="php-comment"> * @param type $string </span><a href="#165" id="165" class="l">165: </a><span class="php-comment"> * @param Model $model </span><a href="#166" id="166" class="l">166: </a><span class="php-comment"> */</span> <a href="#167" id="167" class="l">167: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> interpolate(<span class="php-var">$string</span>, Model <span class="php-var">$model</span>) <a href="#168" id="168" class="l">168: </a> { <a href="#169" id="169" class="l">169: </a> <span class="php-var">$object</span> = <span class="php-var">$model</span>->getModelObject(); <a href="#170" id="170" class="l">170: </a> <a href="#171" id="171" class="l">171: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">is_object</span>(<span class="php-var">$object</span>)) <a href="#172" id="172" class="l">172: </a> { <a href="#173" id="173" class="l">173: </a> <span class="php-var">$reflection</span> = <span class="php-keyword1">new</span> \ReflectionClass(<span class="php-var">$object</span>); <a href="#174" id="174" class="l">174: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$reflection</span>->getProperties() <span class="php-keyword1">as</span> <span class="php-var">$property</span>) <a href="#175" id="175" class="l">175: </a> { <a href="#176" id="176" class="l">176: </a> <span class="php-var">$property</span>->setAccessible(<span class="php-keyword1">true</span>); <a href="#177" id="177" class="l">177: </a> <span class="php-var">$name</span> = <span class="php-var">$property</span>->getName(); <a href="#178" id="178" class="l">178: </a> <span class="php-var">$value</span> = <span class="php-var">$property</span>->getValue(<span class="php-var">$object</span>); <a href="#179" id="179" class="l">179: </a> <a href="#180" id="180" class="l">180: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">is_array</span>(<span class="php-var">$value</span>)) <a href="#181" id="181" class="l">181: </a> { <a href="#182" id="182" class="l">182: </a> <span class="php-var">$string</span> = <span class="php-var">$this</span>->interpolate(<span class="php-var">$string</span>, <span class="php-keyword1">new</span> ArrayModel(<span class="php-var">$value</span>)); <a href="#183" id="183" class="l">183: </a> } <a href="#184" id="184" class="l">184: </a> <span class="php-keyword1">else</span> <span class="php-keyword1">if</span>(<span class="php-keyword2">is_object</span>(<span class="php-var">$value</span>)) <a href="#185" id="185" class="l">185: </a> { <a href="#186" id="186" class="l">186: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> \UnsupportedOperationException(<span class="php-quote">'Recursive interpolation not supported'</span>); <a href="#187" id="187" class="l">187: </a> } <a href="#188" id="188" class="l">188: </a> <span class="php-keyword1">else</span> <a href="#189" id="189" class="l">189: </a> { <a href="#190" id="190" class="l">190: </a> <span class="php-var">$string</span> = <span class="php-keyword2">str_replace</span>(<span class="php-quote">"\</span><span class="php-var">$</span><span class="php-quote">{"</span>.<span class="php-var">$name</span>.<span class="php-quote">"}"</span>, <span class="php-var">$value</span>, <span class="php-var">$string</span>); <a href="#191" id="191" class="l">191: </a> } <a href="#192" id="192" class="l">192: </a> } <a href="#193" id="193" class="l">193: </a> } <a href="#194" id="194" class="l">194: </a> <span class="php-keyword1">else</span> <span class="php-keyword1">if</span>(<span class="php-keyword2">is_array</span>(<span class="php-var">$object</span>)) <a href="#195" id="195" class="l">195: </a> { <a href="#196" id="196" class="l">196: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$object</span> <span class="php-keyword1">as</span> <span class="php-var">$key</span> => <span class="php-var">$value</span>) <a href="#197" id="197" class="l">197: </a> { <a href="#198" id="198" class="l">198: </a> <span class="php-var">$string</span> = <span class="php-keyword2">str_replace</span>(<span class="php-quote">"\</span><span class="php-var">$</span><span class="php-quote">{"</span>.<span class="php-var">$key</span>.<span class="php-quote">"}"</span>, <span class="php-var">$value</span>, <span class="php-var">$string</span>); <a href="#199" id="199" class="l">199: </a> } <a href="#200" id="200" class="l">200: </a> } <a href="#201" id="201" class="l">201: </a> <span class="php-keyword1">return</span> <span class="php-var">$string</span>; <a href="#202" id="202" class="l">202: </a> } <a href="#203" id="203" class="l">203: </a>} <a href="#204" id="204" class="l">204: </a> <a href="#205" id="205" class="l">205: </a><span class="xlang">?></span> <a href="#206" id="206" class="l">206: </a></code></pre> <div id="footer"> Picon Framework API documentation generated by <a href="http://apigen.org">ApiGen 2.7.0</a> </div> </div> </div> </body> </html>