PHP Class CampContext

Datei anzeigen Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$flash_messages array
$form_contact Application_Form_Contact
$login_action array dummy login action

Public Methods

Method Description
TranslateProperty ( string $p_property ) : string Processes a property name; returns a valid property name.
__construct ( ) Class constructor
__get ( string $p_element ) : mix Overloaded method call to give access to context properties.
__set ( string $p_element, string $p_value ) : mix Overloade method call to set the context properties.
allPropertiesNames ( ) : array Returns the list of all properties
current_list_id ( ) : integer Returns the corresponding id for the current list
getCurrentListName ( ) : string Returns the list name of the current list.
getListName ( $list ) fn setCurrentList
getSystemPreference ( string $preferenceName, $default = null ) : mixed Check system preferences in smarty
getUserCount ( ) : integer Get active user count
has_object ( string $p_object ) Returns true if the given object exists.
has_property ( string $p_property ) Returns true if the given property exists.
isPluginEnabled ( string $pluginName ) : boolean Check if plugin is installed and enabled
list_id_prefix ( $p_className )
next_list_id ( string $p_className ) Returns the corresponding id for a new list of the given type
next_list_start ( string $p_className ) Returns the corresponding list start index for a new list of the given type
resetCurrentList ( ) : void Resets the current list.
restoreContext ( ) Restores the global context.
saveCurrentContext ( array $p_propertiesList = [] ) : void Saves the current context objects.
setCurrentList ( object &$p_list, array $p_savePropertiesList = [] ) : void Sets the current list.
setPreviewMode ( $status = true ) Set preview mode for context.

Protected Methods

Method Description
ObjectType ( string $p_property ) Returns the name corresponding to the given property; null if the property is not an object.
getArticle ( ) : MetaIssue Returns the article defined in the current context; if it wasn't defined it initializes the article by an empty object.
getIssue ( ) : MetaIssue Returns the issue defined in the current context; if it wasn't defined it initializes the issue by an empty object.
getLanguage ( ) : MetaIssue Returns the language defined in the current context; if it wasn't defined it initializes the language by an empty object.
getPublication ( ) : MetaPublication Returns the publication defined in the current context; if it wasn't defined it initializes the publication by an empty object.
getSection ( ) : MetaIssue Returns the section defined in the current context; if it wasn't defined it initializes the section by an empty object.
trigger_invalid_object_error ( string $p_object ) Triggers an invalid object error.
trigger_invalid_property_error ( string $p_property, $p_smarty = null ) Triggers an invalid property error.
trigger_invalid_register_error ( $p_message )

Private Methods

Method Description
GetListObjectName ( string $p_listClassName ) : string Returns the object name from the list class name.
RestoreProperties ( ) Restores the last list of properties from the stack
SaveProperties ( array $p_propertiesList ) : void Saves a given list of properties
createObject ( string $p_objectType ) : object Creates an object of the given type. Returns the created object.
registerListObject ( array $listObject ) Register an list object
registerObjectType ( array $p_objectType ) Register an new object type
setArticleHandler ( MetaArticle $p_oldArticle, MetaArticle $p_newArticle ) Handler for the article change event.
setCommentHandler ( MetaComment $p_oldComment, MetaComment $p_newComment ) Handler for the comment change event.
setIssueHandler ( MetaIssue $p_oldIssue, MetaIssue $p_newIssue ) Handler for the issue change event.
setLanguageHandler ( MetaLanguage $p_oldLanguage, MetaLanguage $p_newLanguage ) Handler for the language change event.
setPublicationHandler ( MetaPublication $p_oldPublication, MetaPublication $p_newPublication ) Handler for the publication change event.
setSectionHandler ( MetaSection $p_oldSection, MetaSection $p_newSection ) Handler for the section change event.
setSubtitleHandler ( MetaSubtitle $p_oldSubtitle, MetaSubtitle $p_newSubtitle )
setTopicHandler ( MetaTopic $p_oldTopic, MetaTopic $p_newTopic )

Method Details

ObjectType() protected static method

Returns the name corresponding to the given property; null if the property is not an object.
protected static ObjectType ( string $p_property )
$p_property string

TranslateProperty() public static method

Processes a property name; returns a valid property name.
public static TranslateProperty ( string $p_property ) : string
$p_property string
return string

__construct() final public method

Class constructor
final public __construct ( )

__get() final public method

Overloaded method call to give access to context properties.
final public __get ( string $p_element ) : mix
$p_element string - the property name
return mix - the property value

__set() final public method

Overloade method call to set the context properties.
final public __set ( string $p_element, string $p_value ) : mix
$p_element string - property name
$p_value string - value of the property
return mix - the property value

allPropertiesNames() public method

Returns the list of all properties
public allPropertiesNames ( ) : array
return array

current_list_id() public method

Returns the corresponding id for the current list
public current_list_id ( ) : integer
return integer - the current list identifier

getArticle() final protected method

This method was defined because it's faster than using the magic method __get(). *
final protected getArticle ( ) : MetaIssue
return MetaIssue

getCurrentListName() public method

Returns the list name of the current list.
public getCurrentListName ( ) : string
return string The name of the list

getIssue() final protected method

This method was defined because it's faster than using the magic method __get().
final protected getIssue ( ) : MetaIssue
return MetaIssue

getLanguage() final protected method

This method was defined because it's faster than using the magic method __get().
final protected getLanguage ( ) : MetaIssue
return MetaIssue

getListName() public method

fn setCurrentList
public getListName ( $list )

getPublication() final protected method

This method was defined because it's faster than using the magic method __get().
final protected getPublication ( ) : MetaPublication
return MetaPublication

getSection() final protected method

This method was defined because it's faster than using the magic method __get().
final protected getSection ( ) : MetaIssue
return MetaIssue

getSystemPreference() public method

Check system preferences in smarty
public getSystemPreference ( string $preferenceName, $default = null ) : mixed
$preferenceName string Systempreferences machine name
return mixed

getUserCount() public method

Get active user count
public getUserCount ( ) : integer
return integer

has_object() public method

Returns true if the given object exists.
public has_object ( string $p_object )
$p_object string

has_property() public method

Returns true if the given property exists.
public has_property ( string $p_property )
$p_property string

isPluginEnabled() public method

Check if plugin is installed and enabled
public isPluginEnabled ( string $pluginName ) : boolean
$pluginName string Plugin name ex. "vendor/plugin-name"
return boolean

list_id_prefix() public method

public list_id_prefix ( $p_className )

next_list_id() public method

Returns the corresponding id for a new list of the given type
public next_list_id ( string $p_className )
$p_className string

next_list_start() public method

Returns the corresponding list start index for a new list of the given type
public next_list_start ( string $p_className )
$p_className string

resetCurrentList() public method

Resets the current list.
public resetCurrentList ( ) : void
return void

restoreContext() public method

Restores the global context.
public restoreContext ( )

saveCurrentContext() public method

Saves the current context objects.
public saveCurrentContext ( array $p_propertiesList = [] ) : void
$p_propertiesList array
return void

setCurrentList() public method

Sets the current list.
public setCurrentList ( object &$p_list, array $p_savePropertiesList = [] ) : void
$p_list object
$p_savePropertiesList array
return void

setPreviewMode() public method

Setting preview mode allows rendering not published issues and articles.
public setPreviewMode ( $status = true )

trigger_invalid_object_error() final protected method

Triggers an invalid object error.
final protected trigger_invalid_object_error ( string $p_object )
$p_object string - object name

trigger_invalid_property_error() final protected method

Triggers an invalid property error.
final protected trigger_invalid_property_error ( string $p_property, $p_smarty = null )
$p_property string - property name

trigger_invalid_register_error() final protected method

final protected trigger_invalid_register_error ( $p_message )

Property Details

$flash_messages public_oe property

public array $flash_messages
return array

$form_contact public_oe property

public Application_Form_Contact $form_contact
return Application_Form_Contact

$login_action public_oe property

dummy login action
public array $login_action
return array