summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-06 11:39:11 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-06 11:39:11 -0700
commit5835715e49f98943c561d6cee67840488c428175 (patch)
tree4a48034bc1f3e4b279b8791dbc7c30b5d21f8cac
parentab1fc6ad533968ac7cb1d0506e989f549935b7aa (diff)
parentcd92b2ed85f063d990412601c19eeed1783be7c4 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
-rw-r--r--modules/gallery/helpers/gallery_menu.php6
-rw-r--r--modules/gallery/tests/Xss_Security_Test.php32
-rw-r--r--modules/info/views/info_block.html.php11
-rw-r--r--modules/notification/helpers/notification_menu.php16
-rw-r--r--themes/admin_default/views/admin.html.php4
-rw-r--r--themes/default/css/screen.css12
-rw-r--r--themes/default/images/avatar.jpgbin914 -> 1172 bytes
-rw-r--r--themes/default/images/ico-notify-add.pngbin1469 -> 0 bytes
-rw-r--r--themes/default/images/ico-notify-remove.pngbin1500 -> 0 bytes
-rw-r--r--themes/default/images/ico-view-album.pngbin345 -> 0 bytes
10 files changed, 22 insertions, 59 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())));
}
}
}
diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php
index c1c880ad..efb5f62c 100644
--- a/themes/admin_default/views/admin.html.php
+++ b/themes/admin_default/views/admin.html.php
@@ -42,8 +42,8 @@
<div id="gHeader">
<?= $theme->admin_header_top() ?>
<ul id="gLoginMenu">
- <li class="first"><?= html::anchor("albums/1", "Browse the Gallery") ?></li>
- <li id="gLogoutLink"><a href="<?= url::site("logout?continue=albums/1&csrf=$csrf") ?>">Logout</a></li>
+ <li class="first"><?= html::anchor("albums/1", t("Browse the Gallery")) ?></li>
+ <li id="gLogoutLink"><a href="<?= url::site("logout?continue=albums/1&csrf=$csrf") ?>"><?= t("Logout") ?></a></li>
</ul>
<a href="<?= url::site("albums/1") ?>"><img src="<?= url::file("themes/default/images/logo.png") ?>" id="gLogo" alt="<?= t("Gallery 3: Your Photos on Your Web Site") ?>" /></a>
<div id="gSiteAdminMenu" style="display: none">
diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css
index 0dcfd75f..71711147 100644
--- a/themes/default/css/screen.css
+++ b/themes/default/css/screen.css
@@ -602,18 +602,6 @@ form .gError,
width: 43px !important;
}
-#gViewMenu #gAlbumLink {
- background-image: url('../images/ico-view-album.png');
-}
-
-#gViewMenu #gAddNotifyLink {
- background-image: url('../images/ico-notify-add.png');
-}
-
-#gViewMenu #gRemoveNotifyLink {
- background-image: url('../images/ico-notify-remove.png');
-}
-
#gViewMenu #gHybridLink {
background-image: url('../images/ico-view-hybrid.png');
}
diff --git a/themes/default/images/avatar.jpg b/themes/default/images/avatar.jpg
index 2e76b12b..acad9314 100644
--- a/themes/default/images/avatar.jpg
+++ b/themes/default/images/avatar.jpg
Binary files differ
diff --git a/themes/default/images/ico-notify-add.png b/themes/default/images/ico-notify-add.png
deleted file mode 100644
index 937bfd4f..00000000
--- a/themes/default/images/ico-notify-add.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-notify-remove.png b/themes/default/images/ico-notify-remove.png
deleted file mode 100644
index 8c0f29ca..00000000
--- a/themes/default/images/ico-notify-remove.png
+++ /dev/null
Binary files differ
diff --git a/themes/default/images/ico-view-album.png b/themes/default/images/ico-view-album.png
deleted file mode 100644
index 20b5af20..00000000
--- a/themes/default/images/ico-view-album.png
+++ /dev/null
Binary files differ