context_title
context_text
Topic Summary - Displaying 1 post(s). Click here to show all |
Posted by: Dandello Posted on: Feb 11th, 2015 at 1:13am
|
Does not properly show which items are checked. In Admin/AdminEdit.pm find fopen( MODACCESS, "$vardir/gmodsettings.txt" );
@scriptlines = <MODACCESS>;
fclose(MODACCESS);
$startread = 0;
$counter = 0;
foreach my $scriptline (@scriptlines) {
chomp $scriptline;
if ( substr( $scriptline, 0, 1 ) eq q{'} ) {
$scriptline =~ s/newsettings\;page\=//xsm;
if ( $scriptline =~ /\"(.*?)\"/sm ) {
$allow = $1;
}
if ( $scriptline =~ /\'(.*?)\'/sm ) {
$actionfound = $1;
}
push @actfound, $actionfound;
push @allowed, $allow;
$counter++;
}
}
@actfound = sort @actfound;
$column = int( $counter / 2 );
$counter = 0;
$aa = 0;
foreach my $actfound (@actfound) {
$checked = q{};
if ( $allowed[$aa] eq 'on' ) { $checked = ' checked="checked"'; }
$dismenu .=
qq~\n<input type="checkbox" name="$actfound" id="$actfound"$checked /> <label for="$actfound"><img src="$admin_img{'question'}" alt="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" title="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" /> $actfound</label><br />~;
$counter++;
$aa++;
if ( $counter > $column + 1 ) {
$dismenu .= q~</td><td class="windowbg2 vtop">~;
$counter = 0;
}
}
Replace with: $counter = 0;
my %gmodset1 = ();
for my $key ( keys %gmod_access ) {
$value = $gmod_access{$key};
$key =~ s/newsettings\;page\=//xsm;
$gmodset1{$key} = $value;
$counter++;
}
$column = int( $counter / 2 );
$counter = 0;
my @gmodsrt = sort keys %gmodset1;
for my $actfound (@gmodsrt) {
$checked = q{};
if ( $gmodset1{$actfound} eq 'on' ) { $checked = ' checked="checked"'; }
$dismenu .=
qq~\n<input type="checkbox" name="$actfound" id="$actfound"$checked /> <label for="$actfound"><img src="$admin_img{'question'}" alt="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" title="$reftxt{'1a'} $gmodprivexpl_txt{$actfound}" /> $actfound</label><br />~;
$counter++;
if ( $counter > $column + 1 ) {
$dismenu .= q~</td><td class="windowbg2 vtop">~;
$counter = 0;
}
}
|