Permalink
Browse files

Recent Changes

  • Loading branch information...
1 parent e4ae927 commit 42a8074e61dace4de7c734fb9d2183ff25603f6d @gdever committed Apr 16, 2012
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
Binary file not shown.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -119,7 +119,54 @@ function load_config( $ConfigFilePath )
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
-
+
+ /**
+ * \~russian Добавление контекстов.
+ *
+ * @param $Options - Параметры.
+ *
+ * @param $ContextFolder - Путь к директории.
+ *
+ * @param $Contexts - Контексты.
+ *
+ * @exception Exception Кидается исключение этого типа с описанием ошибки.
+ *
+ * @author Додонов А.А.
+ */
+ /**
+ * \~english Method adds non-standart contexts.
+ *
+ * @param $Options - Options.
+ *
+ * @param $ContextFolder - Path to the directory.
+ *
+ * @param $Contexts - Contexts.
+ *
+ * @exception Exception An exception of this type is thrown.
+ *
+ * @author Dodonov A.A.
+ */
+ function load_hinted_config( &$Options , $ContextFolder , $Contexts )
+ {
+ try
+ {
+ $HintedContext = $Options->get_setting( 'context' , false );
+
+ if( $HintedContext !== false && in_array( $HintedContext , $Contexts ) )
+ {
+ $this->load_config( "$ContextFolder/conf/$HintedContext" );
+ }
+ else
+ {
+ throw( new Exception( 'Config was not hinted' ) );
+ }
+ }
+ catch( Exception $e )
+ {
+ $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
+ }
+ }
+
/**
* \~russian Функция загрузки конфига.
*
@@ -1,5 +1,4 @@
page::page_composer#last#post_process=1#
-user::user_controller#last#controller=1;simple_login=1#
page::page_composer_view#last#view=1;direct_controller=1#data
lang::lang_markup#last#post_process=1#
gui#last#post_process=1#
@@ -1,4 +1,3 @@
-user::user_controller#last#controller=1;simple_login=1#
page::page_composer_view#last#view=1;direct_view=1#data
page::page_composer#last#post_process=1#
lang::lang_markup#last#post_process=1#
@@ -35,6 +35,7 @@ class user_controller_1_0_0{
*
* @author Dodonov A.A.
*/
+ var $Context = false;
var $EventManager = false;
var $Messages = false;
var $PageComposerUtilities = false;
@@ -149,6 +150,7 @@ function __construct()
{
try
{
+ $this->Context = get_package( 'gui::context' , 'last' , __FILE__ );
$this->EventManager = get_package( 'event_manager' , 'last' , __FILE__ );
$this->Messages = get_package( 'page::messages' , 'last' , __FILE__ );
$this->PageComposerUtilities = get_package( 'page::page_composer_utilities' , 'last' , __FILE__ );
@@ -855,17 +857,15 @@ function controller( &$Options )
{
try
{
- $ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
-
- $ContextSet->add_contexts(
+ $this->Context->load_hinted_config(
$Options , dirname( __FILE__ ) ,
array(
'cfcx_update_user' , 'cfcx_activate_user' , 'cfcx_restore_password' ,
'cfcx_registration_form' , 'cfcx_user_set_avatar' , 'cfcx_login' , 'cfcx_logout'
)
);
- if( $ContextSet->execute( $Options , $this , __FILE__ ) )
+ if( $this->Context->execute( $Options , $this , __FILE__ ) )
{
return;
}
@@ -42,6 +42,7 @@ class user_view_1_0_0{
* @author Dodonov A.A.
*/
var $CachedMultyFS = false;
+ var $ContextSet = false;
var $Security = false;
var $String = false;
var $UserAccess = false;
@@ -145,6 +146,7 @@ function __construct()
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
+ $this->ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );;
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->UserAccess = get_package( 'user::user_access' , 'last' , __FILE__ );
@@ -610,11 +612,9 @@ function view( &$Options )
{
try
{
- $ContextSet = get_package_object( 'gui::context_set' , 'last' , __FILE__ );
+ $this->ContextSet->add_contexts( $Options , dirname( __FILE__ ) , $this->get_contexts() );
- $ContextSet->add_contexts( $Options , dirname( __FILE__ ) , $this->get_contexts() );
-
- $ContextSet->execute( $Options , $this , __FILE__ );
+ $this->ContextSet->execute( $Options , $this , __FILE__ );
return( $this->Output );
}

0 comments on commit 42a8074

Please sign in to comment.