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
Overrides
|
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
|
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
|
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
Returns
boolean success state of this operation
Throws
|
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
|
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
|
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
|
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
|
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
|
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.
|