ultimix
user_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 compile_session_login (&$Settings)
 compile_auth (&$Settings, $Data)
 compile_user_id (&$Settings)
 compile_user_list (&$Settings)
 compile_months_on_site (&$Settings)
 compile_user_login (&$Settings)

Data Fields

 $CachedMultyFS = false
 $MacroSettings = false
 $PermitAlgorithms = false
 $String = false
 $UserAlgorithms = false
 $UserView = false
 $EnableRegistration = 1

Detailed Description

Working with user's accounts.

Author
Dodonov A.A.

Definition at line 26 of file user_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 67 of file user_markup.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->PermitAlgorithms = get_package( 'permit::permit_algorithms' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->UserAlgorithms = get_package( 'user::user_algorithms' , 'last' , __FILE__ );
$this->UserView = get_package( 'user::user_view' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_auth ( $Settings,
  $Data 
)

Function compiles блока 'logged_in'.

Parameters
$Settings- Parameters.
$Data- Data.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 148 of file user_markup.php.

{
try
{
$RawSettings = $Settings->get_raw_settings();
$Flag = array_shift( array_keys( $RawSettings ) );
$ShowData = ( $Flag == 'logged_in' && $this->UserAlgorithms->logged_in() === true ) ||
( $Flag == 'guest' && $this->UserAlgorithms->logged_in() === false );
if( $ShowData )
{
return( $Data );
}
return( '' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_months_on_site ( $Settings)

Function compiles macro 'months_on_site'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 325 of file user_markup.php.

{
try
{
$User = $this->UserAlgorithms->get_by_id( $Settings->get_setting( 'user_id' ) );
$Code = time() - strtotime( get_field( $User , 'registered' ) );
$Code = intval( $Code / ( 30 * 24 * 60 * 60 ) );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_session_login ( $Settings)

Function compiles macro 'session_login'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 105 of file user_markup.php.

{
try
{
if( $this->UserAlgorithms->logged_in() )
{
return( $this->UserAlgorithms->get_login() );
}
return( 'public' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_user_id ( $Settings)

Function compiles macro 'user_id'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 193 of file user_markup.php.

{
try
{
if( $this->UserAlgorithms->logged_in() )
{
return( $this->UserAlgorithms->get_id() );
}
return( $this->UserAccess->GuestUserId );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_user_list ( $Settings)

Function compiles macro 'user_list'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 278 of file user_markup.php.

{
try
{
$Users = $this->fetch_users( $Settings );
$Name = $Settings->get_setting( 'name' );
$Field = $Settings->get_setting( 'field' , 'login' );
$Code = '';
foreach( $Users as $i => $id )
{
$User = $this->UserAlgorithms->get_by_id( $id );
$Code .= "{checkbox:name=_$Name".get_field( $User , 'id' ).";current_value=on}".
get_field( $User , $Field ).
$this->CahcedMultyFS->get_template( __FILE__ , 'user_end_line.tpl' );
}
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_user_login ( $Settings)

Function compiles macro 'user_login'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 364 of file user_markup.php.

{
try
{
$User = $this->UserAlgorithms->get_by_id( $Settings->get_setting( 'user_id' ) );
return( get_field( $User , 'login' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cached packages.

Author
Dodonov A.A.

Definition at line 38 of file user_markup.php.

$EnableRegistration = 1

If the registration exists.

Author
Dodonov A.A.

Definition at line 55 of file user_markup.php.

$MacroSettings = false

Definition at line 39 of file user_markup.php.

$PermitAlgorithms = false

Definition at line 40 of file user_markup.php.

$String = false

Definition at line 41 of file user_markup.php.

$UserAlgorithms = false

Definition at line 42 of file user_markup.php.

$UserView = false

Definition at line 43 of file user_markup.php.


The documentation for this class was generated from the following file: