Tuskfish API V1.1.2
  • Package
  • Class

Packages

  • content
  • core
  • database
  • installation
  • security
  • user
  • utilities

Classes

  • TfArticle
  • TfAudio
  • TfBlock
  • TfBlockHandler
  • TfCollection
  • TfCollectionHandler
  • TfContentControllerFactory
  • TfContentHandler
  • TfContentHandlerFactory
  • TfContentObject
  • TfContentObjectController
  • TfDownload
  • TfImage
  • TfRss
  • TfSearchContent
  • TfStatic
  • TfTag
  • TfTagHandler
  • TfTaglinkHandler
  • TfVideo

Traits

  • TfContentTypes

Class TfContentObjectController

Controls basic content object operations (add, edit, delete, toggle and update). It encapsulates the admin controller script functionality for these operations.

Package: content
Copyright: Simon Wilkinson 2013+ (https://tuskfish.biz)
License: GNU General Public License (GPL) V2
Author: Simon Wilkinson simon@isengard.biz
Version: Release: 1.0
Since: 1.0
Var: TfValidator $validator Instance of the Tuskfish data validator class.
Var: TfDatabase $db Instance of the Tuskfish database class.
Var: TfCriteriaFactory $criteriaFactory Instance of the Tuskfish criteria factory class.
Var: TfContentHandlerFactory $contentHandlerFactory Instance of the Tuskfish content handler factory class.
Var: TfTemplate $template Instance of the Tuskfish template object class.
Var: TfPreference $preference Instance of the Tuskfish site preferences class.
Var: TfCache $cache Instance of the Tuskfish site cache class.
Located at trust_path/modules/content/class/TfContentObjectController.php

Methods summary

public
# __construct( TfValidator $validator, TfDatabase $db, TfCriteriaFactory $criteriaFactory, TfContentHandlerFactory $contentHandlerFactory, TfTemplate $template, TfPreference $preference, TfCache $cache )

Constructor.

Constructor.

Parameters

$validator
Instance of the validator class.
$db
Instance of the database class.
$criteriaFactory
Instance of the criteria factory class.
$contentHandlerFactory
Instance of the content handler class.
$template
Instance of the template class.
$preference
Instance of the site preferences class.
$cache
Instance of the cache class.
public
# addContent( )

Add a content object to the site.

Add a content object to the site.

public
# confirmDelete( integer $id )

Request confirmation to delete a content object from the site.

Request confirmation to delete a content object from the site.

Actual deletion is carried out in the deleteContent() option, not here. This is just the sanity check.

Parameters

$id
ID of the content object to confirm deletion of.
public
# deleteContent( integer $id )

Delete a content object from the database.

Delete a content object from the database.

Parameters

$id
Id of the content object to be deleted.
public
# editContent( integer $id )

Edit a content object.

Edit a content object.

Opens a data entry form pre-filled with the object's data, for editing.

Parameters

$id
ID of the content object to be edited.
public
# submitContent( array $formData )

Submit a new content object for insertion into the database.

Submit a new content object for insertion into the database.

Parameters

$formData
Data from the content data entry form.
public
# toggleOnlineStatus( integer $id )

Toggle a content object online or offline.

Toggle a content object online or offline.

Offline content objects are not available on the front end of the site and are not returned in search results or in RSS feeds. Exception is tags, which are always online. Marking a tag as offline will remove it from the front end tag select box, to keep it uncluttered.

Parameters

$id
ID of the content object to toggle on/offline.
public
# updateContent( array $formData )

Update an existing content object.

Update an existing content object.

Parameters

$formData
Data from the edit content form.

Properties summary

protected $validator
#
protected $db
#
protected $criteriaFactory
#
protected $contentHandlerFactory
#
protected $template
#
protected $preference
#
protected $cache
#
Tuskfish API V1.1.2 API documentation generated by ApiGen