Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some HTML validation fixes (don't render empty <ul> lists, empty id a…

…ttributes, use &amp; not &)
  • Loading branch information...
commit 2dad1d7cd15bed3c89de11cadf4b3b5c43134f69 1 parent 8412aeb
@andyst andyst authored talmdal committed
View
6 modules/gallery/helpers/gallery_event.php
@@ -336,7 +336,7 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
->css_class("ui-icon-rotate-ccw")
->ajax_handler("function(data) { " .
"\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
- ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type")))
+ ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&amp;from_id=$theme_item->id&amp;page_type=$page_type")))
->append(
Menu::factory("ajax_link")
->id("rotate_cw")
@@ -344,7 +344,7 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
->css_class("ui-icon-rotate-cw")
->ajax_handler("function(data) { " .
"\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
- ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type")));
+ ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&amp;from_id=$theme_item->id&amp;page_type=$page_type")));
}
// @todo Don't move photos from the photo page; we don't yet have a good way of redirecting
@@ -384,7 +384,7 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
->label($delete_title)
->css_class("ui-icon-trash")
->css_id("g-quick-delete")
- ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type")));
+ ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&amp;from_id=$theme_item->id&amp;page_type=$page_type")));
}
if ($item->is_album()) {
View
13 modules/gallery/libraries/Menu.php
@@ -216,6 +216,19 @@ public function get($id) {
return null;
}
+ public function is_empty() {
+ foreach ($this->elements as $element) {
+ if ($element instanceof Menu) {
+ if (!$element->is_empty()) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+
public function render() {
$view = new View(isset($this->view) ? $this->view : "menu.html");
$view->menu = $this;
View
4 modules/gallery/views/menu.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<? if ($menu->elements): // Don't show the menu if it has no choices ?>
+<? if (!$menu->is_empty()): // Don't show the menu if it has no choices ?>
<? if ($menu->is_root): ?>
-<ul <?= isset($menu->css_id) ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>">
+<ul <?= $menu->css_id ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>">
<? foreach ($menu->elements as $element): ?>
<?= $element->render() ?>
<? endforeach ?>
View
2  modules/gallery/views/menu_ajax_link.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li>
- <a id="<?= $menu->css_id ?>"
+ <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?>
class="g-ajax-link <?= $menu->css_class ?>"
href="<?= $menu->url ?>"
title="<?= $menu->label->for_html_attr() ?>"
View
2  modules/gallery/views/menu_dialog.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li>
- <a id="<?= $menu->css_id ?>"
+ <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?>
class="g-dialog-link <?= $menu->css_class ?>"
href="<?= $menu->url ?>"
title="<?= $menu->label->for_html_attr() ?>">
View
2  modules/gallery/views/menu_link.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li>
- <a id="<?= $menu->css_id ?>"
+ <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?>
class="g-menu-link <?= $menu->css_class ?>"
href="<?= $menu->url ?>"
title="<?= $menu->label->for_html_attr() ?>">
View
2  themes/wind/views/page.html.php
@@ -91,7 +91,7 @@
<div id="g-site-menu" style="visibility: hidden">
<?= $theme->site_menu() ?>
</div>
- <script> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script>
+ <script type="text/javascript"> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script>
<?= $theme->header_bottom() ?>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.