File/program/modules/mypage/mypage_admin.php

Description

/program/modules/mypage/mypage_admin.php - management interface for mypage-module

This file defines the administrative interface to this module. The interface consists of the following four functions.

    mypage_disconnect(&$output,$area_id,$node_id,$module) mypage_connect(&$output,$area_id,$node_id,$module) mypage_show_edit(&$output,$area_id,$node_id,$module,$viewonly,$edit_again,$href,$option) mypage_save(&$output,$area_id,$node_id,$module,$viewonly,&$edit_again,$option)

These functions are called from pagemanagerlib.php whenever necessary.

Functions
mypage_connect (line 67)

connect this module to a node

this makes the link between the node $node_id in area $area_id and this module. There is nothing to configure so this routine is a NOP.

  • return: TRUE on success, FALSE otherwise
bool mypage_connect (object &$output, int $area_id, int $node_id, array $module)
  • object &$output: collects the html output (if any)
  • int $area_id: the area in which $node_id resides
  • int $node_id: the node to which we need to connect
  • array $module: the module record straight from the database
mypage_disconnect (line 51)

disconnect this module from a node

this breaks the link between the node $node_id in area $area_id and this module. Since there is nothing to configure this is a NOP.

  • return: TRUE on success, FALSE otherwise
bool mypage_disconnect (object &$output, int $area_id, int $node_id, array $module)
  • object &$output: collects the html output (if any)
  • int $area_id: the area in which $node_id resides
  • int $node_id: the node from which we need to disconnect
  • array $module: the module record straight from the database
mypage_save (line 127)

save the modified content data of this module linked to node $node_id

basically also a NOP: If the user has cancelled the operation, the flag $edit_again is set to FALSE and the return value is also FALSE.

If the modified data is stored successfully, the return value is TRUE and the value of $edit_again is based on the button used to save ([Save] or [Done]).

Here is a summary of return values.

$retval | $edit_again | Action
------- | ----------- | ------
FALSE   | FALSE       | [Cancel] Stop editing, unlock & return to tree view
FALSE   | TRUE        | [Save] or [Done] failed: redo the dialog and let user correct mistakes
TRUE    | FALSE       | [Done] pressed, everything saved succesfully, we're done
TRUE    | TRUE        | [Save] pressed, everything saved succesfully but continue editing

The parameter $option is not used in this module.

  • return: TRUE on success + output stored via $output, FALSE otherwise
bool mypage_save (object &$output, int $area_id, int $node_id, array $module, bool $viewonly, bool &$edit_again, string $option)
  • object &$output: collects the html output (if any)
  • int $area_id: the area in which $node_id resides
  • int $node_id: the node to which the content is connected
  • array $module: the module record straight from the database
  • bool $viewonly: if TRUE, editing and hence saving is not allowed
  • bool &$edit_again: set to TRUE if we need to edit the content again, FALSE otherwise
  • string $option: indicates which submenu-option was selected (NULL for none)
mypage_show_edit (line 87)

present the user with a dialog to modify the mypage that is connected to node $node_id

display a short message indicating that this module has no configuration options. The user can only use the Cancel button to return to Page Manager.

  • return: TRUE on success + output stored via $output, FALSE otherwise
bool mypage_show_edit (object &$output, int $area_id, int $node_id, array $module, bool $viewonly, bool $edit_again, string $href, string $option)
  • object &$output: collects the html output (if any)
  • int $area_id: the area in which $node_id resides
  • int $node_id: the node to which this module is connected
  • array $module: the module record straight from the database
  • bool $viewonly: if TRUE, editing is not allowed (but simply showing the content is allowed)
  • bool $edit_again: if TRUE start with data from $_POST, else use data from database
  • string $href: the action property of the HTML-form, the place where data will be POST'ed
  • string $option: indicates which submenu-option was selected (NULL for none)

Documentation generated on Tue, 28 Jun 2016 19:10:32 +0200 by phpDocumentor 1.4.0