Class handles content type teaser, its editmode and viewmode. All properties of teaser content type were stored as xml document in database as content in {prefix}_content

 Methods

Constructor of class inits some important class variables and gets some Contenido global vars, so this class has no need to use ugly and buggy global commands

__construct(string $sContent, integer $iNumberOfCms, integer $iIdArtLang, array $sEditLink, array $aCfg, array $oDB, string $sContenidoLang, integer $iClient, integer $iLang, array $aCfgClient, $oSess) 

access public

Parameters

$sContent

string
  • xml document from database containing teaser settings

$iNumberOfCms

integer
  • CMS_TEASER[4] => 4

$iIdArtLang

integer
  • Idartlang of current article

$sEditLink

array
  • sEditlink for editbuttons, not currently used

$aCfg

array
  • Contenido configuration array

$oDB

array
  • Contenido database object (not used because we need own object (else problems by cross query in same object))

$sContenidoLang

string
  • Contenido Backend language string

$iClient

integer
  • Contenido client id

$iLang

integer
  • Contenido frontend language id

$aCfgClient

array
  • Contenido Client configuration array

$oSess

Returns all translation strings for mi18n.

addModuleTranslations(array $aTranslationStrings) : array

Parameters

$aTranslationStrings

array

Array with translation strings

Returns

arrayTranslation strings

Function is called in editmode of contenido an returns teaser view and editbutton

getAllWidgetEdit() : string

access public

Returns

string- escaped html code for further use in contenido and sending to browser

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

getAllWidgetOutput(boolean $bEditmode) : \html

access public

Parameters

$bEditmode

boolean
  • in editmode skip encoding because it is done in getAllWidgetEdit()

Returns

\htmlstring of select box

Dynamic filelist generator.

getAllWidgetView() : string

This method is executed every time the filelist is displayed.

Returns

stringoutput of the filelist

In Contenido content type code is evaled by php. To make this possible, this function prepares code for evaluation

encodeForOutput(string $sCode) : string

access private

Parameters

$sCode

string
  • code to escape

Returns

string- escaped code

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

extractImage(string $sContent) : \img

access private

Parameters

$sContent

string
  • HTML string to search image in

Returns

\imgtag containing scaled image

In edit and view mode this function fills teaser template with informations from an Contenido article object

fillTeaserTemplateEntry(object $oArticle, object $oTpl) : boolean

access private

Parameters

$oArticle

object
  • Contenido Article object

$oTpl

object
  • Contenido Template object (as reference)

Returns

boolean- success state of this operation

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

getArtContent(object $oArticle, string $sIdType, integer $iIdType) : string

access private

Parameters

$oArticle

object
  • Contenido article object

$sIdType

string
  • Name of Content type to extract informations from

$iIdType

integer
  • list of ids to search in

Returns

string- largest result of content

Function retrives name of an article by its id from database

getArtName(integer $iIdArt) : string

access private

Parameters

$iIdArt

integer
  • Contenido article id

Returns

string- name of article

Function which generated a select box for setting number of articles which were displayed in teaser as a maximum. Only important in editmode

getCountSelect(string $sSelected) : \html

access private

Parameters

$sSelected

string
  • value of select box which is selected

Returns

\htmlstring of select box

Function which provides select option for cropping teaser images

getCropSelect(string $sSelected) : \html

access private

Parameters

$sSelected

string
  • value of select box which is selected

Returns

\htmlstring of select box

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

getImage(integer $iImage, integer $iMaxX, integer $iMaxY, $bCropped, boolean $bIsFile) : string

access private

Parameters

$iImage

integer
  • idupl of image to use for teaser

$iMaxX

integer
  • maximum image width

$iMaxY

integer
  • maximum image height

$bCropped

$bIsFile

boolean
  • in case of a direct file path retrival from database is not needed

Returns

string- tag contains scaled image

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

getSortOrderSelect(string $sSelected) : \html

access private

Parameters

$sSelected

string
  • value of select box which is selected

Returns

\htmlstring of select box

Function which generated a select box for setting teaser sort argument

getSortSelect(string $sSelected) : \html

access private

Parameters

$sSelected

string
  • value of select box which is selected

Returns

\htmlstring of select box

Function which generated a select box for setting teaser style currently two seperate teaser templates were supported

getStyleSelect(string $sSelected) : \html

access private

Parameters

$sSelected

string
  • value of select box which is selected

Returns

\htmlstring of select box

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

getTypeSelect(\unknown_type $sSelectName, string $sSelected, string $sValue) : \html

access private

Parameters

$sSelectName

\unknown_type
  • name of input elements

$sSelected

string
  • value of select box which is selected

$sValue

string
  • current value of text box

Returns

\htmlstring of select box

Function which gets all currenty avariable content types and their ids from database and store it into class variable aCMSTypes. Because this information is used multiple, this way causes a better performance to get this information seperately

initCmsTypes() 

access private

Functen parses XML Document which contains teaser settings and store properties as array into $aSettings

readSettings() 

access private

Function sets some default values for teaser in case that there is no value definied

setDefaultValues() 

access private

Function gets all submitted values for new teaser properties from $_POST array, generates new corresponding config XML Document and stores it as content, using contenido conSaveContentEntry() function

storeTeaser() 

access private

 Properties

 

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

$aCMSTypes : array

access private
 

Contenido configuration array

$aCfg : array

access private
 

Contenido configuration array for currently active client

$aCfgClient : array

access private
 

Array which contains current teaser settings

$aSettings : array

access private
 

List of fieldnames in frontend (properties) which the teaser has and which were also described in the config xml document

$aTeaserData : array

access private
 

Placeholders for labels in frontend.

$aTranslations : array

Important: This must be a static array!

access private
 

current Contenido client id

$iClient : integer

access private
 

Current id of content type CMS_TEASER[3] -> 3

$iId : integer

access private
 

Idartlang of article, which is currently in edit- or viewmode

$iIdArtLang : integer

access private
 

current Contenido language id

$iLang : integer

access private
 

Contenido database object

$oDb : object

access private
 

Contenido Session object

$oSess : object

access private
 

String contains value of stored content in database in this case this is the config xml document which is later parsed and its settings were stored in $aSettings

$sContent : string

access private
 

print XHTML

$sUseXHTML : string

access private