$ag_hasXML = '<img src="' . JURI::root() . 'administrator/components/com_admirorgallery/templates/' . $AG_templateID . '/images/icon-hasXML.png"  class="ag_hasXML" />';
            $ag_XML_xml =& JFactory::getXMLParser('simple');
            $ag_XML_xml = simplexml_load_file($ag_XML_path);
            if (isset($ag_XML_xml->priority)) {
                $ag_XML_priority = $ag_XML_xml->priority;
            }
            if (isset($ag_XML_xml->visible)) {
                if ((string) $ag_XML_xml->visible == "false") {
                    $ag_XML_visible = "HIDDEN";
                }
            }
        }
        if (file_exists(JPATH_SITE . "/plugins/content/AdmirorGallery/thumbs/" . basename($ag_folderName) . "/" . basename($value))) {
            $ag_hasThumb = '<img src="' . JURI::root() . 'administrator/components/com_admirorgallery/templates/' . $AG_templateID . '/images/icon-hasThumb.png"  class="ag_hasThumb" />';
        }
        agHelper::ag_createThumb(JPATH_SITE . $ag_itemURL . $value, $thumbsFolderPhysicalPath . DS . $value, 145, 80, "none");
        $AG_thumb_checked = "";
        if ($ag_XML_thumb == $value) {
            $AG_thumb_checked = " CHECKED";
        }
        $ag_preview_content .= '
     <div class="AG_border_color AG_border_width AG_item_wrapper">
	<a href="' . $ag_itemURL . $value . '" class="AG_fileLink AG_item_link" title="' . $value . '">
	      <div style="display:block; text-align:center;" class="AG_item_img_wrapper">
	      <img src="' . JURI::root() . 'administrator/components/com_admirorgallery/assets/thumbs/' . $value . '" class="ag_imgThumb" />
	      </div>
	</a>
	<div class="AG_border_color AG_border_width AG_item_controls_wrapper">	
	    <input type="text" value="' . JFile::stripExt(basename($value)) . '" name="AG_rename[' . $ag_itemURL . $value . ']" class="AG_input" style="width:95%" /><hr /> 
	    ' . JText::_($ag_XML_visible) . '<hr />
        <img src="' . JURI::root() . 'administrator/components/com_admirorgallery/templates/' . $AG_templateID . '/images/operations.png" style="float:left;" /><input type="checkbox" value="' . $ag_itemURL . $value . '" name="AG_cbox_selectItem[]" class="AG_cbox_selectItem"><hr />
示例#2
0
    foreach ($ag_files as $key => $value) {
        if (is_numeric(array_search(strtolower(JFile::getExt(basename($value))), $ag_ext_valid))) {
            $ag_images[] = $value;
        }
    }
    if (array_search($ag_fileName, $ag_images) != 0) {
        $ag_fileName_prev = $ag_images[array_search($ag_fileName, $ag_images) - 1];
    }
    if (array_search($ag_fileName, $ag_images) < count($ag_images) - 1) {
        $ag_fileName_next = $ag_images[array_search($ag_fileName, $ag_images) + 1];
    }
    if (!empty($ag_fileName_prev)) {
        $ag_preview_content .= '<a class="AG_common_button" href="" onclick="AG_jQuery(\'#AG_input_itemURL\').val(\'' . $ag_folderName . '/' . $ag_fileName_prev . '\');submitbutton(\'AG_reset\');return false;"><span><span>' . JText::_("AG_PREVIOUS_IMAGE") . '</span></span></a>' . "\n";
    }
    if (!empty($ag_fileName_next)) {
        $ag_preview_content .= '<a class="AG_common_button" href="" onclick="AG_jQuery(\'#AG_input_itemURL\').val(\'' . $ag_folderName . '/' . $ag_fileName_next . '\');submitbutton(\'AG_reset\');return false;"><span><span>' . JText::_("AG_NEXT_IMAGE") . '</span></span></a>' . "\n";
    }
}
$ag_preview_content .= '<hr />';
$ag_preview_content .= '
<h1>' . JText::_('AG_IMAGE_DETAILS_FOR_FILE') . '</h1>
<div class="AG_border_color AG_border_width AG_margin_bottom AG_breadcrumbs_wrapper">
' . $this->ag_render_breadcrumb($ag_itemURL, $this->ag_starting_folder, $ag_folderName, $ag_fileName) . '
</div>
';
agHelper::ag_createThumb(JPATH_SITE . $ag_itemURL, $thumbsFolderPhysicalPath . DIRECTORY_SEPARATOR . basename($ag_itemURL), 145, 80, "none");
//Image and image details
$ag_preview_content .= $this->ag_render_image_info($ag_itemURL, $AG_imgInfo, $ag_hasXML, $ag_hasThumb);
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_admirorgallery' . DIRECTORY_SEPARATOR . 'slimbox' . DIRECTORY_SEPARATOR . 'index.php';
$ag_preview_content .= $this->ag_render_captions($ag_imgXML_captions);
$ag_preview_content .= $this->ag_render_file_footer();
示例#3
0
 /**
  * Generates Album Thumbs
  */
 function Album_generateThumb($AG_parent_folder, $AG_img)
 {
     if ($this->params['thumbWidth'] == 0 || $this->params['thumbHeight'] == 0) {
         $this->adderror(JText::_("AG_CANNOT_CREATE_THUMBNAILS_WIDTH_AND_HEIGHT_MUST_BE_GREATER_THEN_0"));
         return;
     }
     $imagesFolderPhysicalPath = $this->imagesFolderPhysicalPath . $AG_parent_folder . $this->DS;
     $thumbsFolderPhysicalPath = $this->thumbsFolderPhysicalPath . $AG_parent_folder . $this->DS;
     //Create directory in thumbs for gallery
     if (!file_exists($thumbsFolderPhysicalPath)) {
         JFolder::create($thumbsFolderPhysicalPath, 0755);
     }
     //Add's index.html to thumbs folder
     if (!file_exists($thumbsFolderPhysicalPath . 'index.html')) {
         $this->ag_indexWrite($thumbsFolderPhysicalPath . 'index.html');
     }
     $original_file = $imagesFolderPhysicalPath . $AG_img;
     $thumb_file = $thumbsFolderPhysicalPath . $AG_img;
     if (!file_exists($thumb_file)) {
         $this->addError(agHelper::ag_createThumb($original_file, $thumb_file, $this->params['thumbWidth'], $this->params['thumbHeight'], $this->params['thumbAutoSize']));
     } else {
         list($imagewidth, $imageheight) = getimagesize($thumb_file);
         switch ($this->params['thumbAutoSize']) {
             case "none":
                 if ($imageheight != $this->params['thumbHeight'] || $imagewidth != $this->params['thumbWidth']) {
                     $this->addError(agHelper::ag_createThumb($original_file, $thumb_file, $this->params['thumbWidth'], $this->params['thumbHeight'], $this->params['thumbAutoSize']));
                 }
                 break;
             case "height":
                 if ($imagewidth != $this->params['thumbWidth']) {
                     $this->addError(agHelper::ag_createThumb($original_file, $thumb_file, $this->params['thumbWidth'], $this->params['thumbHeight'], $this->params['thumbAutoSize']));
                 }
                 break;
             case "width":
                 if ($imageheight != $this->params['thumbHeight']) {
                     $this->addError(agHelper::ag_createThumb($original_file, $thumb_file, $this->params['thumbWidth'], $this->params['thumbHeight'], $this->params['thumbAutoSize']));
                 }
                 break;
         }
     }
     // ERROR - Invalid image
     if (!file_exists($thumb_file)) {
         //$this->addError("Cannot read thumbnail");
         $this->addError(JText::sprintf("AG_CANNOT_READ_THUMBNAIL", $thumb_file));
     }
 }