| alpha--controller

# Class: ViewArticle Source Location: /controller/ViewArticle.php ## Class ViewArticle Class Overview
Implements interfaces: AlphaControllerInterface Controller used to display a Markdown version of an article Located in /controller/ViewArticle.php [line 61]
    AlphaController
       |
       --ViewArticle
Author(s): John Collins <dev@alphaframework.org> Information Tags:
Version: | $Id: ViewArticle.php 1453 2011-12-04 15:12:54Z johnc $
Copyright: | Copyright (c) 2011, John Collins (founder of Alpha Framework). All rights reserved.
     Redistribution and use in source and binary forms, with or
     without modification, are permitted provided that the
     following conditions are met:

     * Redistributions of source code must retain the above
       copyright notice, this list of conditions and the
       following disclaimer.
     * Redistributions in binary form must reproduce the above
       copyright notice, this list of conditions and the
       following disclaimer in the documentation and/or other
       materials provided with the distribution.
     * Neither the name of the Alpha Framework nor the names
       of its contributors may be used to endorse or promote
       products derived from this software without specific
       prior written permission.

     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Since: | 1.0
License: | The BSD License
| Properties $BO | Methods __construct before_displayPageFoot_callback doGET doPOST during_displayPageHead_callback insert_CMSDisplayStandardHeader_callback
[ Top ] Descendants
Child Class | Description
--- | ---
ViewArticleFile | Controller used to display a Markdown version of a page article where the name of the .text file containing the Markdown/HTML content is provided
ViewArticlePrint | Controller used to display a printer-friendly version of an article where the title is provided in GET vars
ViewArticleTitle | Controller used to display a Markdown version of a page article where the title is provided in GET vars
[ Top ] Inherited Properties, Constants, and Methods
Inherited Properties | Inherited Methods | Inherited Constants
--- | --- | ---
Inherited From AlphaController AlphaController::$description AlphaController::$dirtyObjects AlphaController::$firstJob AlphaController::$keywords AlphaController::$lastJob AlphaController::$name AlphaController::$newObjects AlphaController::$nextJob AlphaController::$previousJob AlphaController::$statusMessage AlphaController::$title AlphaController::$unitEndTime AlphaController::$unitMAXDuration AlphaController::$unitOfWork AlphaController::$unitStartTime AlphaController::$visibility | Inherited From AlphaController AlphaController::__construct() Constructor for the AlphaController that starts a new session if required, and handles the population of new/dirty objects from the session when available. Accepts the name of the rights group that has access to this controller, 'Public' by default. AlphaController::abort() Method to clearup a cancelled unit of work. AlphaController::accessError() Method to display an access error for trespassing users. HTTP response header code will be 403. AlphaController::checkControllerDefExists() Checks that the definition for the controller classname provided exists. Will also return true if you pass "/" for the root of the web application. AlphaController::checkIfAccessingFromSecureURL() Static function for determining if the current request URL is a secure one (has a tk string or not) AlphaController::checkRights() Checks the user rights of the currently logged-in person against the page visibility set for this controller. Will return false if the user has not got the correct rights. AlphaController::checkSecurityFields() Method to check the validity of the two hidden form security fields which aim to ensure that a post to the controller is being sent from the same server that is hosting it. AlphaController::commit() Commits (saves) all of the new and modified (dirty) objects in the unit of work to the database. AlphaController::generateSecurityFields() Generates the two security fields to prevent remote form processing. AlphaController::getBO() Get the BO for this controller (if any). AlphaController::getCustomControllerName() Returns the name of a custom controller if one is found, otherwise returns null. AlphaController::getDescription() Getter for the page description. AlphaController::getDirtyObjects() Getter for the dirty objects array. AlphaController::getEndTime() Getter for the unit end time. AlphaController::getFirstJob() Gets the name of the first job in this unit of work. AlphaController::getKeywords() Getter for the page keywords. AlphaController::getLastJob() Gets the name of the last job in this unit of work. AlphaController::getMAXDuration() Getter for the unit of work MAX duration. AlphaController::getName() Get the name of the unit of work job. AlphaController::getNewObjects() Getter for the new objects array. AlphaController::getNextJob() Gets the name of the next job in this unit of work AlphaController::getPreviousJob() Gets the name of the previous job in this unit of work AlphaController::getStartTime() Getter for the unit start time. AlphaController::getStatusMessage() Gets the current status message for this controller. Note that by getting the current status message, you clear out the value stored in _SESSION so this method can only be used to get the status message once for display purposes. AlphaController::getTitle() Getter for the page title. AlphaController::getUnitDuration() Calculates and returns the unit of work current duration in seconds. AlphaController::getVisibility() Get the name of the rights group that has access to this controller. AlphaController::loadControllerDef() Loads the definition for the controller classname provided. AlphaController::loadCustomController() Does a HTTP redirect to a custom controller if one is found. AlphaController::markDirty() Adds the supplied business object to the dirtyObjects array in the session. AlphaController::markNew() Adds a newly created business object to the newObjects array in the session. AlphaController::setBO() Setter for the BO for this controller. AlphaController::setDescription() Setter for the page description. AlphaController::setKeywords() Setter for the page keywords, should pass a comma-seperated list as a string. AlphaController::setName() Setter for the unit of work job name. AlphaController::setStatusMessage() Set the status message in the _SESSION to the value provided. AlphaController::setTitle() Setter for the page title. AlphaController::setUnitEndTime() Setter for the unit end time (value will be stored in the session as key unitEndTime). AlphaController::setUnitMAXDuration() Setter for the unit MAX duration. AlphaController::setUnitOfWork() Sets the name of the controller job sequence to the values in the supplied array (and stores the array in the session). AlphaController::setUnitStartTime() Setter for the unit start time (value will be stored in the session as key unitStartTime). AlphaController::setVisibility() Setter for the name of the rights group that has access to this controller. |
[ Top ] Property Summary
ArticleObject | $BO | The article to be rendered
[ Top ] Method Summary
ViewArticle | __construct() | constructor to set up the object
string | before_displayPageFoot_callback() | Callback used to render footer content, including comments, votes and print/PDF buttons when enabled to do so.
void | doGET() | Handle GET requests
void | doPOST() | Method to handle POST requests
string | during_displayPageHead_callback() | Callback used to inject ArticleObject headerContent into the page
string | insert_CMSDisplayStandardHeader_callback() | Callback that inserts the CMS level header
[ Top ] Properties ArticleObject $BO [line 68] The article to be rendered API Tags:
Access: | protected
Information Tags:
Since: | 1.0
Redefinition of: AlphaController::$BO Optionally, a BO may be set for the default validation form handling code to load in the displayPageHead() method. The definition of this BO class will need to be included in the child controller. [ Top ] Methods Constructor __construct [line 83]
`ViewArticle __construct( )`
constructor to set up the object API Tags:
Access: | public
Information Tags:
Since: | 1.0
Redefinition of: AlphaController::__construct() Constructor for the AlphaController that starts a new session if required, and handles the population of new/dirty objects from the session when available. Accepts the name of the rights group that has access to this controller, 'Public' by default. Redefined in descendants as: ViewArticlePrint::__construct() : Constructor to set up the object ViewArticleTitle::__construct() : Constructor to set up the object [ Top ] before_displayPageFoot_callback [line 186]
`string before_displayPageFoot_callback( )`
Callback used to render footer content, including comments, votes and print/PDF buttons when enabled to do so. API Tags:
Access: | public
Information Tags:
Since: | 1.0
Redefined in descendants as: ViewArticleFile::before_displayPageFoot_callback() : Overidding the parent here as we want an empty footer on file-based articles ViewArticlePrint::before_displayPageFoot_callback() : Callback used to render footer content, including comments, votes and print/PDF buttons when enabled to do so. [ Top ] doGET [line 104]
`void doGET( array $params )`
Handle GET requests Parameters:
array | $params: |
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Throws: | ResourceNotFoundException
Implementation of: AlphaControllerInterface::doGET() Handles GET HTTP requests Redefined in descendants as: ViewArticleFile::doGET() : Handle GET requests ViewArticlePrint::doGET() : Handle GET requests ViewArticleTitle::doGET() : Handle GET requests [ Top ] doPOST [line 270]
`void doPOST( array $params )`
Method to handle POST requests Parameters:
array | $params: |
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Implementation of: AlphaControllerInterface::doPOST() Handles POST HTTP requests Redefined in descendants as: ViewArticlePrint::doPOST() : Handle POST requests [ Top ] during_displayPageHead_callback [line 152]
`string during_displayPageHead_callback( )`
Callback used to inject ArticleObject headerContent into the page API Tags:
Access: | public
Information Tags:
Since: | 1.0
Redefined in descendants as: ViewArticlePrint::during_displayPageHead_callback() : Injects the print CSS into the page header [ Top ] insert_CMSDisplayStandardHeader_callback [line 162]
`string insert_CMSDisplayStandardHeader_callback( )`
Callback that inserts the CMS level header API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] Documentation generated on Tue, 13 Dec 2011 20:27:46 +0000 by phpDocumentor 1.4.3