77 * @author Robert Rackl <[email protected] > 88 */
99
10- // must be run within Dokuwiki
11- if (!defined ('DOKU_INC ' )) die ();
12-
13- if (!defined ('DOKU_LF ' )) define ('DOKU_LF ' , "\n" );
14- if (!defined ('DOKU_TAB ' )) define ('DOKU_TAB ' , "\t" );
15- if (!defined ('DOKU_PLUGIN ' )) define ('DOKU_PLUGIN ' , DOKU_INC .'lib/plugins/ ' );
16-
17- require_once (DOKU_PLUGIN .'syntax.php ' );
18-
1910class syntax_plugin_blog_blog extends DokuWiki_Syntax_Plugin {
2011 private $ included_pages = array ();
2112
@@ -62,13 +53,13 @@ function render($mode, Doku_Renderer $renderer, $data) {
6253
6354 // get the blog entries for our namespace
6455 /** @var helper_plugin_blog $my */
65- if ($ my =& plugin_load ('helper ' , 'blog ' )) $ entries = $ my ->getBlog ($ ns );
56+ if ($ my = plugin_load ('helper ' , 'blog ' )) $ entries = $ my ->getBlog ($ ns );
6657 else return false ;
6758
6859 // use tag refinements?
6960 if ($ refine ) {
7061 /** @var helper_plugin_tag $tag */
71- if (plugin_isdisabled ('tag ' ) || (!$ tag =& plugin_load ('helper ' , 'tag ' ))) {
62+ if (plugin_isdisabled ('tag ' ) || (!$ tag = plugin_load ('helper ' , 'tag ' ))) {
7263 msg ($ this ->getLang ('missing_tagplugin ' ), -1 );
7364 } else {
7465 $ entries = $ tag ->tagRefine ($ entries , $ refine );
@@ -94,12 +85,12 @@ function render($mode, Doku_Renderer $renderer, $data) {
9485 }
9586
9687 // slice the needed chunk of pages
97- $ more = (( count ($ entries ) > ($ first + $ num)) ? true : false );
88+ $ isMore = count ($ entries ) > ($ first + $ num );
9889 $ entries = array_slice ($ entries , $ first , $ num );
9990
10091 // load the include helper plugin
10192 /** @var helper_plugin_include $include */
102- if (plugin_isdisabled ('include ' ) || (!$ include =& plugin_load ('helper ' , 'include ' ))) {
93+ if (plugin_isdisabled ('include ' ) || (!$ include = plugin_load ('helper ' , 'include ' ))) {
10394 msg ($ this ->getLang ('missing_includeplugin ' ), -1 );
10495 return false ;
10596 }
@@ -150,7 +141,7 @@ function render($mode, Doku_Renderer $renderer, $data) {
150141 if ($ clevel && !$ include_flags ['inline ' ]) $ renderer ->doc .= '<div class="level ' .$ clevel .'"> ' .DOKU_LF ;
151142
152143 // show older / newer entries links
153- if ($ pagingcontrols ) $ renderer ->doc .= $ this ->_browseEntriesLinks ($ more , $ first , $ num );
144+ if ($ pagingcontrols ) $ renderer ->doc .= $ this ->_browseEntriesLinks ($ isMore , $ first , $ num );
154145
155146 // show new entry form
156147 if ($ perm_create && $ formpos == 'bottom ' ) {
@@ -165,6 +156,11 @@ function render($mode, Doku_Renderer $renderer, $data) {
165156
166157 /**
167158 * Displays links to older newer entries of the blog namespace
159+ *
160+ * @param $more
161+ * @param $first
162+ * @param $num
163+ * @return string
168164 */
169165 function _browseEntriesLinks ($ more , $ first , $ num ) {
170166 global $ ID ;
@@ -191,6 +187,10 @@ function _browseEntriesLinks($more, $first, $num) {
191187 /**
192188 * Displays a form to enter the title of a new entry in the blog namespace
193189 * and then open that page in the edit mode
190+ *
191+ * @param $ns
192+ * @param $newentrytitle
193+ * @return string
194194 */
195195 function _newEntryForm ($ ns , $ newentrytitle ) {
196196 global $ lang ;
0 commit comments