Documentation

article extends template
in package
Uses pubTemplateArticles

Article Template Objekt

Tags
author

Stefan Seehafer sea75300@yahoo.de

Table of Contents

FETCH_REGEX  = '/\\{{2}((\\w*\\s?)((?>\\w*\\=\\".*\\"\\s?)*))\\}{2}/i'
GALLERY_TAG_END  = '[/gallery]'
GALLERY_TAG_LINK  = ':link'
GALLERY_TAG_START  = '[gallery]{{IMAGES}}'
GALLERY_TAG_THUMB  = 'thumb:'
PAGEBREAK_TAG  = '<!-- pagebreak -->'
TEMPLATE_ID  = 'article'
TEMPLATE_ID_SINGLE  = 'articleSingle'
$allowedTags  : array<string|int, mixed>
erlaubte Template-Tags
$cache  : cache
Cache-Objekt
$cacheModule  : string
Cache Modul
$cacheName  : string
Cache name
$cleanups  : array<string|int, mixed>
Tag-Kombinationen, die beseitigt werden müssen
$commentsEnabled  : bool
Kommentar-Parsner aktiv
$config  : config
System-Config-Objekt
$content  : string
Dateiinhalt
$data  : array<string|int, mixed>
data-Array für nicht weiter definierte Eigenschaften
$dbcon  : database
DB-Verbindung
$events  : events
Event-Liste
$extension  : string
Dateierweiterung
$filename  : string
Dateiname
$filepath  : string
Dateispfad
$filesize  : int
Dateigröße
$fullpath  : string
Dateipfad inkl. Dateiname
$language  : language
System-Sprachen-Objekt
$notifications  : notifications
Notifications
$replacementAttributes  : array<string|int, mixed>
List of previously parsed attributes
$replacementAttributesMap  : array<string|int, mixed>
List of attributes by replacement tag
$replacementInternal  : array<string|int, mixed>
Interne Platzhalter
$replacementTags  : array<string|int, mixed>
Template-Platzhalter
$replacementTranslated  : array<string|int, mixed>
Platzhalter mit Sprachbezeichner
$table  : string
Tabellen-Name
$tagMatches  : array<string|int, mixed>
Tag matches in Template
__construct()  : bool
Konstruktor
assignByObject()  : bool
Assigns template variables by object of type @see \fpcm\model\articles\article
delete()  : bool
Löscht Datei in Dateisystem
escapeFileName()  : mixed
Bereinigt Dateiname von problematischen Zeichen
exists()  : bool
Prüft ob Datei existiert
getAllowedTags()  : string
Gibt erlaubte HTML-Tags als string zurück
getAllowedTagsArray()  : array<string|int, mixed>
Returns raw allowed HTML tags list
getContent()  : string
Dateiinhalt
getData()  : array<string|int, mixed>
Gibt Inhalt von "data" zurück
getExtension()  : string
Erweiterung
getFileHash()  : string
File SHA256 hash
getFilename()  : string
Dateiname
getFileNameHash()  : string
Return hash based on filename
getFilepath()  : string
Dateipfad
getFilesize()  : int
Dateigröße
getFullpath()  : string
Dateipfad + Dateiname
getLazyLoadingImg()  : string
Get lazy loading string for images
getModificationTime()  : int
Return file upload time in file system
getReplacementAttributesMap()  : array<string|int, mixed>
Returns attribute map for replacement tags
getReplacementInternal()  : array<string|int, mixed>
Liefert interne Platzhalter zurück
getReplacementTags()  : array<string|int, mixed>
Liefert Platzhalter zurück
getReplacementTranslations()  : array<string|int, mixed>
Platzhalter-Übersetzungen
isReadable()  : bool
ist Datei lesbar
isValidDataFolder()  : bool
Check if fullpath is valid path in /data folder structure
isWritable()  : bool
ist Datei beschreibbar
loadContent()  : bool
Lädt Inhalt von gespeicherter Datei
moveUploadedFile()  : bool
Verschiebt via PHP Upload hochgeladene Datei von tmp-Pfad nach Zielpfad
parse()  : bool
Parst Template-Platzhalter
rename()  : bool
Datei umbenennen
retrieveFileExtension()  : string
Retrieve file extension via pathinfo
retrieveFileName()  : string
Retrieve file name via pathinfo
retrieveRealType()  : string
Retrieve real file path via finfo
save()  : bool
Speichert Template in Dateisystem
setAllowedTags()  : mixed
Fügt erlaubte HTML-Tags hinzu
setCommentsEnabled()  : mixed
Kommentar-Parser aktivieren
setContent()  : mixed
Dateiinhalt setzen
setFilename()  : mixed
Dateiname setzen
setReplacementTags()  : mixed
Fügt Platzhalter hinzu
writeContent()  : bool
Lädt Inhalt von gespeicherter Datei
basePath()  : string
Returns base path for file
cleanup()  : string
Cleanup tags
init()  : mixed
Initialisiert Template-Inhalt
lazyReplace()  : int
Adds lazy loading string to images
parseAttributes()  : array<string|int, mixed>
Parses replacement attributes
parseCommentLink()  : mixed
Parse comment link tag
parseGallery()  : string
Parse gallery tag
parseLinks()  : string
Links in Text parsen
parsePermaLink()  : mixed
Parse perma link tag
parseSmileys()  : string
Parst Smileys in Artikeln und Kommentaren
parseSources()  : mixed
Parse comment link tag
parseTag()  : bool
Parse replacement tags
parseTextShort()  : mixed
Parse short text tag
realpathNoExists()  : string
"realpath" wrapper for non-existing files
parseSmileyFilePath()  : string
Parst Smileys
processAttributes()  : bool
Fetch and replace tag attributes

Constants

FETCH_REGEX

public mixed FETCH_REGEX = '/\\{{2}((\\w*\\s?)((?>\\w*\\=\\".*\\"\\s?)*))\\}{2}/i'
public mixed GALLERY_TAG_END = '[/gallery]'
public mixed GALLERY_TAG_LINK = ':link'
public mixed GALLERY_TAG_START = '[gallery]{{IMAGES}}'
public mixed GALLERY_TAG_THUMB = 'thumb:'

PAGEBREAK_TAG

public mixed PAGEBREAK_TAG = '<!-- pagebreak -->'

TEMPLATE_ID

public mixed TEMPLATE_ID = 'article'

TEMPLATE_ID_SINGLE

public mixed TEMPLATE_ID_SINGLE = 'articleSingle'

Properties

$allowedTags

erlaubte Template-Tags

protected array<string|int, mixed> $allowedTags = array('<div>', '<span>', '<p>', '<b>', '<strong>', '<i>', '<em>', '<u>', '<a>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<img>', '<table>', '<tr>', '<td>', '<br>', '<form>', '<input>', '<button>', '<select>', '<option>', '<ul>', '<ol>', '<li>', '<script>', '<iframe>', '<label>')

$cacheModule

Cache Modul

protected string $cacheModule = ''
Tags
since
3.4

$cacheName

Cache name

protected string $cacheName = false

$cleanups

Tag-Kombinationen, die beseitigt werden müssen

protected array<string|int, mixed> $cleanups = array('<p><readmore>' => '<readmore>', '</readmore></p>' => '</readmore>')

$commentsEnabled

Kommentar-Parsner aktiv

protected bool $commentsEnabled = true

$content

Dateiinhalt

protected string $content

$data

data-Array für nicht weiter definierte Eigenschaften

protected array<string|int, mixed> $data

$extension

Dateierweiterung

protected string $extension

$filename

Dateiname

protected string $filename

$filepath

Dateispfad

protected string $filepath

$filesize

Dateigröße

protected int $filesize

$fullpath

Dateipfad inkl. Dateiname

protected string $fullpath

$replacementAttributes

List of previously parsed attributes

protected array<string|int, mixed> $replacementAttributes = []
Tags
since
4.1

$replacementAttributesMap

List of attributes by replacement tag

protected array<string|int, mixed> $replacementAttributesMap = ['{{sources}}' => ['descr', 'descrAlt', 'hideEmpty']]
Tags
since
4.1

$replacementInternal

Interne Platzhalter

protected array<string|int, mixed> $replacementInternal = array('<readmore>:</readmore>')

$replacementTags

Template-Platzhalter

protected array<string|int, mixed> $replacementTags = array('{{headline}}' => '', '{{text}}' => '', '{{textShort}}' => '', '{{author}}' => '', '{{authorEmail}}' => '', '{{authorInfoText}}' => '', '{{authorAvatar}}' => '', '{{date}}' => '', '{{changeDate}}' => '', '{{changeUser}}' => '', '{{statusPinned}}' => '', '{{shareButtons}}' => '', '{{categoryIcons}}' => '', '{{categoryTexts}}' => '', '{{commentCount}}' => '', '{{permaLink}}:{{/permaLink}}' => '', '{{commentLink}}:{{/commentLink}}' => '', '{{articleImage}}' => '', '{{sources}}' => '')

$replacementTranslated

Platzhalter mit Sprachbezeichner

protected array<string|int, mixed> $replacementTranslated = []
Tags
since
3.5.2

$table

Tabellen-Name

protected string $table

$tagMatches

Tag matches in Template

protected array<string|int, mixed> $tagMatches = []
Tags
since
5.0.0-a4

Methods

__construct()

Konstruktor

public __construct(string $fileName) : bool
Parameters
$fileName : string

Template-Datei unterhalb von data/styles/articles

Return values
bool

assignByObject()

Assigns template variables by object of type @see \fpcm\model\articles\article

public assignByObject(article $article, array<string|int, mixed> $users, array<string|int, mixed> $categories, int $commentCount) : bool
Parameters
$article : article
$users : array<string|int, mixed>
$categories : array<string|int, mixed>
$commentCount : int
Return values
bool

delete()

Löscht Datei in Dateisystem

public delete() : bool
Return values
bool

escapeFileName()

Bereinigt Dateiname von problematischen Zeichen

public escapeFileName(string &$filename) : mixed
Parameters
$filename : string
Return values
mixed

exists()

Prüft ob Datei existiert

public exists() : bool
Return values
bool

getAllowedTags()

Gibt erlaubte HTML-Tags als string zurück

public getAllowedTags([string $delim = '' ]) : string
Parameters
$delim : string = ''
Return values
string

getAllowedTagsArray()

Returns raw allowed HTML tags list

public getAllowedTagsArray() : array<string|int, mixed>
Tags
since
4.2
Return values
array<string|int, mixed>

getContent()

Dateiinhalt

public getContent() : string
Return values
string

getData()

Gibt Inhalt von "data" zurück

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

getExtension()

Erweiterung

public getExtension() : string
Return values
string

getFileHash()

File SHA256 hash

public getFileHash() : string
Tags
since
4.1
Return values
string

getFilename()

Dateiname

public getFilename() : string
Return values
string

getFileNameHash()

Return hash based on filename

public getFileNameHash() : string
Tags
since
5.0.0-a1
Return values
string

getFilepath()

Dateipfad

public getFilepath() : string
Return values
string

getFilesize()

Dateigröße

public getFilesize() : int
Return values
int

getFullpath()

Dateipfad + Dateiname

public getFullpath() : string
Return values
string

getLazyLoadingImg()

Get lazy loading string for images

public final getLazyLoadingImg() : string
Tags
since
4.5
Return values
string

getModificationTime()

Return file upload time in file system

public getModificationTime() : int
Return values
int

getReplacementAttributesMap()

Returns attribute map for replacement tags

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

getReplacementInternal()

Liefert interne Platzhalter zurück

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

getReplacementTags()

Liefert Platzhalter zurück

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

getReplacementTranslations()

Platzhalter-Übersetzungen

public getReplacementTranslations(string $prefix) : array<string|int, mixed>
Parameters
$prefix : string
Tags
since
3.5.2
Return values
array<string|int, mixed>

isReadable()

ist Datei lesbar

public isReadable() : bool
Tags
since
3.5
Return values
bool

isValidDataFolder()

Check if fullpath is valid path in /data folder structure

public isValidDataFolder([string $path = '' ][, string $type = '/' ]) : bool
Parameters
$path : string = ''
$type : string = '/'
Tags
since
4.1
Return values
bool

isWritable()

ist Datei beschreibbar

public isWritable() : bool
Tags
since
3.5
Return values
bool

loadContent()

Lädt Inhalt von gespeicherter Datei

public loadContent() : bool
Tags
since
3.5
Return values
bool

moveUploadedFile()

Verschiebt via PHP Upload hochgeladene Datei von tmp-Pfad nach Zielpfad

public moveUploadedFile(string $uploadedPath) : bool
Parameters
$uploadedPath : string
Tags
since
3.3
Return values
bool

parse()

Parst Template-Platzhalter

public parse() : bool
Return values
bool

rename()

Datei umbenennen

public rename(string $newname[, int $userid = false ]) : bool
Parameters
$newname : string
$userid : int = false
Return values
bool

retrieveFileExtension()

Retrieve file extension via pathinfo

public static retrieveFileExtension(string $filename) : string
Parameters
$filename : string
Tags
since
4.5
Return values
string

retrieveFileName()

Retrieve file name via pathinfo

public static retrieveFileName(string $filename) : string
Parameters
$filename : string
Tags
since
5.0
Return values
string

retrieveRealType()

Retrieve real file path via finfo

public static retrieveRealType(string $path) : string
Parameters
$path : string
Tags
since
5.0.0-a3
Return values
string

save()

Speichert Template in Dateisystem

public save() : bool
Return values
bool

setAllowedTags()

Fügt erlaubte HTML-Tags hinzu

public setAllowedTags(array<string|int, mixed> $allowedTags) : mixed
Parameters
$allowedTags : array<string|int, mixed>
Return values
mixed

setCommentsEnabled()

Kommentar-Parser aktivieren

public setCommentsEnabled(bool $commentsEnabled) : mixed
Parameters
$commentsEnabled : bool
Return values
mixed

setContent()

Dateiinhalt setzen

public setContent(string $content) : mixed
Parameters
$content : string
Return values
mixed

setFilename()

Dateiname setzen

public setFilename(string $filename) : mixed
Parameters
$filename : string
Return values
mixed

setReplacementTags()

Fügt Platzhalter hinzu

public setReplacementTags(array<string|int, mixed> $replacementTags) : mixed
Parameters
$replacementTags : array<string|int, mixed>
Return values
mixed

writeContent()

Lädt Inhalt von gespeicherter Datei

public writeContent() : bool
Tags
since
4.2
Return values
bool

basePath()

Returns base path for file

protected abstract basePath(string $filename) : string
Parameters
$filename : string

File name

Tags
abstract
Return values
string

cleanup()

Cleanup tags

protected cleanup(string $values) : string
Parameters
$values : string
Return values
string

init()

Initialisiert Template-Inhalt

protected init(void $initDB) : mixed
Parameters
$initDB : void
Return values
mixed

lazyReplace()

Adds lazy loading string to images

protected lazyReplace(string &$content) : int
Parameters
$content : string
Tags
since
4.5
Return values
int

parseAttributes()

Parses replacement attributes

protected parseAttributes(string $var) : array<string|int, mixed>
Parameters
$var : string
Tags
since
4.1
Return values
array<string|int, mixed>

Parse comment link tag

protected parseCommentLink(mixed $value, array<string|int, mixed> &$return) : mixed
Parameters
$value : mixed
$return : array<string|int, mixed>
Tags
since
4.4
Return values
mixed

parseGallery()

Parse gallery tag

protected parseGallery(string $content) : string
Parameters
$content : string
Tags
since
4.4
Return values
string

Links in Text parsen

protected parseLinks(string &$content[, array<string|int, mixed> $attributes = [] ][, bool $returnOnly = false ]) : string
Parameters
$content : string
$attributes : array<string|int, mixed> = []
$returnOnly : bool = false
Return values
string

Parse perma link tag

protected parsePermaLink(mixed $value, array<string|int, mixed> &$return) : mixed
Parameters
$value : mixed
$return : array<string|int, mixed>
Tags
since
4.4
Return values
mixed

parseSmileys()

Parst Smileys in Artikeln und Kommentaren

protected parseSmileys(string $content) : string
Parameters
$content : string
Return values
string

parseSources()

Parse comment link tag

protected parseSources(mixed $value, array<string|int, mixed> &$return) : mixed
Parameters
$value : mixed
$return : array<string|int, mixed>
Tags
since
4.4
Return values
mixed

parseTag()

Parse replacement tags

protected parseTag(string $tag, string $value, array<string|int, mixed> &$return, type $replacement) : bool
Parameters
$tag : string
$value : string
$return : array<string|int, mixed>
$replacement : type
Return values
bool

parseTextShort()

Parse short text tag

protected parseTextShort(mixed $value, array<string|int, mixed> &$return) : mixed
Parameters
$value : mixed
$return : array<string|int, mixed>
Tags
since
4.4
Return values
mixed

realpathNoExists()

"realpath" wrapper for non-existing files

protected realpathNoExists(string $path) : string
Parameters
$path : string
Tags
since
4.5
see
ops::realpathNoExists
Return values
string

parseSmileyFilePath()

Parst Smileys

private parseSmileyFilePath(smiley $smiley) : string
Parameters
$smiley : smiley
Return values
string

processAttributes()

Fetch and replace tag attributes

private processAttributes(string $tag, mixed $value, array<string|int, mixed> &$replacementData, callable $callback) : bool
Parameters
$tag : string
$value : mixed
$replacementData : array<string|int, mixed>
$callback : callable
Tags
since
4.1
Return values
bool

Search results