From d9e4ad79bbebb3f439df4403c668271c86c19935 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 25 Jun 2009 08:14:34 -0700 Subject: 1) Move the digibug css in the default and admin_default themes 2) Remove most of the marketing cruft on the admin pages 3) Change the name of the admin settings to just Digibug 4) Remove the "switch on mouseover" approach --- themes/admin_default/css/screen.css | 93 +++++++++++++++++++++++++++ themes/admin_default/images/digibug_logo.png | Bin 0 -> 17296 bytes themes/default/css/screen.css | 25 ++++--- 3 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 themes/admin_default/images/digibug_logo.png (limited to 'themes') diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index 862f1fc1..1653f115 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -9,6 +9,8 @@ * 4) Content blocks in specific layout containers * 5) Browser hacks * 6) jQuery and jQuery UI + * 7) Server Add + * 8) Digibug Print Administration */ /** ******************************************************************* @@ -436,3 +438,94 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { width: 150px; overflow: hidden; } + +/** ******************************************************************* + * 8) Digibug Print Administration + **********************************************************************/ +.gAdminDigibugIntro { + background-image: url(../images/digibug_logo.png); + background-repeat: no-repeat; + padding-bottom: 20px; + width: 820px; +} + +.gAdminDigibugIntro p { + font-family: Trebuchet MS,Arial,Verdana,Helvetica,sans-serif; + font-size: 1.3em; + font-weight: bold; + padding-left: 5px; + padding-top: 15px; + text-indent: 110px; +} + +.gDigibugTab { + width: 820px; + height: 420px; +} + +.gDigibugTab .gDigibugTitle { + font-family: Georgia; + font-size: 20px; + font-weight: bold; + padding-bottom: 10px; +} + +.gDigibugTab .gDigibugText { + font-size: 12px; + font-weight: bold; + line-height: 17px; + padding-bottom: 15px; +} + +.gDigibugListItems ul { + list-style-type: disc; + padding-left: 20px; + font-size: 12px; + font-weight: bold; + line-height: 15px; +} + +.gDigibugListItems ul li{ + padding-top: 10px; +} + +.gDigibugRounded { + background-color:#5C9CCC; + color: white; + width: 308px; + height: 45px; + text-align: center; + line-height: 15px; + margin-top: 10px; + font-weight: bold; + font-size: 12px; + margin-left: 60px; + margin-right: -50px; + margin-left: 20px; + margin-right: 0px; +} + +.gDigibugRounded a { + color: white !important; + font-weight: bold; + text-decoration: underline; +} + +.gDigibugSignIn { + width: 115px; + float: left; +} + +.gDigibugSignIn a { + color: black; + font-size: 16px; + font-weight: bold; + text-decoration: underline; +} + +.gDigibugAdvancedForm { + float: left; + padding-left: 30px; + width: 180px; +} + diff --git a/themes/admin_default/images/digibug_logo.png b/themes/admin_default/images/digibug_logo.png new file mode 100644 index 00000000..5eac2c7d Binary files /dev/null and b/themes/admin_default/images/digibug_logo.png differ diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index c7918fc0..671b259d 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -4,15 +4,16 @@ * @requires YUI reset, font, grids CSS * * Sheet organization: - * 1) Basic HTML elements - * 2) Reusable classes - * 3) Reusable content blocks - * 4) Page layout containers - * 5) Content blocks in specific layout containers - * 6) Navigation and menus - * 7) Browser hacks - * 8) jQuery and jQuery UI - * 9) Right-to-left language styles + * 1) Basic HTML elements + * 2) Reusable classes + * 3) Reusable content blocks + * 4) Page layout containers + * 5) Content blocks in specific layout containers + * 6) Navigation and menus + * 7) Browser hacks + * 8) jQuery and jQuery UI + * 9) Right-to-left language styles + * 10) Digibug Print */ /** ******************************************************************* @@ -1049,4 +1050,8 @@ form .gError, .rtl .gButtonSet li, .rtl .ui-icon-left .ui-icon { float: right; -} \ No newline at end of file +} + +/** ******************************************************************* + * 10) Digibug Print + **********************************************************************/ -- cgit v1.2.3 From 627b5e144caefb7ff48224a4bdc8faae2debdbd7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 25 Jun 2009 08:53:04 -0700 Subject: This change to the default/css/screen.css file was overlooked --- themes/default/css/screen.css | 3 +++ 1 file changed, 3 insertions(+) (limited to 'themes') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 671b259d..7075494d 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -1055,3 +1055,6 @@ form .gError, /** ******************************************************************* * 10) Digibug Print **********************************************************************/ +.gDigibugPrintButton { + float: left; +} -- cgit v1.2.3 From 1b263c312f621bc3439d0c6b60645c01424174aa Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 25 Jun 2009 18:26:31 -0700 Subject: Replace the crappy temporary print image with one that is more consistent with the theme. Thanks again Ben Dunkle. --- themes/default/images/ico-print.png | Bin 4411 -> 989 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'themes') diff --git a/themes/default/images/ico-print.png b/themes/default/images/ico-print.png index 087e6694..b82a8e1e 100644 Binary files a/themes/default/images/ico-print.png and b/themes/default/images/ico-print.png differ -- cgit v1.2.3 From e2e1aa06834125f10e03f929a41e527ec7c2f8ea Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 25 Jun 2009 21:41:54 -0700 Subject: 1) Rename the basic_company_id and basic_event_id to default_*_id 2) Removed the tabs on the digibug admin page word count is now at 35. 3) Added a default link which resets the event and company id's to gallery's ids --- modules/digibug/controllers/admin_digibug.php | 34 +++++++++--------- modules/digibug/controllers/digibug.php | 14 ++++---- modules/digibug/helpers/digibug_installer.php | 4 +-- themes/admin_default/css/screen.css | 52 +++++---------------------- 4 files changed, 33 insertions(+), 71 deletions(-) (limited to 'themes') diff --git a/modules/digibug/controllers/admin_digibug.php b/modules/digibug/controllers/admin_digibug.php index 8263fc83..9b75cb11 100644 --- a/modules/digibug/controllers/admin_digibug.php +++ b/modules/digibug/controllers/admin_digibug.php @@ -22,24 +22,14 @@ class Admin_Digibug_Controller extends Admin_Controller { print $this->_get_view(); } - public function basic() { - access::verify_csrf(); - - module::set_var("digibug", "mode", "basic"); - message::success(t("Successfully set Digibug mode to basic")); - - url::redirect("admin/digibug"); - } - - public function advanced() { + public function update() { access::verify_csrf(); $form = $this->_get_form(); if ($form->validate()) { module::set_var("digibug", "company_id", $form->group->company_id->value); module::set_var("digibug", "event_id", $form->group->event_id->value); - module::set_var("digibug", "mode", "advanced"); - message::success(t("Successfully set Digibug mode to advanced")); + message::success(t("Successfully updated Digibug company and event id's")); url::redirect("admin/digibug"); } @@ -47,18 +37,28 @@ class Admin_Digibug_Controller extends Admin_Controller { print $this->_get_view($form); } + public function default_settings() { + access::verify_csrf(); + + module::set_var("digibug", "company_id", module::get_var("digibug", "default_company_id")); + module::set_var("digibug", "event_id", module::get_var("digibug", "default_event_id")); + message::success(t("Successfully set Digibug company and event id's to default")); + + url::redirect("admin/digibug"); + } + private function _get_view($form=null) { $v = new Admin_View("admin.html"); $v->content = new View("admin_digibug.html"); - $v->content->mode = module::get_var("digibug", "mode", "basic"); $v->content->form = empty($form) ? $this->_get_form() : $form; return $v; } private function _get_form() { - $form = new Forge("admin/digibug/advanced", "", "post", - array("id" => "gAdminForm")); - $group = $form->group("group"); + $form = new Forge("admin/digibug/update", "", "post", + array("id" => "gDigibugForm")); + $group = $form->group("group") + ->label(t("Enter your account information.")); $group->input("company_id") ->label(t("Company Id")) ->rules("required") @@ -67,7 +67,7 @@ class Admin_Digibug_Controller extends Admin_Controller { ->label(t("Event Id")) ->rules("required") ->value(module::get_var("digibug", "event_id", "")); - $group->submit("submit")->value(t("Submit")); + $group->submit("")->value(t("Submit")); return $form; } diff --git a/modules/digibug/controllers/digibug.php b/modules/digibug/controllers/digibug.php index 25a9912a..6900c65a 100644 --- a/modules/digibug/controllers/digibug.php +++ b/modules/digibug/controllers/digibug.php @@ -29,13 +29,11 @@ class Digibug_Controller extends Controller { $proxy->save(); $url = url::abs_site("digibug/print_proxy/{$proxy->uuid}"); - if (module::get_var("digibug", "mode", "basic")) { - $company_id = module::get_var("digibug", "basic_company_id"); - $event_id = module::get_var("digibug", "basic_event_id"); - } else { - $company_id = module::get_var("digibug", "company_id"); - $event_id = module::get_var("digibug", "event_id"); - } + $company_id = module::get_var("digibug", "company_id", + module::get_var("digibug", "default_company_id")); + $event_id = module::get_var("digibug", "event_id", + module::get_var("digibug", "default_event_id")); + $v = new View("digibug_form.html"); $v->order_parms = array( "digibug_api_version" => "100", @@ -50,7 +48,7 @@ class Digibug_Controller extends Controller { "image_width_1" => $item->width, "thumb_height_1" => $item->thumb_height, "thumb_width_1" => $item->thumb_width, - "title_1" => $item->title); + "title_1" => p::clean($item->title)); print $v; } diff --git a/modules/digibug/helpers/digibug_installer.php b/modules/digibug/helpers/digibug_installer.php index 83b58351..be2b8a6b 100644 --- a/modules/digibug/helpers/digibug_installer.php +++ b/modules/digibug/helpers/digibug_installer.php @@ -28,8 +28,8 @@ class digibug_installer { PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - module::set_var("digibug", "basic_company_id", "3153"); - module::set_var("digibug", "basic_event_id", "8491"); + module::set_var("digibug", "default_company_id", "3153"); + module::set_var("digibug", "default_event_id", "8491"); module::set_var("digibug", "mode", "basic"); module::set_version("digibug", 1); diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index 1653f115..d66115ef 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -458,18 +458,11 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { text-indent: 110px; } -.gDigibugTab { +.gDigibugAccount { width: 820px; height: 420px; } -.gDigibugTab .gDigibugTitle { - font-family: Georgia; - font-size: 20px; - font-weight: bold; - padding-bottom: 10px; -} - .gDigibugTab .gDigibugText { font-size: 12px; font-weight: bold; @@ -477,40 +470,6 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { padding-bottom: 15px; } -.gDigibugListItems ul { - list-style-type: disc; - padding-left: 20px; - font-size: 12px; - font-weight: bold; - line-height: 15px; -} - -.gDigibugListItems ul li{ - padding-top: 10px; -} - -.gDigibugRounded { - background-color:#5C9CCC; - color: white; - width: 308px; - height: 45px; - text-align: center; - line-height: 15px; - margin-top: 10px; - font-weight: bold; - font-size: 12px; - margin-left: 60px; - margin-right: -50px; - margin-left: 20px; - margin-right: 0px; -} - -.gDigibugRounded a { - color: white !important; - font-weight: bold; - text-decoration: underline; -} - .gDigibugSignIn { width: 115px; float: left; @@ -523,9 +482,14 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { text-decoration: underline; } -.gDigibugAdvancedForm { +#gDigibugForm { float: left; padding-left: 30px; - width: 180px; + width: 220px; } +.gDigibugDefault { + clear: none; + float: left; + margin: .3em 1em; +} -- cgit v1.2.3 From 42a5bd20a550a9edb5ec84625037b9d85889ff63 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 26 Jun 2009 07:51:29 -0700 Subject: 1) Move the generation of script tags to gallery_theme::head and gallery_theme::admin_head. This allows us to potentially manage the scripts like we do in g2 (single file and compressed) 2) Change Theme_View::_call to always call the gallery_theme::$function first. --- modules/gallery/helpers/gallery_theme.php | 20 ++++++++++++++++++++ modules/gallery/libraries/Theme_View.php | 25 +++++++++++++++++++++++-- themes/admin_default/views/admin.html.php | 10 +--------- themes/default/views/page.html.php | 12 ------------ 4 files changed, 44 insertions(+), 23 deletions(-) (limited to 'themes') diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index a96c8f5b..24f4129b 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -21,6 +21,18 @@ class gallery_theme_Core { static function head($theme) { $session = Session::instance(); $buf = ""; + $buf .= html::script("lib/jquery.js"); + $buf .= html::script("lib/jquery.form.js"); + $buf .= html::script("lib/jquery-ui.js"); + $buf .= html::script("lib/gallery.common.js"); + $buf .= html::script("lib/gallery.dialog.js"); + $buf .= html::script("lib/gallery.form.js"); + $buf .= html::script("lib/superfish/js/superfish.js"); + if ($theme->page_type == 'photo') { + $buf .= html::script("lib/jquery.scrollTo.js"); + $buf .= html::script("lib/jquery.localscroll.js"); + } + $buf .= html::script($theme->url("js/ui.init.js", false, true)); if ($session->get("debug")) { $buf .= ""; @@ -79,6 +91,14 @@ class gallery_theme_Core { static function admin_head($theme) { $session = Session::instance(); $buf = ""; + $buf .= html::script("lib/jquery.js"); + $buf .= html::script("lib/jquery.form.js"); + $buf .= html::script("lib/jquery-ui.js"); + $buf .= html::script("lib/gallery.common.js"); + $buf .= html::script("lib/gallery.dialog.js"); + $buf .= html::script("lib/superfish/js/superfish.js"); + $buf .= html::script($theme->url("js/jquery.dropshadow.js", false, true)); + $buf .= html::script($theme->url("js/ui.init.js", false, true)); if ($session->get("debug")) { $buf .= ""; diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 7b2ca840..5235fabb 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -68,9 +68,9 @@ class Theme_View_Core extends View { return module::get_var("gallery", "thumb_size", 200) / 200; } - public function url($path, $absolute_url=false) { + public function url($path, $absolute_url=false, $no_root=false) { $arg = "themes/{$this->theme_name}/$path"; - return $absolute_url ? url::abs_file($arg) : url::file($arg); + return $absolute_url ? url::abs_file($arg) : $no_root ? $arg : url::file($arg); } public function item() { @@ -192,7 +192,28 @@ class Theme_View_Core extends View { case "thumb_info": case "thumb_top": $blocks = array(); + if (method_exists("gallery_theme", $function)) { + switch (count($args)) { + case 0: + $blocks[] = gallery_theme::$function($this); + break; + case 1: + $blocks[] = gallery_theme::$function($this, $args[0]); + break; + case 2: + $blocks[] = gallery_theme::$function($this, $args[0], $args[1]); + break; + default: + $blocks[] = call_user_func_array( + array("gallery_theme", $function), + array_merge(array($this), $args)); + } + + } foreach (module::active() as $module) { + if ($module->name == "gallery") { + continue; + } $helper_class = "{$module->name}_theme"; if (method_exists($helper_class, $function)) { $blocks[] = call_user_func_array( diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index b7cfaa40..dfbafe31 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -20,15 +20,7 @@ " media="screen,print,projection" /> - - - - - - - - - admin_head() ?> + admin_head() ?> body_attributes() ?>> diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index f6286f95..c74d4097 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -49,18 +49,6 @@ - - - - - - - - page_type == 'photo'): ?> - - - - head() ?> -- cgit v1.2.3 From 84e98e830c4967c277dfcb5bb6d18c0ec3313355 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 26 Jun 2009 08:25:24 -0700 Subject: Move the inclusion of photo and movie specific javascript into gallery_theme --- modules/gallery/helpers/gallery_theme.php | 4 ++++ themes/default/views/movie.html.php | 1 - themes/default/views/photo.html.php | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index 24f4129b..0679087e 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -31,6 +31,10 @@ class gallery_theme_Core { if ($theme->page_type == 'photo') { $buf .= html::script("lib/jquery.scrollTo.js"); $buf .= html::script("lib/jquery.localscroll.js"); + $buf .= html::script("lib/gallery.show_full_size.js"); + } + if ($theme->page_type == 'movie') { + $buf .= html::script("lib/flowplayer.js"); } $buf .= html::script($theme->url("js/ui.init.js", false, true)); if ($session->get("debug")) { diff --git a/themes/default/views/movie.html.php b/themes/default/views/movie.html.php index e8559697..134e3571 100644 --- a/themes/default/views/movie.html.php +++ b/themes/default/views/movie.html.php @@ -1,5 +1,4 @@ -
photo_top() ?> diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php index 1c3b81a7..4765a4e3 100644 --- a/themes/default/views/photo.html.php +++ b/themes/default/views/photo.html.php @@ -2,7 +2,6 @@ item())): ?> -
+ "> +

- + +

+ +
    +
  • + +
  • +
+ +

+ register with Digibug and enter your Digibug id in the Advanced Settings page you can make money off of your photos!", + array("signup_url" => "http://www.digibug.com/signup.php", + "advanced_settings_url" => url::site("admin/advanced_settings"))) ?>

-
-
-
- -

- -
-
diff --git a/modules/digibug/views/digibug_form.html.php b/modules/digibug/views/digibug_form.html.php index e18cbc18..c6994cbe 100644 --- a/modules/digibug/views/digibug_form.html.php +++ b/modules/digibug/views/digibug_form.html.php @@ -1,16 +1,11 @@ - - - - + diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index d66115ef..f4173d4b 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -439,57 +439,3 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { overflow: hidden; } -/** ******************************************************************* - * 8) Digibug Print Administration - **********************************************************************/ -.gAdminDigibugIntro { - background-image: url(../images/digibug_logo.png); - background-repeat: no-repeat; - padding-bottom: 20px; - width: 820px; -} - -.gAdminDigibugIntro p { - font-family: Trebuchet MS,Arial,Verdana,Helvetica,sans-serif; - font-size: 1.3em; - font-weight: bold; - padding-left: 5px; - padding-top: 15px; - text-indent: 110px; -} - -.gDigibugAccount { - width: 820px; - height: 420px; -} - -.gDigibugTab .gDigibugText { - font-size: 12px; - font-weight: bold; - line-height: 17px; - padding-bottom: 15px; -} - -.gDigibugSignIn { - width: 115px; - float: left; -} - -.gDigibugSignIn a { - color: black; - font-size: 16px; - font-weight: bold; - text-decoration: underline; -} - -#gDigibugForm { - float: left; - padding-left: 30px; - width: 220px; -} - -.gDigibugDefault { - clear: none; - float: left; - margin: .3em 1em; -} diff --git a/themes/admin_default/images/digibug_logo.png b/themes/admin_default/images/digibug_logo.png deleted file mode 100644 index 5eac2c7d..00000000 Binary files a/themes/admin_default/images/digibug_logo.png and /dev/null differ -- cgit v1.2.3 From aad0dd357f44c75703e4d6368a1869a83e7ee8a2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 27 Jun 2009 16:27:06 -0700 Subject: Create a new thumb_menu() and convert Digibug over to use it. 1) Eliminate digibug_album.html 2) Get rid of the $(document).ready() in digibug.js and rename popUp() to digibug_popup() then just make direct calls to digibug_popup() in the menu urls. --- modules/digibug/helpers/digibug_menu.php | 26 +++++++++++++++++++------- modules/digibug/helpers/digibug_theme.php | 11 ----------- modules/digibug/js/digibug.js | 15 +++------------ modules/digibug/views/digibug_album.html.php | 8 -------- modules/gallery/helpers/gallery_menu.php | 3 +++ modules/gallery/libraries/Theme_View.php | 10 +++++++--- themes/default/views/album.html.php | 1 + 7 files changed, 33 insertions(+), 41 deletions(-) delete mode 100644 modules/digibug/views/digibug_album.html.php (limited to 'themes') diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php index 6d127d72..4b8db5a2 100644 --- a/modules/digibug/helpers/digibug_menu.php +++ b/modules/digibug/helpers/digibug_menu.php @@ -28,12 +28,24 @@ class digibug_menu { static function photo($menu, $theme) { $item = $theme->item(); - $csrf = access::csrf_token(); - $menu - ->append(Menu::factory("link") - ->id("digibug") - ->label(t("Print with Digibug")) - ->url(url::site("digibug/print_photo/$item->id?csrf=$csrf")) - ->css_id("gDigibugLink")); + $menu->append( + Menu::factory("link") + ->id("digibug") + ->label(t("Print with Digibug")) + ->url("javascript:digibug_popup('" . + url::site("digibug/print_photo/$item->id?csrf=$theme->csrf") . "')") + ->css_id("gDigibugLink")); + } + + static function thumb($menu, $theme, $item) { + if ($item->type == "photo" && access::can("view_full", $item)) { + $menu->append( + Menu::factory("link") + ->id("digibug") + ->label(t("Print with Digibug")) + ->url("javascript:digibug_popup('" . + url::site("digibug/print_photo/$item->id?csrf=$theme->csrf") . "')") + ->css_id("gDigibugLink")); + } } } diff --git a/modules/digibug/helpers/digibug_theme.php b/modules/digibug/helpers/digibug_theme.php index a8e7e5b2..3b5be3b3 100644 --- a/modules/digibug/helpers/digibug_theme.php +++ b/modules/digibug/helpers/digibug_theme.php @@ -21,15 +21,4 @@ class digibug_theme_Core { static function head($theme) { return html::script("modules/digibug/js/digibug.js"); } - - static function thumb_bottom($theme, $child) { - if ($theme->page_type() == "album" && $child->type == "photo" && - access::can("view_full", $child)) { - $v = new View("digibug_album.html"); - $v->id = $child->id; - $v->title = t("Print photo with Digibug"); - return $v->render(); - } - return ""; - } } diff --git a/modules/digibug/js/digibug.js b/modules/digibug/js/digibug.js index 456dfecb..78ca8cf3 100644 --- a/modules/digibug/js/digibug.js +++ b/modules/digibug/js/digibug.js @@ -1,17 +1,8 @@ -$(document).ready(function() { - $(".gDigibugPrintButton a").click(function(e) { - e.preventDefault(); - return popUp(e.currentTarget.href, { width: 800, height: 600 } ); - }); - $("#gDigibugLink").click(function(e) { - e.preventDefault(); - return popUp(e.currentTarget.href, { width: 800, height: 600 } ); - }); -}); - -function popUp(url, options) { +function digibug_popup(url, options) { options = $.extend({ /* default options */ + width: '800', + height: '600', target: 'dbPopWin', scrollbars: 'yes', resizable: 'no', diff --git a/modules/digibug/views/digibug_album.html.php b/modules/digibug/views/digibug_album.html.php deleted file mode 100644 index 2fd8803b..00000000 --- a/modules/digibug/views/digibug_album.html.php +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index a25832fe..1f1e1ce2 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -94,6 +94,9 @@ class gallery_menu_Core { static function tag($menu, $theme) { } + static function thumb($menu, $theme, $item) { + } + static function photo($menu, $theme) { if (access::can("view_full", $theme->item())) { $menu->append(Menu::factory("link") diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 7b2ca840..4612a74b 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -121,16 +121,20 @@ class Theme_View_Core extends View { $this->_menu("photo"); } - private function _menu($type) { + public function thumb_menu($item) { + $this->_menu("thumb", $item); + } + + private function _menu($type, $item=null) { $menu = Menu::factory("root"); - call_user_func_array(array("gallery_menu", $type), array(&$menu, $this)); + call_user_func_array(array("gallery_menu", $type), array(&$menu, $this, $item)); foreach (module::active() as $module) { if ($module->name == "gallery") { continue; } $class = "{$module->name}_menu"; if (method_exists($class, $type)) { - call_user_func_array(array($class, $type), array(&$menu, $this)); + call_user_func_array(array($class, $type), array(&$menu, $this, $item)); } } diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php index 7e6913df..46b0d29a 100644 --- a/themes/default/views/album.html.php +++ b/themes/default/views/album.html.php @@ -19,6 +19,7 @@ thumb_img(array("class" => "gThumbnail")) ?> thumb_bottom($child) ?> + thumb_menu($child) ?>

title) ?>

\ No newline at end of file diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index d3c4de6f..e37de70e 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -57,6 +57,10 @@ h2 { font-size: 1.2em; } +#gSidebar .gBlock li { + margin-bottom: .6em; +} + h3 { font-size: 1.2em; } -- cgit v1.2.3 From c4f991bb7d7e90f8c55897f89888d9196c7e438f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 28 Jun 2009 19:45:11 -0700 Subject: Clean up the combined javascript change and refactor out the Gallery_View base class from Theme_View and Admin_View. 1) Move all the theme specific jquery stuff from gallery_theme::head() and admin_head() into the theme files. Use $theme->script() as appropriate. 2) Get rid of the extra boolean on $theme->url() that we were using so that we could call $theme->script($theme->url(...)) -- add $theme->theme_script() instead (poorly named, but still clearer than what we had before) 3) Fix the bug that combined scripts didn't work at all in the admin theme. 4) Get rid of $theme->display() in favor of new View(...) --- modules/gallery/helpers/gallery_theme.php | 24 -------- modules/gallery/libraries/Admin_View.php | 17 ++---- modules/gallery/libraries/Gallery_View.php | 89 ++++++++++++++++++++++++++++++ modules/gallery/libraries/Theme_View.php | 61 +------------------- themes/admin_default/views/admin.html.php | 10 ++++ themes/default/views/page.html.php | 24 +++++++- 6 files changed, 128 insertions(+), 97 deletions(-) create mode 100644 modules/gallery/libraries/Gallery_View.php (limited to 'themes') diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index b6b24b27..cffecb12 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -21,22 +21,6 @@ class gallery_theme_Core { static function head($theme) { $session = Session::instance(); $buf = ""; - $theme->script("lib/jquery.js"); - $theme->script("lib/jquery.form.js"); - $theme->script("lib/jquery-ui.js"); - $theme->script("lib/gallery.common.js"); - $theme->script("lib/gallery.dialog.js"); - $theme->script("lib/gallery.form.js"); - $theme->script("lib/superfish/js/superfish.js"); - if ($theme->page_type == 'photo') { - $theme->script("lib/jquery.scrollTo.js"); - $theme->script("lib/jquery.localscroll.js"); - $theme->script("lib/gallery.show_full_size.js"); - } - if ($theme->page_type == 'movie') { - $theme->script("lib/flowplayer.js"); - } - $theme->script($theme->url("js/ui.init.js", false, true)); if ($session->get("debug")) { $buf .= ""; @@ -95,14 +79,6 @@ class gallery_theme_Core { static function admin_head($theme) { $session = Session::instance(); $buf = ""; - $theme->script("lib/jquery.js"); - $theme->script("lib/jquery.form.js"); - $theme->script("lib/jquery-ui.js"); - $theme->script("lib/gallery.common.js"); - $theme->script("lib/gallery.dialog.js"); - $theme->script("lib/superfish/js/superfish.js"); - $theme->script($theme->url("js/jquery.dropshadow.js", false, true)); - $theme->script($theme->url("js/ui.init.js", false, true)); if ($session->get("debug")) { $buf .= ""; diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 7a7396eb..01496c0d 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -17,9 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Admin_View_Core extends View { - private $theme_name = null; - +class Admin_View_Core extends Gallery_View { /** * Attempts to load a view and pre-load view data. * @@ -46,15 +44,6 @@ class Admin_View_Core extends View { $this->set_global("user", user::active()); } - public function url($path, $absolute_url=false) { - $arg = "themes/{$this->theme_name}/$path"; - return $absolute_url ? url::abs_file($arg) : url::file($arg); - } - - public function display($page_name, $view_class="View") { - return new $view_class($page_name); - } - public function admin_menu() { $menu = Menu::factory("root"); gallery_menu::admin($menu, $this); @@ -109,6 +98,10 @@ class Admin_View_Core extends View { } } + if ($function == "admin_head") { + array_unshift($blocks, $this->combine_script()); + } + if (Session::instance()->get("debug")) { if ($function != "admin_head") { array_unshift( diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php new file mode 100644 index 00000000..f2298b7d --- /dev/null +++ b/modules/gallery/libraries/Gallery_View.php @@ -0,0 +1,89 @@ +scripts[$file] = 1; + } + + /** + * Add a script to the combined scripts list. + * @param $file the relative path to a script from the base of the active theme + * @param + */ + public function theme_script($file) { + $file = "themes/{$this->theme_name}/$file"; + $this->scripts[$file] = 1; + } + + /** + * Provide a url to a resource within the current theme. This allows us to refer to theme + * resources without naming the theme itself which makes themes easier to copy. + */ + public function url($path, $absolute_url=false) { + $arg = "themes/{$this->theme_name}/$path"; + return $absolute_url ? url::abs_file($arg) : url::file($arg); + } + + /** + * Combine a series of Javascript files into a single one and cache it in the database, then + * return a single "; + } +} \ No newline at end of file diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 25818821..8e320f44 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -17,10 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Theme_View_Core extends View { - private $theme_name = null; - private $scripts = array(); - +class Theme_View_Core extends Gallery_View { /** * Attempts to load a view and pre-load view data. * @@ -69,11 +66,6 @@ class Theme_View_Core extends View { return module::get_var("gallery", "thumb_size", 200) / 200; } - public function url($path, $absolute_url=false, $no_root=false) { - $arg = "themes/{$this->theme_name}/$path"; - return $absolute_url ? url::abs_file($arg) : $no_root ? $arg : url::file($arg); - } - public function item() { return $this->item; } @@ -86,10 +78,6 @@ class Theme_View_Core extends View { return $this->page_type; } - public function display($page_name, $view_class="View") { - return new $view_class($page_name); - } - public function site_menu() { $menu = Menu::factory("root"); if ($this->page_type != "login") { @@ -168,49 +156,6 @@ class Theme_View_Core extends View { return message::get(); } - public function script($file) { - $this->scripts[$file] = 1; - } - - /** - * Combine a series of Javascript files into a single one and cache it in the database, then - * return a single "; - } - /** * Handle all theme functions that insert module content. */ @@ -270,8 +215,8 @@ class Theme_View_Core extends View { } } - if ($function == "head" || $function == "admin_head") { - array_unshift($blocks, $this->_combine_script()); + if ($function == "head") { + array_unshift($blocks, $this->combine_script()); } if (Session::instance()->get("debug")) { diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index dfbafe31..2a91a76c 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -20,6 +20,16 @@ " media="screen,print,projection" /> + + script("lib/jquery.js") ?> + script("lib/jquery.form.js") ?> + script("lib/jquery-ui.js") ?> + script("lib/gallery.common.js") ?> + script("lib/gallery.dialog.js") ?> + script("lib/superfish/js/superfish.js") ?> + theme_script("js/jquery.dropshadow.js") ?> + theme_script("js/ui.init.js") ?> + admin_head() ?> diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index c74d4097..8b9466ac 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -49,6 +49,24 @@ + script("lib/jquery.js") ?> + script("lib/jquery.form.js") ?> + script("lib/jquery-ui.js") ?> + script("lib/gallery.common.js") ?> + script("lib/gallery.dialog.js") ?> + script("lib/gallery.form.js") ?> + script("lib/superfish/js/superfish.js") ?> + script("lib/jquery.localscroll.js") ?> + theme_script("js/ui.init.js") ?> + + head() they get combined */ ?> + page_type == "photo"): ?> + script("lib/jquery.scrollTo.js") ?> + script("lib/gallery.show_full_size.js") ?> + page_type == "movie"): ?> + script("lib/flowplayer.js") ?> + + head() ?> @@ -57,7 +75,7 @@
site_status() ?>
- display("header.html") ?> +
@@ -70,12 +88,12 @@
page_type != "login"): ?> - display("sidebar.html") ?> +
- display("footer.html") ?> +
page_bottom() ?> -- cgit v1.2.3 From 6e8a8c53e685a6c3f35f1426ab4dd6dcc18578e0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 28 Jun 2009 19:49:48 -0700 Subject: Rename $theme->url() to $theme->theme_url() for consistency wiht $theme->theme_script(). --- modules/comment/views/admin_block_recent_comments.html.php | 2 +- modules/comment/views/admin_comments.html.php | 2 +- modules/comment/views/comment.html.php | 2 +- modules/comment/views/comments.html.php | 2 +- modules/gallery/libraries/Gallery_View.php | 2 +- modules/user/views/admin_users.html.php | 2 +- themes/admin_default/views/admin.html.php | 4 ++-- themes/default/views/header.html.php | 2 +- themes/default/views/page.html.php | 6 +++--- 9 files changed, 12 insertions(+), 12 deletions(-) (limited to 'themes') diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index edaa19ae..af4d946e 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -2,7 +2,7 @@
    $comment): ?>
  • "> - " + " class="gAvatar" alt="author_name()) ?>" width="32" diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 86585c65..453cf849 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -106,7 +106,7 @@ "> - " + " class="gAvatar" alt="author_name()) ?>" width="40" diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php index ce52951b..6d2cc592 100644 --- a/modules/comment/views/comment.html.php +++ b/modules/comment/views/comment.html.php @@ -2,7 +2,7 @@
  • - " + " class="gAvatar" alt="author_name()) ?>" width="40" diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index 854f9554..d9405e5f 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -10,7 +10,7 @@

  • - " + " class="gAvatar" alt="author_name()) ?>" width="40" diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index f2298b7d..e21e83d8 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -43,7 +43,7 @@ class Gallery_View_Core extends View { * Provide a url to a resource within the current theme. This allows us to refer to theme * resources without naming the theme itself which makes themes easier to copy. */ - public function url($path, $absolute_url=false) { + public function theme_url($path, $absolute_url=false) { $arg = "themes/{$this->theme_name}/$path"; return $absolute_url ? url::abs_file($arg) : url::file($arg); } diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 542b8b8b..b469f82d 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -66,7 +66,7 @@ $user): ?> user admin ? "admin" : "" ?>"> - " + " title="" alt="name) ?>" width="20" diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 2a91a76c..62f9761f 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -14,10 +14,10 @@ media="screen,projection" /> " media="screen,projection" /> - " + " media="screen,projection" /> diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index e1e52bda..b38cffed 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -4,7 +4,7 @@ "> - " src="url("images/logo.png") ?>" /> + " src="theme_url("images/logo.png") ?>" /> diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index 8b9466ac..3ae3e155 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -23,17 +23,17 @@ - " type="image/x-icon" /> + " type="image/x-icon" /> " media="screen,print,projection" /> " media="screen" /> " media="screen,print,projection" /> - " + " media="screen,print,projection" /> page_type == 'album'): ?> -- cgit v1.2.3 From 42c82ef7f081630c15a5d354205896764348a76a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 29 Jun 2009 06:08:50 -0700 Subject: Temporary checkin to allow merge with trunk... don't integrate --- modules/gallery/libraries/Theme_View.php | 29 ++++++++++++++++++++++++- modules/organize/helpers/organize_theme.php | 3 +-- modules/server_add/helpers/server_add_theme.php | 3 +-- themes/admin_default/views/admin.html.php | 16 +------------- 4 files changed, 31 insertions(+), 20 deletions(-) (limited to 'themes') diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 25818821..c5888b4a 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -20,6 +20,7 @@ class Theme_View_Core extends View { private $theme_name = null; private $scripts = array(); + private $css = array(); /** * Attempts to load a view and pre-load view data. @@ -172,6 +173,10 @@ class Theme_View_Core extends View { $this->scripts[$file] = 1; } + public function css($file) { + $this->css[$file] = 1; + } + /** * Combine a series of Javascript files into a single one and cache it in the database, then * return a single "; } + /** + * Combine a series of Javascript files into a single one and cache it in the database, then + * return a single "; diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index dfbafe31..1361ae33 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -6,21 +6,7 @@ <?= t("Admin Dashboard") ?> " type="image/x-icon" /> - " - media="screen,projection" /> - " - media="screen,projection" /> - " - media="screen,projection" /> - " - media="screen,projection" /> - " - media="screen,projection" /> - - admin_head() ?> + admin_head() ?> body_attributes() ?>> -- cgit v1.2.3 From 6ec293dfe70665c528d803b78a2bb295633496ec Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 29 Jun 2009 08:24:42 -0700 Subject: *Note* work in progress. Implement the combined css functionality. Local url references and replace with absolute urls instead of relative. --- modules/gallery/controllers/combined.php | 46 +++++++++++++++++++++++++++++ modules/gallery/libraries/Gallery_View.php | 47 ++++++++++++++++++++++++++++-- themes/default/views/page.html.php | 2 +- 3 files changed, 91 insertions(+), 4 deletions(-) (limited to 'themes') diff --git a/modules/gallery/controllers/combined.php b/modules/gallery/controllers/combined.php index 510482db..50fe77c4 100644 --- a/modules/gallery/controllers/combined.php +++ b/modules/gallery/controllers/combined.php @@ -58,5 +58,51 @@ class Combined_Controller extends Controller { Kohana::close_buffers(false); print $content; } + + public function css($key) { + if (preg_match('/[^0-9a-f]/', $key)) { + // The key can't contain non-hex, so just terminate early + Kohana::show_404(); + } + + // We don't need to save the session for this request + Session::abort_save(); + + // Our data is immutable, so if they already have a copy then it needs no updating. + if (!empty($_SERVER["HTTP_IF_MODIFIED_SINCE"])) { + header('HTTP/1.0 304 Not Modified'); + return; + } + + $cache = Cache::instance(); + if (strpos($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") !== false ) { + $content = $cache->get("{$key}_gz"); + } + + if (empty($content)) { + $content = $cache->get($key); + } + + if (empty($content)) { + Kohana::show_404(); + } + + if (strpos($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") !== false) { + header("Content-Encoding: gzip"); + header("Cache-Control: public"); + } + + header("Content-Type: text/css; charset=UTF-8"); + header("Expires: Tue, 19 Jan 2038 00:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s T", time())); + + Kohana::close_buffers(false); + print $content; + } + + public function __call($function, $args) { + array_unshift($args, $function); + print ""; + } } diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 7000d3de..1c1dec38 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -113,12 +113,53 @@ class Gallery_View_Core extends View { protected function combine_css() { $links = array(); $key = ""; + static $PATTERN = "#url\(\s*['|\"]{0,1}(.*?)['|\"]{0,1}\s*\)#"; + foreach (array_keys($this->css) as $file) { - $links[] = ""; + $path = DOCROOT . $file; + if (file_exists($path)) { + $stats = stat($path); + $links[] = $path; + // 7 == size, 9 == mtime, see http://php.net/stat + $key = "{$key}$file $stats[7] $stats[9],"; + } else { + Kohana::log("alert", "CSS file missing: " . $file); + } + } + $key = md5($key); + $cache = Cache::instance(); + $contents = $cache->get($key); + $docroot_length = strlen(DOCROOT); + + if (empty($contents)) { + $contents = ""; + foreach ($links as $link) { + $css = file_get_contents($link); + if (preg_match_all($PATTERN, $css, $matches, PREG_SET_ORDER)) { + $search = $replace = array(); + foreach ($matches as $match) { + $relative = substr(realpath(dirname($link) . "/$match[1]"), $docroot_length); + if (!empty($relative)) { + $search[] = $match[1]; + $replace[] = url::abs_file($relative); + } else { + Kohana::log("alert", sprintf("Missing URL reference '%s' in CSS file '%s' ", + $match[1], $link)); + } + } + $css = str_replace($search, $replace, $css); + } + $contents .= $css; + } + $cache->set($key, $contents, array("css"), 30 * 84600); + if (function_exists("gzencode")) { + $cache->set("{$key}_gz", gzencode($contents, 9, FORCE_GZIP), + array("css", "gzip"), 30 * 84600); + } } - return implode("\n", $links); + return ""; } } \ No newline at end of file diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index f6984958..2e68f571 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -25,8 +25,8 @@ " type="image/x-icon" /> css("lib/yui/reset-fonts-grids.css") ?> - css("lib/themeroller/ui.base.css") ?> css("lib/superfish/css/superfish.css") ?> + css("lib/themeroller/ui.base.css") ?> theme_css("css/screen.css") ?> + script("lib/jquery.js") ?> script("lib/jquery.form.js") ?> diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index 2e68f571..519a0c39 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -29,7 +29,8 @@ css("lib/themeroller/ui.base.css") ?> theme_css("css/screen.css") ?> page_type == 'album'): ?> -- cgit v1.2.3 From fe668abcb3612ec1b769e8b976a0aec856c21426 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Mon, 29 Jun 2009 20:20:15 -0700 Subject: Fix for ticket 481 - Better plural handling for 2 messages with multiple %count variables. --- themes/admin_default/views/pager.html.php | 10 ++++++---- themes/default/views/pager.html.php | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'themes') diff --git a/themes/admin_default/views/pager.html.php b/themes/admin_default/views/pager.html.php index 8df1b030..471b4811 100644 --- a/themes/admin_default/views/pager.html.php +++ b/themes/admin_default/views/pager.html.php @@ -2,10 +2,12 @@

      $current_first_item, - "to_number" => $current_last_item, - "total" => $total_items)) ?> + $from_to_msg = t2("Item %from_number of %count", + "Items %from_number - %to_number of %count", + $total_items, + array("from_number" => $current_first_item, + "to_number" => $current_last_item, + "count" => $total_items)) ?>
    • diff --git a/themes/default/views/pager.html.php b/themes/default/views/pager.html.php index 28a39490..7cdc9bb0 100644 --- a/themes/default/views/pager.html.php +++ b/themes/default/views/pager.html.php @@ -2,10 +2,12 @@
        $current_first_item, - "to_number" => $current_last_item, - "total" => $total_items)) ?> + $from_to_msg = t2("Photo %from_number of %count", + "Photos %from_number - %to_number of %count", + $total_items, + array("from_number" => $current_first_item, + "to_number" => $current_last_item, + "count" => $total_items)) ?>
      • -- cgit v1.2.3 From 937fd1355233f44bd069e2039a14204ab0958df8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 29 Jun 2009 20:24:48 -0700 Subject: Change XXX to @todo --- themes/admin_default/views/pager.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/admin_default/views/pager.html.php b/themes/admin_default/views/pager.html.php index 471b4811..5034ec19 100644 --- a/themes/admin_default/views/pager.html.php +++ b/themes/admin_default/views/pager.html.php @@ -1,7 +1,7 @@
          - Date: Mon, 29 Jun 2009 20:55:23 -0700 Subject: Fix for ticket 86 - Make Cancel button in doalogs localizable. --- lib/gallery.dialog.js | 3 +-- themes/default/views/page.html.php | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 72c7cdf8..6d986aa0 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -50,7 +50,6 @@ function openDialog(element, on_success) { var sHref = $(element).attr("href"); var sTitle = $(element).attr("title"); var eDialog = '
          '; - // @todo Fix i18n for Cancel link var dialogWidth; $("body").append(eDialog); @@ -99,7 +98,7 @@ function openDialog(element, on_success) { } function on_form_loaded() { - var eCancel = '
          Cancel'; + var eCancel = '' + MSG_CANCEL + ''; if ($("#gDialog .submit").length) { $("#gDialog .submit").addClass("ui-state-default ui-corner-all"); $("#gDialog .submit").parent().append(eCancel); diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index 519a0c39..a21e9eff 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -49,6 +49,10 @@ script("lib/jquery.form.js") ?> script("lib/jquery-ui.js") ?> script("lib/gallery.common.js") ?> + + script("lib/gallery.dialog.js") ?> script("lib/gallery.form.js") ?> script("lib/superfish/js/superfish.js") ?> -- cgit v1.2.3 From 21f228b1aed8b32dc9856add51f4ef8a3c7ced95 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Mon, 29 Jun 2009 21:03:40 -0700 Subject: Ticket 86 (addendum) - Guard against themes that don't define MSG_CANCEL and add the message to admin_default as well. --- lib/gallery.dialog.js | 2 ++ themes/admin_default/views/admin.html.php | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'themes') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 6d986aa0..fc66323e 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -98,6 +98,8 @@ function openDialog(element, on_success) { } function on_form_loaded() { + // Should be defined (and localized) in the theme + MSG_CANCEL = MSG_CANCEL || 'Cancel'; var eCancel = '' + MSG_CANCEL + ''; if ($("#gDialog .submit").length) { $("#gDialog .submit").addClass("ui-state-default ui-corner-all"); diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index fed1afe6..36deea9e 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -21,6 +21,10 @@ script("lib/jquery.form.js") ?> script("lib/jquery-ui.js") ?> script("lib/gallery.common.js") ?> + + script("lib/gallery.dialog.js") ?> script("lib/superfish/js/superfish.js") ?> theme_script("js/jquery.dropshadow.js") ?> -- cgit v1.2.3 From 8ed6d1183b50de62d495361ff37be71fcc00d48b Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 30 Jun 2009 08:21:00 -0700 Subject: Fix for #319. Created a new view "movieplayer.html.php", which is rendered by Item_Model::movie_img(). Changed movie.html.php to use movie_img to render the movie player link. --- modules/gallery/models/item.php | 15 +++++++-------- modules/gallery/views/movieplayer.html.php | 15 +++++++++++++++ themes/default/views/movie.html.php | 18 +----------------- 3 files changed, 23 insertions(+), 25 deletions(-) create mode 100644 modules/gallery/views/movieplayer.html.php (limited to 'themes') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 430119b5..51037073 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -492,14 +492,13 @@ class Item_Model extends ORM_MPTT { * @return string */ public function movie_img($extra_attrs) { - $attrs = array_merge($extra_attrs, - array("id" => "player", - "style" => "display:block;width:400px;height:300px") - ); - return html::anchor($this->file_url(true), "", $attrs) . - ""; + $v = new View("movieplayer.html"); + $v->attrs = array_merge($extra_attrs, + array("style" => "display:block;width:{$this->width}px;height:{$this->height}px")); + if (empty($v->attrs["id"])) { + $v->attrs["id"] = "gMovieId-{$this->id}"; + } + return $v; } /** diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php new file mode 100644 index 00000000..e8cabd31 --- /dev/null +++ b/modules/gallery/views/movieplayer.html.php @@ -0,0 +1,15 @@ + +file_url(true), "", $attrs) ?> + diff --git a/themes/default/views/movie.html.php b/themes/default/views/movie.html.php index 134e3571..c2fb0e30 100644 --- a/themes/default/views/movie.html.php +++ b/themes/default/views/movie.html.php @@ -12,23 +12,7 @@
        - - - + movie_img(array("class" => "gMovie", "id" => "gMovieId-{$item->id}")) ?>

        title) ?>

        -- cgit v1.2.3 From 0b34ec4e8b1f97db0dc6807bdb3a5ece8e1b83e4 Mon Sep 17 00:00:00 2001 From: jhilden Date: Tue, 30 Jun 2009 22:22:29 -0400 Subject: UI enhancement: made the 'back to the Gallery' links a little bit easier to discover --- themes/admin_default/css/screen.css | 20 ++++++++++++++++++-- themes/admin_default/views/admin.html.php | 4 ++-- themes/default/css/fix-ie.css | 2 +- themes/default/css/screen.css | 4 ++-- themes/default/views/header.html.php | 4 ++-- 5 files changed, 25 insertions(+), 9 deletions(-) (limited to 'themes') diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index f4173d4b..629d0451 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -98,12 +98,28 @@ * 4) Content blocks in specific layout containers *********************************************************************/ -#gHeader #gLogo { +#gHeader #gLogo img { float: left; margin: -22px 10px 0 0; } -.rtl #gHeader #gLogo { +#gHeader #gLogo { + position: relative; + display: block; + text-decoration: none; +} +#gHeader #gLogo span { + display: none; + position: absolute; + top: -20px; + left: 2px; + color: #FF6600; +} +#gHeader #gLogo:hover span { + display: inline; +} + +.rtl #gHeader #gLogo img { float: left; } diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 36deea9e..1be454c3 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -44,10 +44,10 @@
        admin_header_top() ?> - ">" id="gLogo" alt="" /> + diff --git a/themes/default/css/fix-ie.css b/themes/default/css/fix-ie.css index 0b37acd2..3d9604e6 100644 --- a/themes/default/css/fix-ie.css +++ b/themes/default/css/fix-ie.css @@ -10,7 +10,7 @@ zoom: 1; } -#gHeader #gLogo { +#gHeader #gLogo img { margin-top: 5px; margin-bottom: 0; } diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index e37de70e..48ded542 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -422,7 +422,7 @@ form .gError, /* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#gHeader #gLogo { +#gHeader #gLogo img { float: left; margin: -4px 10px 0 0; } @@ -1046,7 +1046,7 @@ form .gError, .rtl input[type="submit"], .rtl input[type="reset"], .rtl .gShortForm li, -.rtl #gHeader #gLogo, +.rtl #gHeader #gLogo img, .rtl #gContent #gAlbumGrid .gItem, .rtl #gSiteMenu, .rtl .gBreadcrumbs li, diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index b38cffed..51f55b41 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -3,8 +3,8 @@ -"> - " src="theme_url("images/logo.png") ?>" /> + -- cgit v1.2.3 From 979d32759514cdff790b3fd4a5a59764edfb6b02 Mon Sep 17 00:00:00 2001 From: jhilden Date: Wed, 1 Jul 2009 02:17:38 -0400 Subject: change to the 'back to the Gallery' link from the admin. --- themes/admin_default/css/screen.css | 28 +++++++++------------------- themes/admin_default/views/admin.html.php | 4 ++-- 2 files changed, 11 insertions(+), 21 deletions(-) (limited to 'themes') diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index 629d0451..98e0905e 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -98,30 +98,20 @@ * 4) Content blocks in specific layout containers *********************************************************************/ -#gHeader #gLogo img { +#gHeader #gLogo { float: left; margin: -22px 10px 0 0; -} - -#gHeader #gLogo { - position: relative; display: block; + padding-left: 2px; + width: 105px; /* 107px - padding-left */ + height: 48px; + background-image: url('../../default/images/logo.png'); + color: gray ! important; +} +#gHeader #gLogo:hover { + color: #FF6600 ! important; text-decoration: none; } -#gHeader #gLogo span { - display: none; - position: absolute; - top: -20px; - left: 2px; - color: #FF6600; -} -#gHeader #gLogo:hover span { - display: inline; -} - -.rtl #gHeader #gLogo img { - float: left; -} #gHeader #gLoginMenu { float: none; diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 1be454c3..76f59d4a 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -47,8 +47,8 @@
      - -
    - + -- cgit v1.2.3 From 9beac1132e7d6ffec2192d5a4e54e14985218d6e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 1 Jul 2009 01:08:00 -0700 Subject: Fix a typo in the Doctype. Fixes ticket #497. --- themes/admin_default/views/admin.html.php | 2 +- themes/default/views/page.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 76f59d4a..33e7f58f 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -1,5 +1,5 @@ - diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index a21e9eff..181a2c46 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -1,5 +1,5 @@ - -- cgit v1.2.3 From 54ffea24196e8f5d88cf9d8607455f0f6aab305c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 3 Jul 2009 21:44:10 -0700 Subject: Split the clean method into two clean and purify. clean is a light weight approach using html::specialchars and purify uses HTMLPurifier to intelligently cleanse the output fields. Use purifier for text and title fields where it is likely that a user would enter html to format their data. --- modules/comment/controllers/comments.php | 4 ++-- modules/comment/helpers/comment_rss.php | 2 +- modules/comment/views/admin_block_recent_comments.html.php | 2 +- modules/comment/views/admin_comments.html.php | 4 ++-- modules/comment/views/comment.html.php | 2 +- modules/comment/views/comments.html.php | 2 +- modules/digibug/controllers/digibug.php | 2 +- modules/gallery/controllers/quick.php | 10 +++++----- modules/gallery/helpers/p.php | 4 ++++ modules/gallery/views/permissions_browse.html.php | 2 +- modules/gallery/views/simple_uploader.html.php | 6 +++--- modules/info/views/info_block.html.php | 4 ++-- modules/notification/views/comment_published.html.php | 2 +- modules/notification/views/item_added.html.php | 4 ++-- modules/notification/views/item_deleted.html.php | 2 +- modules/organize/controllers/organize.php | 10 +++++----- modules/organize/views/organize.html.php | 2 +- modules/search/views/search.html.php | 4 ++-- themes/default/views/album.html.php | 4 ++-- themes/default/views/header.html.php | 4 ++-- themes/default/views/movie.html.php | 4 ++-- themes/default/views/photo.html.php | 4 ++-- 22 files changed, 44 insertions(+), 40 deletions(-) (limited to 'themes') diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index 99ecc8e0..2840ba67 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -41,7 +41,7 @@ class Comments_Controller extends REST_Controller { "id" => $comment->id, "author_name" => p::clean($comment->author_name()), "created" => $comment->created, - "text" => p::clean($comment->text)); + "text" => p::purify($comment->text)); } print json_encode($data); break; @@ -128,7 +128,7 @@ class Comments_Controller extends REST_Controller { "id" => $comment->id, "author_name" => p::clean($comment->author_name()), "created" => $comment->created, - "text" => p::clean($comment->text)))); + "text" => p::purify($comment->text)))); } else { $view = new Theme_View("comment.html", "fragment"); $view->comment = $comment; diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index ef2d176e..746c6161 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -23,7 +23,7 @@ class comment_rss_Core { $feeds["comment/newest"] = t("All new comments"); if ($item) { $feeds["comment/item/$item->id"] = - t("Comments on %title", array("title" => p::clean($item->title))); + t("Comments on %title", array("title" => p::purify($item->title))); } return $feeds; } diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index af4d946e..893c1a63 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -10,7 +10,7 @@ created) ?> %author_name said %comment_text', array("author_name" => p::clean($comment->author_name()), - "comment_text" => text::limit_words(p::clean($comment->text), 50))); ?> + "comment_text" => text::limit_words(p::purify($comment->text), 50))); ?>
diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 453cf849..489605d5 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -122,7 +122,7 @@ has_thumb()): ?> <?= p::clean($item->title) ?>thumb_width, $item->thumb_height, 75) ?> /> @@ -132,7 +132,7 @@

created) ?>

- text) ?> + text) ?>

@@ -185,7 +185,7 @@ $("#gUploadQueueInfo").text("(completed " + stats.successful_uploads + " of " + (stats.files_queued + stats.successful_uploads + stats.upload_errors + stats.upload_cancelled + stats.queue_errors) + ")"); } - + // Auto start the upload this.startUpload(); } diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index db621006..ccb564d3 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -2,12 +2,12 @@

- id"), array("method" => "post")) ?> -
@@ -31,10 +29,16 @@ - "> + + + - + - diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index c4670a4d..0c65cd96 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -899,8 +899,14 @@ form .gError, /* Server Add */ +#gServerAdd button { + float: left; + margin-bottom: .5em; +} + #gServerAddTree { cursor: pointer; + padding-left: 4px; } #gServerAddTree li { -- cgit v1.2.3 From 58d0a5013d4cda1be0cf528b8ff08d44b123d75f Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 12 Jul 2009 11:43:41 -0600 Subject: First attempt at animating gThumbMenu. Doesn't work. --- themes/default/css/screen.css | 2 +- themes/default/js/ui.init.js | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 0c65cd96..1853a11d 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -459,7 +459,7 @@ form .gError, font-size: .7em; height: 240px; overflow: hidden; - padding: 14px 8px; + padding: 15px 8px 30px 8px; position: relative; text-align: center; width: 213px; diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index b14127f6..d5755aed 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -50,8 +50,23 @@ $(document).ready(function() { .css({ "height":"10px", "margin":"0", - "padding":"0" + "padding":"0", + "width":"16px" }); + var menuHt = $("#gContent .gThumbMenu").height(); + var bottomPos = "-" + (menuHt - 15) + "px"; + $("#gContent .gThumbMenu").css("bottom",bottomPos); + console.log("Initilizing: Placing at " + bottomPos); + $("#gContent .gThumbMenu li").hover( + function(){ + $(this).css("bottom","0"); + console.log("Placing at 0px"); + }, + function(){ + $(this).css("bottom",bottomPos); + console.log("Placing at " + bottomPos); + } + ); } // Initialize view menu -- cgit v1.2.3 From 413174e89edb36b311237aea4ab8386d75d16760 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 12 Jul 2009 16:07:16 -0600 Subject: Second attempt at showing and hiding the thumb menu. Renamed gThumbMenu to gPhotoMenu for use on both album and photo pages, eventually. --- themes/default/css/screen.css | 9 +++++---- themes/default/js/ui.init.js | 28 +++++++++++----------------- 2 files changed, 16 insertions(+), 21 deletions(-) (limited to 'themes') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 1853a11d..93b68e68 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -582,23 +582,24 @@ form .gError, margin-bottom: 0; } -/* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Photo Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#gContent .gThumbMenu { +#gContent .gPhotoMenu { bottom: 0; left: 0; position: absolute; width: 100%; } -#gContent .gThumbMenu li { +#gContent .gPhotoMenu li { border-left: none; border-right: none; } -#gContent .gThumbMenu a:hover { +#gContent .gPhotoMenu a:hover { text-decoration: none; } + /* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #gViewMenu { diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index d5755aed..37261727 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -14,8 +14,9 @@ var shortForms = new Array( $(document).ready(function() { // Remove .gMenu from thumb menu's before initializing Superfish + // @todo gallery_menu should only apply gMenu to top-level menus, submenus should be gSubMenu-N $("#gContent .gItem .gMenu").removeClass("gMenu"); - $("#gContent .gQuick + ul").addClass("gThumbMenu") + $("#gContent .gQuick + ul").addClass("gPhotoMenu"); // Initialize Superfish menus $("ul.gMenu").addClass("sf-menu"); @@ -40,31 +41,24 @@ $(document).ready(function() { $(dialogLinks[i]).bind("click", handleDialogEvent); } - // gThumbMenu - if ($("#gContent .gThumbMenu").length) { - $("#gContent .gThumbMenu li").addClass("ui-state-default"); - // ui-icon-triangle-1-n - $("#gContent .gThumbMenu li a") + // Initialize photo menus + if ($("#gContent .gPhotoMenu").length) { + $("#gContent .gPhotoMenu li").addClass("ui-state-default"); + $("#gContent .gPhotoMenu li a") .not('[class]') .addClass("gButtonLink ui-icon") .css({ "height":"10px", "margin":"0", - "padding":"0", - "width":"16px" + "padding":"0" }); - var menuHt = $("#gContent .gThumbMenu").height(); - var bottomPos = "-" + (menuHt - 15) + "px"; - $("#gContent .gThumbMenu").css("bottom",bottomPos); - console.log("Initilizing: Placing at " + bottomPos); - $("#gContent .gThumbMenu li").hover( + //$(".gPhotoMenu ul").hide(); + $(".gPhotoMenu").hover( function(){ - $(this).css("bottom","0"); - console.log("Placing at 0px"); + $(this + " ul").show(); }, function(){ - $(this).css("bottom",bottomPos); - console.log("Placing at " + bottomPos); + $(this + " ul").hide(); } ); } -- cgit v1.2.3 From 895fbfd95b5e7a42dd865f4a18401fd2e1491bc2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 17:59:55 -0700 Subject: Get the thumbnail menu working. 1) Stop changing the menu classes in JS, instead allow us to specify it in the Menu class itself and then set it to be gThumbMenu in Theme_View 2) Move the gThumbMenu init code to the bottom of the $(document).ready() block; something in there was interfering with it. --- modules/gallery/libraries/Menu.php | 9 ++++-- modules/gallery/libraries/Theme_View.php | 11 ++++---- themes/default/css/screen.css | 8 +++--- themes/default/js/ui.init.js | 47 ++++++++++++++++---------------- 4 files changed, 38 insertions(+), 37 deletions(-) (limited to 'themes') diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index 162cd3b0..a39b59a5 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -136,7 +136,9 @@ class Menu_Core extends Menu_Element { return new Menu_Element_Dialog($type); case "root": - return new Menu("root"); + $menu = new Menu("root"); + $menu->css_class("gMenu"); + return $menu; case "submenu": return new Menu("submenu"); @@ -156,6 +158,7 @@ class Menu_Core extends Menu_Element { } } } + return $this; } public function __construct($type) { @@ -206,8 +209,8 @@ class Menu_Core extends Menu_Element { } public function __toString() { - $html = $this->is_root ? "
    " : - "
  • label\">$this->label
      "; + $html = $this->is_root ? "
        css_class\">" : + "
      • label\">$this->label
          "; $html .= implode("\n", $this->elements); $html .= $this->is_root ? "
        " : "
      "; return $html; diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 75138f25..fa45ec89 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -99,19 +99,19 @@ class Theme_View_Core extends Gallery_View { } public function album_menu() { - $this->_menu("album"); + print $this->_menu("album"); } public function tag_menu() { - $this->_menu("tag"); + print $this->_menu("tag"); } public function photo_menu() { - $this->_menu("photo"); + print $this->_menu("photo"); } public function thumb_menu($item) { - $this->_menu("thumb", $item); + print $this->_menu("thumb", $item)->css_class("gThumbMenu"); } private function _menu($type, $item=null) { @@ -127,8 +127,7 @@ class Theme_View_Core extends Gallery_View { } } - $menu->compact(); - print $menu; + return $menu->compact(); } public function pager() { diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 93b68e68..c0954690 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -582,21 +582,21 @@ form .gError, margin-bottom: 0; } -/* Photo Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#gContent .gPhotoMenu { +#gContent .gThumbMenu { bottom: 0; left: 0; position: absolute; width: 100%; } -#gContent .gPhotoMenu li { +#gContent .gThumbMenu li { border-left: none; border-right: none; } -#gContent .gPhotoMenu a:hover { +#gContent .gThumbMenu a:hover { text-decoration: none; } diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 37261727..ac7ef8d2 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -15,8 +15,6 @@ $(document).ready(function() { // Remove .gMenu from thumb menu's before initializing Superfish // @todo gallery_menu should only apply gMenu to top-level menus, submenus should be gSubMenu-N - $("#gContent .gItem .gMenu").removeClass("gMenu"); - $("#gContent .gQuick + ul").addClass("gPhotoMenu"); // Initialize Superfish menus $("ul.gMenu").addClass("sf-menu"); @@ -41,28 +39,6 @@ $(document).ready(function() { $(dialogLinks[i]).bind("click", handleDialogEvent); } - // Initialize photo menus - if ($("#gContent .gPhotoMenu").length) { - $("#gContent .gPhotoMenu li").addClass("ui-state-default"); - $("#gContent .gPhotoMenu li a") - .not('[class]') - .addClass("gButtonLink ui-icon") - .css({ - "height":"10px", - "margin":"0", - "padding":"0" - }); - //$(".gPhotoMenu ul").hide(); - $(".gPhotoMenu").hover( - function(){ - $(this + " ul").show(); - }, - function(){ - $(this + " ul").hide(); - } - ); - } - // Initialize view menu if ($("#gViewMenu").length) { $("#gViewMenu ul").removeClass("gMenu").removeClass("sf-menu"); @@ -118,6 +94,29 @@ $(document).ready(function() { } ); + // Initialize thumbnail menus + if ($("#gContent .gThumbMenu").length) { + $("#gContent .gThumbMenu li").addClass("ui-state-default"); + $("#gContent .gThumbMenu li a") + .not('[class]') + .addClass("gButtonLink ui-icon") + .css({ + height: "10px", + margin: "0", + padding: "0" + }); + + $(".gThumbMenu ul").hide(); + $(".gThumbMenu").hover( + function() { + $(this).find("ul").slideDown("fast"); + }, + function() { + $(this).find("ul").slideUp("slow"); + } + ); + } + }); /** -- cgit v1.2.3 From 50cd41655a5e083de3fee5b43fd72c21ffb3dd25 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 12 Jul 2009 22:41:57 -0600 Subject: Minor style tweaks. --- themes/default/css/screen.css | 5 +++++ themes/default/js/ui.init.js | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'themes') diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index c0954690..88631e81 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -594,6 +594,11 @@ form .gError, #gContent .gThumbMenu li { border-left: none; border-right: none; + border-bottom: none; +} + +#gContent .gThumbMenu li li { + padding: .3em; } #gContent .gThumbMenu a:hover { diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index ac7ef8d2..92a42ded 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -95,24 +95,25 @@ $(document).ready(function() { ); // Initialize thumbnail menus + // @todo Toggle between north and south caret's on hover if ($("#gContent .gThumbMenu").length) { $("#gContent .gThumbMenu li").addClass("ui-state-default"); $("#gContent .gThumbMenu li a") .not('[class]') - .addClass("gButtonLink ui-icon") + .addClass("gButtonLink ui-icon ui-icon-caret-l-n") .css({ height: "10px", margin: "0", - padding: "0" + padding: "0 0 3px 0" }); $(".gThumbMenu ul").hide(); $(".gThumbMenu").hover( function() { - $(this).find("ul").slideDown("fast"); + $(this).find("ul").slideDown("fast"); }, function() { - $(this).find("ul").slideUp("slow"); + $(this).find("ul").slideUp("slow"); } ); } -- cgit v1.2.3 From e2a9a1d28459b96e412004df4d4ec010fb9b30e2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 13 Jul 2009 10:36:55 -0700 Subject: Add quotes around all values that contain spaces in them, and add a test to make sure that we continue to do so. This makes sure that we don't have problems with 5.3 which treats the literal "on" as a boolean. --- modules/akismet/module.info | 2 +- modules/comment/module.info | 2 +- modules/digibug/module.info | 4 +-- modules/exif/module.info | 2 +- modules/g2_import/module.info | 4 +-- modules/gallery/module.info | 4 +-- modules/gallery/tests/File_Structure_Test.php | 37 +++++++++++++++++++++++++++ modules/image_block/module.info | 4 +-- modules/info/module.info | 4 +-- modules/notification/module.info | 2 +- modules/organize/module.info | 4 +-- modules/recaptcha/module.info | 2 +- modules/rss/module.info | 4 +-- modules/search/module.info | 4 +-- modules/server_add/module.info | 4 +-- modules/slideshow/module.info | 4 +-- modules/tag/module.info | 4 +-- modules/user/module.info | 4 +-- modules/watermark/module.info | 4 +-- themes/admin_default/theme.info | 6 ++--- themes/default/theme.info | 6 ++--- 21 files changed, 74 insertions(+), 37 deletions(-) (limited to 'themes') diff --git a/modules/akismet/module.info b/modules/akismet/module.info index d45d8a7b..b61ed107 100644 --- a/modules/akismet/module.info +++ b/modules/akismet/module.info @@ -1,3 +1,3 @@ -name = Akismet +name = "Akismet" description = "Filter comments through the Akismet web service to detect and eliminate spam (http://akismet.com). You'll need a WordPress.com API key to use it." version = 1 diff --git a/modules/comment/module.info b/modules/comment/module.info index 55997317..c371cf27 100644 --- a/modules/comment/module.info +++ b/modules/comment/module.info @@ -1,3 +1,3 @@ -name = Comments +name = "Comments" description = "Allows users and guests to leave comments on photos and albums." version = 2 diff --git a/modules/digibug/module.info b/modules/digibug/module.info index c25a2454..be4e880a 100644 --- a/modules/digibug/module.info +++ b/modules/digibug/module.info @@ -1,3 +1,3 @@ -name = Digibug -description = Digibug Photo Printing Module +name = "Digibug" +description = "Digibug Photo Printing Module" version = 2 diff --git a/modules/exif/module.info b/modules/exif/module.info index 1e16a5ff..c8ae688e 100644 --- a/modules/exif/module.info +++ b/modules/exif/module.info @@ -1,3 +1,3 @@ -name = Exif Data +name = "Exif Data" description = "Extract Exif data and display it on photo pages." version = 1 diff --git a/modules/g2_import/module.info b/modules/g2_import/module.info index 9e04f49b..554cf33b 100644 --- a/modules/g2_import/module.info +++ b/modules/g2_import/module.info @@ -1,3 +1,3 @@ -name = Gallery2 Import -description = Import your Gallery 2 content into Gallery 3 +name = "Gallery2 Import" +description = "Import your Gallery 2 content into Gallery 3" version = 1 diff --git a/modules/gallery/module.info b/modules/gallery/module.info index c184aba7..64a30b1f 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ -name = Gallery 3 -description = Gallery core application +name = "Gallery 3" +description = "Gallery core application" version = 6 diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 06f456ff..8a97e00b 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -213,6 +213,43 @@ class File_Structure_Test extends Unit_Test_Case { } } } + + public function module_info_is_well_formed_test() { + $info_files = array_merge( + glob("modules/*/module.info"), + glob("themes/*/module.info")); + + $errors = array(); + foreach ($info_files as $file) { + foreach (file($file) as $line) { + $parts = explode("=", $line, 2); + $values[trim($parts[0])] = trim($parts[1]); + } + + $module = dirname($file); + // Certain keys must exist + foreach (array("name", "description", "version") as $key) { + if (!array_key_exists($key, $values)) { + $errors[] = "$module: missing key $key"; + } + } + + // Any values containing spaces must be quoted + foreach ($values as $key => $value) { + if (strpos($value, " ") !== false && !preg_match('/^".*"$/', $value)) { + $errors[] = "$module: value for $key must be quoted"; + } + } + + // The file must parse + if (!is_array(parse_ini_file($file))) { + $errors[] = "$module: info file is not parseable"; + } + } + if ($errors) { + $this->assert_true(false, $errors); + } + } } class PhpCodeFilterIterator extends FilterIterator { diff --git a/modules/image_block/module.info b/modules/image_block/module.info index 8852d33c..e6d85048 100644 --- a/modules/image_block/module.info +++ b/modules/image_block/module.info @@ -1,3 +1,3 @@ -name = Image Block -description = Display a random image in the sidebar +name = "Image Block" +description = "Display a random image in the sidebar" version = 1 diff --git a/modules/info/module.info b/modules/info/module.info index ce03473e..e352213c 100644 --- a/modules/info/module.info +++ b/modules/info/module.info @@ -1,3 +1,3 @@ -name = Info -description = Display extra information about photos and albums +name = "Info" +description = "Display extra information about photos and albums" version = 1 diff --git a/modules/notification/module.info b/modules/notification/module.info index d4dc34e0..31684ccf 100644 --- a/modules/notification/module.info +++ b/modules/notification/module.info @@ -1,3 +1,3 @@ -name = Notification +name = "Notification" description = "Send notifications to users when changes are made to watched albums." version = 1 diff --git a/modules/organize/module.info b/modules/organize/module.info index b3ae94a3..5c6b1de0 100644 --- a/modules/organize/module.info +++ b/modules/organize/module.info @@ -1,3 +1,3 @@ -name = Organize -description = Organize your gallery by apply tags or moving images +name = "Organize" +description = "Organize your gallery by apply tags or moving images" version = 1 diff --git a/modules/recaptcha/module.info b/modules/recaptcha/module.info index 9f44648a..cfa1bf7a 100644 --- a/modules/recaptcha/module.info +++ b/modules/recaptcha/module.info @@ -1,3 +1,3 @@ -name = reCAPTCHA +name = "reCAPTCHA" description = "reCAPTCHA displays a graphical verification that protects the input form from abuse from 'bots,' or automated programs usually written to generate spam (http://recaptcha.net)." version = 1 diff --git a/modules/rss/module.info b/modules/rss/module.info index ffd26192..81ee7848 100644 --- a/modules/rss/module.info +++ b/modules/rss/module.info @@ -1,3 +1,3 @@ -name = RSS -description = Provide a RSS feeds +name = "RSS" +description = "Provide a RSS feeds" version = 1 diff --git a/modules/search/module.info b/modules/search/module.info index b286ab6c..f417c4fa 100644 --- a/modules/search/module.info +++ b/modules/search/module.info @@ -1,3 +1,3 @@ -name = Search -description = Allows users to search their Gallery +name = "Search" +description = "Allows users to search their Gallery" version = 1 diff --git a/modules/server_add/module.info b/modules/server_add/module.info index 295d3beb..23acab94 100644 --- a/modules/server_add/module.info +++ b/modules/server_add/module.info @@ -1,3 +1,3 @@ -name = Server Add -description = Allows authorized users to load images directly from your web server +name = "Server Add" +description = "Allows authorized users to load images directly from your web server" version = 3 diff --git a/modules/slideshow/module.info b/modules/slideshow/module.info index 5eb69ce3..6841199a 100644 --- a/modules/slideshow/module.info +++ b/modules/slideshow/module.info @@ -1,3 +1,3 @@ -name = Slideshow -description = Allows users to view a slideshow of photos +name = "Slideshow" +description = "Allows users to view a slideshow of photos" version = 1 diff --git a/modules/tag/module.info b/modules/tag/module.info index 562d5c32..e505dd81 100644 --- a/modules/tag/module.info +++ b/modules/tag/module.info @@ -1,3 +1,3 @@ -name = Tags -description = Allows users to tag photos and albums +name = "Tags" +description = "Allows users to tag photos and albums" version = 1 diff --git a/modules/user/module.info b/modules/user/module.info index 2dba517d..8a9af407 100644 --- a/modules/user/module.info +++ b/modules/user/module.info @@ -1,3 +1,3 @@ -name = Users and Groups -description = Provides user and group management +name = "Users and Groups" +description = "Provides user and group management" version = 1 diff --git a/modules/watermark/module.info b/modules/watermark/module.info index 7f866695..abd4a3cf 100644 --- a/modules/watermark/module.info +++ b/modules/watermark/module.info @@ -1,3 +1,3 @@ -name = Watermarks -description = Allows users to watermark their photos +name = "Watermarks" +description = "Allows users to watermark their photos" version = 1 diff --git a/themes/admin_default/theme.info b/themes/admin_default/theme.info index d21b0ff5..b3d9741d 100644 --- a/themes/admin_default/theme.info +++ b/themes/admin_default/theme.info @@ -1,6 +1,6 @@ -name = Gallery Default -description = A crisp Site Administration theme with soft colors and drop down menus. +name = "Gallery Default" +description = "A crisp Site Administration theme with soft colors and drop down menus." version = 1 -author = Gallery Team +author = "Gallery Team" admin = 1 site = 0 diff --git a/themes/default/theme.info b/themes/default/theme.info index 71e8a740..5f19d0d7 100644 --- a/themes/default/theme.info +++ b/themes/default/theme.info @@ -1,6 +1,6 @@ -name = Gallery Default -description = A crisp and distinctive theme that uses large fonts and icons for easy navigation and an enjoyable browsing experience. +name = "Gallery Default" +description = "A crisp and distinctive theme that uses large fonts and icons for easy navigation and an enjoyable browsing experience." version = 1 -author = Gallery Team +author = "Gallery Team" site = 1 admin = 0 -- cgit v1.2.3