Sha256: f0ac6efef77984587c98ee3d17028def9c2fc1af38a8bb93f217c5780797bb80
Contents?: true
Size: 1.98 KB
Versions: 2
Compression:
Stored size: 1.98 KB
Contents
<? function pretty_r($var, $die=true) { echo "<pre>"; var_dump($var); echo "<pre>"; if($die) { die(); }; } function is_edit_mode() { global $c; return $c->isEditMode(); } function is_logged_in() { global $u; return $u->isLoggedIn(); } function has_blocks($area) { global $c; return $area->getTotalBlocksInArea($c) > 0; } function is_admin() { $u = new User(); $g = Group::getByName('Administrators'); return $u->isSuperUser()||$u->inGroup($g); } function current_url() { Loader::helper('navigation'); return NavigationHelper::getLinkToCollection(Page::getCurrentPage(), true); } function page_classes($c) { return $c->getCollectionTypeHandle() . " " . $c->getCollectionHandle() . " " . (is_admin() ? 'admin' : ''); } function image_tag($t, $img, $html_options = false) { $imgPath = ($t->getThemePath()) . "/images/"; if ($html_options) { $options = " alt='" . explode(".", $img, 2)[0] . "'"; foreach ($html_options as $k => $v) { $options .= " " . $k . "='" . addslashes($v) . "'"; } } else { $options = " alt='" . explode(".", $img, 2)[0] . "'"; }; echo "<img src='" . $imgPath . $img . "'" . $options . " />"; } function page_specific_scripts($page, $t) { $script_html = ""; $handle = $page->getCollectionTypeHandle(); if (isset($handle) === true) { $script_path = __DIR__ . "/../js/template_" . $handle . ".js"; if (file_exists($script_path) === true) { $script_html .= "<script src='" . $t->getThemePath() . "/js/template_" . $handle . ".js'></script>"; } } $page_name = $page->getCollectionHandle(); if (isset($page_name) === true) { $script_path = __DIR__ . "/../js/page_" . $page_name . ".js"; if (file_exists($script_path) === true) { $script_html .= "<script src='" . $t->getThemePath() . "/js/page_" . $page_name . ".js'></script>"; } } return $script_html; } ?>
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pave-0.13.0 | templates/themes/blank/includes/view_helpers.php |
pave-0.12.0 | templates/themes/blank/includes/view_helpers.php |