Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • 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
  • cContentTypeRaw
  • 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
Author: Simon Sprankel
Located at classes/content_types/class.content.type.teaser.php
Methods summary
public
# __construct( string $rawSettings, integer $id, array $contentTypes )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

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

Throws

cDbException

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

Throws

cDbException
cException
cInvalidArgumentException
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 [optional] modeswitch betwwen template generation and returning result as array

Returns

mixed
string of select box or array of articles

Throws

cDbException
cException
cInvalidArgumentException
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

Throws

cDbException
cException
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

Throws

cDbException
private string
# _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

string
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.

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 [optional] 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

Throws

cDbException
cException
cInvalidArgumentException
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

Throws

cDbException
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 string
# _generateStyleSelect( )

Generats a select box for setting teaser style.

Generats a select box for setting teaser style.

Currently four default teaser templates are supported but any number of user templates can be defined as settings of type "cms_teaser" having a label as name and a filename as value.

The default templates are:

  • Slider style (cms_teaser_slider.html)
  • Image style (cms_teaser_image.html)
  • Text style (cms_teaser_text.html)
  • Blog style (cms_teaser_blog.html)

Returns

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

Teaser gets informations from other articles and their content typs.

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 content 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

string
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

Throws

cDbException
cException
private string
# _generateSortSelect( )

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

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

Returns

string
html string of select box
private string
# _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

string
html string of select box
private string
# _generateCropSelect( )

Function which provides select option for cropping teaser images.

Function which provides select option for cropping teaser images.

Returns

string
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

Throws

cDbException
cException
Methods inherited from cContentTypeAbstractTabbed
_generateActionCode(), _generateTabMenuCode(), _getRawSettings()
Methods inherited from cContentTypeAbstract
__toString(), _encodeForOutput(), _isActiveDirectory(), _isSubdirectory(), _readSettings(), _shouldDirectoryBeExpanded(), _storeSettings(), buildDirectoryList(), generateDirectoryList(), getConfiguration(), isWysiwygCompatible()
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 installation (described as hash [idtype => cmstypename]).

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

private array $_ignoreTypes array()
#

Content types in this array will be completely ignored by CMS_TEASER.

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.

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.

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.10.1 API documentation generated by ApiGen 2.8.0