Skip to content

Commit

Permalink
removed old tpl_content_core method
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Aug 15, 2017
1 parent 7c6a857 commit 952acff
Showing 1 changed file with 8 additions and 91 deletions.
99 changes: 8 additions & 91 deletions inc/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,102 +87,19 @@ function tpl_content($prependTOC = true) {
return !empty($html_output);
}

function tpl_content_core() {
$router = \dokuwiki\ActionRouter::getInstance();
$router->getAction()->tplContent();
return true; // FIXME when is this false? do we need to catch an exception?
}

/**
* Default Action of TPL_ACT_RENDER
*
* @return bool
*/
function XXX_tpl_content_core() {
global $ACT;
global $TEXT;
global $PRE;
global $SUF;
global $SUM;
global $IDX;
global $INPUT;

switch($ACT) {
case 'show':
html_show();
break;
/** @noinspection PhpMissingBreakStatementInspection */
case 'locked':
html_locked();
case 'edit':
case 'recover':
html_edit();
break;
case 'preview':
html_edit();
html_show($TEXT);
break;
case 'draft':
html_draft();
break;
case 'search':
html_search();
break;
case 'revisions':
html_revisions($INPUT->int('first'));
break;
case 'diff':
html_diff();
break;
case 'recent':
$show_changes = $INPUT->str('show_changes');
if (empty($show_changes)) {
$show_changes = get_doku_pref('show_changes', $show_changes);
}
html_recent($INPUT->extract('first')->int('first'), $show_changes);
break;
case 'index':
html_index($IDX); #FIXME can this be pulled from globals? is it sanitized correctly?
break;
case 'backlink':
html_backlinks();
break;
case 'conflict':
html_conflict(con($PRE, $TEXT, $SUF), $SUM);
html_diff(con($PRE, $TEXT, $SUF), false);
break;
case 'login':
html_login();
break;
case 'register':
html_register();
break;
case 'resendpwd':
html_resendpwd();
break;
case 'denied':
html_denied();
break;
case 'profile' :
html_updateprofile();
break;
case 'admin':
tpl_admin();
break;
case 'subscribe':
tpl_subscribe();
break;
case 'media':
tpl_media();
break;
default:
$evt = new Doku_Event('TPL_ACT_UNKNOWN', $ACT);
if($evt->advise_before()) {
msg("Failed to handle command: ".hsc($ACT), -1);
}
$evt->advise_after();
unset($evt);
return false;
function tpl_content_core() {
$router = \dokuwiki\ActionRouter::getInstance();
try {
$router->getAction()->tplContent();
} catch(\dokuwiki\Action\Exception\FatalException $e) {
// there was no content for the action
msg(hsc($e->getMessage()), -1);
return false;
}
return true;
}
Expand Down

0 comments on commit 952acff

Please sign in to comment.