Documentation

NewsManager extends NewsLibrary

News manager

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Cloudrexx Development Team info@cloudrexx.com

access

public

version
1.0.0
subpackage

coremodule_news

Table of Contents

Properties

$_arrCharsets  : mixed
$_defaultTickerFileName  : mixed
$_objTeaser  : object
Teaser object
$_objTpl  : mixed
$_selectedLang  : mixed
$arrSettings  : mixed
$langId  : mixed
$newsMetaKeys  : mixed
$pageContent  : mixed
$pageTitle  : mixed
$strErrMessage  : mixed
$strOkMessage  : mixed
$useThumbnails  : bool
Value of setting use_thumbnails
$arrTypeData  : array<string|int, mixed>
Localized data of available types
$errMsg  : array<string|int, mixed>
Status messages
$nestedSetRootId  : int
NestedSet root node ID
$objNestedSet  : DB_NestedSet|null
NestedSet object
$act  : mixed

Methods

__construct()  : mixed
PHP5 Constructor
_buildNewsCategories()  : string
Generates the formated ul/li of categories Used in the template's
_comment_validate()  : bool
Validate edit comment form (check all fields to be not empty)
_deleteTeaserFrame()  : mixed
_deleteTicker()  : mixed
_editTeaserFrame()  : mixed
_editTeaserFrameTemplate()  : mixed
_generate_notify_group_list()  : mixed
_generate_notify_list()  : mixed
Generates a list of <option> lines, including a "disable" entry on top of the list.
_generate_notify_user_list()  : mixed
_getAllUserGroups()  : mixed
_getCharsetMenu()  : mixed
_getTicker()  : mixed
_getTickers()  : mixed
_modifyTicker()  : mixed
_saveSettings()  : mixed
Save the news settings
_showTeaserFrame()  : mixed
_showTeaserFrames()  : mixed
_showTeaserFrameTemplates()  : mixed
_store_settings_item()  : mixed
_teasers()  : mixed
_ticker()  : mixed
_tickerCount()  : mixed
_tickerOverview()  : mixed
_updateTeaserFrame()  : mixed
_updateTeaserFrameTemplate()  : mixed
add()  : mixed
adds a news entry
addTag()  : bool|int
Save new tag into database
changeCommentStatus()  : mixed
Change status of multiple news comments
checkForCommentFlooding()  : bool
Check if the current user has already written a comment within the definied timeout-time set by news_comments_timeout.
comment_edit()  : mixed
Prepare edit comment form
comment_save()  : bool
Save comment
comments_delete()  : mixed
Remove single comment or several comments from database.
comments_list()  : mixed
List up news comments for edit or delete
createRSS()  : void
Create the RSS-Feed
dateFromInput()  : long
Takes a date in the format dd.mm.yyyy hh:mm and returns it's representation as mktime()-timestamp.
dbFromDate()  : string
Takes a mktime()-timestamp and formats it as yyyy-mm-dd hh:mm:00 for insertion in db.
delete()  : void
Deletes a news entry
deleteType()  : mixed
Delete the news types
edit()  : mixed
Edit the news, or if $copy is true, it copies an entry
fetchSubmittedCommentData()  : array<string|int, mixed>
Fetch news comment data that has been submitted via POST and return it as array with three elements.
filterBodyTag()  : string
Gets only the body content and deleted all the other tags
findCmdById()  : string
Searches for cmds having the passed id and returns the cmd of the result set having the lowest length.
getApplicationUrl()  : string
Get URL pointing to an application page of this component
getCategoriesByNewsId()  : mixed
Get the categories by News ID
getCategoryLocale()  : array<string|int, mixed>
Getting the locale categories
getCategoryRelNews()  : mixed
Get the news ID list based on the category
getIdsOfCategorySubCategories()  : array<string|int, mixed>
Get subcategory-ID lsit
getLangData()  : array<string|int, mixed>
Get language data (title, text, teaser_text) from database
getMediaBrowserButton()  : mixed
Get the MediaBrowser button
getMostFrequentTag()  : bool|array<string|int, mixed>
Retruns most Frequent(Searched|Viewed) tag details.
getMostUsedTag()  : bool|array<string|int, mixed>
Retruns most used tag details
getNewsArchiveList()  : string
Generates the formated ul/li of Archive list Used in the template's If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.
getNewsCategories()  : string
Generates the formated ul/li of categories Used in the template's
getNewsDetailsById()  : array<string|int, mixed>
Get news Details by id
getNewsFilterQuery()  : string
Get News Filter Condition Query
getNewsFromDbForSearch()  : ADORecordSet
getNewsGlobalPlaceholderNames()  : array<string|int, mixed>
Get all the News global placeholder names
getNewsLink()  : string
Get the News important/source link
getNewsRelCategories()  : array<string|int, mixed>
Get the news related category by ID
getNewsTags()  : bool|array<string|int, mixed>
Get the news IDs and tags using news id (and|or) tag
getPage()  : string
Do the requested newsaction
getRssNewsLinks()  : mixed
Get the RSS News links
getSettings()  : mixed
Gets the category option menu string
getTags()  : bool|array<string|int, mixed>
Getting all the stored tags
getTypeMenu()  : mixed
getTypeNameById()  : string
Get name of a type
getTypesLangData()  : array<string|int, mixed>
Get types language data
hasCategories()  : mixed
incrementViewingCount()  : null
Increment the tags viewing count
insertLocales()  : bool
Insert new locales after create news from backend
invertCommentStatus()  : mixed
Inverts the status of the news comment with the id $intCommentId.
invertStatus()  : mixed
Invert status of a single message
manageTypes()  : mixed
Add or edit the news types
manipulateTags()  : bool
Manipulating the submitted tags from the news Entry form.
overview()  : mixed
List up the news for edit or delete
parseCategoryList()  : mixed
Parse the category list
parseCommentsOfMessage()  : null
Lists all active comments of the news message specified by $messageId
parseImageBlock()  : mixed
Parse the Image Block for thumbnail and detail image
parseImageThumbnail()  : mixed
parseMessageCommentForm()  : null
Validates the submitted comment data and writes it to the databse if valid.
parseNewsCommentsCount()  : mixed
Parse the news comments count
parseNewsPlaceholders()  : string
Parse the news placeholders
parseNextAndPreviousLinks()  : null
Generate the next and previous news links from the current news
parseTagCloud()  : mixed
parseUserAccountData()  : mixed
Parses a user's account and profile data specified by $userId.
registerTagJsCode()  : mixed
Register the JS code for the given input field ID
settings()  : mixed
Loads subnavbar level 2
showNewsTextOrRedirectLink()  : mixed
Show News Text content or Redirect link
storeMessageComment()  : array<string|int, mixed>
Validates the submitted comment data and writes it to the databse if valid.
submitLocales()  : bool
Insert new locales after submit news from frontend One copy for all languages
valueFromDate()  : string
Takes a mktime()-timestamp and formats it as dd.mm.yyyy hh:mm
categoryExists()  : bool
Checks whether the passed category exists.
deleteCat()  : bool
Delete a category with its entries and subcategories
findPageById()  : bool
Find the Page based on the category id $cmdId
getAuthorMenu()  : string
Get Author dropdown options
getCategoriesData()  : array<string|int, mixed>
Get categories data
getCategoryFilterForSearchComponent()  : array<string|int, mixed>
Get category Ids from the published application pages of this component
getCategoryMenu()  : string
Generates the category menu.
getCategoryNestedSet()  : DB_NestedSet
Returns the category nested set
getCategoryNestedSetRootId()  : int
Returns the root ID of the category nested set
getCatIdsFromNestedSetArray()  : array<string|int, mixed>
Returns the category ids of a nested set array.
getEmptyCategoryIds()  : array<string|int, mixed>
Returns an array containing the ids of empty categories.
getIdOfLatestNewsArticle()  : int
Fetch ID of latest news article. If $categoryId is specified, then the ID of the latest news article of the category identified by ID $categoryId is returned.
getMonthlyNewsStats()  : array<string|int, mixed>
Returns the news monthly stats by the given filters If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.
getNestedSetCategories()  : array<string|int, mixed>
Returns an array containing the nested set information for the passed categories and their subcategories (ordered by their left id).
getParentCatId()  : int
Returns the parent category id of passed category.
getPublisherMenu()  : string
Get Publisher dropdown options
getRelatedNews()  : bool
Getting the realated News
getRelatedNewsIds()  : mixed
getSortedCategoryIdListIncludingSubcategories()  : array<string|int, mixed>
getTeaserPreview()  : HtmlElement
Get HTML-preview of teaser identified by ID `$teaserFrameId` by using the template identified by ID `$teaserFrameTemplateId`.
initTypesLangData()  : mixed
Fetch type localization and store them in a local member variable
manageCategories()  : void
Add or edit the news categories
manipulateCategories()  : bool
Manipulating the submitted categories from the news Entry form.
manipulateRelatedNews()  : bool
Manipulating the submitted related news from the news Entry form.
modifyCategory()  : mixed
parseLink()  : mixed
parseNewsCategoryWidgetBlock()  : mixed
Parse element of category widget block
parseNewsTags()  : mixed
Parsing the News tags.
parseRelatedNews()  : mixed
Parsing related News
sortCategoryIdByPriorityId()  : array<string|int, mixed>
Prepend the array by the given values
sortNestedSetArray()  : array<string|int, mixed>
Sorts the given nested set array by the left id.
storeCategoriesLocales()  : bool
Saving categories locales
storeFeedLocales()  : bool
Saving feed settings locales
storeLocales()  : bool
Saving locales after edit news
storeTypesLocales()  : bool
Saving types locales
update()  : bool
Update news
validateNews()  : bool
Validate the News entries While Add/Edit News
_deleteTeaserFrameTeamplate()  : mixed
Deletes a teaser frame template
setNavigation()  : mixed
settingsGeneral()  : mixed
Loads and saves general settings
settingsPlaceholders()  : mixed
Shows placeholders

Properties

$_arrCharsets

public mixed $_arrCharsets = array( // European languages /*'ASCII',*/ 'ISO-8859-1', /*'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-7', 'ISO-8859-9', 'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 'KOI8-R', 'KOI8-U', 'KOI8-RU', 'CP1250', 'CP1251', 'CP1252', 'CP1253', 'CP1254', 'CP1257', 'CP850', 'CP866', 'MacRoman', 'MacCentralEurope', 'MacIceland', 'MacCroatian', 'MacRomania', 'MacCyrillic', 'MacUkraine', 'MacGreek', 'MacTurkish', 'Macintosh', // Semitic languages 'ISO-8859-6', 'ISO-8859-8', 'CP1255', 'CP1256', 'CP862', 'MacHebrew', 'MacArabic', // Japanese 'EUC-JP', 'SHIFT_JIS', 'CP932', 'ISO-2022-JP', 'ISO-2022-JP-2', 'ISO-2022-JP-1', // Chinese 'EUC-CN', 'HZ', 'GBK', 'GB18030', 'EUC-TW', 'BIG5', 'CP950', 'BIG5-HKSCS', 'ISO-2022-CN', 'ISO-2022-CN-EXT', // Korean 'EUC-KR', 'CP949', 'ISO-2022-KR', 'JOHAB', // Armenian 'ARMSCII-8', // Georgian 'Georgian-Academy', 'Georgian-PS', // Tajik 'KOI8-T', // Thai 'TIS-620', 'CP874', 'MacThai', // Laotian 'MuleLao-1', 'CP1133', // Vietnamese 'VISCII', 'TCVN', 'CP1258', // Platform specifics 'HP-ROMAN8', 'NEXTSTEP', // Full Unicode*/ 'UTF-8', )

$_defaultTickerFileName

public mixed $_defaultTickerFileName = 'newsticker.txt'

$useThumbnails

Value of setting use_thumbnails

public static bool $useThumbnails

$arrTypeData

Localized data of available types

protected array<string|int, mixed> $arrTypeData = array()

$errMsg

Status messages

protected array<string|int, mixed> $errMsg = array()

$nestedSetRootId

NestedSet root node ID

protected int $nestedSetRootId = 0
Tags
access

protected

$objNestedSet

NestedSet object

protected DB_NestedSet|null $objNestedSet = null
Tags
access

protected

Methods

__construct()

PHP5 Constructor

public __construct() : mixed
Tags
access

public

_buildNewsCategories()

Generates the formated ul/li of categories Used in the template's

public _buildNewsCategories(Sigma $template, int $catId, array<string|int, mixed> $categoriesLang[, int $langId = null ][, int $categoryId = 0 ]) : string
Parameters
$template : Sigma

Template object to be parsed

$catId : int

Category id

$categoriesLang : array<string|int, mixed>

Category locale

$langId : int = null

Language id

$categoryId : int = 0

ID of category to highlight

Return values
string

Formated ul/li of categories

_comment_validate()

Validate edit comment form (check all fields to be not empty)

public _comment_validate() : bool
Tags
global

array langData

Return values
bool

(true -- if all OK, false -- if errors)

_generate_notify_group_list()

public _generate_notify_group_list() : mixed

_generate_notify_list()

Generates a list of <option> lines, including a "disable" entry on top of the list.

public _generate_notify_list(mixed $type, mixed $active_id) : mixed

For this to work, the function needs to know the following parameters:

Parameters
$type : mixed
$active_id : mixed

_getCharsetMenu()

public _getCharsetMenu(mixed $selectedCharset[, mixed $attrs = '' ]) : mixed
Parameters
$selectedCharset : mixed
$attrs : mixed = ''

_getTickers()

public _getTickers([mixed $offSet = 0 ]) : mixed
Parameters
$offSet : mixed = 0

_saveSettings()

Save the news settings

public _saveSettings() : mixed
Tags
access

private

global

ADONewConnection

global

array

global

array

see
createRSS()

_store_settings_item()

public _store_settings_item(mixed $name_in_db, mixed $value) : mixed
Parameters
$name_in_db : mixed
$value : mixed

add()

adds a news entry

public add() : mixed
Tags
global

array

global

array

global

ADONewConnection

addTag()

Save new tag into database

public addTag(string $tag) : bool|int
Parameters
$tag : string

Tag name to insert

Tags
global

object $objDatabase

Return values
bool|int

Retrun inserted Tag id or retrun false if failed to insert

changeCommentStatus()

Change status of multiple news comments

public changeCommentStatus() : mixed
Tags
global

ADONewConnection

global

array

global

array

checkForCommentFlooding()

Check if the current user has already written a comment within the definied timeout-time set by news_comments_timeout.

public checkForCommentFlooding(mixed $newsMessageId) : bool
Parameters
$newsMessageId : mixed
Tags
global

object

Return values
bool

TRUE, if the user hast just written a comment before.

comment_edit()

Prepare edit comment form

public comment_edit() : mixed
Tags
global

ADONewConnection

global

array langData

comment_save()

Save comment

public comment_save() : bool
Tags
global

ADONewConnection

global

array langData

Return values
bool

(true -- is comment saved successfuly, false -- otherwise)

comments_delete()

Remove single comment or several comments from database.

public comments_delete() : mixed
Tags
global

ADONewConnection

global

array langData

global

array config

comments_list()

List up news comments for edit or delete

public comments_list() : mixed
Tags
global

ADONewConnection

global

array langData

global

array config

dateFromInput()

Takes a date in the format dd.mm.yyyy hh:mm and returns it's representation as mktime()-timestamp.

public dateFromInput(mixed $value) : long
Parameters
$value : mixed

string

Return values
long

timestamp

dbFromDate()

Takes a mktime()-timestamp and formats it as yyyy-mm-dd hh:mm:00 for insertion in db.

public dbFromDate(mixed $value) : string
Parameters
$value : mixed

long timestamp

Return values
string

delete()

Deletes a news entry

public delete() : void
Tags
global

ADONewConnection

global

array

deleteType()

Delete the news types

public deleteType() : mixed
Tags
global

ADONewConnection

global

array

edit()

Edit the news, or if $copy is true, it copies an entry

public edit([mixed $copy = false ]) : mixed
Parameters
$copy : mixed = false
Tags
global

ADONewConnection

global

array

global

array

fetchSubmittedCommentData()

Fetch news comment data that has been submitted via POST and return it as array with three elements.

public fetchSubmittedCommentData() : array<string|int, mixed>

Where the first element is the name of the poster (if poster is anonymous), the second is the title of the comment and the third is the comment message by it self.

Return values
array<string|int, mixed>

filterBodyTag()

Gets only the body content and deleted all the other tags

public filterBodyTag(string $fullContent) : string
Parameters
$fullContent : string

HTML-Content with more than BODY

Return values
string

$content HTML-Content between BODY-Tag

findCmdById()

Searches for cmds having the passed id and returns the cmd of the result set having the lowest length.

public findCmdById(string $cmdName, array<string|int, mixed> $cmdIds[, string $cmdSeparator = ',' ][, string $module = 'News' ][, int $lang = FRONTEND_LANG_ID ]) : string
Parameters
$cmdName : string
$cmdIds : array<string|int, mixed>
$cmdSeparator : string = ','
$module : string = 'News'
$lang : int = FRONTEND_LANG_ID
Tags
access

public

Return values
string

$cmd

getApplicationUrl()

Get URL pointing to an application page of this component

public getApplicationUrl(array<string|int, mixed> $searchData) : string
Parameters
$searchData : array<string|int, mixed>

Array of search data

Return values
string

URL pointing to an application page of this component / other page in content manager / external link

getCategoriesByNewsId()

Get the categories by News ID

public getCategoriesByNewsId(int $newsId[, mixed $selectHidden = array() ]) : mixed
Parameters
$newsId : int
$selectHidden : mixed = array()
Tags
global

object $objDatabase

Return values
mixed

boolean|array

getCategoryLocale()

Getting the locale categories

public getCategoryLocale([mixed $categoryIds = null ][, mixed $langIds = null ]) : array<string|int, mixed>
Parameters
$categoryIds : mixed = null
$langIds : mixed = null
Tags
global

object $objDatabase

Return values
array<string|int, mixed>

getCategoryRelNews()

Get the news ID list based on the category

public getCategoryRelNews(int $categoryId) : mixed
Parameters
$categoryId : int
Tags
global

object $objDatabase

Return values
mixed

boolean|array

getIdsOfCategorySubCategories()

Get subcategory-ID lsit

public getIdsOfCategorySubCategories(int $catId) : array<string|int, mixed>
Parameters
$catId : int

ID of category to fetch IDs of subcategories from

Return values
array<string|int, mixed>

All IDs of categories that are a child (direct and indirect) of the category identified by $catId. $catId itself is also being returned.

getLangData()

Get language data (title, text, teaser_text) from database

public getLangData(int $id) : array<string|int, mixed>
Parameters
$id : int
Tags
global

ADONewConnection

Return values
array<string|int, mixed>

getMediaBrowserButton()

Get the MediaBrowser button

public static getMediaBrowserButton(string $options[, string $callBackName = '' ]) : mixed
Parameters
$options : string

mediabrowser options

$callBackName : string = ''

callback javascript function name

Tags
global

array $_ARRAYLANG

Return values
mixed

boolean|string

getMostFrequentTag()

Retruns most Frequent(Searched|Viewed) tag details.

public getMostFrequentTag() : bool|array<string|int, mixed>
Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

array( 'id' => //Tag id 'tag' => //Tag Value 'maxViewedCount' => //Maximum count of the tag viewed | searched ) | FALSE on query fails

getMostUsedTag()

Retruns most used tag details

public getMostUsedTag() : bool|array<string|int, mixed>
Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

array( 'id' => //Tag id 'tag' => //Tag Value 'maxUsedCount' => //Maximum count of the tag used ) | FALSE on query fails

getNewsArchiveList()

Generates the formated ul/li of Archive list Used in the template's If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.

public getNewsArchiveList([int $langId = null ][, DateTime &$nextUpdateDate = null ]) : string

If there are are no news with scheduled publishing $nextUpdateDate will be null.

Parameters
$langId : int = null

Language id

$nextUpdateDate : DateTime = null

(reference) DateTime of the next change

Return values
string

Formated ul/li of Archive list

getNewsCategories()

Generates the formated ul/li of categories Used in the template's

public getNewsCategories([Sigma $template = null ][, int $langId = null ][, int $categoryId = 0 ][, mixed $rootCategoryId = 0 ]) : string
Parameters
$template : Sigma = null

Template object to be parsed

$langId : int = null

Language id

$categoryId : int = 0

ID of category to highlight

$rootCategoryId : mixed = 0
Return values
string

Formated ul/li of categories

getNewsDetailsById()

Get news Details by id

public getNewsDetailsById(int $id) : array<string|int, mixed>
Parameters
$id : int
Tags
global

object $objDatabase

Return values
array<string|int, mixed>

getNewsFilterQuery()

Get News Filter Condition Query

public getNewsFilterQuery(string $tableAlias, array<string|int, mixed> $filters, string $filterCategory) : string
Parameters
$tableAlias : string
$filters : array<string|int, mixed>
$filterCategory : string

category filter

Return values
string

sql query

getNewsFromDbForSearch()

public getNewsFromDbForSearch(Search $search[, bool $fetchAssociationData = false ]) : ADORecordSet
Parameters
$search : Search
$fetchAssociationData : bool = false

Set to true to fetch a comma-separated ID-list of associated categories and one of associated tags.

Return values
ADORecordSet

News articles matching the seach query

getNewsGlobalPlaceholderNames()

Get all the News global placeholder names

public getNewsGlobalPlaceholderNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

Get the News important/source link

public getNewsLink(string $linkSource) : string
Parameters
$linkSource : string
Return values
string

getNewsRelCategories()

Get the news related category by ID

public getNewsRelCategories(int $newsId) : array<string|int, mixed>
Parameters
$newsId : int
Tags
global

object $objDatabase

Return values
array<string|int, mixed>

getNewsTags()

Get the news IDs and tags using news id (and|or) tag

public getNewsTags([int $newsId = null ][, array<string|int, mixed> $tags = array() ]) : bool|array<string|int, mixed>
Parameters
$newsId : int = null

News id to get the corresponding related tags

$tags : array<string|int, mixed> = array()

Tag string to search the corresponding tags

Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

Array List of News Related tags

getPage()

Do the requested newsaction

public getPage() : string
Tags
global

\Cx\Core\Html\Sigma

Return values
string

parsed content

Get the RSS News links

public getRssNewsLinks(int $langId, array<string|int, mixed> $newsCategoryIds, mixed $categoryDetails) : mixed
Parameters
$langId : int
$newsCategoryIds : array<string|int, mixed>

list of category Ids

$categoryDetails : mixed
Tags
global

array $_CONFIG

getSettings()

Gets the category option menu string

public getSettings() : mixed
Tags
global

ADONewConnection

getTags()

Getting all the stored tags

public getTags([int $id = null ][, int $tag = null ]) : bool|array<string|int, mixed>
Parameters
$id : int = null

Tag id

$tag : int = null

Tag name

Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

Array list of tag and its id as key array('id' => //Id of the tag 'tag' => //Tag value)

getTypeMenu()

public getTypeMenu([mixed $selectedOption = '' ]) : mixed
Parameters
$selectedOption : mixed = ''

getTypeNameById()

Get name of a type

public getTypeNameById(int $id) : string
Parameters
$id : int

ID of type to get name from

Return values
string

Name of type identified by $id. If type identified by $id is unknown, then an empty string is returned.

getTypesLangData()

Get types language data

public getTypesLangData() : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
array<string|int, mixed>

incrementViewingCount()

Increment the tags viewing count

public incrementViewingCount([array<string|int, mixed> $tagIds = array() ]) : null
Parameters
$tagIds : array<string|int, mixed> = array()

tag ids

Tags
global

object $objDatabase

Return values
null

insertLocales()

Insert new locales after create news from backend

public insertLocales(int $newsId, array<string|int, mixed> $newLangData) : bool
Parameters
$newsId : int
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

invertCommentStatus()

Inverts the status of the news comment with the id $intCommentId.

public invertCommentStatus(int $intCommentId) : mixed
Parameters
$intCommentId : int

: the status of this comment will be inverted.

Tags
global

ADONewConnection

invertStatus()

Invert status of a single message

public invertStatus(int $intNewsId) : mixed
Parameters
$intNewsId : int
Tags
global

ADONewConnection

global

array

manageTypes()

Add or edit the news types

public manageTypes() : mixed
Tags
global

ADONewConnection

global

array

manipulateTags()

Manipulating the submitted tags from the news Entry form.

public manipulateTags([array<string|int, mixed> $tags = array() ][, int $newsId = null ]) : bool

i) Adding the new tag if the tag is not availbale already. ii) Update the relationship of the news in the corresponding table iii) Delete the removed tags ids from the news relation table

Parameters
$tags : array<string|int, mixed> = array()

Array of submitted tags

$newsId : int = null

News id for manipulation

Tags
global

object $objDatabase

Return values
bool

true when tags stored, false otherwise

overview()

List up the news for edit or delete

public overview() : mixed
Tags
global

ADONewConnection

global

array

global

array

access

private

todo

use SQL_CALC_FOUND_ROWS and drop 'n.validated' in where clause instead of calling same query four times

parseCategoryList()

Parse the category list

public parseCategoryList(object $objTpl, array<string|int, mixed> $newsCategories[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$newsCategories : array<string|int, mixed>

News categories array by its news message id

$templatePrefix : mixed = ''

parseCommentsOfMessage()

Lists all active comments of the news message specified by $messageId

public parseCommentsOfMessage(object $objTpl, int $messageId, int $newsCommentActive[, mixed $templatePrefix = '' ]) : null
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$messageId : int

News message-ID

$newsCommentActive : int

Status of news comment activation

$templatePrefix : mixed = ''
Return values
null

parseImageBlock()

Parse the Image Block for thumbnail and detail image

public static parseImageBlock(object $objTpl, string $imagePath, string $altText, string $newsUrl, string $block[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$imagePath : string

Image path(Thumbnail/Detail Image)

$altText : string

News title

$newsUrl : string

News url

$block : string

Block name

$templatePrefix : mixed = ''

parseImageThumbnail()

public static parseImageThumbnail(mixed $imageSource, mixed $thumbnailSource, mixed $altText, mixed $newsUrl) : mixed
Parameters
$imageSource : mixed
$thumbnailSource : mixed
$altText : mixed
$newsUrl : mixed

parseMessageCommentForm()

Validates the submitted comment data and writes it to the databse if valid.

public parseMessageCommentForm(object $objTpl, int $newsMessageId, string $newsMessageTitle, int $newsCommentActive[, mixed $templatePrefix = '' ]) : null

Additionally, a notification is send out to the administration about the comment by e-mail (only if the corresponding configuration option is set to do so).

Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$newsMessageId : int

News message ID for which the comment shall be stored

$newsMessageTitle : string

Title of the news message for which the comment shall be stored. The title will be used in the notification e-mail

$newsCommentActive : int

Status of news comment activation

$templatePrefix : mixed = ''
Return values
null

parseNewsCommentsCount()

Parse the news comments count

public parseNewsCommentsCount(object $objTpl, int $newsid, int $newsCommentActive[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$newsid : int

News message ID

$newsCommentActive : int

News comment active

$templatePrefix : mixed = ''

parseNewsPlaceholders()

Parse the news placeholders

public parseNewsPlaceholders(object $objTpl, array<string|int, mixed> $objResult, string $newsUrl[, mixed $templatePrefix = '' ][, mixed $selectedCategories = array() ]) : string
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$objResult : array<string|int, mixed>

Result Array

$newsUrl : string

News Url

$templatePrefix : mixed = ''
$selectedCategories : mixed = array()
Return values
string

Generate the next and previous news links from the current news

public parseNextAndPreviousLinks(Sigma $objTpl[, mixed $selectedCategories = array() ]) : null
Parameters
$objTpl : Sigma

template object

$selectedCategories : mixed = array()
Return values
null

parseTagCloud()

public parseTagCloud(mixed $template, mixed $langId) : mixed
Parameters
$template : mixed
$langId : mixed

parseUserAccountData()

Parses a user's account and profile data specified by $userId.

public static parseUserAccountData(mixed $objTpl, mixed $userId, mixed $userTitle, mixed $blockName) : mixed

If the \Cx\Core\Html\Sigma template block specified by $blockName exists, then the user's data will be parsed inside this block. Otherwise, it will try to parse a template variable by the same name. For instance, if $blockName is set to news_publisher, it will first try to parse the template block news_publisher, if unable it will parse the template variable NEWS_PUBLISHER.

Parameters
$objTpl : mixed
$userId : mixed
$userTitle : mixed
$blockName : mixed

registerTagJsCode()

Register the JS code for the given input field ID

public registerTagJsCode([type $newsTagId = 'newsTags' ]) : mixed
Parameters
$newsTagId : type = 'newsTags'

HMTL ID attribute Value of the input field

settings()

Loads subnavbar level 2

public settings() : mixed
Tags
access

private

global

array $_CORELANG

Show News Text content or Redirect link

public showNewsTextOrRedirectLink(object $objTpl, string $text, string $redirect[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$text : string

Text news content

$redirect : string

News redirect link

$templatePrefix : mixed = ''

storeMessageComment()

Validates the submitted comment data and writes it to the databse if valid.

public storeMessageComment(mixed $newsMessageId, mixed $newsMessageTitle, mixed $name, mixed $title, mixed $message) : array<string|int, mixed>

Additionally, a notification is send out to the administration about the comment by e-mail (only if the corresponding configuration option is set to do so).

Parameters
$newsMessageId : mixed
$newsMessageTitle : mixed
$name : mixed
$title : mixed
$message : mixed
Tags
global

ADONewConnection

global

array

global

array

global

array

Return values
array<string|int, mixed>

Returns an array of two elements. The first is either TRUE on success or FALSE on failure. The second element contains an error message on failure.

submitLocales()

Insert new locales after submit news from frontend One copy for all languages

public submitLocales(int $newsId, string $title, string $text, string $teaser_text) : bool
Parameters
$newsId : int
$title : string
$text : string
$teaser_text : string
Tags
global

ADONewConnection

Return values
bool

valueFromDate()

Takes a mktime()-timestamp and formats it as dd.mm.yyyy hh:mm

public valueFromDate([mixed $value = 0 ]) : string
Parameters
$value : mixed = 0

long timestamp

Return values
string

categoryExists()

Checks whether the passed category exists.

protected categoryExists(int $category) : bool
Parameters
$category : int
Tags
access

protected

Return values
bool

deleteCat()

Delete a category with its entries and subcategories

protected deleteCat([int $catId = null ]) : bool
Parameters
$catId : int = null

Id of the Category

Tags
access

private

Return values
bool

true on success, false otherwise

findPageById()

Find the Page based on the category id $cmdId

protected findPageById(string $cmdName, array<string|int, mixed> $cmdId[, string $cmdSeparator = ',' ][, string $module = 'News' ][, int $lang = FRONTEND_LANG_ID ]) : bool
Parameters
$cmdName : string
$cmdId : array<string|int, mixed>
$cmdSeparator : string = ','
$module : string = 'News'
$lang : int = FRONTEND_LANG_ID
Return values
bool

getAuthorMenu()

Get Author dropdown options

protected getAuthorMenu([int $selectedOption = '' ][, array<string|int, mixed> $categoryId = array() ]) : string
Parameters
$selectedOption : int = ''
$categoryId : array<string|int, mixed> = array()
Return values
string

options string

getCategoriesData()

Get categories data

protected getCategoriesData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCategoryFilterForSearchComponent()

Get category Ids from the published application pages of this component

protected getCategoryFilterForSearchComponent(Search $search) : array<string|int, mixed>
Parameters
$search : Search
Tags
throws
NewsLibraryException

In case no application page of this component is published

Return values
array<string|int, mixed>

List of published category IDs. An empty array is returned, in case an application page is published that has no category restriction set through its CMD.

getCategoryMenu()

Generates the category menu.

protected getCategoryMenu(mixed $categories[, array<string|int, mixed> $selectedCategory = array() ][, array<string|int, mixed> $hiddenCategories = array() ][, bool $highlightOnlyCategoriesWithEntries = false ][, bool $showLevel = true ][, mixed $includeHidden = true ]) : string
Parameters
$categories : mixed
$selectedCategory : array<string|int, mixed> = array()

selected category

$hiddenCategories : array<string|int, mixed> = array()

the categories which shouldn't be shown as option

$highlightOnlyCategoriesWithEntries : bool = false

only categories which have entries

$showLevel : bool = true

Whether or not to visualy show the hierarchy as indent

$includeHidden : mixed = true
Tags
access

protected

Return values
string

$options html options

getCategoryNestedSet()

Returns the category nested set

protected getCategoryNestedSet() : DB_NestedSet
Return values
DB_NestedSet

Nested set instance

getCategoryNestedSetRootId()

Returns the root ID of the category nested set

protected getCategoryNestedSetRootId() : int
Return values
int

Root ID of the category nested set

getCatIdsFromNestedSetArray()

Returns the category ids of a nested set array.

protected getCatIdsFromNestedSetArray(array<string|int, mixed> $nestedSet) : array<string|int, mixed>
Parameters
$nestedSet : array<string|int, mixed>
Tags
access

protected

Return values
array<string|int, mixed>

$categories

getEmptyCategoryIds()

Returns an array containing the ids of empty categories.

protected getEmptyCategoryIds() : array<string|int, mixed>
Tags
access

protected

global

object $objDatabase ADONewConnection

Return values
array<string|int, mixed>

$arrEmptyCategoryIds ids of categories without entries

getIdOfLatestNewsArticle()

Fetch ID of latest news article. If $categoryId is specified, then the ID of the latest news article of the category identified by ID $categoryId is returned.

protected getIdOfLatestNewsArticle([int $categoryId = 0 ]) : int
Parameters
$categoryId : int = 0

ID of category to fetch the latest news article from

Tags
throws
NewsLibraryException

In case no latest news article was found

Return values
int

ID of latest news article

getMonthlyNewsStats()

Returns the news monthly stats by the given filters If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.

protected getMonthlyNewsStats(array<string|int, mixed> $categories[, int $langId = null ][, DateTime &$nextUpdateDate = null ]) : array<string|int, mixed>

If there are are no news with scheduled publishing $nextUpdateDate will be null.

Parameters
$categories : array<string|int, mixed>

category filter

$langId : int = null

Language id

$nextUpdateDate : DateTime = null

(reference) DateTime of the next change

Tags
access

protected

Return values
array<string|int, mixed>

$monthlyStats Monthly status array

getNestedSetCategories()

Returns an array containing the nested set information for the passed categories and their subcategories (ordered by their left id).

protected getNestedSetCategories(mixed $categories) : array<string|int, mixed>
Parameters
$categories : mixed
Tags
access

protected

Return values
array<string|int, mixed>

nested set information

getParentCatId()

Returns the parent category id of passed category.

protected getParentCatId(int $category) : int
Parameters
$category : int
Tags
access

protected

Return values
int

or boolean $cmd

getPublisherMenu()

Get Publisher dropdown options

protected getPublisherMenu([int $selectedOption = '' ][, array<string|int, mixed> $categoryId = array() ]) : string
Parameters
$selectedOption : int = ''
$categoryId : array<string|int, mixed> = array()
Return values
string

options string

getRelatedNews()

Getting the realated News

protected getRelatedNews([type $newsId = 0 ][, mixed $additionalRelatedNewsIds = array() ][, mixed $withArticleData = true ]) : bool
Parameters
$newsId : type = 0
$additionalRelatedNewsIds : mixed = array()
$withArticleData : mixed = true
Return values
bool

getRelatedNewsIds()

protected getRelatedNewsIds(mixed $newsId) : mixed
Parameters
$newsId : mixed

getSortedCategoryIdListIncludingSubcategories()

protected getSortedCategoryIdListIncludingSubcategories(array<string|int, mixed> $categoryIds) : array<string|int, mixed>
Parameters
$categoryIds : array<string|int, mixed>

List of IDs of categories to fetch and sort including their subcategories.

Return values
array<string|int, mixed>

Sorted list of category IDs

getTeaserPreview()

Get HTML-preview of teaser identified by ID `$teaserFrameId` by using the template identified by ID `$teaserFrameTemplateId`.

protected getTeaserPreview(int $teaserFrameId, int $teaserFrameTemplateId) : HtmlElement
Parameters
$teaserFrameId : int

ID of teaser to preview.

$teaserFrameTemplateId : int

ID of template to use for preview.

Return values
HtmlElement

HTML-preview of teaser.

initTypesLangData()

Fetch type localization and store them in a local member variable

protected initTypesLangData() : mixed

manageCategories()

Add or edit the news categories

protected manageCategories([bool $createMode = false ]) : void
Parameters
$createMode : bool = false

manipulateCategories()

Manipulating the submitted categories from the news Entry form.

protected manipulateCategories([type $categoryIds = array() ][, type $newsId = null ]) : bool

i) Update the relationship of the news in the corresponding table ii) Delete the removed categories ids from the news relation table

Parameters
$categoryIds : type = array()

Array of submitted category Ids

$newsId : type = null

News id for manipulation

Tags
global

object $objDatabase

global

array $_ARRAYLANG

Return values
bool

manipulateRelatedNews()

Manipulating the submitted related news from the news Entry form.

protected manipulateRelatedNews([type $relatedNewsIds = array() ][, type $newsId = null ]) : bool

i) Update the relationship of the news in the corresponding table ii) Delete the removed related news ids from the news relation table

Parameters
$relatedNewsIds : type = array()

Array of submitted related_news Ids

$newsId : type = null

News id for manipulation

Return values
bool

Returns TRUE

modifyCategory()

protected modifyCategory([int $id = null ]) : mixed
Parameters
$id : int = null
protected static parseLink(mixed $href, mixed $title, mixed $innerHtml[, mixed $target = null ]) : mixed
Parameters
$href : mixed
$title : mixed
$innerHtml : mixed
$target : mixed = null

parseNewsCategoryWidgetBlock()

Parse element of category widget block

protected parseNewsCategoryWidgetBlock(Sigma $template, string $block, array<string|int, mixed> $category, int $categoryId) : mixed

The element identified by $block will be parsed in template $template. All other elements (blocks) in the template will be hidden.

Parameters
$template : Sigma

Template object to parse

$block : string

Name of block to parse

$category : array<string|int, mixed>

Category data as array

$categoryId : int

ID of category to highlight

parseNewsTags()

Parsing the News tags.

protected parseNewsTags(Sigma $objTpl[, int $newsId = null ][, string $block = 'news_tag_list' ][, bool $setMetaKeys = false ][, string $templatePrefix = '' ][, bool $parseContent = true ]) : mixed
Parameters
$objTpl : Sigma

Template object

$newsId : int = null

News id

$block : string = 'news_tag_list'

Name of the block to parse the news tags

$setMetaKeys : bool = false

Set the tags as $this->newsMetaKeys when it is true

$templatePrefix : string = ''

Prefix for the blocks and variables to parse

$parseContent : bool = true

Whether to parse content or only set variables

Tags
global

type $_ARRAYLANG

parseRelatedNews()

Parsing related News

protected parseRelatedNews(Sigma $objTpl[, Interger $newsId = null ][, mixed $selectedCategories = array() ]) : mixed
Parameters
$objTpl : Sigma

Template Object

$newsId : Interger = null

News Id

$selectedCategories : mixed = array()
Tags
global

type $_ARRAYLANG

sortCategoryIdByPriorityId()

Prepend the array by the given values

protected static sortCategoryIdByPriorityId([array<string|int, mixed> $categoryIds = array() ][, array<string|int, mixed> $priorityIds = array() ]) : array<string|int, mixed>
Parameters
$categoryIds : array<string|int, mixed> = array()
$priorityIds : array<string|int, mixed> = array()
Return values
array<string|int, mixed>

sortNestedSetArray()

Sorts the given nested set array by the left id.

protected sortNestedSetArray(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Tags
access

protected

Return values
array<string|int, mixed>

$array

storeCategoriesLocales()

Saving categories locales

protected storeCategoriesLocales(array<string|int, mixed> $newLangData) : bool
Parameters
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

storeFeedLocales()

Saving feed settings locales

protected storeFeedLocales(mixed $settingsName, array<string|int, mixed> $newLangData) : bool
Parameters
$settingsName : mixed
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

storeLocales()

Saving locales after edit news

protected storeLocales(int $newsId, array<string|int, mixed> $newLangData) : bool
Parameters
$newsId : int
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

storeTypesLocales()

Saving types locales

protected storeTypesLocales(array<string|int, mixed> $newLangData) : bool
Parameters
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

update()

Update news

protected update() : bool
Tags
global

ADONewConnection

global

array

global

array

Return values
bool

result

validateNews()

Validate the News entries While Add/Edit News

protected validateNews(array<string|int, mixed> $locales, array<string|int, mixed> $newsCategories) : bool
Parameters
$locales : array<string|int, mixed>
$newsCategories : array<string|int, mixed>
Tags
global

array $_ARRAYLANG

Return values
bool

_deleteTeaserFrameTeamplate()

Deletes a teaser frame template

private _deleteTeaserFrameTeamplate() : mixed
Tags
access

private

see
Teaser::deleteTeaserFrameTemplate()

settingsGeneral()

Loads and saves general settings

private settingsGeneral() : mixed
Tags
access

private

global

array $_ARRAYLANG

global

array $_CORELANG

global

array $_CONFIG

global

object $objDatabase

settingsPlaceholders()

Shows placeholders

private settingsPlaceholders() : mixed
Tags
access

private

global

array $_CORELANG

global

array $_ARRAYLANG


        
On this page

Search results