function smarty_function_content_url($params, $template) { if (!isset($params['name'])) { if ($content = \BlankCanvas\Content::getById($params['id'])) { $params['name'] = $content->name; } } return BlankCanvas\App::getRootUri() . $params['id'] . '/_' . preg_replace('/[^\\w]/', '_', $params['name']); }
function smarty_function_crumbs($params, $template) { $crumbs = BlankCanvas\View::getCrumbs(); $html = ""; $i = 0; foreach ($crumbs as $k => $v) { $i++; $html .= $i < count($crumbs) ? '<a href="' . $v . '">' . $k . '</a> > ' : (is_int($k) ? $v : $k); } return $html; return BlankCanvas\App::getRootUri() . $params['id'] . '/_' . preg_replace('/[^\\w]/', '_', $params['name']); }
function smarty_block_a($params, $content, $template, &$repeat) { if ($content) { if (isset($params['href'])) { $params['href'] = BlankCanvas\App::getRootUri() . preg_replace('/^\\//', '', $params['href']); } $html = '<a'; foreach ($params as $name => $val) { $html .= ' ' . $name . '="' . $val . '"'; } $html .= ">" . $content . '</a>'; return $html; } }