NAME

ePortal::PageView - Custom home page of ePortal.

SYNOPSIS

There are 3 types of PageView:

  • user - personal home page of a registered user

  • default - only one PageView may be default. This is default home page of a site

  • template - There may be many templates. They are used when user create new personal home page.

METHODS

restore(id)

Restore a PageView.

id is 'default' - find unique default PageView

id is Number - restore a PageView with this ID

Else use some magic to find desired PageView. This is the rules:

- Anonymous user always sees default PageView.

- If user is registered and has 'DefaultPageView' then restore it. If it fails then restore default PageView. Once a day restore default PageView for the user to see some global news ;-)

- Else or if something fails then restore default PageView.

This function returns 1 on success or 0 on error.

restore_all_templates()

Does restore_where(pvtype = template).

restore_all_for_user(username)

Does restore_where(...) for all PageView available to user (both default and user type)

username is default to current user name

ColumnsCount()

Return a number of columns in the current PageView.

ColumnsWidthPercent()

Returns array of numbers with width in percent of PageView's columns. Narrow column counts as 1, wide column - as 2. For two-column PageView (N:W) result would be (33,66).

Note: The percent sign is not included after numbers.

AvailableSections(column_number)

Returns array (\@values, \%labels) with available sections for addition to the column. References returned are ready to pass to CGI::popup_menu(...)

column_number is number of desired column in PageView.

get_UserSection($column)

Does restore_where(for the column) on ePortal::UserSection object.

If $column is undef then all UserSection (for all columns) are selected. This is the same as call to children().

Returns ePortal::UserSection object ready to restore_next().

CopyFrom($template_id)

Copy PageView object from denoted by $template_id to current one. The pvtype attribute is changed to 'user'. Also copies all daughter UserSection objects.

Returns: 1 on success.

SetDefaultPageView($new_id)

This function is mean only for registered users. new_id is stored in user's configuration and used when next call to PageView->restore().

handle_request()

Get and process URL parameters to add, remove, modify a section. Parameters are:

ps - PageSection ID

us - UserSection ID

colnum - column number

addsection - if true then add new section ps to column colnum

removesection - if true then remove section us

min - if true then minimize section us

restore - if true then restore section us to normal size

AUTHOR

Sergey Rusakov, <rusakov_sa@users.sourceforge.net>