* based on the PGTheme by Pedro Gilberto */ /** * This implements the standard gallery theme * * @package GalleryTheme * @subpackage Theme */ class natureTheme extends GalleryTheme { /** * Constructor */ function natureTheme() { global $gallery; $this->setId('nature'); $this->setName($gallery->i18n('Nature')); $this->setDescription($gallery->i18n('Gallery2 theme designed by www.saulmade.nl (based on the PGTheme)')); $this->setVersion('1.0.0'); /* Update upgrade() also */ $this->setRequiredCoreApi(array(6, 5)); $this->setRequiredThemeApi(array(2, 1)); $this->setStandardSettings( array('rows' => 4, 'columns' => 4, 'showImageOwner' => 0, 'showAlbumOwner' => 0, 'albumFrame' => '', 'itemFrame' => '', 'photoFrame' => 'natureWhite', 'colorpack' => 'natureGreenDarkGreen', // write the dirName of the colorPack you want to use 'showMicroThumbs' => 1, 'sidebarBlocks' => serialize(array( array('core.ItemLinks', array('useDropdown' => true)), array('search.SearchBlock',array('showAdvancedLink' => true)), array('imageblock.ImageBlock', array()), array('albumselect.AlbumTree', array()), array('checkout.ShowCart', array()), array('core.LanguageSelector', array()) )), 'albumBlocks' => serialize(array( array('search.SearchBlock',array('showAdvancedLink' => false)), array('checkout.ShowCart', array()) )), 'photoBlocks' => serialize(array( array('search.SearchBlock',array('showAdvancedLink' => false)), array('checkout.ShowCart', array()) )) )); } /** * @see GalleryLayout::getSettings() */ function getSettings($itemId=null) { list ($ret, $settings) = parent::getSettings($itemId); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } list ($ret, $params) = $this->fetchParameters($itemId); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } /* Add in our custom settings */ $params = array_merge(array( 'site' => '', 'email' => '', 'iestatus' => '1', 'expand' => '', 'expandBtn' => '', 'RC' => '', 'RCoptions' => '1', 'RCalert' => '', 'sidebar' => '', 'sidebarT' => '20', 'sidebarL' => '10', 'link1' => '', 'link1url' => '', 'link2' => '', 'link2url' => '', 'showOwnerContact' => '1', 'authorlink1' =>'','authorlink1url' =>'', 'authorlink2' =>'','authorlink2url' =>'', 'columns1st'=>'2', '1stTitle' => '1', '1stDescription' => '1', 'InfoGallery'=>'', 'Showslideshow'=> '1', 'AlbumBlock'=> '', 'NavAlbumTop'=>'1', 'NavAlbumBottom'=>'1', 'opacityT' => '10', 'opacityTover' => '6', 'AlbumTitle'=> '1', 'AlbumDescription'=> '1', 'AlbumInfo'=>'', 'AlbumTitleTop'=> '1', 'AlbumDescriptionTop'=> '1', 'AlbumInfoTop'=>'', 'ItemsCenter'=>'', 'ItemsTitle'=> '1', 'ItemsDesc'=>'', 'ItemsInfo'=>'', 'NavPhotoTop'=>'0', 'NavPhotoBottom'=> '1', 'NavPop'=> '0', 'NavPopEven'=> '', 'NavOverTop'=> '0', 'NavOverBottom'=> '', 'NavOverPopup'=> '1','NavOverPopupEven'=> '', 'PhotoTitle'=> '1', 'PhotoDescription'=> '1', 'InfoPhoto'=> '1', 'PhotoTitleTop'=> '', 'PhotoDescriptionTop'=>'', 'InfoPhotoTop'=>'', 'InfoSize'=> '0', 'InfoSizeEven'=> '', 'PopSize'=> '0', 'PopSizeEven'=> '', 'imageFadin' => '0', 'MTposition' => '', 'MTends' => '1', 'MTmorepics' => '1', 'MTmore' => '1', 'MTmoretext' => '', 'peerWindowSize' => '9', 'columnsMT' => '4', 'sizeMT' => '40', 'opacityMT' => '4', 'opacityMTover' => '10', 'MToversize' => '3', 'MTbg' => '', 'MTbgborder' => '', 'BlocksAlign'=> 'right', 'BlocksInAlign'=> 'left', 'OtherBlocksBtn'=> '0', 'AuthorActions'=> '1', 'AuthorComments'=>'', 'AlbumActions'=> '1', 'AddAlbumComments'=>'', 'AlbumComments'=>'', 'ItemsActions'=> '1', 'ItemsComments'=>'', 'ItemsExif' =>'', 'BtnAfter'=> '1', 'PhotoActions'=> '1', 'AddPhotoComments'=>'1', 'PhotoComments'=>'1', 'PhotoCart'=>'1', 'PhotoExif'=>'1', 'ActionsText'=>'1', 'AddCartText'=>'/', 'ExifText'=>'/', 'CommentsText'=>'/', 'ViewCommentsText'=>'/', 'BlocksText'=>'', 'valbtn'=>'1', 'g2btn'=>'1', 'g2verbtn'=>'1', 'pgbtn'=>'1', 'pgcpbtn'=>'1', 'donbtn'=>'1', 'ss' => '1', // Nature theme params '1stShowCartForRoot' => '0', 'ShowCartForAlbums' => '0', '1stShowAlbumText' => '1', '1stShowBreadCrumb' => '0', 'HeadPosition' => 'hide', // hide, intern or extern 'BreadCrumbPosition' => 'intern', // hide, intern or extern 'SystemLinksPosition' => 'hide', // hide, intern or extern 'ExternalLinksPosition' => 'intern', // hide, intern or extern 'NavigationStyle' => 'natureTheme', // square or esssentialPictures 'LinksSeparator'=>'|', 'BreadCrumbSeparator'=>'>', 'LogoLink'=>'http://www.saulmade.nl', 'ReturnText'=>'', 'SlideshowText'=>'', 'fullSizePopupText'=>'/', 'ShowFooterAsBar'=>'1', 'FooterBarLinkText'=>'', 'FooterBarLinkURL'=>'', '1stFooterBarLinkExclusive'=>'1', '1stHideCart'=>'1', 'SmallLogoPosition'=>'intern', '1stHideSmallLogo'=>'1', 'pageDiv'=>'0', 'ShowKeywordsPhoto'=>'1', 'titleAndDescriptionDiv'=>'0' ), $params); $settings[] = array('key' => 'site', 'name' => $this->translate('OVERALL :: Your SITE ID. to display on Copyright Messages'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['site']); $settings[] = array('key' => 'email', 'name' => $this->translate('OVERALL :: Your EMAIL to display a link on footer Copyright Message'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['email']); $settings[] = array('key' => 'iestatus', 'name' => $this->translate('OVERALL :: Display Your SITE ID. on Window Status Bar (only for IE)'), 'type' => 'checkbox', 'value' => $params['iestatus']); $settings[] = array('key' => 'expand', 'name' => $this->translate('OVERALL :: Expand windows to full screen on loading'), 'type' => 'checkbox', 'value' => $params['expand']); $settings[] = array('key' => 'expandBtn', 'name' => $this->translate('OVERALL :: Show expand to full screen button'), 'type' => 'checkbox', 'value' => $params['expandBtn']); $settings[] = array('key' => 'pageDiv', 'name' => $this->translate('OVERALL :: Height of the content, excluding the menu\'s, head and footer. A scrollbar will appear when the content extends this height. Set to zero or leave empty if you don\'t want a height limitation.'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['pageDiv']); $settings[] = array('key' => 'LogoLink', 'name' => $this->translate('OVERALL :: URL to which to logo must link (gallery root if empty).'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['LogoLink']); $settings[] = array('key' => 'HeadPosition', 'name' => $this->translate('OVERALL :: Position or hide the head (logo and fullScreen button).'), 'type' => 'single-select', 'choices' => array("extern"=>"extern", "intern"=>"intern", "hide"=>"hide"), 'value' => $params['HeadPosition']); $settings[] = array('key' => 'SmallLogoPosition', 'name' => $this->translate('OVERALL :: Position or hide the small logo. A small logo that appears between the BreadCrumbs and the menu links.'), 'type' => 'single-select', 'choices' => array("extern"=>"extern", "intern"=>"intern", "hide"=>"hide"), 'value' => $params['SmallLogoPosition']); $settings[] = array('key' => '1stHideSmallLogo', 'name' => $this->translate('OVERALL :: Force the small logo to hide on the first page. This overrides the setting above for the first page.'), 'type' => 'checkbox', 'value' => $params['1stHideSmallLogo']); $settings[] = array('key' => 'RC', 'name' => $this->translate('OVERALL :: Right Click - Disable'), 'type' => 'checkbox', 'value' => $params['RC']); $settings[] = array('key' => 'RCoptions', 'name' => $this->translate('OVERALL :: Right Click - Show Options'), 'type' => 'checkbox', 'value' => $params['RCoptions']); $settings[] = array('key' => 'RCalert', 'name' => $this->translate('OVERALL :: Right Click - Show Alert'), 'type' => 'checkbox', 'value' => $params['RCalert']); $settings[] = array('key' => 'sidebar', 'name' => $this->translate('OVERALL :: SideBar - Show Static Sidebar'), 'type' => 'checkbox', 'value' => $params['sidebar']); $settings[] = array('key' => 'sidebarT', 'name' => $this->translate('OVERALL :: SideBar - Top position for Floating Sidebar'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['sidebarT']); $settings[] = array('key' => 'sidebarL', 'name' => $this->translate('OVERALL :: SideBar - Left position for Floating Sidebar'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['sidebarL']); $settings[] = array('key' => 'BreadCrumbSeparator', 'name' => $this->translate('OVERALL :: Top Navigation - Separation for BreadCrumb items (ex. >)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['BreadCrumbSeparator']); $settings[] = array('key' => 'BreadCrumbPosition', 'name' => $this->translate('OVERALL :: Top Navigation - Position or hide the BreadCrumbs. Even when hidden, the BreadCrumbs will still show externaly for the admin.'), 'type' => 'single-select', 'choices' => array("extern"=>"extern", "intern"=>"intern", "hide"=>"hide"), 'value' => $params['BreadCrumbPosition']); $settings[] = array('key' => '1stShowBreadCrumb', 'name' => $this->translate('OVERALL :: Top Navigation - Show BreadCrumbs on the first page. Even when hidden, the BreadCrumbs will still show externaly for the admin.'), 'type' => 'checkbox', 'value' => $params['1stShowBreadCrumb']); $settings[] = array('key' => 'link1', 'name' => $this->translate('OVERALL :: Top Navigation - Link'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['link1']); $settings[] = array('key' => 'link1url', 'name' => $this->translate('OVERALL :: Top Navigation - URL for this Link'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['link1url']); $settings[] = array('key' => 'link2', 'name' => $this->translate('OVERALL :: Top Navigation - Other Link'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['link2']); $settings[] = array('key' => 'link2url', 'name' => $this->translate('OVERALL :: Top Navigation - URL for this Link'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['link2url']); $settings[] = array('key' => 'LinksSeparator', 'name' => $this->translate('OVERALL :: Top Navigation - Separation for system and external link items (ex. |)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['LinksSeparator']); $settings[] = array('key' => 'SystemLinksPosition', 'name' => $this->translate('OVERALL :: Top Navigation - Position or hide the system/admin links. Even when hidden, these links will still show externaly for the admin.'), 'type' => 'single-select', 'choices' => array("extern"=>"extern", "intern"=>"intern", "hide"=>"hide"), 'value' => $params['SystemLinksPosition']); $settings[] = array('key' => 'ExternalLinksPosition', 'name' => $this->translate('OVERALL :: Top Navigation - Position or hide the external/site links (externalLinks.tpl).'), 'type' => 'single-select', 'choices' => array("extern"=>"extern", "intern"=>"intern", "hide"=>"hide"), 'value' => $params['ExternalLinksPosition']); $settings[] = array('key' => 'NavigationStyle', 'name' => $this->translate('OVERALL :: Gallery Navigation - Show the \'square\' gallery navigation icons (square icons near the top of the page) or \'natureTheme\' icons (no gallery root link, but only a return arrow to go to the image\'s album. This icon and the slideshow icon are positioned below the MicroThumbs. If nothing needs to be displayed near the top of the page, the horizontal bar will be hidden.)'), 'type' => 'single-select', 'choices' => array("square"=>"square", "natureTheme"=>"natureTheme"), 'value' => $params['NavigationStyle']); $settings[] = array('key' => 'showOwnerContact', 'name' => $this->translate('ALBUM :: 1st Page - Show author welcome message'), 'type' => 'checkbox', 'value' => $params['showOwnerContact']); $settings[] = array('key' => 'authorlink1', 'name' => $this->translate('ALBUM :: 1st Page message - 1st link title (on the left)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['authorlink1']); $settings[] = array('key' => 'authorlink1url', 'name' => $this->translate('ALBUM :: 1st Page message - 1st link tpl file (ex:equipment.tpl)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['authorlink1url']); $settings[] = array('key' => 'authorlink2', 'name' => $this->translate('ALBUM :: 1st Page message- 2nd link title (on the right)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['authorlink2']); $settings[] = array('key' => 'authorlink2url', 'name' => $this->translate('ALBUM :: 1st Page message - 2nd link tpl file (ex:portfolio.tpl)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['authorlink2url']); $settings[] = array('key' => 'columns1st', 'name' => $this->translate('ALBUM :: 1st Page - Columns per album page'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['columns1st']); $settings[] = array('key' => '1stTitle', 'name' => $this->translate('ALBUM :: 1st Page - Show Title on 1st page of the Gallery'), 'type' => 'checkbox', 'value' => $params['1stTitle']); $settings[] = array('key' => '1stDescription', 'name' => $this->translate('ALBUM :: 1st Page - Show Description on 1st page of the Gallery'), 'type' => 'checkbox', 'value' => $params['1stDescription']); $settings[] = array('key' => 'InfoGallery', 'name' => $this->translate('ALBUM :: 1st Page - Show Information on 1st page of the Gallery'), 'type' => 'checkbox', 'value' => $params['InfoGallery']); $settings[] = array('key' => '1stShowAlbumText', 'name' => $this->translate('ALBUM :: 1st Page - Show the text block on 1st page of the Gallery - hiding overrides all three of the settings above'), 'type' => 'checkbox', 'value' => $params['1stShowAlbumText']); $settings[] = array('key' => 'AlbumBlock', 'name' => $this->translate('ALBUM :: 1st Page - Link Thumbnail directly to photo page (to work must activate "Image Block" Module)'), 'type' => 'checkbox', 'value' => $params['AlbumBlock']); $settings[] = array('key' => 'NavAlbumTop', 'name' => $this->translate('ALBUM :: Navigation - Show pics on the TOP of the Album'), 'type' => 'checkbox', 'value' => $params['NavAlbumTop']); $settings[] = array('key' => 'NavAlbumBottom', 'name' => $this->translate('ALBUM :: Navigation - Show pics on the BOTTOM of the Album'), 'type' => 'checkbox', 'value' => $params['NavAlbumBottom']); $settings[] = array('key' => 'opacityT', 'name' => $this->translate('ALBUM :: Set Opacity for Thumbnails (1 to 10)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['opacityT']); $settings[] = array('key' => 'opacityTover', 'name' => $this->translate('ALBUM :: Set Opacity for Thumbnails on MouseOver (1 to 10)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['opacityTover']); $settings[] = array('key' => 'AlbumTitle', 'name' => $this->translate('ALBUM :: Show Title'), 'type' => 'checkbox', 'value' => $params['AlbumTitle']); $settings[] = array('key' => 'AlbumTitleTop', 'name' => $this->translate('ALBUM :: Show Title above the Thumbnails (by default: side by side)'), 'type' => 'checkbox', 'value' => $params['AlbumTitleTop']); $settings[] = array('key' => 'AlbumDescription', 'name' => $this->translate('ALBUM :: Show Description'), 'type' => 'checkbox', 'value' => $params['AlbumDescription']); $settings[] = array('key' => 'AlbumDescriptionTop', 'name' => $this->translate('ALBUM :: Show Description above the Thumbnails below the Title (by default: side by side)'), 'type' => 'checkbox', 'value' => $params['AlbumDescriptionTop']); $settings[] = array('key' => 'titleAndDescriptionDiv', 'name' => $this->translate('ALBUM :: Maximum height for the Title and Description after which a scrollbar has to appear. This only applies for the title and/or scrollbar positioned above the Thumbnails below the Title. Enter a pixel height to limit or 0/empty to allow any height.'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['titleAndDescriptionDiv']); $settings[] = array('key' => 'AlbumInfo', 'name' => $this->translate('ALBUM :: Show Information'), 'type' => 'checkbox', 'value' => $params['AlbumInfo']); $settings[] = array('key' => 'AlbumInfoTop', 'name' => $this->translate('ALBUM :: Show Information above the Thumbnails after Title and Description (by default: side by side)'), 'type' => 'checkbox', 'value' => $params['AlbumInfoTop']); $settings[] = array('key' => 'ItemsCenter', 'name' => $this->translate('ALBUM :: Items - Center Items (by default: left aligned)'), 'type' => 'checkbox', 'value' => $params['ItemsCenter']); $settings[] = array('key' => 'ItemsTitle', 'name' => $this->translate('ALBUM :: Items - Show Title'), 'type' => 'checkbox', 'value' => $params['ItemsTitle']); $settings[] = array('key' => 'ItemsDesc', 'name' => $this->translate('ALBUM :: Items - Show Description'), 'type' => 'checkbox', 'value' => $params['ItemsDesc']); $settings[] = array('key' => 'ItemsInfo', 'name' => $this->translate('ALBUM :: Items - Show Information'), 'type' => 'checkbox', 'value' => $params['ItemsInfo']); $settings[] = array('key' => 'NavPhotoTop', 'name' => $this->translate('PHOTO :: Navigation - Show pics above the Photo'), 'type' => 'checkbox', 'value' => $params['NavPhotoTop']); $settings[] = array('key' => 'NavPhotoBottom', 'name' => $this->translate('PHOTO :: Navigation - Show pics below the Photo'), 'type' => 'checkbox', 'value' => $params['NavPhotoBottom']); $settings[] = array('key' => 'NavPop', 'name' => $this->translate('PHOTO :: Navigation - Show full size photo POPUP navigation pic'), 'type' => 'checkbox', 'value' => $params['NavPop']); $settings[] = array('key' => 'NavPopEven', 'name' => $this->translate('PHOTO :: Navigation - Show POPUP navigation pic even if the current view is the full size image'), 'type' => 'checkbox', 'value' => $params['NavPopEven']); $settings[] = array('key' => 'NavOverTop', 'name' => $this->translate('PHOTO :: Navigation (OnMouseOver) - Show navigation pics above the Photo'), 'type' => 'checkbox', 'value' => $params['NavOverTop']); $settings[] = array('key' => 'NavOverBottom', 'name' => $this->translate('PHOTO :: Navigation (OnMouseOver) - Show navigation pics below the Photo'), 'type' => 'checkbox', 'value' => $params['NavOverBottom']); $settings[] = array('key' => 'NavOverPopup', 'name' => $this->translate('PHOTO :: Navigation (OnMouseOver) - Show full size photo POPUP navigation pic'), 'type' => 'checkbox', 'value' => $params['NavOverPopup']); $settings[] = array('key' => 'NavOverPopupEven', 'name' => $this->translate('PHOTO :: Navigation (OnMouseOver) - Show POPUP navigation pic even if the current view is the full size image'), 'type' => 'checkbox', 'value' => $params['NavOverPopupEven']); $settings[] = array('key' => 'PhotoTitle', 'name' => $this->translate('PHOTO :: Show Title'), 'type' => 'checkbox', 'value' => $params['PhotoTitle']); $settings[] = array('key' => 'PhotoTitleTop', 'name' => $this->translate('PHOTO :: Show Title ABOVE the Photo (by default: side by side)'), 'type' => 'checkbox', 'value' => $params['PhotoTitleTop']); $settings[] = array('key' => 'PhotoDescription', 'name' => $this->translate('PHOTO :: Show Description'), 'type' => 'checkbox', 'value' => $params['PhotoDescription']); $settings[] = array('key' => 'PhotoDescriptionTop', 'name' => $this->translate('PHOTO :: Show Description ABOVE the Photo below the Title (by default: side by side)'), 'type' => 'checkbox', 'value' => $params['PhotoDescriptionTop']); $settings[] = array('key' => 'InfoPhoto', 'name' => $this->translate('PHOTO :: Show Information'), 'type' => 'checkbox', 'value' => $params['InfoPhoto']); $settings[] = array('key' => 'InfoPhotoTop', 'name' => $this->translate('PHOTO :: Show Information above the Photo after Title and Description(by default: side by side)'), 'type' => 'checkbox', 'value' => $params['InfoPhotoTop']); $settings[] = array('key' => 'InfoSize', 'name' => $this->translate('PHOTO :: Show Size'), 'type' => 'checkbox', 'value' => $params['InfoSize']); $settings[] = array('key' => 'InfoSizeEven', 'name' => $this->translate('PHOTO :: Show Size even on full size image'), 'type' => 'checkbox', 'value' => $params['InfoSizeEven']); $settings[] = array('key' => 'PopSize', 'name' => $this->translate('PHOTO :: Clicking on full size link will show the full size image on a POPUP Window (by default: Tradicional full size link)'), 'type' => 'checkbox', 'value' => $params['PopSize']); $settings[] = array('key' => 'PopSizeEven', 'name' => $this->translate('PHOTO :: Show POPUP link even if the current view is the full size image'), 'type' => 'checkbox', 'value' => $params['PopSizeEven']); $settings[] = array('key' => 'ShowKeywordsPhoto', 'name' => $this->translate('PHOTO :: Show Keywords'), 'type' => 'checkbox', 'value' => $params['ShowKeywordsPhoto']); $settings[] = array('key' => 'imageFadin', 'name' => $this->translate('PHOTO :: Show Photos fading in'), 'type' => 'checkbox', 'value' => $params['imageFadin']); $settings[] = array('key' => 'MTposition', 'name' => $this->translate('PHOTO :: Show image LEFT (by default: RIGHT)'), 'type' => 'checkbox', 'value' => $params['MTposition']); $settings[] = array('key' => 'MTends', 'name' => $this->translate('PHOTO :: MicroThumbs - Show allways first and last MicroThumbs'), 'type' => 'checkbox', 'value' => $params['MTends']); $settings[] = array('key' => 'MTmore', 'name' => $this->translate('PHOTO :: MicroThumbs - Show navigation below MicroThumbs table, when they are not all visible'), 'type' => 'checkbox', 'value' => $params['MTmore']); $settings[] = array('key' => 'MTmorepics', 'name' => $this->translate('PHOTO :: MicroThumbs - Show first and last linked pics below MicroThumbs table, when they are not all visible'), 'type' => 'checkbox', 'value' => $params['MTmorepics']); $settings[] = array('key' => 'MTmoretext', 'name' => $this->translate('PHOTO :: MicroThumbs - Set text to show width "first" and "last" pics or with "<<" ">>" (ex. : more)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['MTmoretext']); $settings[] = array('key' => 'peerWindowSize', 'name' => $this->translate('PHOTO :: MicroThumbs - Set (peerWindowSize) number of MicroThumbs diplayed (plus first and last)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['peerWindowSize']); $settings[] = array('key' => 'columnsMT', 'name' => $this->translate('PHOTO :: MicroThumbs - Set number of columns per MicroThumbs'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['columnsMT']); $settings[] = array('key' => 'sizeMT', 'name' => $this->translate('PHOTO :: MicroThumbs - Set width for MicroThumbs'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['sizeMT']); $settings[] = array('key' => 'opacityMT', 'name' => $this->translate('PHOTO :: MicroThumbs - Set opacity for MicroThumbs (1 to 10)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['opacityMT']); $settings[] = array('key' => 'opacityMTover', 'name' => $this->translate('PHOTO :: MicroThumbs - Set opacity for MicroThumbs on MouseOver (1 to 10)'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['opacityMTover']); $settings[] = array('key' => 'MToversize', 'name' => $this->translate('PHOTO :: MicroThumbs - Set size increment for MicroThumbs on MouseOver'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['MToversize']); $settings[] = array('key' => 'BlocksAlign', 'name' => $this->translate('BLOCKS :: Position the Blocks Table that displayed the selected Blocks to show on album and photo pages on the tradicional way (choices: left,center,right).'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['BlocksAlign']); $settings[] = array('key' => 'BlocksInAlign', 'name' => $this->translate('BLOCKS :: Align the Blocks displayed inside the Blocks Table (choices: left,center,right).'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['BlocksInAlign']); $settings[] = array('key' => 'OtherBlocksBtn', 'name' => $this->translate('BLOCKS :: Show a "Blocks" button on photo pages (when clicked Blocks selected to show: containing EXIF, Comments,etc, will be displayed)'), 'type' => 'checkbox', 'value' => $params['OtherBlocksBtn']); $settings[] = array('key' => 'AuthorActions', 'name' => $this->translate('ACTIONS :: 1st Page - Show "Gallery" actions below author welcome message (on webmaster mode)'), 'type' => 'checkbox', 'value' => $params['AuthorActions']); $settings[] = array('key' => 'AuthorComments', 'name' => $this->translate('ACTIONS :: 1st Page - Show "Comments" buttons below author welcome message'), 'type' => 'checkbox', 'value' => $params['AuthorComments']); $settings[] = array('key' => '1stShowCartForRoot', 'name' => $this->translate('ACTIONS :: 1st Page - Show "Add to Cart" button below author welcome message'), 'type' => 'checkbox', 'value' => $params['1stShowCartForRoot']); $settings[] = array('key' => 'ShowCartForAlbums', 'name' => $this->translate('ACTIONS :: 1st Page and Album - Show "Add to Cart" button for every album on the 1st page and near the top of the screen on album pages'), 'type' => 'checkbox', 'value' => $params['ShowCartForAlbums']); $settings[] = array('key' => 'AlbumActions', 'name' => $this->translate('ACTIONS :: Album - Show "Albums" actions on top navigation bar (on webmaster mode)'), 'type' => 'checkbox', 'value' => $params['AlbumActions']); $settings[] = array('key' => 'AddAlbumComments', 'name' => $this->translate('ACTIONS :: Album - display a "Add Comments" button'), 'type' => 'checkbox', 'value' => $params['AddAlbumComments']); $settings[] = array('key' => 'AlbumComments', 'name' => $this->translate('ACTIONS :: Album - display a "View Comments" button'), 'type' => 'checkbox', 'value' => $params['AlbumComments']); $settings[] = array('key' => 'ItemsActions', 'name' => $this->translate('ACTIONS :: Items - Show "Items" actions below thumbnails on webmaster mode (for guests show a "Add to Cart" button if module is active)'), 'type' => 'checkbox', 'value' => $params['ItemsActions']); $settings[] = array('key' => 'ItemsComments', 'name' => $this->translate('ACTIONS :: Items - display "Comments" buttons'), 'type' => 'checkbox', 'value' => $params['ItemsComments']); $settings[] = array('key' => 'ItemsExif', 'name' => $this->translate('ACTIONS :: Items - display "Show EXIF" button'), 'type' => 'checkbox', 'value' => $params['ItemsExif']); $settings[] = array('key' => 'BtnAfter', 'name' => $this->translate('ACTIONS :: Items - display "Buttons" below Title, Description and Information. (by default: between Thumbnail and Title)'), 'type' => 'checkbox', 'value' => $params['BtnAfter']); $settings[] = array('key' => 'PhotoActions', 'name' => $this->translate('ACTIONS :: Photo - Show "Photo" actions (on webmaster mode)'), 'type' => 'checkbox', 'value' => $params['PhotoActions']); $settings[] = array('key' => 'AddPhotoComments', 'name' => $this->translate('ACTIONS :: Photo - display a "Add Comments" button'), 'type' => 'checkbox', 'value' => $params['AddPhotoComments']); $settings[] = array('key' => 'PhotoComments', 'name' => $this->translate('ACTIONS :: Photo - display a "View Comments" button'), 'type' => 'checkbox', 'value' => $params['PhotoComments']); $settings[] = array('key' => 'PhotoCart', 'name' => $this->translate('ACTIONS :: Photo - display a "Add to Cart" button'), 'type' => 'checkbox', 'value' => $params['PhotoCart']); $settings[] = array('key' => 'PhotoExif', 'name' => $this->translate('ACTIONS :: Photo - display a "Show EXIF" button'), 'type' => 'checkbox', 'value' => $params['PhotoExif']); $settings[] = array('key' => 'AddCartText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "Add to Cart" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['AddCartText']); $settings[] = array('key' => 'ExifText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "Show EXIF" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['ExifText']); $settings[] = array('key' => 'CommentsText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "Add comment" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['CommentsText']); $settings[] = array('key' => 'ViewCommentsText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "View comments" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['ViewCommentsText']); $settings[] = array('key' => 'BlocksText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "Blocks" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['BlocksText']); $settings[] = array('key' => 'ReturnText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "Return" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['ReturnText']); $settings[] = array('key' => 'SlideshowText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "Slideshow" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['SlideshowText']); $settings[] = array('key' => 'fullSizePopupText', 'name' => $this->translate('ACTIONS :: Alternative text and title to show with the "full size image popup" button'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['fullSizePopupText']); $settings[] = array('key' => 'ActionsText', 'name' => $this->translate('ACTIONS :: Show alternative texts after "Actions" buttons - Hiding will show no texts after "Actions" buttons/icons, nevertheless alternative text is entered in any of the above five entries and the alt and title texts will default to the button names. Should you want to have the default text or their translated equivalents (if this time is translated in your language) show up after the buttons, leave the above five entries empty and leave this display option ON.'), 'type' => 'checkbox', 'value' => $params['ActionsText']); $settings[] = array('key' => 'Showslideshow', 'name' => $this->translate('SLIDESHOW :: If module is active display a SlideShow navigation pic'), 'type' => 'checkbox', 'value' => $params['Showslideshow']); $settings[] = array('key' => 'ss', 'name' => $this->translate('SLIDESHOW :: Use Nature theme on SlideShow if is the selected theme'), 'type' => 'checkbox', 'value' => $params['ss']); $settings[] = array('key' => 'ShowFooterAsBar', 'name' => $this->translate('FOOTER :: Show footer as a bar. The footer bar will hold the search and cart/checkout Blocks, the footerBarLink and the copyright message. The buttons (see next options) remain positioned outside the bar, at the bottom of the page.'), 'type' => 'checkbox', 'value' => $params['ShowFooterAsBar']); $settings[] = array('key' => 'FooterBarLinkText', 'name' => $this->translate('FOOTER :: FooterBarLink Text'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['FooterBarLinkText']); $settings[] = array('key' => 'FooterBarLinkURL', 'name' => $this->translate('FOOTER :: FooterBarLink URL'), 'type' => 'text-field', 'type-params' => array('size' => 2), 'value' => $params['FooterBarLinkURL']); $settings[] = array('key' => '1stFooterBarLinkExclusive', 'name' => $this->translate('FOOTER :: Show FooterBarLink only on first page'), 'type' => 'checkbox', 'value' => $params['1stFooterBarLinkExclusive']); $settings[] = array('key' => '1stHideCart', 'name' => $this->translate('FOOTER :: Hide cart/checkout on first page. (This only applies for the cart/checkout in the footerBar))'), 'type' => 'checkbox', 'value' => $params['1stHideCart']); $settings[] = array('key' => 'valbtn', 'name' => $this->translate('FOOTER :: Show "XHTML 1.0 (validation)" button'), 'type' => 'checkbox', 'value' => $params['valbtn']); $settings[] = array('key' => 'g2btn', 'name' => $this->translate('FOOTER :: Show "GALLERY 2" button'), 'type' => 'checkbox', 'value' => $params['g2btn']); $settings[] = array('key' => 'g2verbtn', 'name' => $this->translate('FOOTER :: Show "G2 Version" button'), 'type' => 'checkbox', 'value' => $params['g2verbtn']); $settings[] = array('key' => 'pgbtn', 'name' => $this->translate('FOOTER :: Show "Nature Theme" button'), 'type' => 'checkbox', 'value' => $params['pgbtn']); $settings[] = array('key' => 'pgcpbtn', 'name' => $this->translate('FOOTER :: Show "Nature ColorPack" button'), 'type' => 'checkbox', 'value' => $params['pgcpbtn']); $settings[] = array('key' => 'donbtn', 'name' => $this->translate('FOOTER :: Show "Donate" button'), 'type' => 'checkbox', 'value' => $params['donbtn']); return array(GalleryStatus::success(), $settings); } /** * @see GalleryTheme::showAlbumPage */ function showAlbumPage(&$template, $item, $params, $childIds) { $ret = $this->loadCommonTemplateData( $template, $item, $params, array('owner', 'viewCount', 'childCount', 'descendentCount', 'parents', 'peers', 'systemLinks', 'itemLinks', 'itemSummaries', 'permissions', 'thumbnails', 'pageNavigator', 'jumpRange'), $childIds); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } /* Add in our extra stuff */ $theme =& $template->getVariableByReference('theme'); $theme['columnWidthPct'] = floor(100 / $params['columns']); list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } if (!empty($pluginStatus['slideshow']['active'])) { $theme['slideshow'] = 1; } else { $theme['slideshow'] =0; } if (!empty($pluginStatus['cart']['active'])) { $theme['cart'] = 1; } else { $theme['cart'] =0; } // nature - added checkout if (!empty($pluginStatus['checkout']['active'])){ $theme['checkout'] = 1; } else { $theme['checkout'] =0; } // nature - added search if (!empty($pluginStatus['search']['active'])){ $theme['search'] = 1; } else { $theme['search'] =0; } if (!empty($pluginStatus['comment']['active'])) { $theme['comments'] = 1; } else { $theme['comments'] =0; } if (!empty($pluginStatus['exif']['active'])) { $theme['exif'] = 1; } else { $theme['exif'] =0; } if (!empty($pluginStatus['imageblock']['active'])) { $theme['imageblock'] = 1; } else { $theme['imageblock'] =0; } if (!empty($pluginStatus['register']['active'])) { $theme['register'] = 1; } else { $theme['register'] =0; } if ($this->findCartModuleName($template)) { return array(GalleryStatus::success(), 'theme.tpl'); } else { return array(GalleryStatus::error(ERROR_CONFIGURATION_REQUIRED, __FILE__, __LINE__, 'Both the cart and the checkout module are activated. This theme can only handle one cart at the time, so please deactivate one of them in the admin.'), null); } } /** * @see GalleryTheme::showPhotoPage */ function showPhotoPage(&$template, $item, $params) { $dataTypes = array('owner', 'viewCount', 'parents', 'peers', 'systemLinks', 'itemLinks', 'permissions', 'itemLinksDetailed', 'itemNavigator', 'imageViews'); if (!empty($params['showMicroThumbs'])) { $dataTypes[] = 'navThumbnails'; } $ret = $this->loadCommonTemplateData($template, $item, $params, $dataTypes); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } $theme =& $template->getVariableByReference('theme'); if (!empty($pluginStatus['slideshow']['active'])) { $theme['slideshow'] = 1; } else { $theme['slideshow'] =0; } if (!empty($pluginStatus['cart']['active'])) { $theme['cart'] = 1; } else { $theme['cart'] =0; } // nature - added checkout if (!empty($pluginStatus['checkout']['active'])) { $theme['checkout'] = 1; } else { $theme['checkout'] =0; } // nature - added search if (!empty($pluginStatus['search']['active'])){ $theme['search'] = 1; } else { $theme['search'] =0; } if (!empty($pluginStatus['comment']['active'])) { $theme['comments'] = 1; } else { $theme['comments'] =0; } if (!empty($pluginStatus['exif']['active'])) { $theme['exif'] = 1; } else { $theme['exif'] =0; } if (!empty($pluginStatus['register']['active'])) { $theme['register'] = 1; } else { $theme['register'] =0; } if ($this->findCartModuleName($template)) { return array(GalleryStatus::success(), 'theme.tpl'); } else { return array(GalleryStatus::error(ERROR_CONFIGURATION_REQUIRED, __FILE__, __LINE__, 'Both the cart and the checkout module are activated. This theme can only handle one cart at the time, so please deactivate one of them in the admin.'), null); } } /** * @see GalleryTheme::showModulePage */ function showModulePage(&$template, $item, $params, $templateFile) { $ret = $this->loadCommonTemplateData( $template, $item, $params, array('parents', 'systemLinks')); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } return array(GalleryStatus::success(), 'theme.tpl'); } /** * @see GalleryTheme::showAdminPage */ function showAdminPage(&$template, $item, $params, $templateFile) { $ret = $this->loadCommonTemplateData( $template, $item, $params, array('parents', 'systemLinks')); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } return array(GalleryStatus::success(), 'theme.tpl'); } /** * @see GalleryTheme::showErrorPage */ function showErrorPage(&$template) { return array(GalleryStatus::success(), 'error.tpl'); } /** * @see GalleryTheme::showProgressBarPage */ function showProgressBarPage(&$template, $item, $params) { $ret = $this->loadCommonTemplateData( $template, $item, $params, array('parents', 'systemLinks')); if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } return array(GalleryStatus::success(), 'theme.tpl'); } // nature - no upgrade functionality /** * @see GalleryTheme::upgrade */ /* function upgrade($installedVersion) { if (version_compare($installedVersion, '0.9.7', '<')) { // Older than the big theme changeover. Set some default blocks foreach (array( 'sidebarBlocks' => serialize( array( array('search.SearchBlock', array('showAdvancedLink' => true)), array('core.ItemLinks', array('useDropdown' => false)), array('core.PeerList', array()), array('imageblock.ImageBlock', array()))), 'albumBlocks' => serialize( array(array('comment.ViewComments', array()))), 'photoBlocks' => serialize( array( array('exif.ExifInfo', array()), array('comment.ViewComments', array())))) as $key => $value) { $ret = $this->setParameter($key, $value); if ($ret->isError()) { return $ret->wrap(__FILE__, __LINE__); } } $installedVersion = '0.9.7'; } switch ($installedVersion) { case '0.9.7': $ret = $this->setParameter('colorpack', ''); if ($ret->isError()) { return $ret->wrap(__FILE__, __LINE__); } case '1.0.0': // We now require theme API 2.1 case 'end of upgrade path': break; default: return GalleryStatus::error(ERROR_BAD_PLUGIN, __FILE__, __LINE__, sprintf('Unknown theme version %s', $installedVersion)); } return GalleryStatus::success(); } */ function findCartModuleName($template) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if (!empty($pluginStatus['cart']['active']) && !empty($pluginStatus['checkout']['active'])) { return false; } elseif (!empty($pluginStatus['cart']['active'])) { $template->setVariable('cartModuleName', 'cart'); } elseif (!empty($pluginStatus['checkout']['active'])) { $template->setVariable('cartModuleName', 'checkout'); } return true; } } ?>