Class blocklet

Description

The blocklet is simply a part of a block. It is almost a 'paragraph' of

content, excepting that a blocklet might have content of several text paragraphs, so it is something slightly different, hence the name. This class knows how to get, save and delete blocklets, and how to render them as html.

Located in /block-defs.php (line 1152)

RenderableObject
   |
   --blocklet
Variable Summary
Method Summary
 blocklet blocklet ([string $id = NEW_BLOCKLET])
 void content_css ()
 void content_style ()
 string csv ()
 void delete ()
 string expanded_content ()
 void format_content (mixed $content, [mixed $type = "text"], [mixed $css = ""])
 void get (string $id)
 string html ()
 void put ()
Variables
mixed $blockletid (line 1154)

blocklet ID

mixed $blocklet_style = "" (line 1186)

Manual style to apply to content

mixed $content = "" (line 1180)

Blocklet textual content

mixed $content_colour = "" (line 1184)

Content colour

mixed $content_size = 0 (line 1182)

Content size adjustment -2 thru +2

mixed $desc = "" (line 1158)

The description of the current blocklet

mixed $display_order = 1 (line 1196)

Display order of this blocklet

mixed $exists = false (line 1156)

Whether blocklet exists in database

mixed $heading (line 1166)

blocklet heading

mixed $heading_colour = "" (line 1170)

Heading colour

mixed $heading_level = 3 (line 1168)

blocklet heading level (1-6)

mixed $justify = "left" (line 1164)

Justification: 'left', 'right', 'centered'

mixed $ruler = "none" (line 1172)

blocklet ruler: 'none', 'top', 'bottom'

mixed $ruler_colour = "" (line 1178)

Ruler colour

mixed $ruler_size = 1 (line 1176)

Ruler pixel size

mixed $ruler_width = 100 (line 1174)

Ruler width percent: 0-100

mixed $table_autojustify = false (line 1190)

True if we autojustify table

mixed $table_rowstripes = false (line 1192)

True if we autojustify table

mixed $table_style = "" (line 1188)

Table style to apply to content

mixed $type = "text" (line 1160)

The blocklet type: 'text', 'list', 'ordered', 'bullets', or 'table'

mixed $visible = true (line 1194)

Whether blocklet is visible

mixed $width = 100 (line 1162)

The width % of the blocklet table

Methods
Constructor blocklet (line 1203)

Constructor Create a new blocklet object.

blocklet blocklet ([string $id = NEW_BLOCKLET])
  • string $id: The unique identity of the blocklet.
content_css (line 1312)

Content style.

Returns an internal class style string based on the values of properties: content_colour and content_size. Returns the string as bare style specs 'font-size:0.8em;' etc. $access private

void content_css ()
content_style (line 1337)

Content style.

Returns an internal class style string based on the values of properties: content_colour and content_size. Returns the string as a full 'style="..." style, ready for a <span> tag etc.. $access private

void content_style ()
csv (line 1450)

Render the blocklet as a CSV stream. We split the content types for this into 'table' and 'other'. For tables we use the "|" delimiter to determine where our commas go. For other content we basically just leave it as-is, only adding quotes.

  • return: The CSV formatted blocklet content.
string csv ()
delete (line 1293)

Delete the blocklet.

Delete this blocklet from the database.

void delete ()
expanded_content (line 1501)

Process the current blocklet content for special tags. This effectively expands the special tags into 'real' content from database, or as image references etc. We return the expanded content as a string.

  • return: The new content, expanded as appropriate to the tags. $access private
string expanded_content ()
format_content (line 1348)

Format Content.

Formats the given content according to the given content type. $access private

void format_content (mixed $content, [mixed $type = "text"], [mixed $css = ""])
get (line 1214)

Get the blocklet.

Retrieves the specified blocklet from database.

void get (string $id)
  • string $id: The unique integer identity of the blocklet to get.
html (line 1699)

Render the blocklet.

  • 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.
put (line 1253)

Save the blocklet.

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

void put ()

Inherited Methods

Inherited From RenderableObject

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

Documentation generated by phpDocumentor 1.3.0RC3