Back to PhocaGalleryRenderDetailWindow class

Method setButtons

public
setButtons
(mixed $method = 0, mixed $libraries = array(), mixed $library = array())

Method setButtons - Source code

public function setButtons($method = 0, $libraries = array(), $library = array())
{
    $app = Factory::getApplication();
    $document = $app->getDocument();
    $paramsC = ComponentHelper::getParams('com_phocagallery');
    /*$this->b1 = new stdClass();
    		$this->b1->name = 'image';
    		$this->b1->options = '';
    
    		$this->b2 = new stdClass();
    		$this->b2->name = 'icon';
    		$this->b2->options = '';
    
    		$this->b3 = new stdClass();
    		$this->b3->name = 'other';
    		$this->b3->options = '';
    		$this->b3->optionsrating = '';
    
    		$path = Uri::base(true);
    		if ($this->backend == 1) {
    			$path = Uri::root(true);
    		}*/
    switch ($method) {
        case 1:
            //STANDARD JS POPUP
            /*$this->b1->methodname 		= 'pg-js-nopopup-button';
            			$this->b1->options 			= "window.open(this.href,'win2','width=".$this->popupWidth.",height=".$this->popupHeight.",scrollbars=yes,menubar=no,resizable=yes'); return false;";
            			$this->b1->optionsrating 	= "window.open(this.href,'win2','width=".$this->popupWidth.",height=".$this->popupHeight.",scrollbars=yes,menubar=no,resizable=yes'); return false;";
            
            			$this->b2->methodname 		= $this->b1->methodname;
            			$this->b2->options 			= $this->b1->options;
            			$this->b3->methodname  		= $this->b1->methodname;
            			$this->b3->options 			= $this->b1->options;
            			$this->b3->optionsrating 	= $this->b1->optionsrating;*/
            break;
        case 0:
            // BOOTSTRAP MODAL
            /*$this->b1->name 			= 'image';
            			$this->b1->methodname 		= 'pg-bs-modal-button';
            			$this->b1->options			= '';
            			$this->b1->optionsrating	= '';
            
            
            			$this->b2->methodname 	= $this->b1->methodname;
            			$this->b2->options		= '';
            			$this->b2->optionsrating= '';
            			$this->b3->methodname  	= $this->b1->methodname;
            			$this->b3->options		= '';
            			$this->b3->optionsrating= '';*/
            break;
        case 7:
            // NO POPUP
            /*$this->b1->methodname 	= 'pg-no-popup';
            		$this->b2->methodname 	= $this->b1->methodname;
            		$this->b3->methodname 	= $this->b1->methodname;*/
            break;
        case 12:
            // MAGNIFIC
            HTMLHelper::_('jquery.framework', true);
            $oLang = array('COM_PHOCAGALLERY_LOADING' => Text::_('COM_PHOCAGALLERY_LOADING'), 'COM_PHOCAGALLERY_CLOSE' => Text::_('COM_PHOCAGALLERY_CLOSE'), 'COM_PHOCAGALLERY_PREVIOUS' => Text::_('COM_PHOCAGALLERY_PREVIOUS'), 'COM_PHOCAGALLERY_NEXT' => Text::_('COM_PHOCAGALLERY_NEXT'), 'COM_PHOCAGALLERY_MAGNIFIC_CURR_OF_TOTAL' => Text::_('COM_PHOCAGALLERY_MAGNIFIC_CURR_OF_TOTAL'), 'COM_PHOCAGALLERY_IMAGE_NOT_LOADED' => Text::_('COM_PHOCAGALLERY_IMAGE_NOT_LOADED'));
            $document->addScriptOptions('phLangPG', $oLang);
            $document->addScript(Uri::base(true) . '/media/com_phocagallery/js/magnific/jquery.magnific-popup.min.js');
            $document->addScript(Uri::base(true) . '/media/com_phocagallery/js/magnific/magnific-initialize.js');
            $document->addStyleSheet(Uri::base(true) . '/media/com_phocagallery/js/magnific/magnific-popup.css');
            break;
        case 14:
            // PHOTOSWIPE
            HTMLHelper::_('jquery.framework', true);
            /*$this->b1->methodname 	= 'pg-photoswipe-button';
            			$this->b1->options		= 'itemprop="contentUrl"';
            			$this->b2->methodname 	= 'pg-photoswipe-button-copy';
            			$this->b2->options		= $this->b1->options;
            
            			$this->b3->methodname	= 'pg-ps-modal-button';
            			$this->b3->options		= '';
            			$this->b3->optionsrating= '';*/
            // If standard window, change:
            // FROM: return ' rel="'.$buttonOptions.'"'; TO: return ' onclick="'.$buttonOptions.'"';
            // in administrator\components\com_phocagallery\libraries\phocagallery\render\renderfront.php
            // method: renderAAttributeTitle detailwindow = 14
            if (isset($libraries['pg-group-photoswipe']->value) && $libraries['pg-group-photoswipe']->value == 0) {
                $document->addStyleSheet(Uri::base(true) . '/media/com_phocagallery/js/photoswipe/css/photoswipe.css');
                $document->addStyleSheet(Uri::base(true) . '/media/com_phocagallery/js/photoswipe/css/default-skin/default-skin.css');
                $document->addStyleSheet(Uri::base(true) . '/media/com_phocagallery/js/photoswipe/css/photoswipe-style.css');
            }
            // LoadPhotoSwipeBottom must be loaded at the end of document
            break;
        default:
            break;
    }
}