<?php
    require_once( BX_DIRECTORY_PATH_BASE . 'scripts/BxBaseFunctions.php' );

    class BxTemplFunctions extends BxBaseFunctions
    {
        /**
         * class constructor
        */
        function BxTemplFunctions()
        {
            parent::BxBaseFunctions();
        }

//Begin Pages module function

    function genGalleryImagesPages($aImages, $oTemplate = false)
    {
        if (!$aImages)
            return '';

        $aVars = array (
            'prefix' => $sPrefix ? $sPrefix : 'id'.time().'_'.rand(1, 999999),
            'bx_repeat:images_icons' => array (),
            'bx_repeat:icons' => array (),
        );

        $iId = 0;
        foreach ($aImages as $aImage) {
            $a = array (
                'id' => ++$iId,
                'icon_url' => $aImage['icon_url'],
                'image_url' => $aImage['image_url'],
                'title' => $aImage['title'],
            );
            $aVars['bx_repeat:images'][] = $a;
            $aVars['bx_repeat:icons'][] = $a;
        }

        if (!$oTemplate)
            $oTemplate = $GLOBALS['oSysTemplate'];
        $oTemplate->addJs('jquery.dolGalleryImagesPages.js');
        $oTemplate->addCss('gallery_images_pages.css');
        return $oTemplate->parseHtmlByName('gallery_images_pages.html', $aVars);
    }


// End Pages module Function

    }
    $oFunctions = new BxTemplFunctions();
