From 5c2eed9a193e9341fbfee63d4a973898acdc5ee5 Mon Sep 17 00:00:00 2001 From: lisps Date: Thu, 21 Nov 2013 15:50:52 +0100 Subject: add parameter at($DATE_AT) and mind revisions --- inc/html.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index b48a17fc5..5b79ab659 100644 --- a/inc/html.php +++ b/inc/html.php @@ -207,6 +207,7 @@ function html_show($txt=null){ global $REV; global $HIGH; global $INFO; + global $DATE_AT; //disable section editing for old revisions or in preview if($txt || $REV){ $secedit = false; @@ -226,8 +227,8 @@ function html_show($txt=null){ echo ''; }else{ - if ($REV) print p_locale_xhtml('showrev'); - $html = p_wiki_xhtml($ID,$REV,true); + if ($REV||$DATE_AT) print p_locale_xhtml('showrev'); + $html = p_wiki_xhtml($ID,$REV,true,$DATE_AT); $html = html_secedit($html,$secedit); if($INFO['prependTOC']) $html = tpl_toc(true).$html; $html = html_hilight($html,$HIGH); -- cgit v1.2.3 From 0a91ddc03c2b15ce51208e2c35df292c5276f50e Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Fri, 21 Feb 2014 16:10:11 +0100 Subject: Update text above searchresults, when only read-acl FS#2697 --- inc/html.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 0434f3b45..b88e58c3c 100644 --- a/inc/html.php +++ b/inc/html.php @@ -299,15 +299,17 @@ function html_hilight_callback($m) { * @author Andreas Gohr */ function html_search(){ - global $QUERY; + global $QUERY, $ID; global $lang; $intro = p_locale_xhtml('searchpage'); // allow use of placeholder in search intro + $pagecreateinfo = (auth_quickaclcheck($ID) > AUTH_READ) ? $lang['searchcreatepage'] : ''; $intro = str_replace( - array('@QUERY@','@SEARCH@'), - array(hsc(rawurlencode($QUERY)),hsc($QUERY)), - $intro); + array('@QUERY@', '@SEARCH@', '@CREATEPAGEINFO@'), + array(hsc(rawurlencode($QUERY)), hsc($QUERY), $pagecreateinfo), + $intro + ); echo $intro; flush(); -- cgit v1.2.3 From c09f3f1510ae2fc65fa2118f74630f8100a549ce Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 4 Mar 2014 21:49:11 +0100 Subject: use correct permission level for showing 'create page' text --- inc/html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index b88e58c3c..a9e799d66 100644 --- a/inc/html.php +++ b/inc/html.php @@ -304,7 +304,7 @@ function html_search(){ $intro = p_locale_xhtml('searchpage'); // allow use of placeholder in search intro - $pagecreateinfo = (auth_quickaclcheck($ID) > AUTH_READ) ? $lang['searchcreatepage'] : ''; + $pagecreateinfo = (auth_quickaclcheck($ID) >= AUTH_CREATE) ? $lang['searchcreatepage'] : ''; $intro = str_replace( array('@QUERY@', '@SEARCH@', '@CREATEPAGEINFO@'), array(hsc(rawurlencode($QUERY)), hsc($QUERY), $pagecreateinfo), -- cgit v1.2.3 From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- inc/html.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index bda6fb398..dd4a3d8da 100644 --- a/inc/html.php +++ b/inc/html.php @@ -422,6 +422,9 @@ function html_locked(){ * @author Andreas Gohr * @author Ben Coburn * @author Kate Arzamastseva + * + * @param int $first skip the first n changelog lines + * @param bool|string $media_id id of media, or false for current page */ function html_revisions($first=0, $media_id = false){ global $ID; @@ -926,7 +929,7 @@ function html_li_default($item){ * @param array $data array with item arrays * @param string $class class of ul wrapper * @param callable $func callback to print an list item - * @param string $lifunc callback to the opening li tag + * @param callable $lifunc callback to the opening li tag * @param bool $forcewrapper Trigger building a wrapper ul if the first level is 0 (we have a root object) or 1 (just the root content) * @return string html of an unordered list -- cgit v1.2.3 From 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 21:45:27 +0200 Subject: more scrutinizer issue improvements --- inc/html.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index dd4a3d8da..ce6360175 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1902,6 +1902,7 @@ function html_debug(){ print ''; if (function_exists('apache_get_version')) { + $apache = array(); $apache['version'] = apache_get_version(); if (function_exists('apache_get_modules')) { -- cgit v1.2.3 From 42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 11:30:27 +0200 Subject: Many PHPDocs, some unused and dyn declared vars many PHPDocs some unused variables some dynamically declared variables declared --- inc/html.php | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 5 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index ce6360175..adcd212ed 100644 --- a/inc/html.php +++ b/inc/html.php @@ -83,6 +83,10 @@ function html_denied() { * inserts section edit buttons if wanted or removes the markers * * @author Andreas Gohr + * + * @param string $text + * @param bool $show show section edit buttons? + * @return string */ function html_secedit($text,$show=true){ global $INFO; @@ -101,8 +105,11 @@ function html_secedit($text,$show=true){ * prepares section edit button data for event triggering * used as a callback in html_secedit * - * @triggers HTML_SECEDIT_BUTTON * @author Andreas Gohr + * + * @param array $matches matches with regexp + * @return string + * @triggers HTML_SECEDIT_BUTTON */ function html_secedit_button($matches){ $data = array('secid' => $matches[1], @@ -121,6 +128,9 @@ function html_secedit_button($matches){ * used as default action form HTML_SECEDIT_BUTTON * * @author Adrian Lang + * + * @param array $data name, section id and target + * @return string html */ function html_secedit_get_button($data) { global $ID; @@ -147,6 +157,8 @@ function html_secedit_get_button($data) { * Just the back to top button (in its own form) * * @author Andreas Gohr + * + * @return string html */ function html_topbtn(){ global $lang; @@ -161,6 +173,15 @@ function html_topbtn(){ * If tooltip exists, the access key tooltip is replaced. * * @author Andreas Gohr + * + * @param string $name + * @param string $id + * @param string $akey access key + * @param string[string] $params key-value pairs added as hidden inputs + * @param string $method + * @param string $tooltip + * @param bool|string $label label text, false: lookup btn_$name in localization + * @return string */ function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false){ global $conf; @@ -213,9 +234,11 @@ function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false } /** - * show a wiki page + * Show a wiki page * * @author Andreas Gohr + * + * @param null|string $txt wiki text or null for showing $ID */ function html_show($txt=null){ global $ID; @@ -281,6 +304,10 @@ function html_draft(){ * * @author Andreas Gohr * @author Harry Fuecks + * + * @param string $html + * @param array|string $phrases + * @return string html */ function html_hilight($html,$phrases){ $phrases = (array) $phrases; @@ -299,6 +326,9 @@ function html_hilight($html,$phrases){ * Callback used by html_hilight() * * @author Harry Fuecks + * + * @param array $m matches + * @return string html */ function html_hilight_callback($m) { $hlight = unslash($m[0]); @@ -646,6 +676,9 @@ function html_revisions($first=0, $media_id = false){ * @author Matthias Grimm * @author Ben Coburn * @author Kate Arzamastseva + * + * @param int $first + * @param string $show_changes */ function html_recent($first=0, $show_changes='both'){ global $conf; @@ -833,6 +866,8 @@ function html_recent($first=0, $show_changes='both'){ * Display page index * * @author Andreas Gohr + * + * @param string $ns */ function html_index($ns){ global $conf; @@ -861,6 +896,9 @@ function html_index($ns){ * User function for html_buildlist() * * @author Andreas Gohr + * + * @param array $item + * @return string */ function html_list_index($item){ global $ID, $conf; @@ -891,6 +929,9 @@ function html_list_index($item){ * it gives different classes to opened or closed "folders" * * @author Andreas Gohr + * + * @param array $item + * @return string html */ function html_li_index($item){ if($item['type'] == "f"){ @@ -906,6 +947,9 @@ function html_li_index($item){ * Default List item * * @author Andreas Gohr + * + * @param array $item + * @return string html */ function html_li_default($item){ return '
  • '; @@ -1021,12 +1065,13 @@ function html_backlinks(){ /** * Get header of diff HTML + * * @param string $l_rev Left revisions * @param string $r_rev Right revision * @param string $id Page id, if null $ID is used * @param bool $media If it is for media files * @param bool $inline Return the header on a single line - * @return array HTML snippets for diff header + * @return string[] HTML snippets for diff header */ function html_diff_head($l_rev, $r_rev, $id = null, $media = false, $inline = false) { global $lang; @@ -1482,7 +1527,7 @@ function html_diff_navigationlink($difftype, $linktype, $lrev, $rrev = null) { /** * Insert soft breaks in diff html * - * @param $diffhtml + * @param string $diffhtml * @return string */ function html_insert_softbreaks($diffhtml) { @@ -1521,6 +1566,9 @@ REGEX; * show warning on conflict detection * * @author Andreas Gohr + * + * @param string $text + * @param string $summary */ function html_conflict($text,$summary){ global $ID; @@ -1681,7 +1729,6 @@ function html_edit(){ global $lang; global $conf; global $TEXT; - global $RANGE; if ($INPUT->has('changecheck')) { $check = $INPUT->str('changecheck'); @@ -1783,6 +1830,7 @@ function html_edit(){ * Display the default edit form * * Is the default action for HTML_EDIT_FORMSELECTION. + * * @param mixed[] $param */ function html_edit_form($param) { @@ -1802,6 +1850,8 @@ function html_edit_form($param) { * Adds a checkbox for minor edits for logged in users * * @author Andreas Gohr + * + * @return array|bool */ function html_minoredit(){ global $conf; @@ -2081,6 +2131,9 @@ function html_resendpwd() { * Return the TOC rendered to XHTML * * @author Andreas Gohr + * + * @param array $toc + * @return string html */ function html_TOC($toc){ if(!count($toc)) return ''; @@ -2099,6 +2152,9 @@ function html_TOC($toc){ /** * Callback for html_buildlist + * + * @param array $item + * @return string html */ function html_list_toc($item){ if(isset($item['hid'])){ @@ -2133,6 +2189,7 @@ function html_mktocitem($link, $text, $level, $hash='#'){ * Triggers an event with the form name: HTML_{$name}FORM_OUTPUT * * @author Tom N Harris + * * @param string $name The name of the form * @param Doku_Form $form The form */ @@ -2145,6 +2202,7 @@ function html_form($name, &$form) { /** * Form print function. * Just calls printForm() on the data object. + * * @param Doku_Form $data The form */ function html_form_output($data) { -- cgit v1.2.3 From e3710957c6b7e12293805a15d0624be7c7054092 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 17:05:40 +0200 Subject: more phpdocs and minor check --- inc/html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index adcd212ed..754e08edf 100644 --- a/inc/html.php +++ b/inc/html.php @@ -177,7 +177,7 @@ function html_topbtn(){ * @param string $name * @param string $id * @param string $akey access key - * @param string[string] $params key-value pairs added as hidden inputs + * @param string[] $params key-value pairs added as hidden inputs * @param string $method * @param string $tooltip * @param bool|string $label label text, false: lookup btn_$name in localization -- cgit v1.2.3 From f7dbf1759d3f9a578d8d84bda58bda7777ee7365 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 11 Dec 2014 20:21:44 +0100 Subject: scroll to current page when opening the sitemap --- inc/html.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 711cd8db6..cdcd166d9 100644 --- a/inc/html.php +++ b/inc/html.php @@ -937,8 +937,14 @@ function html_list_index($item){ * @return string html */ function html_li_index($item){ + global $INFO; + if($item['type'] == "f"){ - return '
  • '; + // scroll to the current item + if($item['id'] == $INFO['id']) { + $id = ' id="scroll__here"'; + } + return '
  • '; }elseif($item['open']){ return '
  • '; }else{ -- cgit v1.2.3 From 6fa4721ac57074f958b12cf2cf28a489f24e89e1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 11 Dec 2014 20:51:55 +0100 Subject: add new behaviour: bounce Add the class .bounce to any element to let it bounce slightly for 2 seconds. This is useful to make the user aware of some element. Can be combined with #scroll__here when a long list auto scrolls to a certain item. --- inc/html.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index cdcd166d9..87affd47b 100644 --- a/inc/html.php +++ b/inc/html.php @@ -939,12 +939,16 @@ function html_list_index($item){ function html_li_index($item){ global $INFO; + $class = ''; + $id = ''; + if($item['type'] == "f"){ // scroll to the current item if($item['id'] == $INFO['id']) { $id = ' id="scroll__here"'; + $class = ' bounce'; } - return '
  • '; + return '
  • '; }elseif($item['open']){ return '
  • '; }else{ -- cgit v1.2.3