Permalink
Browse files

Language subsystem update

  • Loading branch information...
1 parent 0f2ca6e commit 3d4f9fbe54acf851d04b4a6b7cb5ea0f7cce655a @gdever committed May 2, 2012
View
@@ -639,11 +639,12 @@ function load_translations_from_package( $PackageName , $PackageVersion )
*
* @author Dodonov A.A.
*/
- private function load_translations_if_necessary()
+ private function force_load_translations()
{
try
{
$Paths = _get_loaded_packages_paths();
+ $Paths [] = "./res/lang/lang.$this->Language";
$Key = implode_ex( '' , $Paths , 'directory' );
if( $this->Cache->data_exists( $Key ) === true )
{
@@ -653,8 +654,8 @@ private function load_translations_if_necessary()
{
foreach( $Paths as $p )
{
- $PackagePath = _get_top_package_name( $p[ 'package_name' ] );
- $LanguageFilePath = $p[ 'directory' ]."/res/lang/$PackagePath.$this->Language";
+ $PackageName = _get_top_package_name( $p[ 'package_name' ] );
+ $LanguageFilePath = $p[ 'directory' ]."/res/lang/$PackageName.$this->Language";
$this->load_translations_from_file( $LanguageFilePath );
}
@@ -689,7 +690,7 @@ function load_translations()
{
$this->get_locale();
- $this->load_translations_if_necessary();
+ $this->force_load_translations();
$this->AutoTranslationsWereLoaded = true;
}
@@ -1,4 +1,5 @@
template_content_access.1.0.0#template_content_access
-template_content_manager.1.0.0#template_content_manager
template_content_controller.1.0.0#template_content_controller
+template_content_manager.1.0.0#template_content_manager
+template_content_markup.1.0.0#template_content_markup
template_content_view.1.0.0#template_content_view
@@ -0,0 +1 @@
+<html><head></head><body></body></html>
@@ -0,0 +1,124 @@
+<?php
+
+ /*
+ * This source code is a part of the Ultimix Project.
+ * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
+ * it's own license wich could be found from the corresponding files or sources.
+ * This source code is provided "as is" without any warranties or garanties.
+ *
+ * Have a nice day!
+ *
+ * @url http://ultimix.sorceforge.net
+ *
+ * @author Alexey "gdever" Dodonov
+ */
+
+ /**
+ * \~russian Отображение статического контента.
+ *
+ * @author Додонов А.А.
+ */
+ /**
+ * \~english Displaying template content.
+ *
+ * @author Dodonov A.A.
+ */
+ class template_content_markup_1_0_0{
+
+ /**
+ * \~russian Закешированные объекты.
+ *
+ * @author Додонов А.А.
+ */
+ /**
+ * \~english Cached objects.
+ *
+ * @author Dodonov A.A.
+ */
+ var $BlockSettings = false;
+ var $CachedMultyFS = false;
+ var $Security = false;
+ var $TemplateContentAccess = false;
+ var $String = false;
+
+ /**
+ * \~russian Конструктор.
+ *
+ * @author Додонов А.А.
+ */
+ /**
+ * \~english Constructor.
+ *
+ * @author Dodonov A.A.
+ */
+ function __construct()
+ {
+ try
+ {
+ $this->BlockSettings = get_package_object( 'settings::settings' , 'last' , __FILE__ );
+ $this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
+ $this->Security = get_package( 'security' , 'last' , __FILE__ );
+ $this->TemplateContentAccess = get_package( 'page::template_content::template_content_access' );
+ $this->String = get_package( 'string' , 'last' , __FILE__ );
+ }
+ catch( Exception $e )
+ {
+ $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
+ }
+ }
+
+ /**
+ * \~russian Функция отвечающая за обработку страницы.
+ *
+ * @param $Options - Параметры отображения.
+ *
+ * @param $ProcessingString - Обрабатывемая строка.
+ *
+ * @param $Changed - Была ли осуществлена обработка.
+ *
+ * @return HTML код для отображения.
+ *
+ * @exception Exception Кидается иключение этого типа с описанием ошибки.
+ *
+ * @author Додонов А.А.
+ */
+ /**
+ * \~english Function processes page.
+ *
+ * @param $Options - Options of drawing.
+ *
+ * @param $ProcessingString - Processing string.
+ *
+ * @param $Changed - Was the processing completed.
+ *
+ * @return HTML code to display.
+ *
+ * @exception Exception An exception of this type is thrown.
+ *
+ * @author Dodonov A.A.
+ */
+ function process_string( $Options , $ProcessingString , &$Changed )
+ {
+ try
+ {
+ $Parameters = '';
+ for( ; $Parameters = $this->String->get_macro_parameters( $ProcessingString , 'template_content' ) ; )
+ {
+ $this->BlockSettings->load_settings( $Parameters );
+ $Content = $this->TemplateContentAccess->get_content_ex( $this->BlockSettings );
+ $ProcessingString = str_replace(
+ "{template_content:$Parameters}" , $Content , $ProcessingString
+ );
+ $Changed = true;
+ }
+
+ return( $ProcessingString );
+ }
+ catch( Exception $e )
+ {
+ $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
+ }
+ }
+ }
+
+?>
@@ -130,6 +130,7 @@ function view( $Options )
{
try
{
+ // TODO detect process_string functions in the non markup packages
if( $Options->get_setting( 'template' , false ) === false )
{
$ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
@@ -148,60 +149,6 @@ function view( $Options )
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
-
- /**
- * \~russian Функция отвечающая за обработку страницы.
- *
- * @param $Options - Параметры отображения.
- *
- * @param $ProcessingString - Обрабатывемая строка.
- *
- * @param $Changed - Была ли осуществлена обработка.
- *
- * @return HTML код для отображения.
- *
- * @exception Exception Кидается иключение этого типа с описанием ошибки.
- *
- * @author Додонов А.А.
- */
- /**
- * \~english Function processes page.
- *
- * @param $Options - Options of drawing.
- *
- * @param $ProcessingString - Processing string.
- *
- * @param $Changed - Was the processing completed.
- *
- * @return HTML code to display.
- *
- * @exception Exception An exception of this type is thrown.
- *
- * @author Dodonov A.A.
- */
- function process_string( $Options , $ProcessingString , &$Changed )
- {
- try
- {
- // TODO create template_markup package
- $Parameters = '';
- for( ; $Parameters = $this->String->get_macro_parameters( $ProcessingString , 'template_content' ) ; )
- {
- $this->BlockSettings->load_settings( $Parameters );
- $Content = $this->TemplateContentAccess->get_content_ex( $this->BlockSettings );
- $ProcessingString = str_replace(
- "{template_content:$Parameters}" , $Content , $ProcessingString
- );
- $Changed = true;
- }
-
- return( $ProcessingString );
- }
- catch( Exception $e )
- {
- $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
- }
- }
}
?>
View
@@ -0,0 +1 @@
+<html><head></head><body></body></html>
View
No changes.
View
No changes.
@@ -1,6 +1,8 @@
Ultimix v. 1.5.243
-----------------------------------------
1. Small refactorings and improvements.
+2. The package 'page::template_content::template_content_markup' was added.
+3. Language file './res/lang/lang.{locale}' was added.
Ultimix v. 1.5.242
-----------------------------------------

0 comments on commit 3d4f9fb

Please sign in to comment.