Maxscape::SiteApplication::Page Package

Synopsis

use Maxscape::SiteApplication::Page;

Description

This package contains database element callbacks and mainloops in order to generate pages.

List of Member Functions

  1. changePageElement
  2. checkPageElementPermission
  3. deleteMemberAccount
  4. deleteSecurityCodeImages
  5. editPageElementPermission
  6. Flash_mp3player
  7. generateSecurityCode
  8. HelpLink
  9. HelpMenuLinks
  10. MessageFormHandler
  11. niceCharacters
  12. niceUnicode_UTF8_CharacterSet
  13. printElements
  14. printGermanEnglish
  15. ProfileEditorFrames
  16. PulldownMenu
  17. ServerGlobalElementCallback
  18. setRootCategoryContext
  19. setTextareaSize
  20. simpleColorTable
  21. simpleElementLoop
  22. SongListToJavacript
  23. standardTemplateElementCallback
  24. standardTemplateLoop
  25. UserElementLoop
  26. UserTemplateElementCallback

Member Functions

setRootCategoryContext

Synopsis

$Page->setRootCategoryContext ($defaultProperties);

Description

Sets the context and theme for an application server. The properties are derived from the app server settings and the users preferences stored in the USER_PROFILE table. Is usually called in an element in the content databases root category.

Examples

my @defaultPreferences = split (';', '#f6f6f6;#FFFFFF;16;float;80;100;800;');

$Page->setRootCategoryContext ($defaultProperties);

ServerGlobalElementCallback

Synopsis

&Maxscape::Page::ServerGlobalElementCallback ($Page, $Element);

Description

This function can be used as an database element callback in order to do element specific actions, when a page is generated. It has to be configurated in the global (/maxscape/etc/maxscape.conf) or a local (e.g. /maxscape/server/MaXscape/etc/maxscape.conf) Maxscape configuration file.

Examples

sub ServerGlobalElementCallback {
  my ($self) = shift;
  my ($Element) = @_;

  my $Text = '';

  my $ElementAttribute = $self->AttributeParameter(
        'Attribute' => ${$Element}{ELEMENT_ATTRIBUTE}
        #,'Parameter' => 'Type'
  );

  my $TypeAttribute = ${$ElementAttribute}{Type};

  if ($TypeAttribute eq 'XML') {
   # ...
  };
  return $Text;
}

standardTemplateElementCallback

Synopsis

&Maxscape::Page::standardTemplateElementCallback ($Page, $Element);

Description

This function is called for each database element in order to do element specific actions, when a page of template type 'standardTemplate' is generated. It has to be configurated via the administration surface (main menu/TreeAdm) for that template type.

Examples

###############################################################################

sub standardTemplateElementCallback  {
  my ($self) = shift;
  my ($Element) = @_;

  my $Text = '';

  my $ElementName = ${$Element}{ELEMENT_NAME};
  my $ElementAttribute = $self->AttributeParameter(
                            'Attribute' => ${$Element}{ELEMENT_ATTRIBUTE}
                            #,'Parameter' => 'name'
  );
  if ($ElementName eq 'h3' || $ElementName eq 'h2') {

    ${$Element}{ELEMENT_CONTENT} =
             '<h3>' . ${$Element}{ELEMENT_CONTENT} . '</h3>';

  } elsif ($ElementName eq 'pre') {

    ${$Element}{ELEMENT_CONTENT} =
             '<pre>' . ${$Element}{ELEMENT_CONTENT} . '</pre>';

  } elsif ($ElementName eq 'pre') {

    ${$Element}{ELEMENT_CONTENT} =
             '<pre>' . ${$Element}{ELEMENT_CONTENT} . '</pre>';

  } elsif ($ElementName eq 'whatever') {

    # send me a postcard
    # ..

  } else {
  }
  return '';
}

UserTemplateElementCallback

Synopsis

&Maxscape::Page::UserTemplateElementCallback ($Page, $Element);

Description

This function is called for each database element in order to do element specific actions, when a page of template type 'standardTemplate' is generated. It has to be configurated via the administration surface (main menu/TreeAdm) for that template type.

Examples

sub UserTemplateElementCallback  {
  my ($self) = shift;
  my ($Element) = @_;

  my $Text = '';

  my $ElementName = ${$Element}{ELEMENT_NAME};
  my $ElementAttribute = $self->AttributeParameter(
                            'Attribute' => ${$Element}{ELEMENT_ATTRIBUTE}
                            #,'Parameter' => 'name'
  );
  if ($ElementName eq 'h3' || $ElementName eq 'h2') {

    ${$Element}{ELEMENT_CONTENT} =
             '<h3>' . ${$Element}{ELEMENT_CONTENT} . '</h3>';

  } elsif ($ElementName eq 'pre') {

    ${$Element}{ELEMENT_CONTENT} =
             '<pre>' . ${$Element}{ELEMENT_CONTENT} . '</pre>';

  } elsif ($ElementName eq 'pre') {

    ${$Element}{ELEMENT_CONTENT} =
             '<pre>' . ${$Element}{ELEMENT_CONTENT} . '</pre>';

  } elsif ($ElementName eq 'whatever') {

    # send me a postcard
    # ..

  } else {
  }
  return '';
}

setTextareaSize

Synopsis

$Page->setTextareaSize ($Element, $ElementAttribute);

Description

Sets the size of a textarefield via some buttons.

standardTemplateLoop

Synopsis

&Maxscape::Page::standardTemplateLoop ($Page);

Description

This function generates a page of template type standardTemplate. It has to be configurated via the administration surface (main menu/TreeAdm) for that template type.

printElements

Synopsis

&Maxscape::Page::printElements ();

Description

Example of a generation function,that generates a page from the page elements.

simpleElementLoop

Synopsis

&Maxscape::Page::simpleElementLoop ($Page);

Description

Example of a generation function, that generates a page from the page elements.

UserElementLoop

Synopsis

&Maxscape::Page::UserElementLoop ($Page);

Description

Example of a generation function, that generates a page from the page elements.

editPageElementPermission

Synopsis

my $allowToEdit = &Maxscape::Page::editPageElementPermission ($Page, $editPageElementPermission);
my $allowToEdit = $Page->editPageElementPermission ($Page->{Data}{editPageElementPermission});

Description

Check page element permission given by $editPageElementPermission.

checkPageElementPermission

Synopsis

my $allowToEdit = &Maxscape::Page::checkPageElementPermission ($Page, $checkPageElementPermission);
my $allowToEdit = $Page->checkPageElementPermission ($Page->{Data}{checkPageElementPermission});

Description

Check page element permissions attribute.

HelpLink

Synopsis

my $HelpLink = $Page->HelpLink ();
my $HelpLink = $Page->HelpLink ( FontSize => 'little', Text => 'Help' );

Description

deleteMemberAccount

Synopsis

$Text = $Page->deleteMemberAccount ( %P );

Description

Examples

$Text = $Page->deleteMemberAccount ( promptPasswordText  => 'Password: ',
                                     confirmDeletionText => 'Confirm: ',
                                     PasswordDoesntMatch => 'Password does not match: ',
        );

Flash_mp3player

Synopsis

my $Flash_mp3player = $Page->Flash_mp3player ();
my $Flash_mp3player = $Page->Flash_mp3player ( File => 'MP3-Song',
                                               SongNumber => 1,
                                               WidgetLength => 240,
                                               ShowDigits => 'true',
                                             );
my $Song1 = $Page->Flash_mp3player ( 
              SongNumber   => 1,
              File         => '/Music/Strinx/Strinx-MD-128-KB.mp3',
              WidgetLength => 200,
              ShowDigits   => 'true',
);

Description

SongListToJavacript

Synopsis

my $Text = $Page->SongListToJavacript ();

Description

printGermanEnglish

Synopsis

my $GermanOREnglishText = $Page->printGermanEnglish ("GermanText","EnglishText");
# alias is $Page->pge();

Description

changePageElement

Synopsis

my $changed = $Page->changePageElement ($Element, $ElementAttribute);

Description

Edit elements within a displayed page. Works together with the method 'standardTemplateElementCallback'.

ProfileEditorFrames

Synopsis

my $HTML_Help_Frame = $Page->ProfileEditorFrames ( %P );

Description

Examples

my $HTML_Help_Frame = $Page->ProfileEditorFrames (
  editMode       => 'ProfileHelpFrameView', # CGI_Property name
  editModeState  => 'off', # CGI_Property value,'HelpHTML'
  openFrameText  => 'Help Frame',
  closeFrameText => 'No Frame',
  #CSS_Class      => 'Menu',
);

my $ProfileHelpFrame = $Page->ProfileEditorFrames (
  editMode       => 'ProfileHelpFrame',   # CGI_Property name
  editModeState  => 'displayProfile',     # CGI_Property value,
  openFrameText  => 'FrameView',
  closeFrameText => 'No Frame',
  #CSS_Class      => 'Menu',
);

if ($Page->{CGI}->{ProfileHelpFrameView} eq 'HelpHTML')
{
  $Addr1 = "/?Category=/User/UserData&Page=Index&"
         . "ProfileHelpFrameView=$ProfileHelpFrameView";
  $Addr2 = "/?Category=/User/Manuals&Page=HTML&"
         . "ProfileHelpFrameView=$ProfileHelpFrameView";
}
elsif ($Page->{CGI}->{ProfileFrame} eq 'displayProfile')
{
  $Addr1 = "/User/?Category=/User/UserData&Page=Index&"
         . "ProfileFrame=$ProfileFrame";
  $Addr2 = "/User/?$UserHomePagePath&ProfileFrame=$ProfileFrame";
}

generateSecurityCode

Synopsis

$Page->generateSecurityCode ();

Description

Generate a security code and images to prevent robot access.

deleteSecurityCodeImages

Synopsis

$Page->deleteSecurityCodeImages ();

Description

Delete a security code images.

MessageFormHandler

Synopsis

$Page->MessageFormHandler ();

Description

Maxscape message form.

Examples

return $Page->MessageFormHandler ($MessageReceiver, $MessageTextColor,
                $MessageErrorTextColor, $MessageBackgroundColor,
                $MessageErrorBackgroundColor, $FormSubmitBarBackgroundColor,
                $MessageSentText);

PulldownMenu

Synopsis

my $PulldownMenu = $Page->PulldownMenu (@HyperlinkList);

Description

Returns a pulldown menu. The CSS is defined in the database templates.

HelpMenuLinks

Synopsis

my $HelpMenuLinks = $Page->HelpMenuLinks ();

Description

Returns links to all help manuals.

simpleColorTable

Synopsis

my $simpleColorTable = $Page->simpleColorTable ();

Description

niceCharacters

Synopsis

my $niceCharacter = $Page->niceCharacters ('jin_jang');

Description

Returns a unicode UTF8 character.

niceUnicode_UTF8_CharacterSet

Synopsis

$Page->niceUnicode_UTF8_CharacterSet ($which);

Description

Returns a unicode UTF8 character.

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