PHP Classes

File: htdocs/modules/system/templates/system_imagemanager2.tpl

Recommend this page to a friend!
  Classes of Michael Beck   Xoops 2.5   htdocs/modules/system/templates/system_imagemanager2.tpl   Download  
File: htdocs/modules/system/templates/system_imagemanager2.tpl
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change: Pass JWT for ajaxfineupload in post, not header

JWT is now passed as a body parameter named 'Authorization'
rather than as a HTTP header. The headers are scrubbed in some
hosting situations causing uploads to fail.

Callers are adjusted to replace:
```
customHeaders: {
"Authorization": "Basic <{$jwt}>"
}
```

with:
```
params: {
"Authorization": "<{$jwt}>"
}
```
Date: 6 years ago
Size: 5,083 bytes
 

Contents

Class file image Download
<!doctype html> <html lang="<{$xoops_langcode}>"> <head> <meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>"> <meta http-equiv="content-language" content="<{$xoops_langcode}>"> <title><{$xoops_sitename}> <{$lang_imgmanager}></title> <{$image_form.javascript}> <link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl xoops.css}>"> <link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl modules/system/css/imagemanager.css}>"> <link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl media/font-awesome/css/font-awesome.min.css}>"> <{php}> $language = $GLOBALS['xoopsConfig']['language']; if(file_exists(XOOPS_ROOT_PATH.'/language/'.$language.'/style.css')){ echo " <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"language/$language/style.css\"/> "; } <{/php}> <!-- fine-upload --> <!-- Fine Uploader New/Modern CSS file ====================================================================== --> <link href="<{xoAppUrl media/fine-uploader/fine-uploader-new.css}>" rel="stylesheet"> <link href="<{xoAppUrl media/fine-uploader/ManuallyTriggerUploads.css}>" rel="stylesheet"> <!-- Fine Uploader JS file ====================================================================== --> <script src="<{$xoops_url}>/media/fine-uploader/fine-uploader.js"></script> <{includeq file="db:system_trigger_uploads.tpl"}> <!-- fine-upload --> </head> <body onload="window.resizeTo(<{$xsize|default:800}>, <{$ysize|default:572}>);"> <table cellspacing="0" id="imagenav"> <tr> <td id="addimage" class="txtleft"><a href="<{$xoops_url}>/imagemanager.php?target=<{$target}>&amp;cat_id=<{$show_cat}>" title="<{$lang_imgmanager}>"><{$lang_imgmanager}></a></td> </tr> </table> <h2><{$imgcat_name}></h2> <div id="fine-uploader-manual-trigger"></div> <div><{$smarty.const._IMGMAXSIZE}> <{$imgcat_maxsize}></div> <div><{$smarty.const._IMGMAXWIDTH}> <{$imgcat_maxwidth}></div> <div><{$smarty.const._IMGMAXHEIGHT}> <{$imgcat_maxheight}></div> <div id="footer"> <input value="<{$lang_close}>" type="button" onclick="window.close();"/> </div> <!-- Your code to create an instance of Fine Uploader and bind to the DOM/template ====================================================================== --> <script> var manualUploader = new qq.FineUploader({ element: document.getElementById('fine-uploader-manual-trigger'), template: 'qq-template-manual-trigger', request: { endpoint: '<{$xoops_url}>/ajaxfineupload.php', params: { "Authorization": "<{$jwt}>" } }, text: { formatProgress: "<{$smarty.const._FORMATPROGRESS}>", failUpload: "<{$smarty.const._FAILUPLOAD}>", waitingForResponse: "<{$smarty.const._WAITINGFORRESPONSE}>", paused: "<{$smarty.const._PAUSED}>" }, messages: { typeError: "<{$smarty.const._TYPEERROR}>", sizeError: "<{$smarty.const._SIZEERROR}>", minSizeError: "<{$smarty.const._MINSIZEERROR}>", emptyError: "<{$smarty.const._EMPTYERROR}>", noFilesError: "<{$smarty.const._NOFILESERROR}>", tooManyItemsError: "<{$smarty.const._TOOMANYITEMSERROR}>", maxHeightImageError: "<{$smarty.const._MAXHEIGHTIMAGEERROR}>", maxWidthImageError: "<{$smarty.const._MAXWIDTHIMAGEERROR}>", minHeightImageError: "<{$smarty.const._MINHEIGHTIMAGEERROR}>", minWidthImageError: "<{$smarty.const.__MINWIDTHIMAGEERROR}>", retryFailTooManyItems: "<{$smarty.const._RETRYFAILTOOMANYITEMS}>", onLeave: "<{$smarty.const._ONLEAVE}>", unsupportedBrowserIos8Safari: "<{$smarty.const._UNSUPPORTEDBROWSERIOS8SAFARI}>" }, thumbnails: { placeholders: { waitingPath: '<{$xoops_url}>/media/fine-uploader/placeholders/waiting-generic.png', notAvailablePath: '<{$xoops_url}>/media/fine-uploader/placeholders/not_available-generic.png' } }, validation: { acceptFiles: ['image/jpeg', 'image/gif', 'image/png'], allowedExtensions: ['jpeg', 'jpg', 'png', 'gif'], image: { maxHeight: <{$imgcat_maxheight}>, maxWidth: <{$imgcat_maxwidth}> }, sizeLimit: <{$imgcat_maxsize}>, itemLimit: <{$imgcat_itemlimit|default:2}> }, autoUpload: false, callbacks: { onError: function(id, name, errorReason, xhrOrXdr) { console.log(qq.format("Error uploading {}. Reason: {}", name, errorReason)); } }, debug: <{$fineup_debug}> }); qq(document.getElementById("trigger-upload")).attach("click", function() { manualUploader.uploadStoredFiles(); }); </script> </body> </html>