Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cCodeGeneratorAbstract
  • cCodeGeneratorFactory
  • cCodeGeneratorStandard
  • cContentTypeAbstract
  • cContentTypeAbstractTabbed
  • cContentTypeDate
  • cContentTypeFilelist
  • cContentTypeHead
  • cContentTypeHtml
  • cContentTypeHtmlhead
  • cContentTypeImg
  • cContentTypeImgdescr
  • cContentTypeImgeditor
  • cContentTypeLink
  • cContentTypeLinkdescr
  • cContentTypeLinkeditor
  • cContentTypeLinktarget
  • cContentTypeTeaser
  • cContentTypeText
  • cTypeGenerator
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cContentTypeTeaser

Content type CMS_TEASER which lets the editor select articles in various ways which are displayed as teasers.

cContentTypeAbstract
Extended by cContentTypeAbstractTabbed
Extended by cContentTypeTeaser
Package: Core\ContentType
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Timo Trautmann, Simon Sprankel
Located at classes/content_types/class.content.type.teaser.php
Methods summary
public
# __construct( string $rawSettings, integer $id, array $contentTypes )

Initialises class attributes and handles store events.

Initialises class attributes and handles store events.

Parameters

$rawSettings
string
$rawSettings the raw settings in an XML structure or as plaintext
$id
integer
$id ID of the content type, e.g. 3 if CMS_DATE[3] is used
$contentTypes
array
$contentTypes array containing the values of all content types

Overrides

cContentTypeAbstract::__construct()
public static array
# addModuleTranslations( array $translationStrings )

Returns all translation strings for mi18n.

Returns all translation strings for mi18n.

Parameters

$translationStrings
array
$translationStrings translation strings

Returns

array
updated translation string
private
# _setDefaultValues( )

Sets some default values for teaser in case that there is no value defined.

Sets some default values for teaser in case that there is no value defined.

public string
# generateViewCode( )

Generates the code which should be shown if this content type is shown in the frontend.

Generates the code which should be shown if this content type is shown in the frontend.

Returns

string
escaped HTML code which sould be shown if content type is shown in frontend
public array
# getConfiguredArticles( )

Function returns idarts of selected articles as array

Function returns idarts of selected articles as array

Returns

array
public mixed
# generateTeaserCode( boolean $returnAsArray = false )

Function is called in edit- and viewmode in order to generate teasercode for output

Function is called in edit- and viewmode in order to generate teasercode for output

Parameters

$returnAsArray
boolean
$returnAsArray modeswitch betwwen template generation and and returning result as array

Returns

mixed
string of select box or array of articles
private boolean
# _fillTeaserTemplateEntry( cApiArticleLanguage $article, cTemplate & $template )

In edit and view mode this function fills teaser template with informations from a CONTENIDO article object.

In edit and view mode this function fills teaser template with informations from a CONTENIDO article object.

Parameters

$article
cApiArticleLanguage
$article - CONTENIDO Article object
$template
cTemplate
$template - CONTENIDO Template object (as reference)

Returns

boolean
- success state of this operation
private string
# _getArtContent( cApiArticleLanguage & $article, string $contentTypeName, string $ids )

Teaser allows to get a list of ids in which article content is searched in article like 1,2,5,6 the result with largest character count is returned

Teaser allows to get a list of ids in which article content is searched in article like 1,2,5,6 the result with largest character count is returned

Parameters

$article
cApiArticleLanguage
$article - CONTENIDO article object
$contentTypeName
string
$contentTypeName - Name of Content type to extract informations from
$ids
string
$ids - list of ids to search in

Returns

string
- largest result of content
private img
# _extractImage( string $content )

When a HTML Code is given for a Teaser image try to find a image in this code and generate Teaser image on that basis

When a HTML Code is given for a Teaser image try to find a image in this code and generate Teaser image on that basis

Parameters

$content
string
$content - HTML string to search image in

Returns

img
tag containing scaled image
private string
# _getImage( integer $image, integer $maxX, integer $maxY, boolean $cropped, mixed $isFile = false )

Function gets path to an image of base of idupload in CONTENIDO, scales this image on basis of teaser settings and returns path to scaled image. It is also possible to give path to image directly, in this case set fourth parameter to true

Function gets path to an image of base of idupload in CONTENIDO, scales this image on basis of teaser settings and returns path to scaled image. It is also possible to give path to image directly, in this case set fourth parameter to true

Parameters

$image
integer
$image - idupl of image to use for teaser
$maxX
integer
$maxX - maximum image width
$maxY
integer
$maxY - maximum image height
$cropped
boolean
$isFile - in case of a direct file path retrival from database is not needed
$isFile

Returns

string
- <img> tag contains scaled image
public string
# generateEditCode( )

Generates the code which should be shown if this content type is edited.

Generates the code which should be shown if this content type is edited.

Returns

string
escaped HTML code which should be shown if content type is edited
private
# _initCmsTypes( )

Gets all currenty avariable content types and their ids from database and store it into class variable aCMSTypes. Because this information is used multiple times, this causes a better performance than gettting it seperately

Gets all currenty avariable content types and their ids from database and store it into class variable aCMSTypes. Because this information is used multiple times, this causes a better performance than gettting it seperately

private string
# _generateTabGeneral( )

Generates code for the general tab in which various settings can be made.

Generates code for the general tab in which various settings can be made.

Returns

string
- the code for the general tab
private html
# _generateCountSelect( )

Generats a select box for setting number of articles which should be displayed in teaser as a maximum. Only important in editmode.

Generats a select box for setting number of articles which should be displayed in teaser as a maximum. Only important in editmode.

Returns

html
string of select box
private html
# _generateStyleSelect( )

Generats a select box for setting teaser style currently two seperate teaser templates were supported

Generats a select box for setting teaser style currently two seperate teaser templates were supported

Returns

html
string of select box
private html
# _generateTypeSelect( string $selectName, string $selected, string $value )

Teaser gets informations from other articles and their content typs Function builds a select box in which coresponding cms type can be selected after that a text box is rendered for setting id for this conent type to get informations from. This function is used three times for source defintion of headline text and teaserimage

Teaser gets informations from other articles and their content typs Function builds a select box in which coresponding cms type can be selected after that a text box is rendered for setting id for this conent type to get informations from. This function is used three times for source defintion of headline text and teaserimage

Parameters

$selectName
string
$selectName - name of input elements
$selected
string
$selected - value of select box which is selected
$value
string
$value - current value of text box

Returns

html
string of select box
private string
# _generateTabAdvanced( )

Generates code for the advanced tab in which various advanced settings can be made.

Generates code for the advanced tab in which various advanced settings can be made.

Returns

string
- the code for the advanced tab
private html
# _generateSortSelect( )

Function which generated a select box for setting teaser sort argument

Function which generated a select box for setting teaser sort argument

Returns

html
string of select box
private html
# _generateSortOrderSelect( )

Function which generated a select box for setting teaser sort order argument

Function which generated a select box for setting teaser sort order argument

Returns

html
string of select box
private html
# _generateCropSelect( )

Function which provides select option for cropping teaser images

Function which provides select option for cropping teaser images

Returns

html
string of select box
private string
# _generateTabManual( )

Generates code for the manual tab in which various settings for the manual teaser can be made.

Generates code for the manual tab in which various settings for the manual teaser can be made.

Returns

string
- the code for the manual tab
private string
# _getArtName( integer $idArt )

Function retrives name of an article by its id from database

Function retrives name of an article by its id from database

Parameters

$idArt
integer
$idArt - CONTENIDO article id

Returns

string
- name of article
Methods inherited from cContentTypeAbstractTabbed
_generateActionCode(), _generateTabMenuCode()
Methods inherited from cContentTypeAbstract
_encodeForOutput(), _isActiveDirectory(), _isSubdirectory(), _readSettings(), _shouldDirectoryBeExpanded(), _storeSettings(), buildDirectoryList(), generateDirectoryList(), getConfiguration()
Constants inherited from cContentTypeAbstract
SETTINGS_TYPE_PLAINTEXT, SETTINGS_TYPE_XML
Properties summary
private array $_cmsTypes
#

Array which contains all avariable CMS_Types and its ids in current CONTENIDO isntallation (described as hash [idtype => cmstypename])

Array which contains all avariable CMS_Types and its ids in current CONTENIDO isntallation (described as hash [idtype => cmstypename])

private array $_ignoreTypes array()
#

Content types in this array will be completely ignored by CMS_TEASER They won't be displayed in the frontend and they won't be shown as an option in the backend

Content types in this array will be completely ignored by CMS_TEASER They won't be displayed in the frontend and they won't be shown as an option in the backend

private array $_forwardTypes array( "CMS_EASYIMG" => "CMS_IMGEDITOR", "CMS_IMG" => "CMS_IMGEDITOR", "CMS_LINK" => "CMS_LINKEDITOR" )
#

If CMS_TEASER tries to load one of the content types listed as the keys of this array it will load the value of that key instead These won't be listed as an option in the backend either

If CMS_TEASER tries to load one of the content types listed as the keys of this array it will load the value of that key instead These won't be listed as an option in the backend either

protected static array $_translations array( "MORE" )
#

Placeholders for labels in frontend. Important: This must be a static array!

Placeholders for labels in frontend. Important: This must be a static array!

protected integer $iteration 0
#

Variable for detecting current interation

Variable for detecting current interation

Properties inherited from cContentTypeAbstract
$_cfg, $_cfgClient, $_client, $_contentTypes, $_formFields, $_id, $_idArt, $_idArtLang, $_idCat, $_lang, $_prefix, $_rawSettings, $_session, $_settings, $_settingsType, $_type, $_uploadPath, $_useXHTML
CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0