Maxscape::Menu Package

Synopsis

use Maxscape::Menu;

Description

The Maxscape::Menu package supplies the functionality to deal with site navigation and menu systems related to the content database.

The Maxscape runtime system can be configured to create a Maxscape::Menu" object by default and fill it's members with the data about categories and pages of the current page category level.

Note, that the displayMainMenuHyperlink method is app server or site global and defined in GlobalServerApplication.pm, resp. ServerApplication.pm.

List of Member Functions

  1. _displayMenu
  2. _displayPageMenuNodeHyperlink
  3. _registerPageMenuNodeHyperlink
  4. CategoryLink
  5. checkProjectMemberNames
  6. checkProjectName
  7. createProject
  8. createProjectPages
  9. displayCategories
  10. displayCategory
  11. displayCategoryMenu
  12. displayMainMenu
  13. displayMainMenuCategories
  14. displayMainMenuHyperlink
  15. HashOfListsEntryToHash
  16. initialiseMainMenu
  17. manageProject
  18. MenuHeaderRule
  19. new
  20. PageMenuProperty
  21. PathDepth
  22. pushCategories
  23. registerCurrentCategoriesAndPages
  24. registerPageMenuNodeHyperlink
  25. selectRandomImage
  26. SequenceLinks
  27. setSequenceLinksAnchorCSS_Class

Member Functions

new

Synopsis

$Menu = Maxscape::Menu->new (Page       => $Page,
                            'Font'      => $Font,
                            'FontEnd'   => $FontEnd,
                            'otherText' => $otherText,
);

Description

Creates a new 'Maxscape::Menu' navigation object.

Examples




HashOfListsEntryToHash

Synopsis

my $Category = $Menu->HashOfListsEntryToHash ($Categories, $i);

Description

Returns a hash of enties.

initialiseMainMenu

Synopsis

$Menu->initialiseMainMenu ($Page);

Examples

my $Text .= $Menu->initialiseMainMenu ($self, $MenuCallbackFunctionName);

Description

Initialises the 'Menu->{mainMenu}' member to the reference returned by the subroutine '$MenuCallbackFunctionName'.

registerCurrentCategoriesAndPages

Synopsis

$Menu->registerCurrentCategoriesAndPages ($self);

Description

Registers the pages current level nodes from the previously collected data.

Examples

if ($Page->{Context}->{'Query.Mode'}) {
  $Menu->registerCurrentCategoriesAndPages($Page);
}

CategoryLink

Synopsis

my $Link .= $self->CategoryLink ();

Description

Returns a category link.

PageMenuProperty

Synopsis

$self->PageMenuProperty ("otherText", $UserChannelText . $otherText);

Description

Add some text to a property.

pushCategories

Synopsis

$Menu->pushCategories ($Categories); # $Categories is a reference to a list.

Description

Pushes a list of categories to the $Menu object's category list. $Categories is a list reference.

displayCategories

Synopsis

my $MenuText = $Menu->displayCategories (%Parameter);

Description

Returns a menu text of the nodes below the current category.

Examples

my $MenuText = $Page->{Menu}->displayCategories (
                 DisplayStart => 0,
                 DisplayStop  => int(($#{$Menu->{Elements}{Categories}}/2)-1),
               );

displayCategoryMenu

Synopsis

my $MenuText = $Menu->displayCategories ();

Description

Returns a menu text of the nodes below the current category.

registerPageMenuNodeHyperlink

Synopsis

$Menu->registerPageMenuNodeHyperlink ($Category);

Description

Registers the category $Category.

_registerPageMenuNodeHyperlink

Synopsis

$Menu->_registerPageMenuNodeHyperlink ($Category);

Description

Registers the category $Category. The default function, but not in use.

_displayPageMenuNodeHyperlink

Synopsis

my $LinkText = $Menu->_displayPageMenuNodeHyperlink (%Parameter);

Description

The default function to return an hyperlink.

Examples

my $LinkText = $Menu->displayPageMenuNodeHyperlink (
                 Category => ${$Menu->{Categories}}[$i]
               );

_displayMenu

Synopsis

my $MenuText = $Menu->_displayMenu (%Parameter);

Description

The default function to display a menu.

displayCategory

Synopsis

my $CategoryText = $Menu->displayCategory ($which);

Description

Displays a category.

setSequenceLinksAnchorCSS_Class

Synopsis

$Menu->setSequenceLinksAnchorCSS_Class ($CSS_Class);

Description

Sets the CSS class.

Examples

$Menu->setSequenceLinksAnchorCSS_Class ('leftSideMenu');

SequenceLinks

Synopsis

$Menu->SequenceLinks ($which, $LinkText, $CSSLinkClass, $ExecutePermission);

Description

Sets the CSS class.

displayMainMenu

Synopsis

Displays the categories and pages of node tree in the content database.

Description

Displays categories and pages of the content database. Several meta data are used to control if and how a node is displayed. E.g, to control if a node is actually displayed, the MENU_NUMBER column of the NODE table is used. The position in the menue is given by the MENU_NUMBER number. Note, that the displayMainMenuHyperlink method is app server or site global and defined in GlobalServerApplication.pm, resp. ServerApplication.pm.

Examples

@{[ $Page->{Menu}->displayMainMenu (
      SubCategoryIndent => "$::SP$::SP$::SP",
      Image             => $Page->{Layout}{MenuImage},
      selectedImage     => $Page->{Layout}{selectedMenuImage},
      ReplaceCategory   => {
                             "//Search"   => $Page->{MenuAnchor}{Search},
                             "//Comments" => $Page->{MenuAnchor}{Comments},
                             "//Contact" => $Page->{MenuAnchor}{Chat},
                           },
)]}

@{[ $Page->{Menu}->displayMainMenu (
      dontShowMainCategories => 1,
      dontShowRootCategory   => 1,
      SubCategoryIndent      => "$::SP$::SP$::SP",
      CSSLinkClass           => 'leftSideMenu',
      MenuSelectedLinkBgColor   => $Page->{Layout}->{leftSideMenuSelectedLinkBgColor},
      MenuSelectedLinkTextColor => $Page->{Layout}->{leftSideMenuSelectedLinkTextColor},
      leftMenuUserAdminPageText => 'Home',
)]}

PathDepth

Synopsis

my $Depth = $Menu->PathDepth ($CategoryMenuHashPath)

Description

Returns the depth.

displayMainMenuCategories

Synopsis

my $Menu = $Page->{Menu}->displayMainMenuCategories ();

Description

Displays the categories and pages of the node tree in the content database. To control if a node is actually displayed, the MENU_NUMBER column of the NODE table is used. The position in the menue is given by the MENU_NUMBER number.

Examples

my $Menu = $Page->{Menu}->displayMainMenuCategories (
             CSSLinkClass    => "Menu",
             Categories   => $Page->{Context}->{MainCategories},
             myCategory   => $Page->Category(),
             myPage       => $Page->PageName(),
             Type         => 'horizontal',
             Indent       => '',
             MenuSelectedLinkBgColor => $Page->{Layout}{TopMenuSelectedLinkBgColor},
             MenuSelectedLinkTextColor => $Page->{Layout}{MenuSelectedLinkTextColor},
             DisplayStart => 0,
             DisplayStop  => $#{$Page->{Context}->{MainCategories}},
             ReplaceCategory   => {
                                    $ReplaceCategory   => '',
                                  },
             additionalMenuLinks => $displayMemberButton, #$editTopMenuButton,
);

displayMainMenuHyperlink

Synopsis

my $HyperlinkText = $Menu->displayMainMenuHyperlink (%Parameter);

Description

Return a menu's hyperlink.

Examples

my $HyperlinkText = $Menu->displayMainMenuHyperlink (
                      Category => ${$Page->{Categories}}[$i]
                    );

MenuHeaderRule

Synopsis

my $HeaderRule = $Menu->MenuHeaderRule ();

Description

Returns an HTML header rule.

selectRandomImage

Synopsis

$Page->selectRandomImage ($Parameter);

Description

Selects a random image.

createProject

Synopsis

$Page->createProject ($PageTreeDocumentRoot);

Description

Creates a project.

checkProjectName

Synopsis

$Page->checkProjectName ($PageTreeDocumentRoot, $ProjectName);

Description

Checks a project name.

createProjectPages

Synopsis

$Page->createProjectPages ($PageTreeDocumentRoot, $ProjectName);

Description

Creates project pages.

manageProject

Synopsis

$Page->manageProject ($PageTreeDocumentRoot);

Description

Manage a project.

checkProjectMemberNames

Synopsis

$Page->checkProjectMemberNames ($PageTreeDocumentRoot, $ProjectName);

Description

Checks project member names.

1
Next ∙ Previous ∙ Top ∙ Join ∙ Contact © Maxscape