[Rt-commit] rt branch, 4.4/add-prefs-before-option-callback, created. rt-4.4.4-144-g94d0b03673

Steve Burr steve at bestpractical.com
Tue Nov 10 16:35:23 EST 2020


The branch, 4.4/add-prefs-before-option-callback has been created
        at  94d0b0367308cd770749a70c5abe664b78a8797c (commit)

- Log -----------------------------------------------------------------
commit 94d0b0367308cd770749a70c5abe664b78a8797c
Author: Steven Burr <steve at bestpractical.com>
Date:   Tue Nov 10 16:20:11 2020 -0500

    Add BeforeOption callback to customize Prefs/Other.html
    
    Sites wishing to customize which options are configurable
    require a hook to insert their logic. This adds a new
    callback called BeforeOption that allows for customization
    as well as for skipping the display of edit controls for
    a given option.

diff --git a/share/html/Prefs/Other.html b/share/html/Prefs/Other.html
index cf9fe4abab..38d03c8914 100644
--- a/share/html/Prefs/Other.html
+++ b/share/html/Prefs/Other.html
@@ -54,7 +54,10 @@
 <&|/Widgets/TitleBox, title => loc( $section ) &>
 % foreach my $option( RT->Config->Options( Section => $section ) ) {
 % next if $option eq 'EmailFrequency' && !RT->Config->Get('RecordOutgoingEmail');
-% my $meta = RT->Config->Meta( $option );
+% my $SkipOption = 0;
+% $m->callback(CallbackName => 'BeforeOption', %ARGS, ARGSRef => \%ARGS, SectionRef => \$section, OptionRef => \$option, SkipRef => \$SkipOption );
+% unless ( $SkipOption ) {
+%   my $meta = RT->Config->Meta( $option );
 <& $meta->{'Widget'},
     Default      => 1,
     %{ $m->comp('/Widgets/FinalizeWidgetArguments', WidgetArguments =>
@@ -63,6 +66,7 @@
     DefaultValue => scalar RT->Config->Get( $option ),
     CurrentValue => $preferences->{ $option },
 &>
+%   }
 % }
 </&>
 % }

-----------------------------------------------------------------------


More information about the rt-commit mailing list