AAAAadministrator/components/com_admirorgallery/views/imagemanager/scripts/imgManager-render-folder.php000060400000043255151373464100033630 0ustar00home/academiac/wwwenqueueMessage(JText::_("AG_CANNOT_CREATE_FOLDER") . " " . $newFolderName, 'error'); } function ag_render_caption($ag_lang_name, $ag_lang_tag, $ag_lang_content) { return '
' . $ag_lang_name . ' / ' . $ag_lang_tag . '
'; } $ag_preview_content = ''; $ag_preview_content.='
' . "\n"; $ag_preview_content.='

' . JText::_('AG_CURRENT_FOLDER') . '

' . $this->_renderBreadcrumb($ag_itemURL, $ag_starting_folder, $ag_folderName, $ag_fileName) . '

' . JText::_('AG_OPERATION_WITH_SELECTED_ITEMS') . '

 ' . JText::_('AG_UPLOAD_IMAGES_JPG_JPEG_GIF_PNG_OR_ZIP') . ' [ ' . JText::_('AG_MAX') . ' ' . (JComponentHelper::getParams('com_media')->get('upload_maxsize',0)).' MB ]: 

 ' . JText::_('AG_CREATE_FOLDERS') . '  ' . JText::_('AG_ADD') . '

' . JText::_('AG_EDIT_FOLDER_CAPTIONS') . '
'; // RENDER FOLDERS // CREATED SORTED ARRAY OF FOLDERS $ag_files = JFolder::folders(JPATH_SITE . $ag_itemURL); if (!empty($ag_files)) { $ag_folders_priority = Array(); $ag_folders_noPriority = Array(); $ag_folders = Array(); foreach ($ag_files as $key => $value) { $ag_folderName = $ag_itemURL; $ag_fileName = basename($value); // Set Possible Description File Apsolute Path // Instant patch for upper and lower case... $ag_pathWithStripExt = JPATH_SITE . $ag_folderName . JFile::stripExt($ag_fileName); $ag_XML_path = $ag_pathWithStripExt . ".XML"; if (JFIle::exists($ag_pathWithStripExt . ".xml")) { $ag_XML_path = $ag_pathWithStripExt . ".xml"; } if (file_exists($ag_XML_path)) { $ag_XML_xml = JFactory::getXMLParser('simple'); $ag_XML_xml->loadFile($ag_XML_path); $ag_XML_priority = $ag_XML_xml->document->priority[0]->data(); } if (!empty($ag_XML_priority) && file_exists($ag_XML_path)) { $ag_folders_priority[$value] = $ag_XML_priority; // PRIORITIES IMAGES } else { $ag_folders_noPriority[] = $value; // NON PRIORITIES IMAGES } } } if (!empty($ag_folders_priority)) { asort($ag_folders_priority); foreach ($ag_folders_priority as $key => $value) { $ag_folders[] = $key; } } if (!empty($ag_folders_noPriority)) { natcasesort($ag_folders_noPriority); foreach ($ag_folders_noPriority as $key => $value) { $ag_folders[] = $value; } } if (!empty($ag_folders)) { foreach ($ag_folders as $key => $value) { $ag_hasXML = ""; $ag_hasThumb = ""; // Set Possible Description File Apsolute Path // Instant patch for upper and lower case... $ag_pathWithStripExt = JPATH_SITE . $ag_itemURL . JFile::stripExt(basename($value)); $ag_XML_path = $ag_pathWithStripExt . ".xml"; if (JFIle::exists($ag_pathWithStripExt . ".XML")) { $ag_XML_path = $ag_pathWithStripExt . ".XML"; } $ag_XML_visible = "AG_VISIBLE"; $ag_XML_priority = ""; if (file_exists($ag_XML_path)) { $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 = "AG_HIDDEN"; } } } $ag_preview_content.='

' . JText::_($ag_XML_visible) . '

' . JText::_('AG_PRIORITY') . ': 
'; } } // RENDER IMAGES // CREATED SORTED ARRAY OF IMAGES $ag_files = JFolder::files(JPATH_SITE . $ag_itemURL); $ag_ext_valid = array("jpg", "jpeg", "gif", "png"); // SET VALID IMAGE EXTENSION if (!empty($ag_files)) { $ag_images_priority = Array(); $ag_images_noPriority = Array(); $ag_images = Array(); foreach ($ag_files as $key => $value) { if (is_numeric(array_search(strtolower(JFile::getExt(basename($value))), $ag_ext_valid))) { $ag_folderName = $ag_itemURL; $ag_fileName = basename($value); // Set Possible Description File Apsolute Path // Instant patch for upper and lower case... $ag_pathWithStripExt = JPATH_SITE . $ag_folderName . JFile::stripExt($ag_fileName); $ag_XML_path = $ag_pathWithStripExt . ".XML"; if (JFIle::exists($ag_pathWithStripExt . ".xml")) { $ag_XML_path = $ag_pathWithStripExt . ".xml"; } if (file_exists($ag_XML_path)) { $ag_XML_xml = JFactory::getXMLParser('simple'); $ag_XML_xml->loadFile($ag_XML_path); $ag_XML_priority = $ag_XML_xml->document->priority[0]->data(); } if (!empty($ag_XML_priority) && file_exists($ag_XML_path)) { $ag_images_priority[$value] = $ag_XML_priority; // PRIORITIES IMAGES } else { $ag_images_noPriority[] = $value; // NON PRIORITIES IMAGES } } } } if (!empty($ag_images_priority)) { asort($ag_images_priority); foreach ($ag_images_priority as $key => $value) { $ag_images[] = $key; } } if (!empty($ag_images_noPriority)) { natcasesort($ag_images_noPriority); foreach ($ag_images_noPriority as $key => $value) { $ag_images[] = $value; } } if (!empty($ag_images)) { foreach ($ag_images as $key => $value) { $ag_hasXML = ""; $ag_hasThumb = ""; // Set Possible Description File Apsolute Path // Instant patch for upper and lower case... $ag_pathWithStripExt = JPATH_SITE . $ag_itemURL . JFile::stripExt(basename($value)); $ag_XML_path = $ag_pathWithStripExt . ".xml"; if (JFIle::exists($ag_pathWithStripExt . ".XML")) { $ag_XML_path = $ag_pathWithStripExt . ".XML"; } $ag_XML_visible = "AG_VISIBLE"; $ag_XML_priority = ""; if (file_exists($ag_XML_path)) { $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 = "AG_HIDDEN"; } } } if (file_exists(JPATH_SITE . "/plugins/content/admirorgallery/admirorgallery/thumbs/" . basename($ag_folderName) . "/" . basename($value))) { $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.='

' . JText::_($ag_XML_visible) . '

' . JText::_('AG_PRIORITY') . ': 
 ' . JText::_('AG_FOLDER_THUMB') . '
'; } } if (empty($ag_folders) && empty($ag_images)) { $ag_preview_content.= JText::_('AG_NO_FOLDERS_OR_IMAGES_FOUND_IN_CURRENT_FOLDER'); } $AG_folderDroplist = ""; $ag_preview_content.=' '; ?>