All the stuff for the frontend (i.e. what the visitor of the website sees).
This file is part of Ratatöskr. Ratatöskr is licensed unter the MIT / X11 License. See “ratatoeskr/licenses/ratatoeskr” for more information.
ratatoeskr/ | All the stuff for the frontend (i.e. |
Functions | |
section_transform_ste | Transforms an Section object to an array, so it can be accessed via a STE template. |
tag_transform_ste | Transforms an Tag object to an array, so it can be accessed via a STE template. |
article_transform_ste | Transforms an Article object to an array, so it can be accessed via a STE template. |
comment_transform_ste | Transforms an Comment object to an array, so it can be accessed via a STE template. |
STE Tags | |
articles_get | Get articles by custom criterias. |
section_list | Iterate over all sections. |
article_comments_count | Get the number of comments for an article. |
article_comments | List all comments for an article. |
comment_form | Generates a HTML form tag that allows the visitor to write a comment. |
Page control | These tags can create links to the previous/next page. |
languages | List all languages available in the current context. |
styles_load | Load all current styles. |
title | Generate a HTML title tag for your site. |
on_article | Execute tag content, if currently an article is requested. |
on_tag | Execute tag content, if currently a tag is requested. |
on_section | Execute tag content, if currently a section is requested. |
STE Variables | |
$current | Holds information about the current page in the frontend (the part of the webpage, the visitor sees). |
$language | The short form (e.g. |
Functions | |
frontend_url_handler | |
CommentRejected | An Exeption a comment validator can throw, if the validation failed. |
function section_transform_ste( $section, $lang )
Transforms an Section object to an array, so it can be accessed via a STE template.
$section | Section object. |
$lang | The current language. |
Array with these fields:
function tag_transform_ste( $tag, $lang )
Transforms an Tag object to an array, so it can be accessed via a STE template.
$section | Tag object. |
$lang | The current language. |
Array with these fields:
function article_transform_ste( $article, $lang )
Transforms an Article object to an array, so it can be accessed via a STE template.
$article | Article object. |
$lang | The current language. |
Array with these fields:
Get articles by custom criterias. Will only get articles, that are available in the current language ($language). The fields of an article can be looked up at article_transform_ste.
var | (mandatory) The name of the variable, where the current article should be stored at. |
id | (optional) Filter by ID. |
urlname | (optional) Filter by urlname. |
section | (optional) Filter by section (section name). |
sectionvar | (optional) Filter by section (Name of variable that contains a section). |
status | (optional) Filter by status (numeric, ARTICLE_STATUS_). |
tag | (optional) Filter by tag (tag name). |
tagvar | (optional) Filter by tag (Name of variable that contains a tag). |
sort | (optional) How to sort. Format: “fieldname direction” where fieldname is one of [id, urlname, title, timestamp] and direction is one of [asc, desc]. |
perpage | (optional) How many articles should be shown per page (default unlimited). |
page | (optional) On which page are we (starting with 1). Useful in combination with $current[page], page_prev and page_next. (Default: 1) |
maxpage | (optional) (variable name) If given, the number of pages are stored in this variable. |
skip | (optional) How many articles should be skipped? (Default: none) |
count | (optional) How many articles to output. (Default unlimited) |
The tag’s content will be executed for every article. The current article will be written to the variable specified by the var parameter before.
All results from the tag content.
Iterate over all sections. The fields of a section can be looked up at section_transform_ste.
var | (mandatory) The name of the variable, where the current section should be stored at. |
exclude | (optional) Sections to exclude |
include_default | (optional) Should the default section be included (default: No). |
The tag’s content will be executed for every section. The current section will be written to the variable specified by the var parameter before.
All results from the tag content.
List all comments for an article. The fields of a comment can be looked up at comment_transform_ste.
var | (mandatory) The name of the variable, where the current comment should be stored at. |
article | (mandatory) The name of the variable, where the article is stored at. |
sort | (optional) Should the comments be sorted chronologically (asc) or inverse (desc)? Default: asc |
The tag’s content will be executed for every comment. The current comment will be written to the variable specified by the var parameter before.
All results from the tag content.
Generates a HTML form tag that allows the visitor to write a comment.
article | (mandatory) The name of the variable, where the article is stored at. |
default | (optional) If not empty, a default formular with the mandatory fields will be generated. |
previewbtn | (optional) If not empty and default form is choosen, a preview button will also be generated. |
The tag’s content will be written into the HTML form tag. You have at least to define these fields:
If the parameter default is not empty, the tag’s content will be thrown away.
The finished HTML form.
The “prevcomment” field in $current.
These tags can create links to the previous/next page.
page_prev | Link to the previous page (if available). |
page_next | Link to the next page (if available). |
current | (mandatory) The current page number. |
maxpage | (mandatory) How many pages in total? |
default | (optional) If not empty, a default localized link text will be used. |
The tag’s content will be used as the link text.
A Link to the previous / next page.
List all languages available in the current context.
var | (mandatory) The name of the variable, where the current language information should be stored at. |
short | 2 letter code of language |
fullname | The full name of the language |
url | URL to the current page in this language |
The tag’s content will be executed for every language. The current language will be written to the variable specified by the var parameter before.
All results from the tag content.
Execute tag content, if currently an article is requested.
var | (optional) If set, the article will be stored in the variable with that name (see article_transform_ste for sub-fields). |
The executed tag content, if an article was requested.
Execute tag content, if currently a tag is requested.
var | (optional) If set, the tag will be stored in the variable with that name (see tag_transform_ste for sub-fields). |
The executed tag content, if a tag was requested.
Execute tag content, if currently a section is requested.
var | (optional) If set, the section will be stored in the variable with that name (see section_transform_ste for sub-fields). |
The executed tag content, if a section was requested.
Holds information about the current page in the frontend (the part of the webpage, the visitor sees).
Plugins might insert their own $current fields.
Transforms an Section object to an array, so it can be accessed via a STE template.
function section_transform_ste( $section, $lang )
Transforms an Tag object to an array, so it can be accessed via a STE template.
function tag_transform_ste( $tag, $lang )
Transforms an Article object to an array, so it can be accessed via a STE template.
function article_transform_ste( $article, $lang )
Transforms an Comment object to an array, so it can be accessed via a STE template.
function comment_transform_ste( $comment )
function frontend_url_handler( & $data, $url_now, & $url_next )