templates/themes/blank/includes/view_helpers.php in pave-0.10.0 vs templates/themes/blank/includes/view_helpers.php in pave-0.10.1
- old
+ new
@@ -5,16 +5,31 @@
if ($c->isEditMode()) {
echo "edit-mode";
}
}
- function image_tag($t, $img) {
- $imgPath = ($t->getThemePath()) . "/images/";
- echo "<img src='" . $imgPath . $img . "' />";
- }
+ function is_logged_in() {
+ global $u;
+ if ($u -> isLoggedIn ()) {
+ echo "logged-in";
+ }
+ }
function has_blocks($area) {
global $c;
return $area->getTotalBlocksInArea($c) > 0;
}
-?>
\ No newline at end of file
+ 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 . " />";
+ }
+
+?>