Back to PhocaGalleryRenderProcess class

Method displayStopThumbnailsCreating

public static
displayStopThumbnailsCreating
(mixed $element = null)

Method displayStopThumbnailsCreating - Source code

public static function displayStopThumbnailsCreating($element = null)
{
    if (is_null($element)) {
        throw new Exception('Function Error: No element added', 500);
        return false;
    }
    // 1 ... link was displayed
    // 0 ... display the link "Stop ThumbnailsCreation
    $view = Factory::getApplication()->input->get('view');
    //we are in whole window - not in modal box
    if ($view == 'phocagalleryi' || $view == 'phocagalleryd') {
        //$this->stopThumbnailsCreating = 1;
        self::$renderProcess[$element] = '';
        return self::$renderProcess[$element];
    } else {
        if (!array_key_exists($element, self::$renderProcess)) {
            //if (!isset($this->stopThumbnailsCreating) || (isset($this->stopThumbnailsCreating) && $this->stopThumbnailsCreating == 0)) {
            // Add stop thumbnails creation in case e.g. of Fatal Error which returns 'ImageCreateFromJPEG'
            $stopText = self::getHeader('processpage');
            $boxStyle = self::getBoxStyle();
            $stopText .= '<div style="' . $boxStyle . '">';
            // End will be added getProcessPage
            $stopText .= '<div style="text-align:right;margin-bottom: 15px;"><a style="font-family: sans-serif, Arial;font-weight:bold;color:#e33131;font-size:12px;" href="/apis/component/phocagallery/?task=phocagalleryimg.disablethumbs" title="' . Text::_('COM_PHOCAGALLERY_STOP_THUMBNAIL_GENERATION_DESC') . '">' . Text::_('COM_PHOCAGALLERY_STOP_THUMBNAIL_GENERATION') . '</a></div>';
            //$this->stopThumbnailsCreating = 1;// it was added to the site, don't add the same code (because there are 3 thumnails - small, medium, large)
            //$this->headerAdded = 1;
            self::$renderProcess[$element] = $stopText;
        } else {
            self::$renderProcess[$element] = '';
        }
        return self::$renderProcess[$element];
    }
}