diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/helpers/gallery_menu.php | 6 | ||||
-rw-r--r-- | modules/gallery/tests/Xss_Security_Test.php | 32 | ||||
-rw-r--r-- | modules/info/views/info_block.html.php | 11 | ||||
-rw-r--r-- | modules/notification/helpers/notification_menu.php | 16 |
4 files changed, 20 insertions, 45 deletions
diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index 854086c1..9729a868 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -100,12 +100,6 @@ class gallery_menu_Core { ->url("#") ->css_class("gFullSizeLink")); } - $menu - ->append(Menu::factory("link") - ->id("album") - ->label(t("Return to album")) - ->url($theme->item()->parent()->url("show={$theme->item->id}")) - ->css_id("gAlbumLink")); } static function admin($menu, $theme) { diff --git a/modules/gallery/tests/Xss_Security_Test.php b/modules/gallery/tests/Xss_Security_Test.php index 03151c8c..e179482c 100644 --- a/modules/gallery/tests/Xss_Security_Test.php +++ b/modules/gallery/tests/Xss_Security_Test.php @@ -18,41 +18,9 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Xss_Security_Test extends Unit_Test_Case { - - static function scan_php_file($file, &$cache) { - $code = file_get_contents($file); - $raw_tokens = token_get_all($code); - unset($code); - - $tokens = array(); - $func_token_list = array("t" => array(), "t2" => array()); - $token_number = 0; - // Filter out HTML / whitespace, and build a lookup for global function calls. - foreach ($raw_tokens as $token) { - if ((!is_array($token)) || (($token[0] != T_WHITESPACE) && ($token[0] != T_INLINE_HTML))) { - if (is_array($token)) { - if ($token[0] == T_STRING && in_array($token[1], array("t", "t2"))) { - $func_token_list[$token[1]][] = $token_number; - } - } - $tokens[] = $token; - $token_number++; - } - } - unset($raw_tokens); - - if (!empty($func_token_list["t"])) { - l10n_scanner::_parse_t_calls($tokens, $func_token_list["t"], $cache); - } - if (!empty($func_token_list["t2"])) { - l10n_scanner::_parse_plural_calls($tokens, $func_token_list["t2"], $cache); - } - } - public function find_unescaped_variables_in_views_test() { foreach (glob("*/*/views/*.php") as $view) { $expr = null; - $line = null; $level = 0; $php = 0; $str = null; diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index db664894..f8e5f35e 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -17,6 +17,17 @@ <td><?= p::clean($item->name) ?></td> </tr> <? endif ?> + <? if ($item->id != 1): ?> + <? $parent = $item->parent(); ?> + <tr> + <th><?= t("Album: ") ?></th> + <td> + <a href="<?= url::site("albums/{$parent->id}?show=$item->id") ?>"> + <?= p::clean($parent->title) ?> + </a> + </td> + </tr> + <? endif ?> <? if ($item->captured): ?> <tr> <th><?= t("Captured:") ?></th> diff --git a/modules/notification/helpers/notification_menu.php b/modules/notification/helpers/notification_menu.php index 87927874..696aad62 100644 --- a/modules/notification/helpers/notification_menu.php +++ b/modules/notification/helpers/notification_menu.php @@ -18,19 +18,21 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class notification_menu_Core { - static function album($menu, $theme) { + static function site($menu, $theme) { if (!user::active()->guest) { $item = $theme->item(); - - if ($item) { + + if ($item && $item->is_album()) { $watching = notification::is_watching($item); - $menu + $watching ? $label = t("Remove notifications") : $label = t("Enable notifications"); + + $menu->get("options_menu") ->append(Menu::factory("link") ->id("watch") - ->label(t("Enable notifications for this album")) - ->url(url::site("notification/watch/$item->id?csrf=" . access::csrf_token())) - ->css_id($watching ? "gRemoveNotifyLink" : "gAddNotifyLink")); + ->label($label) + ->css_id("gNotifyLink") + ->url(url::site("notification/watch/$item->id?csrf=" . access::csrf_token()))); } } } |