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)
Parameters
$sContent
string
- xml document from database containing teaser settings
$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
$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
array
Translation strings
In Contenido content type code is evaled by php. To make this possible,
this function prepares code for evaluation
encodeForOutput(string $sCode) : string
Parameters
Returns
string
- escaped code
In edit and view mode this function fills teaser template with informations from an
Contenido article object
fillTeaserTemplateEntry(object $oArticle, object $oTpl) : boolean
Parameters
$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
Parameters
$sIdType
string
- Name of Content type to extract informations from
Returns
string
- largest result of content
Function retrives name of an article by its id from database
getArtName(integer $iIdArt) : string
Parameters
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
Parameters
$sSelected
string
- value of select box which is selected
Returns
\html
string of select box
Function which provides select option for cropping teaser images
getCropSelect(string $sSelected) : \html
Parameters
$sSelected
string
- value of select box which is selected
Returns
\html
string 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
Parameters
$iImage
integer
- idupl of image to use for teaser
$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
Parameters
$sSelected
string
- value of select box which is selected
Returns
\html
string of select box
Function which generated a select box for setting teaser
sort argument
getSortSelect(string $sSelected) : \html
Parameters
$sSelected
string
- value of select box which is selected
Returns
\html
string of select box
Function which generated a select box for setting teaser style
currently two seperate teaser templates were supported
getStyleSelect(string $sSelected) : \html
Parameters
$sSelected
string
- value of select box which is selected
Returns
\html
string 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
Parameters
$sSelectName
\unknown_type
$sSelected
string
- value of select box which is selected
$sValue
string
- current value of text box
Returns
\html
string 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()
Functen parses XML Document which contains teaser settings
and store properties as array into $aSettings
readSettings()
Function sets some default values for teaser in case that there is no
value definied
setDefaultValues()
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()
Properties
Array which contains all avariable CMS_Types and its ids
in current Contenido isntallation (described as hash [idtype => cmstypename])
$aCMSTypes : array
Contenido configuration array
$aCfg : array
Contenido configuration array for currently active client
$aCfgClient : array
Array which contains current teaser settings
$aSettings : array
List of fieldnames in frontend (properties) which the teaser has
and which were also described in the config xml document
$aTeaserData : array
Placeholders for labels in frontend.
$aTranslations : array
Important: This must be a static array!
current Contenido client id
$iClient : integer
Current id of content type CMS_TEASER[3] -> 3
$iId : integer
Idartlang of article, which is currently in edit- or viewmode
$iIdArtLang : integer
current Contenido language id
$iLang : integer
Contenido database object
$oDb : object
Contenido Session object
$oSess : object
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
print XHTML
$sUseXHTML : string