XI. Page Reference

Midgard uses page records to control the actual site structure and content of a midgard host.

1. Page Record Definition

A page record contains information about a page, its owner and its parent.

Fields of a page record

id

The id of the page record.

up

The id of the parent page.

style

The id of the style of the page.

name

The name of the page. Will be part of the URL.

title

The title of the page.

content

The content of the page.

author

The id of the person that is the author of the page.

info

Contains bits for "auth" and "virtual path". Authentication can be required or inherited. A page is either "virtual path enabled" or not.

changed

The date and time the page record was last changed.

sitegroup

The id of the sitegroup the page record belongs to.

2. Page Object Definition

This section describes the contents of pagelink objects. Most object parameters map directly to the record fields described above.

The functions listed within the object definition are the object methods that are available for the object. Usage information about those methods can be found in Object Methods.

/* Page Object Prototype */

Class page {

  var $N;          # Only with mgd_list_XXX functions.
  var $id;
  var $up;
  var $style;
  var $name;
  var $title;
  var $content;
  var $author;
  var $info;
  var $changed;
  var $sitegroup;

  function fetch();  # only with mgd_list_XXX functions.

  function create();
  function update();
  function delete();

  function setsitegroup();
  function getsitegroup();

  function parameter();
  function listparameters();
  function searchparameters();

  function setscore();

  function settype();

  function createattachment();
  function updateattachment();
  function deleteattachment();
  function getattachment();
  function listattachment();
  function openattachment();
  function serveattachment();
}
Table of Contents
mgd_get_page — Get a page record
mgd_get_page_by_name — Get a page record by its name
mgd_create_page — Create a page record
mgd_delete_page — Delete a page record
mgd_delete_page_tree — Delete a page tree
mgd_update_page — Update a page record
mgd_move_page — Move a page
mgd_copy_page — Copy a page record
mgd_is_page_owner — Check page ownership
mgd_is_in_page_tree — Check residance within pagetree
mgd_list_pages — List page records
mgd_page_has_children — Check if page has children
mgd_walk_page_tree — Walk a page tree