Skip to content
Browse files

minor changes

  • Loading branch information...
1 parent e2c9bc7 commit 9cb4e7ece6d6568258af86ec5d2147beac384d77 @DanielMuller committed Feb 12, 2013
Showing with 40 additions and 40 deletions.
  1. +40 −40 libraries/MY_Theme_View.php
View
80 libraries/MY_Theme_View.php
@@ -96,7 +96,7 @@ protected function ensureoptionsvalue($key, $default) {
public function read_session_cmdparam($cmd, $cookie, $issession, $default) {
try {
- $_cmd = $_GET[$cmd];
+ $_cmd = $_GET[$cmd];
} catch (Exception $e) {
};
@@ -109,7 +109,7 @@ public function read_session_cmdparam($cmd, $cookie, $issession, $default) {
else:
$_from_cmd = FALSE;
if ($cookie):
- try {
+ try {
$_var = $_COOKIE[$cookie];
} catch (Exception $e) {
};
@@ -149,7 +149,7 @@ public function load_sessioninfo() {
$this->thumb_ratio = $this->read_session_cmdparam("ratio", "gd_ratio", TRUE, $this->ensureoptionsvalue("thumb_ratio", "photo"));
if ($this->ensureoptionsvalue("allow_root_page", FALSE)):
- $_root = $this->read_session_cmdparam("root", "gd_rootpage", TRUE, "yes");
+ $_root = $this->read_session_cmdparam("root", "gd_rootpage", TRUE, "yes");
$this->show_root_page = ($_root == "yes");
$this->allow_root_page = TRUE;
@@ -180,13 +180,13 @@ public function load_sessioninfo() {
case "right":
$this->sidebarvisible = "right";
break;
- case "left":
+ case "left":
$this->sidebarvisible = "left";
break;
- case "bottom":
+ case "bottom":
$this->sidebarvisible = "bottom";
break;
- case "top":
+ case "top":
$this->sidebarvisible = "top";
break;
endswitch;
@@ -206,7 +206,7 @@ public function load_sessioninfo() {
$this->sidebarallowed = "none";
endif;
- if (($this->page_subtype == "login") || ($this->page_subtype == "reauthenticate") || ($this->page_subtype == "error")):
+ if (($this->page_subtype == "login") || ($this->page_subtype == "reauthenticate") || ($this->page_subtype == "error")):
$this->sidebarvisible = "none";
$this->sidebarallowed = "none";
endif;
@@ -260,7 +260,7 @@ public function load_sessioninfo() {
if ($this->ensureoptionsvalue("use_permalinks", FALSE)):
$this->permalinks = array("enter" => "enter", "root" => "root");
endif;
- if (((module::is_active("shadowbox")) and (module::info("shadowbox")))
+ if (((module::is_active("shadowbox")) and (module::info("shadowbox")))
or ((module::is_active("fancybox")) and (module::info("fancybox")))
or ((module::is_active("colorbox")) and (module::info("colorbox")))
):
@@ -329,7 +329,7 @@ public function load_sessioninfo() {
if (($this->sidebarvisible == "none") or ($this->sidebarvisible == "bottom") or ($this->sidebarvisible == "top") ):
$this->thumb_inpage = $this->ensureoptionsvalue("thumb_inpage", FALSE);
- endif;
+ endif;
}
public function is_sidebarallowed($align) {
@@ -338,13 +338,13 @@ public function is_sidebarallowed($align) {
public function custom_header() {
if (Kohana::find_file('views', "header.html", FALSE)):
- return new View("header.html");
+ return new View("header.html");
endif;
}
public function custom_footer() {
if (Kohana::find_file('views', "footer.html", FALSE)):
- return new View("footer.html");
+ return new View("footer.html");
endif;
}
@@ -370,12 +370,12 @@ public function get_item_title($item, $allowbbcode = FALSE, $limit_title_length
$filename = pathinfo($filename, PATHINFO_FILENAME);
elseif (strstr($item->filename, '.')):
$filename = substr($filename, 0, strrpos($filename, '.'));
- endif;
+ endif;
if (strcasecmp($title, $filename) == 0):
$title = "";
else:
- $filename = item::convert_filename_to_title($filename); // Normalize filename to title format
+ $filename = item::convert_filename_to_title($filename); // Normalize filename to title format
if (strcasecmp($title, $filename) == 0)
$title = "";
endif;
@@ -433,7 +433,7 @@ protected function sidebar_menu_item($type, $url, $caption, $css) {
endif;
$iscurrent = ($this->sidebarvisible == $type);
- $content_menu = '<li>';
+ $content_menu = '<li>';
if (!$iscurrent):
$content_menu .= '<a title="' . $caption . '" href="' . $url . '?sb=' . $type . '" rel="nofollow">';
endif;
@@ -493,10 +493,10 @@ public function get_bodyclass() {
$body_class .= " g-sidebar-" . $this->sidebarvisible;
switch ($this->column_count):
- case 5:
+ case 5:
$body_class .= " g-column-5";
break;
- case 4:
+ case 4:
$body_class .= " g-column-4";
break;
case 2:
@@ -566,16 +566,16 @@ public function get_thumb_element($item, $addcontext = FALSE, $linkonly = FALSE)
$_shift = "";
switch ($this->thumb_imgalign):
case "center":
- if (($this->crop_factor == 1) and (!$is_portrait)):
+ if (($this->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval(($this->_thumb_size_y - $thumb_item->thumb_height) / 2) . 'px;"';
- elseif ($this->crop_factor > 0):
+ elseif ($this->crop_factor > 0):
$_shift = 'style="margin-top: -' . intval(($thumb_item->thumb_height - $this->_thumb_size_y) / 2) . 'px;"';
endif;
break;
case "bottom":
- if (($this->crop_factor == 1) and (!$is_portrait)):
+ if (($this->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval($this->_thumb_size_y - $thumb_item->thumb_height) . 'px;"';
- elseif ($this->crop_factor > 0):
+ elseif ($this->crop_factor > 0):
$_shift = 'style="margin-top: -' . intval($thumb_item->thumb_height - $this->_thumb_size_y) . 'px;"';
endif;
break;
@@ -596,7 +596,7 @@ public function get_thumb_element($item, $addcontext = FALSE, $linkonly = FALSE)
$content .= '<div class="g-thumbslide">';
$thumb_content = '<p class="g-thumbcrop">';
- $use_direct_link = (($this->disablephotopage) && (!$item->is_album()));
+ $use_direct_link = (($this->disablephotopage) && (!$item->is_album()));
$class_name = "g-thumblink";
if ($use_direct_link):
$class_name .= ' g-sb-preview" rel="g-preview';
@@ -609,7 +609,7 @@ public function get_thumb_element($item, $addcontext = FALSE, $linkonly = FALSE)
$direct_link = $item->url();
endif;
- if ($use_direct_link && module::is_active("exif") && module::info("exif")):
+ if ($use_direct_link && module::is_active("exif") && module::info("exif")):
$thumb_content .= '<a class="g-meta-exif-link g-dialog-link" href="' . url::site("exif/show/{$item->id}") . '" title="' . t("Photo details")->for_html_attr() . '">&nbsp;</a>';
endif;
@@ -650,21 +650,21 @@ public function get_thumb_element($item, $addcontext = FALSE, $linkonly = FALSE)
$thumb_content .= 'g-overlay-bottom';
endif;
$thumb_content .= '"><li class="g-title">' . $this->get_item_title($item, FALSE, $this->visible_title_length) . '</li>';
- if ($_thumb_metamode == "merged"):
+ if ($_thumb_metamode == "merged"):
$thumb_content .= $this->thumb_info($item);
endif;
$thumb_content .= '</ul>';
endif;
- if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
+ if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
$thumb_content .= '<ul class="g-metadata">' . $this->thumb_info($item) . '</ul>';
endif;
if ($_thumb_descmode == "bottom"):
$thumb_content .= '<ul class="g-description">';
$thumb_content .= '<li class="g-title">' . $this->get_item_title($item) . '</li>';
- if ($item->is_album()) $thumb_content .= '<li class="g-album-description">' . $item->description . '</li>';
- if ($_thumb_metamode == "merged"):
+ if ($item->is_album()) $thumb_content .= '<li class="g-album-description">' . $this->bb2html($item->description,1) . '</li>';
+ if ($_thumb_metamode == "merged"):
$thumb_content .= $this->thumb_info($item);
endif;
$thumb_content .= '</ul>';
@@ -777,7 +777,7 @@ public function bb2html($text, $mode) {
// [list][*]item[*]item[*]item[/list]
// [code]value="123";[/code]
// [quote]John said yadda yadda yadda[/quote]
-
+
static $bbcode_mappings = array(
"#\\[b\\](.*?)\\[/b\\]#" => "<strong>$1</strong>",
"#\\[i\\](.*?)\\[/i\\]#" => "<em>$1</em>",
@@ -799,22 +799,22 @@ public function bb2html($text, $mode) {
"#\\[ul\\](.*?)\\[/ul\\]#" => "<ul>$1</ul>",
"#\\[li\\](.*?)\\[/li\\]#" => "<li>$1</li>",
);
-
- static $bbcode_strip = '|[[\/\!]*?[^\[\]]*?]|si';
+
+ static $bbcode_strip = '|[[\/\!]*?[^\[\]]*?]|si';
if (($mode == 1) or ($mode == 3)):
- $newtext = str_replace("&lt;", "<", $text);
- $newtext = str_replace("&gt;", ">", $newtext);
- $newtext = str_replace("&quot;", "\"", $newtext);
+ $newtext = str_replace("&lt;", "<", $text);
+ $newtext = str_replace("&gt;", ">", $newtext);
+ $newtext = str_replace("&quot;", "\"", $newtext);
else:
- // Replace any html brackets with HTML Entities to prevent executing HTML or script
- $newtext = str_replace("<", "&lt;", $text);
- $newtext = str_replace(">", "&gt;", $newtext);
- $newtext = str_replace("&amp;quot;", "&quot;", $newtext);
+ // Replace any html brackets with HTML Entities to prevent executing HTML or script
+ $newtext = str_replace("<", "&lt;", $text);
+ $newtext = str_replace(">", "&gt;", $newtext);
+ $newtext = str_replace("&amp;quot;", "&quot;", $newtext);
endif;
- // Convert new line chars to html <br /> tags
- $newtext = nl2br($newtext);
+ // Convert new line chars to html <br /> tags
+ $newtext = nl2br($newtext);
if (strpos($text, "[") !== false):
if (($mode == 2) or ($mode == 3)):
@@ -833,7 +833,7 @@ function curl_get_file_contents($url) {
curl_setopt($curl, CURLOPT_URL, $url);
$contents = curl_exec($curl);
curl_close($curl);
-
+
if ($contents):
return $contents;
else:
@@ -857,7 +857,7 @@ function get_slideshow_list($limit = 10) {
$feed_url = $host . $feed_url;
endif;
- $use_file_load = ($this->valid_url($feed_url)) || is_file($feed_url);
+ $use_file_load = ($this->valid_url($feed_url)) || is_file($feed_url);
$er = error_reporting(0);
// Try to get feed directly

0 comments on commit 9cb4e7e

Please sign in to comment.
Something went wrong with that request. Please try again.