ultimix
content_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 pre_generation (&$Options)
 select_content_line_items ($Start, $Limit, $Field, $Order, $Condition, &$Options)
 content_archive (&$Options)
 compile_view_content ($ContentId)
 view_content ($Options)
 view ($Options)

Data Fields

 $Output
 $CachedMultyFS = false
 $ContentAccess = false
 $ContentAlgorithms = false
 $PageMeta = false
 $Security = false
 $Settings = false
 $String = false

Detailed Description

This manager helps creating content.

Author
Dodonov A.A.

Definition at line 26 of file content_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 68 of file content_view.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->ContentAccess = get_package( 'content::content_access' , 'last' , __FILE__ );
$this->ContentAlgorithms = get_package( 'content::content_algorithms' , 'last' , __FILE__ );
$this->PageMeta = get_package( 'page::page_meta' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->Settings = get_package( 'settings::package_settings' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_view_content (   $ContentId)

Function draws component.

Parameters
$ContentId- Content id.
Returns
Content.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 565 of file content_view.php.

{
try
{
$Content = $this->ContentAlgorithms->get_by_id( $ContentId );
$Template = $this->CachedMultyFS->get_template( __FILE__ , 'content_view_template.tpl' );
$Output = $this->String->print_record( $Template , $Content );
$this->PageMeta->set_page_title( get_field( $Content , 'title' ) );
$this->PageMeta->add_page_keywords( get_field( $Content , 'keywords' ) );
$this->PageMeta->add_page_description( get_field( $Content , 'description' ) );
return( $Output );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
content_archive ( $Options)

Function draws component.

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

Definition at line 522 of file content_view.php.

{
try
{
$CategoryAccess = get_package( 'category::category_algorithms' , 'last' , __FILE__ );
$CategoryIds = $CategoryAccess->get_category_ids(
$Options->get_setting( 'category' , 'news,article,faq,blog' )
);
$PublicationStructure = $this->ContentAccess->get_publication_structure( $CategoryIds );
$Years = array_unique( get_field_ex( $PublicationStructure , 'publication_year' ) );
$this->compile_years( $PublicationStructure , $Years , $CategoryIds );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
pre_generation ( $Options)

Function executes before any page generating actions took place.

Parameters
$Options- Settings.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 104 of file content_view.php.

{
try
{
$PackagePath = _get_package_relative_path_ex( 'content::content_view' , '1.0.0' );
$PageCSS = get_package( 'page::page_css' , 'last' , __FILE__ );
$PageCSS->add_stylesheet( "{http_host}/$PackagePath/res/css/content.css" );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
select_content_line_items (   $Start,
  $Limit,
  $Field,
  $Order,
  $Condition,
$Options 
)

Function returns list of records.

Parameters
$Start- Number of the first record.
$Limit- Count of records limitation.
$Field- Field to sort by.
$Order- Sorting order.
$Condition- Additional condtions.
$Options- Additional options.
Returns
List of records.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 204 of file content_view.php.

{
try
{
$Category = get_package( 'category::category_algorithms' , 'last' , __FILE__ );
$CategoryNames = $this->get_category_names( $Options );
$CategoryIds = $Category->get_category_ids( $CategoryNames );
return(
$this->ContentAccess->select(
$Start , $Options->get_setting( 'display_limit' , $Limit ) , $Field , $Order ,
"( $Condition ) AND category IN ( ".implode( ' , ' , $CategoryIds ).' )'
)
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view (   $Options)

Function draws component.

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

Definition at line 643 of file content_view.php.

{
try
{
$ContextSet = get_package_object( 'gui::context_set' , 'last' , __FILE__ );
$Path = dirname( __FILE__ );
$ContextSet->add_context( "$Path/conf/cfcxs_content_line" );
$ContextSet->add_context( "$Path/conf/cfcxs_content_view" );
$ContextSet->add_context( "$Path/conf/cfcxs_content_archive" );
$ContextSet->execute( $Options , $this , __FILE__ );
return( $this->Output );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view_content (   $Options)

Function draws component.

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

Definition at line 603 of file content_view.php.

{
try
{
if( ( $ContentId = $this->Security->get_gp( 'content_id' , 'integer' , false ) ) === false )
{
$this->Output = '{lang:exact_content_was_not_found}';
return;
}
$this->Output = $this->compile_view_content( $ContentId );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cached objects.

Author
Dodonov A.A.

Definition at line 50 of file content_view.php.

$ContentAccess = false

Definition at line 51 of file content_view.php.

$ContentAlgorithms = false

Definition at line 52 of file content_view.php.

$Output

Display function's result.

Author
Dodonov A.A.

Definition at line 38 of file content_view.php.

$PageMeta = false

Definition at line 53 of file content_view.php.

$Security = false

Definition at line 54 of file content_view.php.

$Settings = false

Definition at line 55 of file content_view.php.

$String = false

Definition at line 56 of file content_view.php.


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