mirror of
https://github.com/e107inc/e107.git
synced 2025-08-12 01:25:01 +02:00
- Upload shortcode diable_button parameter added
- Media upload field/add new entry temporary enabled - Form handler appropriate upload field changes made
This commit is contained in:
@@ -60,7 +60,7 @@ class media_admin extends e_admin_dispatcher
|
|||||||
|
|
||||||
protected $adminMenu = array(
|
protected $adminMenu = array(
|
||||||
'main/list' => array('caption'=> 'Media Library', 'perm' => 'A'),
|
'main/list' => array('caption'=> 'Media Library', 'perm' => 'A'),
|
||||||
// 'main/create' => array('caption'=> "Add New Media", 'perm' => 'A'), // Should be handled in Media-Import.
|
'main/create' => array('caption'=> "Add New Media", 'perm' => 'A'), // Should be handled in Media-Import.
|
||||||
'main/import' => array('caption'=> "Media Import", 'perm' => 'A'),
|
'main/import' => array('caption'=> "Media Import", 'perm' => 'A'),
|
||||||
'cat/list' => array('caption'=> 'Media Categories', 'perm' => 'A'),
|
'cat/list' => array('caption'=> 'Media Categories', 'perm' => 'A'),
|
||||||
// 'cat/create' => array('caption'=> "Create Category", 'perm' => 'A'), // is automatic.
|
// 'cat/create' => array('caption'=> "Create Category", 'perm' => 'A'), // is automatic.
|
||||||
@@ -240,7 +240,7 @@ class media_admin_ui extends e_admin_ui
|
|||||||
'media_category' => array('title'=> LAN_CATEGORY, 'type' => 'method', 'data'=> 'str', 'width' => 'auto', 'filter' => true, 'batch' => true,),
|
'media_category' => array('title'=> LAN_CATEGORY, 'type' => 'method', 'data'=> 'str', 'width' => 'auto', 'filter' => true, 'batch' => true,),
|
||||||
|
|
||||||
// Upload should be managed completely separately via upload-handler.
|
// Upload should be managed completely separately via upload-handler.
|
||||||
// 'media_upload' => array('title'=> "Upload File", 'type' => 'upload', 'data'=> false, 'readParm' => 'hidden', 'width' => '10%', 'nolist' => true),
|
'media_upload' => array('title'=> "Upload File", 'type' => 'upload', 'data'=> false, 'readParms' => 'hidden', 'writeParms' => 'disable_button=1', 'width' => '10%', 'nolist' => true),
|
||||||
'media_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'data'=> 'str', 'width' => 'auto'),
|
'media_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'data'=> 'str', 'width' => 'auto'),
|
||||||
'media_caption' => array('title'=> "Caption", 'type' => 'text', 'data'=> 'str', 'width' => 'auto'),
|
'media_caption' => array('title'=> "Caption", 'type' => 'text', 'data'=> 'str', 'width' => 'auto'),
|
||||||
// media_description is type = textarea until bbarea can be reduced to not include youtube etc
|
// media_description is type = textarea until bbarea can be reduced to not include youtube etc
|
||||||
|
@@ -105,6 +105,7 @@ function uploadfile_shortcode($parm)
|
|||||||
'upload_max_file_count' => '0',
|
'upload_max_file_count' => '0',
|
||||||
'upload_overwrite' => '0',
|
'upload_overwrite' => '0',
|
||||||
'return_type' => 'message',
|
'return_type' => 'message',
|
||||||
|
'disable_button' => '0',
|
||||||
), $parms);
|
), $parms);
|
||||||
|
|
||||||
|
|
||||||
@@ -149,7 +150,8 @@ function uploadfile_shortcode($parm)
|
|||||||
<button class='action duplicate' type='button' value='no-value'{$onclickd}><span>".LAN_UPLOAD_ADDFILE."</span></button>";
|
<button class='action duplicate' type='button' value='no-value'{$onclickd}><span>".LAN_UPLOAD_ADDFILE."</span></button>";
|
||||||
|
|
||||||
// Media Manager does the submit, not the shortcode.
|
// Media Manager does the submit, not the shortcode.
|
||||||
// $text .= "<button class='upload' type='submit' name='{$parms['trigger']}' value='no-value'{$onclickt}><span>".LAN_UPLOAD_FILES."</span></button>";
|
if(!$parms['disable_button'])
|
||||||
|
$text .= "<button class='upload' type='submit' name='{$parms['trigger']}' value='no-value'{$onclickt}><span>".LAN_UPLOAD_FILES."</span></button>";
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
</div>
|
</div>
|
||||||
|
@@ -443,11 +443,18 @@ class e_form
|
|||||||
$ret = "
|
$ret = "
|
||||||
<div class='bbarea {$size}'>
|
<div class='bbarea {$size}'>
|
||||||
".$this->textarea($name, $value, $rows, 50, $options, $counter)."
|
".$this->textarea($name, $value, $rows, 50, $options, $counter)."
|
||||||
<div><a href='#' onclick=\"tinyMCE.execCommand('mceToggleEditor',false,'".$tinyMceID."');expandit('".$toggleID."');\">Toggle WYSIWYG</a></div>
|
<div><a href='#' class='e-wysiwyg-switch' onclick=\"tinyMCE.execCommand('mceToggleEditor',false,'".$tinyMceID."');expandit('".$toggleID."');\">Toggle WYSIWYG</a></div>
|
||||||
<div class='field-spacer'><!-- --></div>
|
<div class='field-spacer'><!-- --></div>
|
||||||
{$bbbar}
|
{$bbbar}
|
||||||
</div>
|
</div>
|
||||||
";
|
";
|
||||||
|
// Quick fix - hide TinyMCE links if not installed, dups are handled by JS handler
|
||||||
|
e107::getJs()->footerInline("
|
||||||
|
if(typeof tinyMCE === 'undefined')
|
||||||
|
{
|
||||||
|
\$$('a.e-wysiwyg-switch').invoke('hide');
|
||||||
|
}
|
||||||
|
");
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@@ -1389,6 +1396,7 @@ class e_form
|
|||||||
{
|
{
|
||||||
$value = $tp->htmlwrap($value, (int)$parms['wrap'], varset($parms['wrapChar'], ' '));
|
$value = $tp->htmlwrap($value, (int)$parms['wrap'], varset($parms['wrapChar'], ' '));
|
||||||
}
|
}
|
||||||
|
|
||||||
$value = vartrue($parms['pre']).$value.vartrue($parms['post']);
|
$value = vartrue($parms['pre']).$value.vartrue($parms['post']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1824,7 +1832,8 @@ class e_form
|
|||||||
|
|
||||||
case 'upload': //TODO - from method
|
case 'upload': //TODO - from method
|
||||||
// TODO uploadfile SC is now processing uploads as well (add it to admin UI), write/readParms have to be added (see uploadfile.php parms)
|
// TODO uploadfile SC is now processing uploads as well (add it to admin UI), write/readParms have to be added (see uploadfile.php parms)
|
||||||
return $tp->parseTemplate("{UPLOADFILE=".(vartrue($parms['path']) ? e107::getParser()->replaceConstants($parms['path']) : e_UPLOAD)."|nowarn&trigger=etrigger_uploadfiles}");
|
$disbut = varset($parms['disable_button'], '0');
|
||||||
|
return $tp->parseTemplate("{UPLOADFILE=".(vartrue($parms['path']) ? e107::getParser()->replaceConstants($parms['path']) : e_UPLOAD)."|nowarn&trigger=etrigger_uploadfiles&disable_button={$disbut}}");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'hidden':
|
case 'hidden':
|
||||||
|
Reference in New Issue
Block a user