-
AuthorPosts
-
January 15, 2017 at 11:43 am #1002385
1.) Request "File Upload"
The AJAX plugin (currently v.1.0.0) does a great job on enhancing the core functionality of form field "media", by allowing users to directly browse and select all kind of files filtered by extension (such as videos or pdfs etc.) and not just images, which is (in my view) a major limitation of the standard Joomla Field Type "Media" (it should be rather called "Images"). So thanks for your great work on this!
Theres one major aspect missing from your plugin "AJAX JA Content Type", that users most certainly wish to have. With the standard "Media" form field you are able to upload images while editing the article / module or whatever component etc.. Your "Media_Modal" does not allow for file uploads on the other hand at all, just file-picking while in editing mode.
So I believe, my first point taken here is more of a feature request, that might be useful for all templates using Custom JA Content Types, for which this plugin is known to be a requirement.
After further investigation of your Plugin Code, one will notice that you have commented the upload form (task) starting on line 142 in "jacontenttype/layouts/contenttype/media.php". Of course, simply uncommenting does not the trick. Replacing a couple of variables helps and does finallay allow with reasonable work for uploads, hurray. BUT in consequence (after uploading files within you "modal_media" field) you would not be returned to the specified views of your plugin (media.php and media_list.php), but instead to the default views of "com_media" ("images and images_list"). Meaning one’s initially specified file extensions within the xml field "modal_media" (legalExtionsions="WHATEVER_EXTENSION_YOU_HAVE") have no effect in these default joomla views anymore. The user only sees "images" after uploading eg. a m4v video, but is not able to pick the file right after uploading it. Only closing und re-opening the "Modal_Media" field solves this problem. So this is not a good solution but rather a workaround for the users. So I tend to tell my users, they should upload their files with com_media first, before creating articles and the like, which is my point here: It’s inconvenient and it would be really highly appreciated to also have an upload solution exactly while working on the article/contenttype.
I’m sure you are aware of this issue, otherwise you wouldn’t have uncommented the mentioned lines within your Plugin. But may I kindly ask you to evaluate that matter in terms of integrating the upload functionality/task to your Plugin? I’m quite certain that it would be the right feature for the users! And certainly this does not only account for the magz2 template, but all templates using contenttypes.
2.) Local Source Videos cannot be picked (are not visible)
My second point beeing that there seems to be a bug, too. The file filtering (specified by the "legalExtensions" Attribute within the form field "Modal_Media") does not work for local videos! At least with a new joomla > 3.6 install, I cannot see any mp4, mv4, ogg or whatever video format is specified by the "Modal_Media" Field. (And of course, I do have videos uploaded to my local directoryies!)
Steps to reproduce: If you choose Contenttype "Video", then pick "local source" from the options list, you cannot pick any specified videos format, since the custom media manager view of your plugin (modal window) does not see local video file formats (even if specified). I had to extend your Plugin Code, in order to get local sources / files to be seen and to get chosen by the users. Here’s what I have done to get it working:
1.) Change "jacontenttype.php" on line 132 from
$options = array( 'baseURL' => COM_MEDIA_BASEURL, 'docs' => $model->getDocuments(), 'images' => $model->getImages(), 'folders' => $model->getFolders(), 'state' => $model->getState() );
to
$options = array( 'baseURL' => COM_MEDIA_BASEURL, 'docs' => $model->getDocuments(), 'images' => $model->getImages(), 'videos' => $model->getVideos(), 'folders' => $model->getFolders(), 'state' => $model->getState() );
2.) Add variable $videos at the beginning of "/layouts/contenttype/media_list.php" (its not there right now)
$baseURL = $displayData['baseURL']; $docs = $displayData['docs']; $images = $displayData['images']; $videos = $displayData['videos']; $folders = $displayData['folders']; $state = $displayData['state'];
3.) Also add a new foreach loop for videos (similar to the docs loop) in the same file "/layouts/contenttype/media_list.php", eg at the end before the closing ul tag
<?php for ($i = 0, $n = count($videos); $i < $n; $i++) : $item = $videos[$i]; if(count($filterExtensions) && !in_array(strtolower(JFile::getExt($item->name)), $filterExtensions)) continue; ?> <li class="imgOutline thumbnail height-80 width-80 center"> <a class="img-preview" href="javascript:ImageManager.populateFields('<?php echo $item->path_relative; ?>')" title="<?php echo $item->name; ?>" > <div class="height-50"> <?php echo JHtml::_('image', $item->icon_16, $item->title, null, true, true) ? JHtml::_('image', $item->icon_16, $item->title, array('width' => 16, 'height' => 16), true) : JHtml::_('image', 'media/con_info.png', $item->title, array('width' => 16, 'height' => 16), true);?> </div> <div class="small"> <?php echo JHtml::_('string.truncate', $item->name, 10, false); ?> </div> </a> </li> <?php endfor; ?>
I hope this topic proofs to be useful.
I’m looking forward hearing from you, especiall regarding my request.Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
January 16, 2017 at 10:14 am #1002660Hi,
Thank you very much for your feedback. I will forward your idea to the team for further consideration.
Regards
-
AuthorPosts
This topic contains 1 reply, has 2 voices, and was last updated by Ninja Lead 7 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum