From 39cf3c2b046b03691937e112268403130508da63 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 21 Jun 2009 08:52:26 -0700 Subject: The start of the digibug printing module. The first cut at the administration panels. This is still a work in progress. --- modules/digibug/helpers/digibug_menu.php | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 modules/digibug/helpers/digibug_menu.php (limited to 'modules/digibug/helpers/digibug_menu.php') diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php new file mode 100644 index 00000000..3f41bb16 --- /dev/null +++ b/modules/digibug/helpers/digibug_menu.php @@ -0,0 +1,42 @@ +get("settings_menu") + ->append(Menu::factory("link") + ->id("digibug_menu") + ->label(t("Digibug Administration")) + ->url(url::site("admin/digibug"))); + } + + static function photo($menu, $theme) { + } + + static function site($menu, $theme) { + $item = $theme->item(); + + if ($item && access::can("edit", $item)) { + $options_menu = $menu->get("options_menu") + ->append(Menu::factory("dialog") + ->id("digibug") + ->label(t("Peform Digibug Processing")) + ->url(url::site("digibug/index/$item->id"))); + } + } +} -- cgit v1.2.3 From 05f8659a7ffa35cb1458c69e4db1196aa384fff0 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 22 Jun 2009 06:03:55 -0700 Subject: Fix preamble so tests pass --- modules/digibug/controllers/admin_digibug.php | 3 ++- modules/digibug/controllers/digibug.php | 5 +++-- modules/digibug/helpers/digibug_installer.php | 3 ++- modules/digibug/helpers/digibug_menu.php | 7 ++++--- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'modules/digibug/helpers/digibug_menu.php') diff --git a/modules/digibug/controllers/admin_digibug.php b/modules/digibug/controllers/admin_digibug.php index 86338f6b..8263fc83 100644 --- a/modules/digibug/controllers/admin_digibug.php +++ b/modules/digibug/controllers/admin_digibug.php @@ -1,4 +1,5 @@ - $form->__toString())); } } - + private function _get_form() { $form = new Forge("digibug/handler", "", "post", array("id" => "gDigibugForm")); diff --git a/modules/digibug/helpers/digibug_installer.php b/modules/digibug/helpers/digibug_installer.php index 90dab990..33b5107b 100644 --- a/modules/digibug/helpers/digibug_installer.php +++ b/modules/digibug/helpers/digibug_installer.php @@ -1,4 +1,5 @@ -label(t("Digibug Administration")) ->url(url::site("admin/digibug"))); } - + static function photo($menu, $theme) { } - + static function site($menu, $theme) { $item = $theme->item(); -- cgit v1.2.3 From 292d216f7c133152cb921db1cbc7a0c4843a977a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 24 Jun 2009 18:02:36 -0700 Subject: Implement printing support on the photo page. I've used an icon that doesn't quite match the theme temporarily. I'm hoping to have a matching icon soon. --- modules/digibug/helpers/digibug_menu.php | 18 +++++++----------- modules/digibug/js/digibug.js | 4 ++++ themes/default/css/screen.css | 4 ++++ 3 files changed, 15 insertions(+), 11 deletions(-) (limited to 'modules/digibug/helpers/digibug_menu.php') diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php index 1ff0f6bf..6c466031 100644 --- a/modules/digibug/helpers/digibug_menu.php +++ b/modules/digibug/helpers/digibug_menu.php @@ -27,17 +27,13 @@ class digibug_menu { } static function photo($menu, $theme) { - } - - static function site($menu, $theme) { $item = $theme->item(); - - if ($item && access::can("edit", $item)) { - $options_menu = $menu->get("options_menu") - ->append(Menu::factory("dialog") - ->id("digibug") - ->label(t("Peform Digibug Processing")) - ->url(url::site("digibug/index/$item->id"))); - } + $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")); } } diff --git a/modules/digibug/js/digibug.js b/modules/digibug/js/digibug.js index e9e8933e..837c8f7f 100644 --- a/modules/digibug/js/digibug.js +++ b/modules/digibug/js/digibug.js @@ -3,6 +3,10 @@ $(document).ready(function() { e.preventDefault(); queue_print(e); }); + $("#gDigibugLink").click(function(e) { + e.preventDefault(); + return queue_print(e); + }); }); function popUp(url, options) { diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index a450356c..8967efdf 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -665,6 +665,10 @@ form .gError, background-image: url('../images/ico-view-comments.png'); } +#gViewMenu #gDigibugLink { + background-image: url('../images/ico-print.png'); +} + /* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ .gBreadcrumbs { -- cgit v1.2.3 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 --- modules/digibug/css/digibug.css | 91 -------------------------- modules/digibug/css/logo.png | Bin 17296 -> 0 bytes modules/digibug/helpers/digibug_menu.php | 2 +- modules/digibug/helpers/digibug_theme.php | 10 +-- modules/digibug/views/admin_digibug.html.php | 33 ++-------- themes/admin_default/css/screen.css | 93 +++++++++++++++++++++++++++ themes/admin_default/images/digibug_logo.png | Bin 0 -> 17296 bytes themes/default/css/screen.css | 25 ++++--- 8 files changed, 115 insertions(+), 139 deletions(-) delete mode 100644 modules/digibug/css/digibug.css delete mode 100644 modules/digibug/css/logo.png create mode 100644 themes/admin_default/images/digibug_logo.png (limited to 'modules/digibug/helpers/digibug_menu.php') diff --git a/modules/digibug/css/digibug.css b/modules/digibug/css/digibug.css deleted file mode 100644 index a09e4551..00000000 --- a/modules/digibug/css/digibug.css +++ /dev/null @@ -1,91 +0,0 @@ -.gAdminDigibugIntro { - background-image: url(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: 110px; - padding-top: 15px; -} - -.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; -} - -.gDigibugPrintButton { - float: left; -} - - diff --git a/modules/digibug/css/logo.png b/modules/digibug/css/logo.png deleted file mode 100644 index 5eac2c7d..00000000 Binary files a/modules/digibug/css/logo.png and /dev/null differ diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php index 6c466031..d9baf59c 100644 --- a/modules/digibug/helpers/digibug_menu.php +++ b/modules/digibug/helpers/digibug_menu.php @@ -22,7 +22,7 @@ class digibug_menu { $menu->get("settings_menu") ->append(Menu::factory("link") ->id("digibug_menu") - ->label(t("Digibug Administration")) + ->label(t("Digibug")) ->url(url::site("admin/digibug"))); } diff --git a/modules/digibug/helpers/digibug_theme.php b/modules/digibug/helpers/digibug_theme.php index e52fcc7f..bd269256 100644 --- a/modules/digibug/helpers/digibug_theme.php +++ b/modules/digibug/helpers/digibug_theme.php @@ -19,15 +19,7 @@ */ class digibug_theme_Core { static function head($theme) { - $head[] = ""; - $head[] = html::script("modules/digibug/js/digibug.js");; - return implode("\n", $head); - } - - static function admin_head($theme) { - return ""; + return html::script("modules/digibug/js/digibug.js"); } static function thumb_bottom($theme, $child) { diff --git a/modules/digibug/views/admin_digibug.html.php b/modules/digibug/views/admin_digibug.html.php index 33ce5f83..205d8b7a 100644 --- a/modules/digibug/views/admin_digibug.html.php +++ b/modules/digibug/views/admin_digibug.html.php @@ -1,16 +1,13 @@
-

- +

@@ -19,20 +16,8 @@
  • -
    - -
    - -
    - -
    -
    -
      -
    • -
    • -
    • -
    +

    @@ -45,16 +30,8 @@
    -
    - -
    - -
    -
    - -
    - +
    @@ -62,7 +39,7 @@
    -
    +
    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 3ab6f2ed4bc1bf1e46174e273e18b2174e5b6ee2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 27 Jun 2009 14:35:16 -0700 Subject: Remove unnecessary curly braces. --- modules/digibug/helpers/digibug_menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/digibug/helpers/digibug_menu.php') diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php index d9baf59c..6d127d72 100644 --- a/modules/digibug/helpers/digibug_menu.php +++ b/modules/digibug/helpers/digibug_menu.php @@ -33,7 +33,7 @@ class digibug_menu { ->append(Menu::factory("link") ->id("digibug") ->label(t("Print with Digibug")) - ->url(url::site("digibug/print_photo/{$item->id}?csrf={$csrf}")) + ->url(url::site("digibug/print_photo/$item->id?csrf=$csrf")) ->css_id("gDigibugLink")); } } -- 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 'modules/digibug/helpers/digibug_menu.php') 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) ?>