Back to PhocaGalleryRenderFront class

Method renderCloseReloadDetail

public static
renderCloseReloadDetail
(mixed $detailWindow, mixed $type = 0)

Method renderCloseReloadDetail - Source code

public static function renderCloseReloadDetail($detailWindow, $type = 0)
{
    $o = array();
    if ($detailWindow == 1) {
        $output['detailwindowclose'] = 'window.close();';
        $output['detailwindowreload'] = 'window.location.reload(true);';
        $closeLink = '<div><a href="javascript:void(0);" onclick="' . $output['detailwindowclose'] . '" >' . Text::_('COM_PHOCAGALLERY_CLOSE_WINDOW') . '</a></div>';
        // Highslide
    } else {
        if ($detailWindow == 4 || $detailWindow == 5) {
            $output['detailwindowclose'] = 'return false;';
            $output['detailwindowreload'] = 'window.location.reload(true);';
            $closeLink = '<div><a href="javascript:void(0);" onclick="' . $output['detailwindowclose'] . '" >' . Text::_('COM_PHOCAGALLERY_CLOSE_WINDOW') . '</a></div>';
            // No Popup
        } else {
            if ($detailWindow == 7) {
                $output['detailwindowclose'] = '';
                $output['detailwindowreload'] = '';
                // Should not happen as it should be reloaded to login page
                $closeLink = '<div><a href="' . Uri::base(true) . '" >' . Text::_('COM_PHOCAGALLERY_MAIN_SITE') . '</a></div>';
                // Magnific iframe
            } else {
                if ($detailWindow == 11) {
                    $output['detailwindowclose'] = '';
                    $output['detailwindowreload'] = '';
                    $closeLink = '<div><a href="javascript:void(0);" class="mfp-close" >' . Text::_('COM_PHOCAGALLERY_CLOSE_WINDOW') . '</a></div>';
                    // Modal Box
                } else {
                    //$this->t['detailwindowclose']	= 'window.parent.document.getElementById(\'sbox-window\').close();';
                    $output['detailwindowclose'] = 'window.parent.SqueezeBox.close();';
                    $output['detailwindowreload'] = 'window.location.reload(true);';
                    $closeLink = '<div><a href="javascript:void(0);" onclick="' . $output['detailwindowclose'] . '" >' . Text::_('COM_PHOCAGALLERY_CLOSE_WINDOW') . '</a></div>';
                }
            }
        }
    }
    $o[] = '<div style="font-family:sans-serif">';
    if ($type == 0) {
        $o[] = '<div>' . Text::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION') . ' ' . Text::_('COM_PHOCAGALLERY_PLEASE_LOGIN') . '.</div>';
        $o[] = '<div> </div>';
    }
    $o[] = $closeLink;
    $o[] = '</div>';
    $output['html'] = implode('', $o);
    return $output;
}