Kernel::WebApp::Util::ScreenConfig::Widget

NAME

Kernel::WebApp::Util::ScreenConfig::Widget

DESCRIPTION

Handles all the screen config widget operations.

PUBLIC INTERFACE

has ScreenConfigObject

Attribute that holds the current screen config object.

has Types

This attribute contains a hash of the available widget types.

Get()

Get the widget information for the given screen config and the given widget ID.

    my $Widget = $WidgetObject->Get(
        WidgetID => '...',
    );

Returns

    {
        ID     => '...',
        Title  => '...',
        Config => {...},
    }

Update()

Updates the widget information for the given screen config and the given widget ID.

    my $Sucess = $WidgetObject->Update(
        Config   => {...},
        WidgetID => '...',
        Data     => {...},
    );

Returns

    1 - in case the widget was updated.
    undef - in case the widget was not updated
        (this could happen if the widget ID does not exists).

Reset()

Reset the widget information to the default for the given screen config and the given widget ID.

    my $Success = $WidgetObject->Reset(
        Config   => {...},
        WidgetID => '...',
    );

Returns

    1 - in case the widget was reseted.
    undef - in case the widget was not reseted
        (this could happen if the widget ID does not exists).

TypeObject()

Determines the correct widget type object by a given type name.

    my $TypeObject = $WidgetObject->TypeObject( 'TicketList' );

Returns the correct widget type object.

DefaultWidgets()

Fetches the default configurations for the widget type and all the widgets and merge them.

    my $WidgetDefaultConfig = $ScreenConfigObject->DefaultWidgets(
        StripeSidebar => 0|1,   # default: 0, use 1 to get widgets for the stripe sidebar.
    );

Returns the default widget configuration.

Widgets()

Returns a list of all widgets that are in the screen config.

    my $List = $WidgetObject->Widgets(
        Config => '...' # optional screen config
    );

HelperFor()

Returns the widget helper module for the given type.

    my $Helper = $WidgetObject->HelperFor(
        Type => '...' # required
    );

PRIVATE INTERFACE

_BuildTypes()

Searches for available widget modules and returns a hash of widget instances.

_LoopThroughWidgets

Loop through all the widget and for each one send it to the callback.

    $WidgetObject->_LoopThroughWidgets(
        Callback => sub {
            my ( $Widget, $SourceList, $Index, ) = @_;
            push @Preferences, $Preference;

            # return; # to stop the loop.
            return 1; # To continue the loop.
        }
    );

_CheckGroupAccess()

Checks the group access for the current user id and given widget.

Scroll to Top