Dashboard: Refactor search/replace implementation

refs #4537
This commit is contained in:
Marius Hein 2014-11-11 16:04:51 +01:00
parent 979bec24a5
commit b679c1e770
1 changed files with 19 additions and 7 deletions

View File

@ -175,13 +175,25 @@ EOD;
$iframeUrl = clone($url);
$iframeUrl->setParam('isIframe');
$html = str_replace('{URL}', $url, $this->template);
$html = str_replace('{IFRAME_URL}', $iframeUrl, $html);
$html = str_replace('{FULL_URL}', $url->getUrlWithout(array('view', 'limit')), $html);
$html = str_replace('{REMOVE_BTN}', $this->getRemoveForm($view), $html);
$html = str_replace('{TITLE}', $view->escape($this->getTitle()), $html);
$html = str_replace('{REMOVE}', $this->getRemoveForm(), $html);
return $html;
$searchTokens = array(
'{URL}',
'{IFRAME_URL}',
'{FULL_URL}',
'{REMOVE_BTN}',
'{TITLE}',
'{REMOVE}'
);
$replaceTokens = array(
$url,
$iframeUrl,
$url->getUrlWithout(array('view', 'limit')),
$this->getRemoveForm($view),
$view->escape($this->getTitle()),
$this->getRemoveForm()
);
return str_replace($searchTokens, $replaceTokens, $this->template);
}
/**