CMS MADE SIMPLE FORGE

Form Builder

 

[#12729] Restriction info on file inputs can’t be styled individually

avatar
Created By: Stephan (10010110)
Date Submitted: Fri Jun 14 12:06:28 -0400 2024

Assigned To: Fernando Morgado (JoMorg)
Version: 1.2
CMSMS Version: 2.2.21
Severity: Minor
Resolution: None
State: Open
Summary:
Restriction info on file inputs can’t be styled individually
Detailed Description:
If you enable the restriction info for file upload fields, the resulting text
comes in plain text as part of $entry->input. Either it should be in an own HTML
container such as a div, so that it can be styled individually or it should have
its own property in the $entry array so that output can be controlled manually
in the template.


History

Comments
avatar
Date: 2024-06-19 05:47
Posted By: Stephan (10010110)

For the records: The relevant code is in classes/FileUploadField.class.php,
starting at line 49.
I hacked it for my personal needs to look like this:

$details = '';
if ($this->GetOption('show_details','0') == '1')
{
  $ms = $this->GetOption('max_size');
  if ($ms != '')
  {
    $details .= ' '.$mod->Lang('maximum_size').': '.$ms.'kb';
  }
  $exts = $this->GetOption('permitted_extensions');
  if ($exts != '')
  {
    $details .= ' '.$mod->Lang('permitted_extensions') . ': '.$exts;
  }
  if(!empty($details)) {
    $details = '<span class="file_details">'.$details.'</span>';
  }
}
return $txt.$details;
      
Updates

Updated: 2024-06-19 05:47
resolution_id: => 5