Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/filebrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function buildForm(data)
{
var $ = jQuery;

$("div.right").html('<form method="post" action="' + urlNew + '"></form>');
$("div.right").html('<form method="post" action="' + urlNew + '" enctype="multipart/form-data"></form>');
$("div.field", data).each(function(){
$("div.right form").append('<div class="field">' + $(this).html() + '</div>');
});
Expand Down
13 changes: 9 additions & 4 deletions content/content.filebrowserajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ function build($context)

// Get the field id's:
$fields = $section->fetchFields();

$fieldIDs = array();
foreach($fields as $field)
{
$fieldIDs[] = $field->get('id');
//Get path to file from Section field
$dest = $field->get('destination');
isset($dest)? $destination = $field->get('destination'):null;
}

// Add rows:
Expand All @@ -72,17 +76,18 @@ function build($context)
$name = basename($info['file']);
}

$value = '<a href="'.$symphonySubdir.'/workspace'.$info['file'].'">';
$value = '<a href="'.$symphonySubdir.$destination.'/'.$info['file'].'">';

$value = '<a href="/workspace'.$info['file'].'">';
$a = explode('.', $info['file']);
$ext = trim(strtolower($a[count($a)-1]));

// Check if JIT is enabled:
if($jitEnabled &&
($ext == 'jpeg' || $ext == 'jpg' || $ext == 'png' || $ext == 'gif'))
{
$value .= '<img src="'.$symphonySubdir.'/image/2/100/100/5'.$info['file'].'" alt="thumb" width="100" height="100" />';
{
//Replace '/workspace' with '' for jit transform
$value .= '<img src="'.$symphonySubdir.'/image/2/100/100/5'.preg_replace('/\/workspace/','',$destination,1).'/'.$info['file'].'" alt="thumb" width="100" height="100" />';

} else {
// Show an icon according to it's extension:
$a = explode('.', basename($info['file']));
Expand Down