Back to PhocaGalleryRenderFront class

Method renderOnUploadJS

public static
renderOnUploadJS
()

Method renderOnUploadJS - Source code

// hotnew
/*
    public static function getOverImageIcons($date, $hits) {
        $app    = Factory::getApplication();
        $params = $app->getParams();
        $new    = $params->get('display_new', 0);
        $hot    = $params->get('display_hot', 0);


        $output = '';
        if ($new == 0) {
            $output .= '';
        } else {
            $dateAdded  = strtotime($date, time());
            $dateToday  = time();
            $dateExists = $dateToday - $dateAdded;
            $dateNew    = (int)$new * 24 * 60 * 60;
            if ($dateExists < $dateNew) {
                $output .= HTMLHelper::_('image', 'media/com_phocagallery/images/icon-new.png', '', array('class' => 'pg-img-ovr1'));
            }
        }
        if ($hot == 0) {
            $output .= '';
        } else {
            if ((int)$hot <= $hits) {
                if ($output == '') {
                    $output .= HTMLHelper::_('image', 'media/com_phocagallery/images/icon-hot.png', '', array('class' => 'pg-img-ovr1'));
                } else {
                    $output .= HTMLHelper::_('image', 'media/com_phocagallery/images/icon-hot.png', '', array('class' => 'pg-img-ovr2'));
                }
            }
        }
        return $output;
    }

    public static function renderCommentJS($chars) {

        $tag = "<script type=\"text/javascript\">"
            . "function countChars() {" . "\n"
            . "var maxCount	= " . $chars . ";" . "\n"
            . "var pfc 			= document.getElementById('phocagallery-comments-form');" . "\n"
            . "var charIn		= pfc.phocagallerycommentseditor.value.length;" . "\n"
            . "var charLeft	= maxCount - charIn;" . "\n"
            . "" . "\n"
            . "if (charLeft < 0) {" . "\n"
            . "   alert('" . Text::_('COM_PHOCAGALLERY_MAX_LIMIT_CHARS_REACHED', true) . "');" . "\n"
            . "   pfc.phocagallerycommentseditor.value = pfc.phocagallerycommentseditor.value.substring(0, maxCount);" . "\n"
            . "	charIn	 = maxCount;" . "\n"
            . "  charLeft = 0;" . "\n"
            . "}" . "\n"
            . "pfc.phocagallerycommentscountin.value	= charIn;" . "\n"
            . "pfc.phocagallerycommentscountleft.value	= charLeft;" . "\n"
            . "}" . "\n"

            . "function checkCommentsForm() {" . "\n"
            . "   var pfc = document.getElementById('phocagallery-comments-form');" . "\n"
            . "   if ( pfc.phocagallerycommentstitle.value == '' ) {" . "\n"
            . "	   alert('" . Text::_('COM_PHOCAGALLERY_ENTER_TITLE', true) . "');" . "\n"
            . "     return false;" . "\n"
            . "   } else if ( pfc.phocagallerycommentseditor.value == '' ) {" . "\n"
            . "	   alert('" . Text::_('COM_PHOCAGALLERY_ENTER_COMMENT', true) . "');" . "\n"
            . "     return false;" . "\n"
            . "   } else {" . "\n"
            . "     return true;" . "\n"
            . "   }" . "\n"
            . "}" . "\n"
            . "</script>";

        return $tag;
    }
*/
/*
    public static function renderCategoryCSS($font_color, $background_color, $border_color, $imageBgCSS, $imageBgCSSIE, $border_color_hover, $background_color_hover, $ol_fg_color, $ol_bg_color, $ol_tf_color, $ol_cf_color, $margin_box, $padding_box, $opacity = 0.8) {

        $opacityPer = (float)$opacity * 100;

        $tag = "<style type=\"text/css\">\n"
            . " #phocagallery .pg-name {color: $font_color ;}\n"
            . " .phocagallery-box-file {background: $background_color ; border:1px solid $border_color;margin: " . $margin_box . "px;padding: " . $padding_box . "px; }\n"
            . " .phocagallery-box-file-first { $imageBgCSS }\n"
            . " .phocagallery-box-file:hover, .phocagallery-box-file.hover {border:1px solid $border_color_hover ; background: $background_color_hover ;}\n"
            /*
            ." .ol-foreground { background-color: $ol_fg_color ;}\n"
            ." .ol-background { background-color: $ol_bg_color ;}\n"
            ." .ol-textfont { font-family: Arial, sans-serif; font-size: 10px; color: $ol_tf_color ;}"
            ." .ol-captionfont {font-family: Arial, sans-serif; font-size: 12px; color: $ol_cf_color ; font-weight: bold;}"*/
/*

            . ".bgPhocaClass{
			background:" . $ol_bg_color . ";
			filter:alpha(opacity=" . $opacityPer . ");
			opacity: " . $opacity . ";
			-moz-opacity:" . $opacity . ";
			z-index:1000;
			}
			.fgPhocaClass{
			background:" . $ol_fg_color . ";
			filter:alpha(opacity=100);
			opacity: 1;
			-moz-opacity:1;
			z-index:1000;
			}
			.fontPhocaClass{
			color:" . $ol_tf_color . ";
			z-index:1001;
			}
			.capfontPhocaClass, .capfontclosePhocaClass{
			color:" . $ol_cf_color . ";
			font-weight:bold;
			z-index:1001;
			}"
            . " </style>\n"
            . '<!--[if lt IE 8]>' . "\n"
            . '<style type="text/css">' . "\n"
            . " .phocagallery-box-file-first { $imageBgCSSIE }\n"
            . ' </style>' . "\n" . '<![endif]-->';

        return $tag;
    }

    public static function renderIeHover() {

        $tag = '<!--[if lt IE 7]>' . "\n" . '<style type="text/css">' . "\n"
            . '.phocagallery-box-file{' . "\n"
            . ' background-color: expression(isNaN(this.js)?(this.js=1, '
            . 'this.onmouseover=new Function("this.className+=\' hover\';"), ' . "\n"
            . 'this.onmouseout=new Function("this.className=this.className.replace(\' hover\',\'\');")):false););
}' . "\n"
            . ' </style>' . "\n" . '<![endif]-->';

        return $tag;

    }

    public static function renderPicLens($categoryId) {
        $tag = "<link id=\"phocagallerypiclens\" rel=\"alternate\" href=\""
            . Uri::base(true) . "/images/phocagallery/"
            . $categoryId . ".rss\" type=\"application/rss+xml\" title=\"\" />"
            . "<script type=\"text/javascript\" src=\"http://lite.piclens.com/current/piclens.js\"></script>"

            . "<style type=\"text/css\">\n"
            . " .mbf-item { display: none; }\n"
            . " #phocagallery .mbf-item { display: none; }\n"
            . " </style>\n";
        return $tag;

    }*/
public static function renderOnUploadJS()
{
    $tag = "<script type=\"text/javascript\"> \n" . "function OnUploadSubmitUserPG() { \n" . "document.getElementById('loading-label-user').style.display='block'; \n" . "return true; \n" . "} \n" . "function OnUploadSubmitPG(idLoad) { \n" . "  if ( document.getElementById('filter_catid_image').value < 1 ) {" . "\n" . "\t   alert('" . Text::_('COM_PHOCAGALLERY_PLEASE_SELECT_CATEGORY', true) . "');" . "\n" . "     return false;" . "\n" . "} \n" . "document.getElementById(idLoad).style.display='block'; \n" . "return true; \n" . "} \n" . "</script>";
    return $tag;
}