Added table-building support to SetupBlock to allow easily building cleaner setup controls

This commit is contained in:
Matthew Barbour 2019-06-26 23:00:49 -05:00 committed by matthew
parent 4065540f0e
commit 8638a16694
2 changed files with 9 additions and 5 deletions

View File

@ -280,13 +280,17 @@ class Media extends Extension
// $sb->add_label("<b style='color:red'>ImageMagick not detected</b>"); // $sb->add_label("<b style='color:red'>ImageMagick not detected</b>");
// } // }
// } else { // } else {
$sb->add_text_option(MediaConfig::CONVERT_PATH, "convert command: "); $sb->start_table();
$sb->add_table_header("Commands");
$sb->add_text_option(MediaConfig::CONVERT_PATH, "convert", true);
// } // }
$sb->add_text_option(MediaConfig::FFMPEG_PATH, "<br/>ffmpeg command: "); $sb->add_text_option(MediaConfig::FFMPEG_PATH, "<br/>ffmpeg", true);
$sb->add_text_option(MediaConfig::FFPROBE_PATH, "<br/>ffprobe command: "); $sb->add_text_option(MediaConfig::FFPROBE_PATH, "<br/>ffprobe", true);
$sb->add_shorthand_int_option(MediaConfig::MEM_LIMIT, "<br />Max memory use: "); $sb->add_shorthand_int_option(MediaConfig::MEM_LIMIT, "<br />Mem limit: ", true);
$sb->end_table();
$event->panel->add_block($sb); $event->panel->add_block($sb);

View File

@ -98,7 +98,7 @@ class TranscodeImage extends Extension
$sb->start_table(); $sb->start_table();
$sb->add_bool_option(TranscodeConfig::ENABLED, "Allow transcoding images: ", true); $sb->add_bool_option(TranscodeConfig::ENABLED, "Allow transcoding images: ", true);
$sb->add_bool_option(TranscodeConfig::UPLOAD, "Transcode on upload: ", true); $sb->add_bool_option(TranscodeConfig::UPLOAD, "Transcode on upload: ", true);
$sb->add_choice_option(TranscodeConfig::ENGINE, Media::IMAGE__MEDIA_ENGINES, "Engine", true); $sb->add_choice_option(TranscodeConfig::ENGINE, Media::IMAGE_MEDIA_ENGINES, "Engine", true);
foreach (self::INPUT_FORMATS as $display=>$format) { foreach (self::INPUT_FORMATS as $display=>$format) {
if (in_array($format, MediaEngine::INPUT_SUPPORT[$engine])) { if (in_array($format, MediaEngine::INPUT_SUPPORT[$engine])) {
$outputs = $this->get_supported_output_formats($engine, $format); $outputs = $this->get_supported_output_formats($engine, $format);