ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
gallery_markup_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| get_dependent_gallery_id (&$BlockSettings)
| get_gallery (&$BlockSettings)
| get_galery_template_for_client ($FilePath, $GalleryId)
| compile_gallery (&$Settings)

## Data Fields
| $CachedMultyFS = false
| $GalleryAccess = false
| $GalleryAlgorithms = false
| $Link = false
| $String = false

## Detailed Description

Class processes gallery macro.

Author
  Dodonov A.A.

Definition at line 26 of file gallery_markup.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 58 of file gallery_markup.php.

{
try
{
$this->CachedMultyFS = get_package_object( 'cached_multy_fs' , 'last' , __FILE__ );
$this->GalleryAccess = get_package( 'gallery::gallery_access' , 'last' , __FILE__ );
$this->GalleryAlgorithms = get_package( 'gallery::gallery_algorithms' , 'last' , __FILE__ );
$this->Link = get_package( 'link' , '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_gallery | ( | & | $Settings | ) |

Function processes macro 'radio'.

Parameters

  $Settings | - Compilation parameters.

Returns
  Control.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 375 of file gallery_markup.php.

{
try
{
$Gallery = $this->get_gallery( $Settings );
$Files = $this->GalleryAlgorithms->get_gallery_files( get_field( $Gallery , 'id' ) );
$Code = $this->compile_gallery_files( $Gallery , $Files );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_dependent_gallery_id | ( | & | $BlockSettings | ) |

Function returns id of the dependent gallery. Gallery will be created if necessary.

Parameters

  $BlockSettings | - Parameters.

Returns
  Gallery's id.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 143 of file gallery_markup.php.

{
try
{
$MasterType = $BlockSettings->get_setting( 'master_type' );
$MasterId = $BlockSettings->get_setting( 'master_id' );
if( $this->Link->link_exists( $MasterId , false , $MasterType , 'gallery' ) )
{
$Link = $this->Link->get_links( $MasterId , false , $MasterType , 'gallery' );
return( get_field( $Link[ 0 ] , 'object2_id' ) );
}
else
{
return( $this->create_dependent_gallery( $MasterType , $MasterId ) );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_galery_template_for_client | ( |  | $FilePath,
|  |  | $GalleryId
| ) |  |

GEtting template for the client.

Parameters

  $FilePath | - Path to the template.
  $GalleryId | - Id of the gallery.

Returns
  HTML code of the template.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 236 of file gallery_markup.php.

{
try
{
$GalleryTemplate = $this->CachedMultyFS->file_get_contents( $FilePath );
$GalleryTemplate = str_replace( '{gallery_id}' , $GalleryId , $GalleryTemplate );
$GalleryTemplate = str_replace( '{id}' , '[id]' , $GalleryTemplate );
$GalleryTemplate = str_replace( '{file_path}' , '[file_path]' , $GalleryTemplate );
$GalleryTemplate = str_replace( '{original_file_name}' , '[original_file_name]' , $GalleryTemplate );
$GalleryTemplate = str_replace( '{' , '[lfb]' , $GalleryTemplate );
$GalleryTemplate = str_replace( '}' , '[rfb]' , $GalleryTemplate );
return( $GalleryTemplate );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_gallery | ( | & | $BlockSettings | ) |

Function returns gallery object. Gallery will be created if necessary.

Parameters

  $BlockSettings | - Parameters.

Returns
  Gallery object.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 189 of file gallery_markup.php.

{
try
{
if( $BlockSettings->get_setting( 'master_id' , false ) === false )
{
$id = $BlockSettings->get_setting( 'id' );
}
else
{
$id = $this->get_dependent_gallery_id( $BlockSettings );
}
return( $this->GalleryAlgorithms->get_by_id( $id ) );
}
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 gallery_markup.php.

$GalleryAccess = false

Definition at line 39 of file gallery_markup.php.

$GalleryAlgorithms = false

Definition at line 40 of file gallery_markup.php.

$Link = false

Definition at line 41 of file gallery_markup.php.

$String = false

Definition at line 42 of file gallery_markup.php.

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

- packages/gallery/packages/gallery_markup/gallery_markup.php