SproutCMS

This is the code documentation for the SproutCMS project

function load()

Loads a preview by creating temporary tables in SQL, calling a
controller's _editSave method, and then calling a method it would
normally use to display its (non-temporary) data

Usage

int Preview::load ( ManagedAdminController $ctlr , array $tables [, int $record_id ] );

Arguments

  1. ManagedAdminController $ctlr
    The controller with the preview method
  2. array $tables
    Tables to copy. The keys are the table names, and
           the values are WHERE clauses for data to copy across: use 0 to
           copy just the structure with no data, and 1 to copy all data;
           otherwise use an array of conditions (see Pdb::buildClause)
           The first table specified is the 'core' table which will contain
           the record which will be previewed.
           N.B. It's unnecessary to specify pages, page_revisions, or
           menu_groups here; they will be included automatically.
  3. int $record_id = 0
    ID of the main record, if it exists; 0 to insert a new record

Return value

  • int
    The ID of the record (whether existing or newly inserted)