Class layout

Description

Layout A layout can be simply viewed as a table definition. The table cells can contain blocks, and so this entity is provided to allow control of how blocks of content can be arranged on a webpage.

Located in /layout-defs.php (line 83)

RenderableObject
   |
   --layout
Direct descendents
Class Description
 class named_layout Named Layout. A named layout is just another way of grabbing a layout,
Variable Summary
Method Summary
 layout layout ([string $id = NEW_LAYOUT])
 void delete ()
 void get (mixed $id, string $name)
 string html ()
 void index (string $path, string $title)
 boolean is_pendingver ()
 void paste_layout (mixed $layoutid)
 void put ()
 void replicate ([string $layoutname = ""])
 void unindex ()
 boolean user_can_edit ([mixed $required_version = VERSION_UNDEFINED])
Variables
mixed $author_groups = array(DEFAULT_AUTHOR_GROUPS) (line 132)

The group membership for Authoring privilege

mixed $editable_cells = array() (line 171)

Array of layout cells with edit permission

mixed $editor_groups = array(DEFAULT_EDITOR_GROUPS) (line 129)

The group membership for Editor privilege

mixed $edit_blocks = array() (line 168)

Array of layout blocks in edit mode

mixed $entry_groups = array(DEFAULT_ENTRY_GROUPS) (line 135)

The group membership for Entry privilege

mixed $exists = false (line 110)

Whether the layout exists in database or not

mixed $format_last_modified = NICE_DATE (line 98)

The format string for last modified datetime

mixed $index_category = "" (line 102)

The index category of the current layout - used with Lucene indexing

mixed $language = 0 (line 90)

The language of the layout (0 = default)

mixed $lang_direction = "" (line 94)

The language text direction

mixed $lang_encoding = "" (line 92)

The language encoding code

mixed $last_modified = "" (line 178)

Last modified date/time string.

mixed $layouteditor (line 188)

Local layouteditor object, only instantiated if the

mixed $layoutfm = "layoutform" (line 118)

The name of the layout form

mixed $layoutid = 0 (line 86)

The unique ID of this layout

mixed $layout_blocks = array() (line 138)

The layout blocks, keyed on 'row|col'

mixed $layout_name = "" (line 88)

The name of the current layout

mixed $layout_style = "" (line 141)

Supplemental layout table style

mixed $layout_table (line 115)

The layout table itself

mixed $message = "" (line 184)

Message to display (optional)

mixed $prefix_last_modified = "" (line 100)

The prefix string for last modified datetime

mixed $privileges = array() (line 122)

The group privilege settings for this layout, as

mixed $privilege_groups = array() (line 126)

The groups which have privilege settings for this layout, as

mixed $show_last_modified = false (line 96)

True if we should display last modified date

mixed $table_autojustify = false (line 106)

Table autojustify flag

mixed $table_rowstripes = false (line 108)

Table rowstriping mode flag

mixed $table_style = "" (line 181)

Table style to apply for plain cells table

mixed $table_width = "" (line 104)

Table width specification

mixed $tot_block = 0 (line 153)

Total cells containing a content block

mixed $tot_cols = 0 (line 147)

Total columns in layout

mixed $tot_editable = 0 (line 162)

Total editable plain content cells

mixed $tot_empty = 0 (line 150)

Total empty/undefined cells

mixed $tot_plain = 0 (line 156)

Total plain content cells

mixed $tot_rows = 0 (line 144)

Total rows in layout

mixed $tot_viewable = 0 (line 165)

Total viewable plain content cells

mixed $tot_wysiwyg = 0 (line 159)

Total wysiwyg content cells

mixed $viewable_cells = array() (line 174)

Array of layout cells with view permission

Methods
Constructor layout (line 196)

Constructor Create a new layout object. To create a new layout then just leave leave the argument list empty.

layout layout ([string $id = NEW_LAYOUT])
  • string $id: The unique name/identity of the layout.
activate_editing (line 217)

Provide a layouteditor. This is used to instantiate a layouteditor object for when we need to change this layout somewhow. We only need one, so we check if it's already been done first.

void activate_editing ()
delete (line 472)

Delete the hosted layout from the database. Afterwards, the current object still exists as it was before this method was executed, but the $this->layout->exists flag will have been reset to false.

void delete ()
get (line 234)

Get the layout.

Retrieves the specified layout from database.

void get (mixed $id, string $name)
  • string $name: The name/identity of the layout to get
html (line 857)

Render the block content according to the mode of operation we are in. Possible modes: 'viewing', 'editing', 'saving'.

  • return: The HTML
string html ()

Redefinition of:
RenderableObject::html()
Return output suitable for normal HTML-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to web browsers.

Redefined in descendants as:
index (line 500)

Index all blocks in this layout.

If Lucene indexing is enabled, then we call the indexer for all of the blocks which are in the hosted layout, using the webpage path and title as provided in the call to this method.

void index (string $path, string $title)
  • string $path: The relative path to the webpage the hosted layout is in
  • string $title: The title of the webpage the hosted layout is in

Redefined in descendants as:
  • named_layout::index() : Index the named layout. We only do this if the layout version is LIVE or there is only a single version in existence.
is_pendingver (line 565)

Return PENDING version status.

  • return: True if current versin is PENDING, or only one version.
boolean is_pendingver ()
paste_layout (line 485)

Paste the given layout into this layout, replacing the complete

definition as it currently stands, with the new one. To do this we delete the current layout from the database, get() the new layout from the database, and then replicate it, morphing this object into the brand new layout. All layout and associated block ID's are changed, and are brand new.

void paste_layout (mixed $layoutid)
put (line 424)

Save the layout.

Save this layout to the database. Create a new one if it doesn't already exist.

void put ()
replicate (line 462)

Replicate the hosted layout as a new layout. Creates a brand new

layout in the database, with same data as this one. The end result is that this current object becomes the new layout, and a duplicate set of layout records exist in the database. The layout ID of this new layout is, of course, updated to being a brand new one. NOTES: The layout name is normally left null, which keeps the layout in the same 'family' of layout versions. You can force the layout name to be different, and this will create a new 'layout_set' record of that name for you, if required.

void replicate ([string $layoutname = ""])
  • string $layoutname: New layout name. If null, keeps same name.
unindex (line 523)

Un-Index all blocks in this layout. After calling this method all the bloacks in the layout will have been removed from the Lucene index.

void unindex ()

Redefined in descendants as:
  • named_layout::unindex() : Un-Index the named layout. We only do this if the layout version is LIVE or there is only a single version in existence.
user_can_edit (line 540)

Return true if the current user is permitted to edit layout details.

We allow editing only for versions VERSION_PENDING and VERSION_LIVE and the latter only for Editors.

  • return: True if editing is permitted by current user.
boolean user_can_edit ([mixed $required_version = VERSION_UNDEFINED])

Inherited Methods

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3