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 84)

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 133)

The group membership for Authoring privilege

mixed $editable_cells = array() (line 172)

Array of layout cells with edit permission

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

The group membership for Editor privilege

mixed $edit_blocks = array() (line 169)

Array of layout blocks in edit mode

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

The group membership for Entry privilege

mixed $exists = false (line 111)

Whether the layout exists in database or not

mixed $format_last_modified = NICE_DATE (line 99)

The format string for last modified datetime

mixed $index_category = "" (line 103)

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

mixed $language = 0 (line 91)

The language of the layout (0 = default)

mixed $lang_direction = "" (line 95)

The language text direction

mixed $lang_encoding = "" (line 93)

The language encoding code

mixed $last_modified = "" (line 179)

Last modified date/time string.

mixed $layouteditor (line 189)

Local layouteditor object, only instantiated if the

mixed $layoutfm = "layoutform" (line 119)

The name of the layout form

mixed $layoutid = 0 (line 87)

The unique ID of this layout

mixed $layout_blocks = array() (line 139)

The layout blocks, keyed on 'row|col'

mixed $layout_name = "" (line 89)

The name of the current layout

mixed $layout_style = "" (line 142)

Supplemental layout table style

mixed $layout_table (line 116)

The layout table itself

mixed $message = "" (line 185)

Message to display (optional)

mixed $prefix_last_modified = "" (line 101)

The prefix string for last modified datetime

mixed $privileges = array() (line 123)

The group privilege settings for this layout, as

mixed $privilege_groups = array() (line 127)

The groups which have privilege settings for this layout, as

mixed $show_last_modified = false (line 97)

True if we should display last modified date

mixed $table_autojustify = false (line 107)

Table autojustify flag

mixed $table_rowstripes = false (line 109)

Table rowstriping mode flag

mixed $table_style = "" (line 182)

Table style to apply for plain cells table

mixed $table_width = "" (line 105)

Table width specification

mixed $tot_block = 0 (line 154)

Total cells containing a content block

mixed $tot_cols = 0 (line 148)

Total columns in layout

mixed $tot_editable = 0 (line 163)

Total editable plain content cells

mixed $tot_empty = 0 (line 151)

Total empty/undefined cells

mixed $tot_plain = 0 (line 157)

Total plain content cells

mixed $tot_rows = 0 (line 145)

Total rows in layout

mixed $tot_viewable = 0 (line 166)

Total viewable plain content cells

mixed $tot_wysiwyg = 0 (line 160)

Total wysiwyg content cells

mixed $viewable_cells = array() (line 175)

Array of layout cells with view permission

Methods
Constructor layout (line 197)

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 218)

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 469)

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 231)

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 854)

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 497)

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 562)

Return PENDING version status.

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

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 421)

Save the layout.

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

void put ()
replicate (line 459)

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 520)

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 537)

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