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
Static

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.

encodeForOutput(string $sCode) : string

To make this possible, this function prepares code for evaluation

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.

getCountSelect(string $sSelected) : \html

Only important in editmode

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.

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

It is also possible to give path to image directly, in this case set fourth parameter to true

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.

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

This function is used three times for source defintion of headline text and teaserimage

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.

initCmsTypes() 

Because this information is used multiple, this way causes a better performance to get this information seperately

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

 

$aCMSTypes : array
access private
 

$aCfg : array
access private
 

$aCfgClient : array
access private
 

$aSettings : array
access private
 

$aTeaserData : array
access private
 

$aTranslations : array

Important: This must be a static array!

access private
 

$iClient : integer
access private
 

$iId : integer
access private
 

$iIdArtLang : integer
access private
 

$iLang : integer
access private
 

$oDb : object
access private
 

$oSess : object
access private
 

$sContent : string
access private
 

$sUseXHTML : string
access private