summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php92
1 files changed, 68 insertions, 24 deletions
diff --git a/inc/template.php b/inc/template.php
index eb88732c4..3bccb0bd8 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -68,6 +68,7 @@ function tpl_basedir($tpl='') {
* handled by this function. ACL stuff is not done here either.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @triggers TPL_ACT_RENDER
* @triggers TPL_CONTENT_DISPLAY
* @param bool $prependTOC should the TOC be displayed here?
@@ -187,6 +188,7 @@ function tpl_content_core() {
* a false argument
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param bool $return Should the TOC be returned instead to be printed?
* @return string
*/
@@ -205,7 +207,7 @@ function tpl_toc($return = false) {
$toc = $TOC;
} elseif(($ACT == 'show' || substr($ACT, 0, 6) == 'export') && !$REV && $INFO['exists']) {
// get TOC from metadata, render if neccessary
- $meta = p_get_metadata($ID, false, METADATA_RENDER_USING_CACHE);
+ $meta = p_get_metadata($ID, '', METADATA_RENDER_USING_CACHE);
if(isset($meta['internal']['toc'])) {
$tocok = $meta['internal']['toc'];
} else {
@@ -244,6 +246,8 @@ function tpl_toc($return = false) {
* Handle the admin page contents
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return bool
*/
function tpl_admin() {
global $INFO;
@@ -278,6 +282,7 @@ function tpl_admin() {
* This has to go into the head section of your template.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @triggers TPL_METAHEADER_OUTPUT
* @param bool $alt Should feeds and alternative format links be added?
* @return bool
@@ -427,10 +432,12 @@ function tpl_metaheaders($alt = true) {
* instances. Attributes are given as key value pairs. Values will be HTML
* encoded automatically so they should be provided as is in the $data array.
*
- * For tags having a body attribute specify the the body data in the special
+ * For tags having a body attribute specify the body data in the special
* attribute '_data'. This field will NOT BE ESCAPED automatically.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $data
*/
function _tpl_metaheaders_action($data) {
foreach($data as $tag => $inst) {
@@ -461,7 +468,7 @@ function _tpl_metaheaders_action($data) {
* @param string $url
* @param string $name
* @param string $more
- * @param bool $return if true return the link html, otherwise print
+ * @param bool $return if true return the link html, otherwise print
* @return bool|string html of the link, or true if printed
*/
function tpl_link($url, $name, $more = '', $return = false) {
@@ -481,7 +488,7 @@ function tpl_link($url, $name, $more = '', $return = false) {
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $id page id
- * @param string|null $name link name
+ * @param string|null $name the name of the link
* @return bool true
*/
function tpl_pagelink($id, $name = null) {
@@ -496,6 +503,9 @@ function tpl_pagelink($id, $name = null) {
* returns false if none is available
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @return false|string
*/
function tpl_getparent($id) {
$parent = getNS($id).':';
@@ -514,6 +524,10 @@ function tpl_getparent($id) {
*
* @author Adrian Lang <mail@adrianlang.de>
* @see tpl_get_action
+ *
+ * @param string $type
+ * @param bool $return
+ * @return bool|string html, or false if no data, true if printed
*/
function tpl_button($type, $return = false) {
$data = tpl_get_action($type);
@@ -546,12 +560,12 @@ function tpl_button($type, $return = false) {
* @author Adrian Lang <mail@adrianlang.de>
* @see tpl_get_action
*
- * @param string $type action name
- * @param string $pre prefix of link
- * @param string $suf suffix of link
- * @param string $inner inner HTML for link
- * @param bool $return if true it returns html, otherwise prints
- * @return bool|string html of action link or false if nothing, or true if printed
+ * @param string $type action command
+ * @param string $pre prefix of link
+ * @param string $suf suffix of link
+ * @param string $inner innerHML of link
+ * @param bool $return if true it returns html, otherwise prints
+ * @return bool|string html or false if no data, true if printed
*/
function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = false) {
global $lang;
@@ -617,6 +631,7 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals
* @author Andreas Gohr <andi@splitbrain.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
* @author Adrian Lang <mail@adrianlang.de>
+ *
* @param string $type
* @return array|bool|string
*/
@@ -773,13 +788,14 @@ function tpl_get_action($type) {
* Wrapper around tpl_button() and tpl_actionlink()
*
* @author Anika Henke <anika@selfthinker.org>
- * @param
- * @param bool $link link or form button?
- * @param bool $wrapper HTML element wrapper
- * @param bool $return return or print
- * @param string $pre prefix for links
- * @param string $suf suffix for links
- * @param string $inner inner HTML for links
+ *
+ * @param string $type action command
+ * @param bool $link link or form button?
+ * @param string|bool $wrapper HTML element wrapper
+ * @param bool $return return or print
+ * @param string $pre prefix for links
+ * @param string $suf suffix for links
+ * @param string $inner inner HTML for links
* @return bool|string
*/
function tpl_action($type, $link = false, $wrapper = false, $return = false, $pre = '', $suf = '', $inner = '') {
@@ -807,6 +823,7 @@ function tpl_action($type, $link = false, $wrapper = false, $return = false, $pr
* autocompletion feature (MSIE and Firefox)
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param bool $ajax
* @param bool $autocomplete
* @return bool
@@ -835,6 +852,7 @@ function tpl_searchform($ajax = true, $autocomplete = true) {
* Print the breadcrumbs trace
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $sep Separator between entries
* @return bool
*/
@@ -876,6 +894,7 @@ function tpl_breadcrumbs($sep = '•') {
* @author Sean Coates <sean@caedmon.net>
* @author <fredrik@averpil.com>
* @todo May behave strangely in RTL languages
+ *
* @param string $sep Separator between entries
* @return bool
*/
@@ -926,6 +945,7 @@ function tpl_youarehere($sep = ' » ') {
* Could be enhanced with a profile link in future?
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @return bool
*/
function tpl_userinfo() {
@@ -944,6 +964,7 @@ function tpl_userinfo() {
* Print some info about the current page
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param bool $ret return content instead of printing it
* @return bool|string
*/
@@ -1007,6 +1028,7 @@ function tpl_pageinfo($ret = false) {
* the given ID is used.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $id page id
* @param bool $ret return content instead of printing
* @return bool|string
@@ -1044,9 +1066,10 @@ function tpl_pagetitle($id = null, $ret = false) {
* Only allowed in: detail.php
*
* @author Andreas Gohr <andi@splitbrain.org>
- * @param array|string $tags tag or array of tags to try
- * @param string $alt alternative output if no data was found
- * @param null $src the image src, uses global $SRC if not given
+ *
+ * @param array|string $tags tag or array of tags to try
+ * @param string $alt alternative output if no data was found
+ * @param null|string $src the image src, uses global $SRC if not given
* @return string
*/
function tpl_img_getTag($tags, $alt = '', $src = null) {
@@ -1134,7 +1157,7 @@ function tpl_get_img_meta() {
* @param $maxheight int - maximal height of the image
* @param $link bool - link to the orginal size?
* @param $params array - additional image attributes
- * @return mixed Result of TPL_IMG_DISPLAY
+ * @return bool Result of TPL_IMG_DISPLAY
*/
function tpl_img($maxwidth = 0, $maxheight = 0, $link = true, $params = null) {
global $IMG;
@@ -1287,6 +1310,9 @@ function tpl_loadConfig() {
* tpl_getLang($id)
*
* use this function to access template language variables
+ *
+ * @param string $id key of language string
+ * @return string
*/
function tpl_getLang($id) {
static $lang = array();
@@ -1331,6 +1357,9 @@ function tpl_locale_xhtml($id) {
/**
* Prepends appropriate path for a language dependent filename
+ *
+ * @param string $id id of localized text
+ * @return string wiki text
*/
function tpl_localeFN($id) {
$path = tpl_incdir().'lang/';
@@ -1358,6 +1387,7 @@ function tpl_localeFN($id) {
* @triggers MEDIAMANAGER_CONTENT_OUTPUT
* @param bool $fromajax - set true when calling this function via ajax
* @param string $sort
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function tpl_mediaContent($fromajax = false, $sort='natural') {
@@ -1532,6 +1562,9 @@ function tpl_mediaTree() {
* Note: this will not use any pretty URLs
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $empty empty option label
+ * @param string $button submit button label
*/
function tpl_actiondropdown($empty = '', $button = '&gt;') {
global $ID;
@@ -1645,6 +1678,11 @@ function tpl_license($img = 'badge', $imgonly = false, $return = false, $wrap =
*
* This function is useful to populate sidebars or similar features in a
* template
+ *
+ * @param string $pageid
+ * @param bool $print
+ * @param bool $propagate
+ * @return bool|null|string
*/
function tpl_include_page($pageid, $print = true, $propagate = false) {
if (!$pageid) return false;
@@ -1753,10 +1791,11 @@ function tpl_flush() {
* If a given location starts with a colon it is assumed to be a media
* file, otherwise it is assumed to be relative to the current template
*
- * @param array $search locations to look at
- * @param bool $abs if to use absolute URL
- * @param array &$imginfo filled with getimagesize()
+ * @param string[] $search locations to look at
+ * @param bool $abs if to use absolute URL
+ * @param array &$imginfo filled with getimagesize()
* @return string
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function tpl_getMediaFile($search, $abs = false, &$imginfo = null) {
@@ -1807,6 +1846,8 @@ function tpl_getMediaFile($search, $abs = false, &$imginfo = null) {
*
* @author Anika Henke <anika@selfthinker.org>
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $file
*/
function tpl_includeFile($file) {
global $config_cascade;
@@ -1832,6 +1873,7 @@ function tpl_includeFile($file) {
* Returns <link> tag for various icon types (favicon|mobile|generic)
*
* @author Anika Henke <anika@selfthinker.org>
+ *
* @param array $types - list of icon types to display (favicon|mobile|generic)
* @return string
*/
@@ -1907,6 +1949,8 @@ function tpl_media() {
* Return useful layout classes
*
* @author Anika Henke <anika@selfthinker.org>
+ *
+ * @return string
*/
function tpl_classes() {
global $ACT, $conf, $ID, $INFO;