Class story

Description

RenderableObject class This object should be inherited by all classes which are intended to output content for the client browser.

Located in /story-defs.php (line 30)

RenderableObject
   |
   --story
Variable Summary
Method Summary
 story story ([mixed $id = false], [mixed $category = false], [mixed $language = false])
 void delete_story ()
 string editform ()
 void get_story ([mixed $id = false])
 void get_translation (integer $language)
 string html ()
 void index ()
 void initialise ()
 string make_precis ([integer $maxwords = 50], [integer $minwords = 5])
 string make_story_precis ([integer $maxwords = 50], [integer $minwords = 5])
 void plaintext_content (integer $wrapchars)
 void POSTprocess ()
 string render_story_icon ()
 void save_story ()
 void unindex ()
 boolean user_can_edit ()
 string view ()
 integer word_count ()
Variables
mixed $bytesize = 0 (line 68)
mixed $deleted = false (line 62)
mixed $expiry_date = "" (line 48)
mixed $expiry_date_ts = 0 (line 49)
mixed $formname = "" (line 67)
mixed $has_expiry = true (line 37)
mixed $has_media = true (line 34)
mixed $has_multilang = true (line 38)
mixed $has_multimedia = false (line 35)
mixed $has_precis = true (line 36)
mixed $info_msg = "" (line 63)
mixed $language = 0 (line 39)
mixed $lastmodified = "" (line 50)
mixed $lastmodified_ts = 0 (line 51)
mixed $newstory = false (line 64)
mixed $root_translation_id = -1 (line 58)
mixed $root_translation_lang (line 59)
mixed $storymode = "" (line 66)
mixed $story_author = "" (line 43)
mixed $story_author_name = "" (line 44)
mixed $story_category = false (line 32)
mixed $story_category_desc = "" (line 33)
mixed $story_content = "" (line 42)
mixed $story_date = "" (line 46)
mixed $story_date_ts = 0 (line 47)
mixed $story_headline = "" (line 40)
mixed $story_icon (line 53)
mixed $story_icon_url (line 54)
mixed $story_id = NEW_STORY (line 31)
mixed $story_locs = array() (line 56)
mixed $story_media = array() (line 52)
mixed $story_precis = "" (line 41)
mixed $story_translations = array() (line 57)
mixed $story_type = "" (line 45)
mixed $valid = false (line 65)
mixed $visible = false (line 55)
mixed $wordcount = 0 (line 69)
Methods
Constructor story (line 71)
story story ([mixed $id = false], [mixed $category = false], [mixed $language = false])
delete_story (line 543)

Remove the story from the system. We actually just flag it as deleted on the database, and keep the record.

void delete_story ()
editform (line 897)

Render the story details as an edit form.

  • return: The editform complete.
string editform ()
get_story (line 178)
void get_story ([mixed $id = false])
get_translation (line 775)

Returns the story_id of a translation of the current story in the

given language. If it already exists, then it just returns the story ID. If it doesn't exist, then it simply makes a copy of this story, assigns it the language it _will_ be translated into, and records a relationship to the other associated translations in the database table 'story_tranlsation'. This latter table allows us to put a list of languages (or little country flags) on any stories which have alternatives in another language.

void get_translation (integer $language)
  • integer $language: Language to get translated story in
html (line 1630)

Render the story. We render the story as a table within a form containing all the form elements required to manipulate the story content, email it to someone, save it, and delete it etc...

  • return: The HTML for edit or view.
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.
index (line 459)

Index this story to Lucene, if enabled for this website.

void index ()
initialise (line 147)
void initialise ()
make_precis (line 447)

Generate a precis from the story content.

  • return: The precis
string make_precis ([integer $maxwords = 50], [integer $minwords = 5])
  • integer $maxwords: Maximum number of words for the precis
  • integer $minwords: Minimum number of words for the precis
make_story_precis (line 865)

Generate a story_precis from the story body and return it.

  • return: The precis of this story
string make_story_precis ([integer $maxwords = 50], [integer $minwords = 5])
  • integer $maxwords: Maximum number of words to return
  • integer $minwords: Minimum number of words to return
plaintext_content (line 1606)

Return the content of this story formatted for plaintext display

void plaintext_content (integer $wrapchars)
  • integer $wrapchars: Number of characters to wrap the lines at
POSTprocess (line 558)

Process the POST from form. This method deals with POSTed content from the edit form.

void POSTprocess ()
render_story_icon (line 879)

Return the rendering of the story icon (if one exists) either as a standard HTML anchor tag if an icon URL exists, or as an image.

  • return: HTML for anchor or image of the story icon
string render_story_icon ()
save_story (line 497)

Routine to save the story to the database.

void save_story ()
unindex (line 486)

Un-Index this story from Lucene, if enabled for this website.

void unindex ()
user_can_edit (line 243)

Determine wwhether user can edit this story.

  • return: True if user can edit the story, else false.
boolean user_can_edit ()
view (line 1383)

Render the story as a maintainer reader would view it. Note that this

is not a fully dressed-up story viewer. It is designed as a view that a story administrator would see, showing all the technical bits and pieces such as story byte-size etc. You should create your own viewer for rendering stories 'prettily' on your website.

  • return: The HTML for the view story content.
string view ()
word_count (line 850)

Do a re-count of the story words. Set our local variable and also return the value as a by-product..

  • return: Count of words in the story
integer word_count ()

Inherited Methods

Inherited From RenderableObject

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

Documentation generated by phpDocumentor 1.3.0RC3