1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-09 16:17:14 +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:
secretr
2011-06-07 13:01:36 +00:00
parent 94d76ee505
commit 91debe933b
3 changed files with 113 additions and 102 deletions

View File

@@ -60,7 +60,7 @@ class media_admin extends e_admin_dispatcher
protected $adminMenu = array(
'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'),
'cat/list' => array('caption'=> 'Media Categories', 'perm' => 'A'),
// '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,),
// 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_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

View File

@@ -105,6 +105,7 @@ function uploadfile_shortcode($parm)
'upload_max_file_count' => '0',
'upload_overwrite' => '0',
'return_type' => 'message',
'disable_button' => '0',
), $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>";
// 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 .= "
</div>

View File

@@ -443,11 +443,18 @@ class e_form
$ret = "
<div class='bbarea {$size}'>
".$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>
{$bbbar}
</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;
}
@@ -1389,6 +1396,7 @@ class e_form
{
$value = $tp->htmlwrap($value, (int)$parms['wrap'], varset($parms['wrapChar'], ' '));
}
$value = vartrue($parms['pre']).$value.vartrue($parms['post']);
break;
@@ -1824,7 +1832,8 @@ class e_form
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)
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;
case 'hidden':