#!/usr/local/bin/perl # edit_profile.cgi # Edit or create a burn profile require './burner-lib.pl'; &ReadParse(); if ($in{'type'}) { $access{'create'} || &error($text{'edit_ecannot'}); &ui_print_header(undef, $text{'create_title'}, ""); $profile = { 'type' => $in{'type'} }; } else { $profile = &get_profile($in{'id'}); &can_use_profile($profile) || &error($text{'edit_ecannot'}); &ui_print_header(undef, $text{'edit_title'}, ""); } if ($profile->{'type'} == 2 && !&has_command($config{'mkisofs'})) { print "

",&text('edit_emkisofs', "$config{'mkisofs'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; &ui_print_footer("", $text{"index_return"}); exit; } if ($profile->{'type'} == 3 && !&has_command($config{'mpg123'})) { print "

",&text('edit_empg123', "$config{'mpg123'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; &ui_print_footer("", $text{"index_return"}); exit; } if ($profile->{'type'} == 4 && !&has_command($config{'cdrdao'})) { print "

",&text('edit_ecdrdao', "$config{'cdrdao'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; &ui_print_footer("", $text{"index_return"}); exit; } print "

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'edit_header'}
\n"; print "\n"; print "\n"; print "\n"; if ($profile->{'type'} == 1) { # Single ISO options print "\n"; printf "\n", $profile->{'iso'}, &file_chooser_button("iso"); print "\n"; print "\n"; printf "\n", $profile->{'isosize'} ? '' : 'checked', $text{'no'}; } elsif ($profile->{'type'} == 2) { # Multi-directory options print "\n"; print "\n"; printf "\n", $profile->{'rock'} == 0 ? 'checked' : '', $text{'no'}; print "\n"; printf "\n", $profile->{'joliet'} ? '' : 'checked', $text{'no'}; print "\n"; printf "\n", $profile->{'long'} ? '' : 'checked', $text{'no'}; print "\n"; printf "\n", $profile->{'netatalk'} ? '' : 'checked', $text{'no'}; print "\n"; printf "\n", $profile->{'cap'} ? '' : 'checked', $text{'no'}; print "\n"; printf "\n", $profile->{'trans'} ? '' : 'checked', $text{'no'}; print "\n"; printf "\n", $profile->{'volid'}; } elsif ($profile->{'type'} == 3) { # MP3 files or directories of them print "\n"; print "\n"; } elsif ($profile->{'type'} == 4) { # Duplicating a CD print "\n"; print "\n", $found ? "" : $profile->{'sdev'}; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; printf "\n", $profile->{'fly'} ? "" : "checked", $text{'edit_fly0'}; } print "
$text{'edit_name'}
$text{'edit_iso'} %s
$text{'edit_isosize'} %s\n", $profile->{'isosize'} ? 'checked' : '', $text{'yes'}; printf " %s
$text{'edit_dirs'}\n"; print " ", "\n"; for($i=0; $profile->{"source_".($i-4)} || $i < 4; $i++) { print "\n"; printf "\n", $i, $profile->{"source_$i"}, &file_chooser_button("source_$i"); printf "\n", $i, $profile->{"dest_$i"} ? $profile->{"dest_$i"} : "/"; print "\n"; } print "
$text{'edit_source'}$text{'edit_dest'}
%s
\n"; print "
$text{'edit_rock'} %s\n", $profile->{'rock'} == 2 ? 'checked' : '', $text{'edit_rock2'}; printf " %s\n", $profile->{'rock'} == 1 ? 'checked' : '', $text{'yes'}; printf " %s
$text{'edit_joliet'} %s\n", $profile->{'joliet'} ? 'checked' : '', $text{'yes'}; printf " %s$text{'edit_long'} %s\n", $profile->{'long'} ? 'checked' : '', $text{'yes'}; printf " %s
$text{'edit_netatalk'} %s\n", $profile->{'netatalk'} ? 'checked' : '', $text{'yes'}; printf " %s$text{'edit_cap'} %s\n", $profile->{'cap'} ? 'checked' : '', $text{'yes'}; printf " %s
$text{'edit_trans'} %s\n", $profile->{'trans'} ? 'checked' : '', $text{'yes'}; printf " %s$text{'edit_volid'}
$text{'edit_mp3s'}\n"; for($i=0; $profile->{"source_".($i-4)} || $i < 4; $i++) { printf " %s
\n", $i, $profile->{"source_$i"}, &file_chooser_button("source_$i"); } print "
$text{'edit_sdev'}\n"; printf "
$text{'edit_srcdrv'}
$text{'edit_dstdrv'}
$text{'edit_fly'} %s\n", $profile->{'fly'} ? "checked" : "", $text{'edit_fly1'}; printf " %s
\n"; print "\n"; if ($access{'edit'}) { # Show save, burn, test and delete buttons print "\n"; if ($profile->{'type'} == 4) { print "\n"; } else { print "\n"; print "\n"; } if ($profile->{'id'}) { print "\n"; } else { print "\n"; } print "\n"; print "\n"; } else { # Show only burn and test burn buttons if ($profile->{'type'} == 4) { print "\n"; } else { print "\n"; print "\n"; } print "\n"; } print "
", "", "", "", "
\n"; print " ", "$text{'edit_ask'}\n"; print " ", "", "", "
\n"; if (!$access{'edit'}) { # Add some javascript to disable form print "\n"; } &ui_print_footer("", $text{'index_return'});