From 427e1130b26a75a59b5e180e2008f5eace398920 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 22 Jul 2009 11:11:48 -0700 Subject: Modified the notification get_subscribers to ignore any users that don't have "view" access to the item the notification is being generated for. Fix for ticket: #538. --- modules/notification/helpers/notification.php | 14 ++++++++++---- modules/notification/helpers/notification_menu.php | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php index e246af2c..c3ffeb18 100644 --- a/modules/notification/helpers/notification.php +++ b/modules/notification/helpers/notification.php @@ -67,6 +67,8 @@ class notification { } static function get_subscribers($item) { + // @todo don't access the user table directly + // @todo only return distinct email addresses $users = ORM::factory("user") ->join("subscriptions", "users.id", "subscriptions.user_id") ->join("items", "subscriptions.item_id", "items.id") @@ -77,9 +79,13 @@ class notification { $subscribers = array(); foreach ($users as $user) { - $subscribers[] = $user->email; + Kohana::log("error", "user: $user->name"); + + if (access::user_can($user, "view", $item)) { + $subscribers[$user->email] = 1; + } } - return $subscribers; + return array_keys($subscribers); } static function send_item_updated($item) { @@ -103,8 +109,8 @@ class notification { array("title" => $item->title, "parent_title" => $parent->title)) : ($item->is_photo() ? t("Photo %title added to %parent_title", - array("title" => $item->title, "parent_title" => $parent->title)) - : t("Movie %title added to %parent_title", + array("title" => $item->title, "parent_title" => $parent->title)) : + t("Movie %title added to %parent_title", array("title" => $item->title, "parent_title" => $parent->title))); self::_notify_subscribers($item, $v->render(), $v->subject); diff --git a/modules/notification/helpers/notification_menu.php b/modules/notification/helpers/notification_menu.php index 87478b8a..73d1dd03 100644 --- a/modules/notification/helpers/notification_menu.php +++ b/modules/notification/helpers/notification_menu.php @@ -22,10 +22,10 @@ class notification_menu_Core { if (!user::active()->guest) { $item = $theme->item(); - if ($item && $item->is_album()) { + if ($item && $item->is_album() && access::can("view", $item)) { $watching = notification::is_watching($item); - $watching ? $label = t("Remove notifications") : $label = t("Enable notifications"); + $label = $watching ? t("Remove notifications") : t("Enable notifications"); $menu->get("options_menu") ->append(Menu::factory("link") -- cgit v1.2.3 From 4854003f41fa8a57dc687b9a65a99498fc7c46bc Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 22 Jul 2009 13:03:01 -0700 Subject: bump version to "3.0 git (pre-beta3)" --- modules/gallery/helpers/gallery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index a32ac484..2fa7ad1c 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_Core { - const VERSION = "3.0 beta 2"; + const VERSION = "3.0 git (pre-beta3)"; /** * If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is -- cgit v1.2.3 From dbeadc1407293d0c7af36723db6fe5699890b845 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 22 Jul 2009 14:27:57 -0700 Subject: Use the Kohana cascading filesystem to locate resources loaded by the theme. Because the theme comes first, this means that themes can override any module resources, at the cost that we no longer have namespacing for JS and CSS files. The only file getting used outside of this model is themes/default/screen.css which is used in the admin theme. I fixed that by copying screen.css into admin_default and renaming its screen.css to admin_screen.css. I also copied over all the images that it was referencing. Fixes tickets #48 and #539. Theme API changes: - theme_script(), theme_url() and theme_css() are no longer needed - script(), url() and css() now refer to the first matching asset in the module load path, where gallery3/lib is at the end of the path --- modules/comment/helpers/comment_theme.php | 2 +- modules/digibug/helpers/digibug_theme.php | 2 +- modules/gallery/helpers/gallery_theme.php | 20 +- modules/gallery/libraries/Gallery_View.php | 66 +- modules/organize/helpers/organize_theme.php | 6 +- modules/server_add/helpers/server_add_theme.php | 8 +- modules/tag/helpers/tag_theme.php | 4 +- modules/user/helpers/user_theme.php | 2 +- themes/admin_default/css/admin_screen.css | 458 ++++++++ themes/admin_default/css/screen.css | 1149 +++++++++++++++----- themes/admin_default/images/ico-print.png | Bin 0 -> 989 bytes themes/admin_default/images/ico-separator.gif | Bin 0 -> 106 bytes themes/admin_default/images/ico-view-comments.png | Bin 0 -> 768 bytes themes/admin_default/images/ico-view-fullsize.png | Bin 0 -> 1046 bytes themes/admin_default/images/ico-view-hybrid.png | Bin 0 -> 494 bytes themes/admin_default/images/ico-view-slideshow.png | Bin 0 -> 960 bytes themes/admin_default/images/loading-lg.gif | Bin 0 -> 8238 bytes themes/admin_default/images/loading-sm.gif | Bin 0 -> 673 bytes themes/admin_default/views/admin.html.php | 28 +- themes/default/views/header.html.php | 2 +- themes/default/views/page.html.php | 36 +- 21 files changed, 1431 insertions(+), 352 deletions(-) create mode 100644 themes/admin_default/css/admin_screen.css create mode 100644 themes/admin_default/images/ico-print.png create mode 100644 themes/admin_default/images/ico-separator.gif create mode 100644 themes/admin_default/images/ico-view-comments.png create mode 100644 themes/admin_default/images/ico-view-fullsize.png create mode 100644 themes/admin_default/images/ico-view-hybrid.png create mode 100644 themes/admin_default/images/ico-view-slideshow.png create mode 100644 themes/admin_default/images/loading-lg.gif create mode 100644 themes/admin_default/images/loading-sm.gif (limited to 'modules') diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php index 89b2f57c..b807e2cf 100644 --- a/modules/comment/helpers/comment_theme.php +++ b/modules/comment/helpers/comment_theme.php @@ -19,7 +19,7 @@ */ class comment_theme_Core { static function head($theme) { - $theme->script("modules/comment/js/comment.js"); + $theme->script("comment.js"); return ""; } diff --git a/modules/digibug/helpers/digibug_theme.php b/modules/digibug/helpers/digibug_theme.php index f94d07c6..ceda55b5 100644 --- a/modules/digibug/helpers/digibug_theme.php +++ b/modules/digibug/helpers/digibug_theme.php @@ -19,6 +19,6 @@ */ class digibug_theme_Core { static function head($theme) { - $theme->script("modules/digibug/js/digibug.js"); + $theme->script("digibug.js"); } } diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index f245ea31..998eb289 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -22,12 +22,12 @@ class gallery_theme_Core { $session = Session::instance(); $buf = ""; if ($session->get("debug")) { - $theme->css("modules/gallery/css/debug.css"); + $theme->css("debug.css"); } if (($theme->page_type == "album" || $theme->page_type == "photo") && access::can("edit", $theme->item())) { - $theme->css("modules/gallery/css/quick.css"); - $theme->script("modules/gallery/js/quick.js"); + $theme->css("quick.css"); + $theme->script("quick.js"); } if (module::is_active("rss")) { @@ -43,9 +43,9 @@ class gallery_theme_Core { } if ($session->get("l10n_mode", false)) { - $theme->css("modules/gallery/css/l10n_client.css"); - $theme->script("lib/jquery.cookie.js"); - $theme->script("modules/gallery/js/l10n_client.js"); + $theme->css("l10n_client.css"); + $theme->script("jquery.cookie.js"); + $theme->script("l10n_client.js"); } return $buf; @@ -80,13 +80,13 @@ class gallery_theme_Core { static function admin_head($theme) { $session = Session::instance(); if ($session->get("debug")) { - $theme->css("modules/gallery/css/debug.css"); + $theme->css("debug.css"); } if ($session->get("l10n_mode", false)) { - $theme->css("modules/gallery/css/l10n_client.css"); - $theme->script("lib/jquery.cookie.js"); - $theme->script("modules/gallery/js/l10n_client.js"); + $theme->css("l10n_client.css"); + $theme->script("jquery.cookie.js"); + $theme->script("l10n_client.js"); } } diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 31231ca6..219cc883 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -27,24 +27,20 @@ class Gallery_View_Core extends View { * @param $file the relative path to a script from the gallery3 directory */ public function script($file) { - $this->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; + $base_file = str_replace(".js", "", $file); + if (($path = Kohana::find_file("js", $base_file, false, "js")) || + file_exists($path = DOCROOT . "lib/$file")) { + $this->scripts[$path] = 1; + } else { + Kohana::log("error", "Can't find script file: $file"); + } } /** * 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 theme_url($path, $absolute_url=false) { + public function url($path, $absolute_url=false) { $arg = "themes/{$this->theme_name}/$path"; return $absolute_url ? url::abs_file($arg) : url::file($arg); } @@ -53,27 +49,23 @@ class Gallery_View_Core extends View { * Add a css file to the combined css list. * @param $file the relative path to a script from the gallery3 directory */ - public function css($file, $theme_relative=false) { - $this->css[$file] = 1; - } - - /** - * Add a css file to the combined css list. - * @param $file the relative path to a script from the base of the active theme - * @param - */ - public function theme_css($file) { - $file = "themes/{$this->theme_name}/$file"; - $this->css[$file] = 1; + public function css($file) { + $base_file = str_replace(".css", "", $file); + if (($path = Kohana::find_file("css", $base_file, false, "css")) || + file_exists($path = DOCROOT . "lib/$file")) { + $this->css[$path] = 1; + } else { + Kohana::log("error", "Can't find css file: $file"); + } } /** * Combine a series of files into a single one and cache it in the database. */ - protected function combine_files($files, $type) { + protected function combine_files($paths, $type) { $links = array(); - if (empty($files)) { + if (empty($paths)) { return; } @@ -81,16 +73,10 @@ class Gallery_View_Core extends View { // entries. $key = array(url::abs_file("")); - foreach (array_keys($files) as $file) { - $path = DOCROOT . $file; - if (file_exists($path)) { - $stats = stat($path); - $links[$file] = $path; - // 7 == size, 9 == mtime, see http://php.net/stat - $key[] = "$file $stats[7] $stats[9]"; - } else { - Kohana::log("error", "missing file ($type): $file"); - } + foreach (array_keys($paths) as $path) { + $stats = stat($path); + // 7 == size, 9 == mtime, see http://php.net/stat + $key[] = "$path $stats[7] $stats[9]"; } $key = md5(join(" ", $key)); @@ -99,11 +85,13 @@ class Gallery_View_Core extends View { if (empty($contents)) { $contents = ""; - foreach ($links as $file => $link) { + $docroot_len = strlen(DOCROOT); + foreach (array_keys($paths) as $path) { + $relative = substr($path, $docroot_len); if ($type == "css") { - $contents .= "/* $file */\n" . $this->process_css($link) . "\n"; + $contents .= "/* $relative */\n" . $this->process_css($path) . "\n"; } else { - $contents .= "/* $file */\n" . file_get_contents($link) . "\n"; + $contents .= "/* $relative */\n" . file_get_contents($path) . "\n"; } } diff --git a/modules/organize/helpers/organize_theme.php b/modules/organize/helpers/organize_theme.php index 02f1f589..e4feba2b 100644 --- a/modules/organize/helpers/organize_theme.php +++ b/modules/organize/helpers/organize_theme.php @@ -20,8 +20,8 @@ class organize_theme { static function head($theme) { // @tdo remove the addition css and organize.js (just here to test) - $theme->script("modules/organize/js/organize_init.js"); - $theme->script("modules/organize/js/organize.js"); - $theme->css("modules/organize/css/organize.css"); + $theme->script("organize_init.js"); + $theme->script("organize.js"); + $theme->css("organize.css"); } } diff --git a/modules/server_add/helpers/server_add_theme.php b/modules/server_add/helpers/server_add_theme.php index 02f99690..2ba2e167 100644 --- a/modules/server_add/helpers/server_add_theme.php +++ b/modules/server_add/helpers/server_add_theme.php @@ -20,20 +20,20 @@ class server_add_theme_Core { static function head($theme) { if (user::active()->admin) { - $theme->script("modules/server_add/js/server_add.js"); + $theme->script("server_add.js"); } } static function admin_head($theme) { $head = array(); if (strpos(Router::$current_uri, "admin/server_add") !== false) { - $theme->css("lib/jquery.autocomplete.css"); + $theme->css("jquery.autocomplete.css"); $base = url::site("__ARGS__"); $csrf = access::csrf_token(); $head[] = ""; - $theme->script("lib/jquery.autocomplete.js"); - $theme->script("modules/server_add/js/admin.js"); + $theme->script("jquery.autocomplete.js"); + $theme->script("admin.js"); } return implode("\n", $head); diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index fe30354f..d46a91e9 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -19,11 +19,11 @@ */ class tag_theme_Core { static function head($theme) { - $theme->script("modules/tag/js/tag.js"); + $theme->script("tag.js"); } static function admin_head($theme) { - $theme->script("modules/tag/js/tag.js"); + $theme->script("tag.js"); } static function sidebar_blocks($theme) { diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index ad9d4c63..c5351f8e 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -26,7 +26,7 @@ class user_theme_Core { static function admin_head($theme) { if (strpos(Router::$current_uri, "admin/users") !== false) { - $theme->script("lib/gallery.panel.js"); + $theme->script("gallery.panel.js"); } } } diff --git a/themes/admin_default/css/admin_screen.css b/themes/admin_default/css/admin_screen.css new file mode 100644 index 00000000..d408acf0 --- /dev/null +++ b/themes/admin_default/css/admin_screen.css @@ -0,0 +1,458 @@ +/** + * Gallery 3 Default Admin Theme Screen Styles + * + * Extends themes/default/css/screen.css + * + * 1) Basic HTML elements + * 2) Reusable content blocks + * 3) Page layout containers + * 4) Content blocks in specific layout containers + * 5) Browser hacks + * 6) jQuery and jQuery UI + * 7) Server Add + * 8) Digibug Print Administration + */ + +/** ******************************************************************* + * 1) Basic HTML elements + **********************************************************************/ + +/** ******************************************************************* + * 2) Reusable content blocks + **********************************************************************/ + +.gBlock { + background-color: #fff; + border: 1px solid #ccc; + margin-bottom: 1em; + padding: 1em; +} + +#gSidebar .gBlockContent { + padding: 0; +} + +.gSelected img, +.gAvailable .gBlock img { + float: left; + margin-right: 1em; +} + +.rtl .gSelected img, +.rtl .gAvailable .gBlock img { + float: right; + margin-left: 1em; +} + +.gSelected { + background: #e8e8e8; +} + +.gAvailable .gInstalledToolkit:hover { + cursor: pointer; + background: #eee; +} + +.gAvailable .gButtonLink { + width: 96%; +} + +.gSelected .gButtonLink { + display: none; +} + +.gUnavailable { + border-color: #999; + opacity: 0.4; +} + +.gOddRow { + background-color: #eee; +} + +.gEvenRow { + background-color: #fff; +} + +/** ******************************************************************* + * 3) Page layout containers + **********************************************************************/ + +.gView { + min-width: 974px !important; +} + +#gHeader { + background-color: #e8e8e8; + border-bottom: 1px solid #ccc; + margin-bottom: 20px; + padding: 0 20px; +} + +#gContent { + font-size: 1.1em; + width: 96%; +} + +/** ******************************************************************* + * 4) Content blocks in specific layout containers + *********************************************************************/ + +#gHeader #gLogo { + float: left; + margin: -22px 10px 0 0; + display: block; + padding-left: 2px; + width: 105px; /* 107px - padding-left */ + height: 48px; + background-image: url('../../default/images/logo.png'); + color: #A5A5A5 ! important; +} +#gHeader #gLogo:hover { + color: #FF6600 ! important; + text-decoration: none; +} + +#gHeader #gLoginMenu { + float: none; + margin: 0; + padding: 5px 0 10px 0; + text-align: right; +} + + +.rtl #gHeader #gLoginMenu { + text-align: left; +} + +#gHeader #gSiteAdminMenu { + float: left; + font-size: 1.2em; +} + +.rtl #gHeader #gSiteAdminMenu { + float: right; +} + +#gHeader #gSiteAdminMenu ul { + margin-bottom: 0; +} + +.gBlock .ui-dialog-titlebar { + margin: -1em -1em 0; +} + +#gSidebar .gBlock h2 { + background: none; +} + +#gPhotoStream { + background-color: #e8e8e8; +} + +#gPhotoStream .gBlockContent ul { + border-right: 1px solid #e8e8e8; + height: 135px; + overflow: auto; + overflow: -moz-scrollbars-horizontal; /* for FF */ + overflow-x: scroll; /* scroll horizontal */ + overflow-y: hidden; /* Hide vertical*/ +} + +#gContent #gPhotoStream .gItem { + background-color: #fff; + border: 1px solid #e8e8e8; + border-right-color: #ccc; + border-bottom-color: #ccc; + float: left; + height: 90px; + overflow: hidden; + text-align: center; + width: 90px; +} + +.rtl #gContent #gPhotoStream .gItem { + float: right; +} + +#gSiteStatus { + margin-bottom: 0; +} + +#gContent .gItem { + background-color: #fff; + border: 1px solid #e8e8e8; + border-right-color: #ccc; + border-bottom-color: #ccc; + height: 90px; + padding: 14px 8px; + text-align: center; + width: 90px; +} + +#gAdminCommentsMenu { + margin: 1em 0; +} + +#gAdminCommentsMenu a { + margin: 0; + padding: .2em .6em; +} + +#gAdminGraphics .gAvailable .gBlock { + clear: none; + float: left; + height: 16em; + margin-right: 1em; + width: 30%; +} + +.rtl #gAdminGraphics .gAvailable .gBlock { + float: right; + margin-left: 1em; + margin-right: 0em; +} + +#gSiteTheme, +#gAdminTheme { + float: left; + width: 48%; +} + +.rtl #gSiteTheme, +.rtl #gAdminTheme { + float: right; +} + +#gSiteTheme { + margin-right: 1em; +} + +#gUserAdminList { + margin-bottom: 1em; +} +#gUserAdminList td { + vertical-align: bottom; +} + +#gUserAdminList .gDraggable:hover { + border: 1px dashed black; +} + +#gUserAdminList .admin { + color: #55f; + font-weight: bold; +} + +.gActions a, +.gActions span { + margin-right: 3em; +} + +li.gGroup { + float: left; + display: block; + width: 200px; + border: 1px solid gray; + padding: 0; + margin: 0 1em 1em 0; +} + +.rtl li.gGroup { + float: right; +} + +li.gGroup h4 { + background-color: #EEEEEE; + border-bottom: 1px dashed #CCCCCC; + padding: .5em 0 .5em .5em; +} +li.gGroup .gButtonLink { + padding: 0; +} +li.gGroup ul, li.gGroup div { + height: 180px; + margin: 1px; + overflow: auto; + padding-top: .2em; +} +li.gGroup div p { + color: gray; + text-align: center; + padding: 2em .5em 0 .5em +} +li.gGroup .gUser { + padding: .2em 0 0 .5em; +} +li.gGroup .gUser .gButtonLink { + vertical-align: middle; +} + +li.gDefaultGroup h4, li.gDefaultGroup .gUser { + color: gray; +} + +#gAdminAdvancedSettings tr.setting:hover { + background: #ffc; +} + +/** ******************************************************************* + * 5) Browser hacks + *********************************************************************/ + +#gHeader:after, +#gAdminCommentsMenu:after, +#gGroupAdmin:after, +.gSelected:after, +.gAvailable .gBlock:after, +#gModuleCreateForm ul li ul:after, +#gDeveloperTools:after, +#gPhotoStream:after { + clear: both; + content: "."; + display: block; + height: 0; + visibility: hidden; +} + +/** ******************************************************************* + * 6) jQuery and jQuery UI + *********************************************************************/ + +#gPanel { + display: none; + padding: 1em; +} + +#gPanel legend { + display: none; +} + +#gPanel fieldset { + border: none; +} + +.ui-draggable { + cursor: move; +} + +.gButtonSetVertical a { + width: 8em !important; +} + +#gAdminDashboard .ui-dialog-titlebar, +#gAdminDashboardSidebar .ui-dialog-titlebar { + padding: .2em .4em; +} + +/**** Stuff that needs a home! ****/ +#gTagAdmin { + table-layout: fixed; +} +#gTagAdmin td { + border: 0; +} +#gTagAdmin ul { + padding-bottom: .3em; +} +#gTagAdmin li { + padding: .1em 0 .2em .3em; +} +#gTagAdmin .gColumn { + float: left; + width: 200px; +} +.rtl #gTagAdmin .gColumn { + float: right; +} +.gEditable { + padding: .1em .3em .2em .3em; +} +.gEditable:hover { + background-color: #ffc; + cursor: text; +} +#gRenameTagForm input { + padding: 0 .2em 0 .2em; + clear: none; + float: left; + margin: 0 .2em 0 0; +} +.rtl #gRenameTagForm input { + float: right; +} +#gRenameTagForm input[type="submit"] { + height: 25px; +} +#gRenameTagForm a, #gRenameTagForm span { + display: block; + float: left; + padding: .2em .2em 0 .1em; +} +.rtl #gRenameTagForm a, #gRenameTagForm span { + float: right; +} +#gProgress button { + float: right; + margin-top: 1em; +} +.rtl #gProgress button { + float: left; +} + +#gTaskLogDialog h1 { + font-size: 1.1em; +} + +.gTaskLog { + border: 1pt solid; + font-size: .9em; + height: 400px; + margin: .5em 0; + overflow: auto; + padding: .5em +} + + +/** ******************************************************************* + * 7) Server Add + *********************************************************************/ +#gServerAddAdmin { + margin:auto; + text-align: left; +} + +.rtl #gServerAddAdmin { + text-align: right; +} + +#gServerAddAdmin form fieldset { + border: medium none; +} + +#gServerAddAdmin legend { + display: none; +} + +#gServerAddAdmin .gWarning { + background-color: #FFFF99; +} + +#gAuthorizedPath { + margin: 0 !important; + padding: 0.3em 1.5em 0.3em 1em; +} + +#gServerAdd Admin #path { + width: 80%; +} + +.gRemoveDir:hover { + cursor: pointer; +} + +#gLanguageSettingsForm .checklist li { + width: 150px; + overflow: hidden; +} + diff --git a/themes/admin_default/css/screen.css b/themes/admin_default/css/screen.css index d408acf0..88631e81 100644 --- a/themes/admin_default/css/screen.css +++ b/themes/admin_default/css/screen.css @@ -1,313 +1,774 @@ /** - * Gallery 3 Default Admin Theme Screen Styles + * Gallery 3 Default Theme Screen Styles * - * Extends themes/default/css/screen.css + * @requires YUI reset, font, grids CSS * - * 1) Basic HTML elements - * 2) Reusable content blocks - * 3) Page layout containers - * 4) Content blocks in specific layout containers - * 5) Browser hacks - * 6) jQuery and jQuery UI - * 7) Server Add - * 8) Digibug Print Administration + * 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 content blocks - **********************************************************************/ +body, html { + background-color: #ccc; + font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; +} -.gBlock { - background-color: #fff; - border: 1px solid #ccc; +p { margin-bottom: 1em; - padding: 1em; } -#gSidebar .gBlockContent { - padding: 0; +em { + font-style: oblique; +} + +h1, h2, h3, h4, h5, strong, th { + font-weight: bold; +} + +h1 { + font-size: 1.7em; +} + +#gSearchResults h1 { + margin-bottom: 1em; +} + +#gProgress h1 { + font-size: 1.1em; +} + +h2 { + font-size: 1.4em; +} + +#gSidebar .gBlock h2 { + font-size: 1.2em; +} + +#gSidebar .gBlock li { + margin-bottom: .6em; } -.gSelected img, -.gAvailable .gBlock img { +h3 { + font-size: 1.2em; +} + +/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +a, +.gMenu a, +#gDialog a, +.gButtonLink, +.gButtonLink:hover, +.gButtonLink:active { + color: #5382BF !important; + text-decoration: none; + -moz-outline-style: none; +} + +a:hover, +#gDialog a:hover { + text-decoration: underline; +} + +.gMenu a:hover { + text-decoration: none; +} + +#gDialog .gCancel { + clear: none; float: left; - margin-right: 1em; + margin: .3em 1em; } -.rtl .gSelected img, -.rtl .gAvailable .gBlock img { +#gForgotPasswordLink { float: right; - margin-left: 1em; + font-size: .9em; } -.gSelected { - background: #e8e8e8; +#gDialog .gCancel { + float: left; } -.gAvailable .gInstalledToolkit:hover { - cursor: pointer; - background: #eee; +/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +table { + width: 100%; +} + +#gContent table { + margin: 1em 0; +} + +caption, +th { + text-align: left; +} + +th, +td { + border: none; + border-bottom: 1px solid #ccc; + padding: .5em; + vertical-align: top; +} + +/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +fieldset { + border: 1px solid #ccc; + padding-bottom: .8em; +} + +#gHeader fieldset, +#gSidebar fieldset, +.gShortForm fieldset { + border: none; } -.gAvailable .gButtonLink { - width: 96%; +legend { + font-weight: bold; + margin-left: 1em; } -.gSelected .gButtonLink { +#gHeader legend, +#gSidebar legend, +#gContent #gSearchForm legend, +input[type="hidden"], +.gShortForm label { display: none; } -.gUnavailable { - border-color: #999; - opacity: 0.4; +label { + cursor: help; } -.gOddRow { - background-color: #eee; +input[type="text"], +input[type="password"] { + width: 50%; } -.gEvenRow { - background-color: #fff; +input[type="text"], +input[type="password"], +textarea { + border: 1px solid #e8e8e8; + border-top-color: #ccc; + border-left-color: #ccc; + color: #333; } -/** ******************************************************************* - * 3) Page layout containers - **********************************************************************/ +textarea { + width: 100%; + height: 12em; +} -.gView { - min-width: 974px !important; +input:focus, +textarea:focus, +option:focus { + background-color: #ffc; + color: #000; } -#gHeader { - background-color: #e8e8e8; - border-bottom: 1px solid #ccc; - margin-bottom: 20px; - padding: 0 20px; +/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +form li { + margin: 0 !important; + padding: .3em 1.5em .3em 1em; } -#gContent { - font-size: 1.1em; - width: 96%; +form ul ul { + clear: both; +} + +form ul ul li { + float: left; +} + +input, +select, +textarea { + display: block; + clear: both; + padding: .2em; +} + +input[type="submit"], +input[type="reset"] { + display: inline; + clear: none; + float: left; +} + +/* Form validation ~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gValidationRule { + font-size: 80%; + margin-top: .5em; +} + +form.gError input[type="text"], +li.gError input[type="text"], +form.gError input[type="password"], +li.gError input[type="password"], +form.gError input[type="checkbox"], +li.gError input[type="checkbox"], +form.gError input[type="radio"], +li.gError input[type="radio"], +form.gError textarea, +li.gError textarea, +form.gError select, +li.gError select { + border: 2px solid red; } /** ******************************************************************* - * 4) Content blocks in specific layout containers + * 2) Reusable generic classes *********************************************************************/ -#gHeader #gLogo { +.inactive, .understate { + color: #ccc; + font-weight: normal; +} + +.left { float: left; - margin: -22px 10px 0 0; - display: block; - padding-left: 2px; - width: 105px; /* 107px - padding-left */ - height: 48px; - background-image: url('../../default/images/logo.png'); - color: #A5A5A5 ! important; -} -#gHeader #gLogo:hover { - color: #FF6600 ! important; - text-decoration: none; + margin: 1em 1em 1em 0; } -#gHeader #gLoginMenu { - float: none; - margin: 0; - padding: 5px 0 10px 0; +.right { + float: right; + margin: 1em 0 1em 1em; +} + +.txtright { text-align: right; } +/** ******************************************************************* + * 3) Reusable content blocks + *********************************************************************/ + +.gBlock { + clear: both; + margin-bottom: 2.5em; +} + +.gBlock h2 { + background-color: #e8e8e8; + padding: .3em .8em; +} -.rtl #gHeader #gLoginMenu { - text-align: left; +.gBlockContent { + margin-top: 1em; } -#gHeader #gSiteAdminMenu { - float: left; - font-size: 1.2em; +/* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gMessage { + width: 99%; } -.rtl #gHeader #gSiteAdminMenu { - float: right; +#gAdminAkismet .gSuccess, +#gSiteStatus li, +#gMessage li { + border: 1px solid #ccc; + margin-bottom: .4em; } -#gHeader #gSiteAdminMenu ul { +#gSiteStatus li { margin-bottom: 0; + border: none; + border-bottom: 1px solid #ccc; } -.gBlock .ui-dialog-titlebar { - margin: -1em -1em 0; +#gSiteStatus .gError, +#gMessage .gError, +form p.gError, +#gSiteStatus .gInfo, +#gMessage .gInfo, +#gSiteStatus .gSuccess, +#gMessage .gSuccess, +#gSiteStatus .gWarning, +#gMessage .gWarning { + background-position: .4em 50%; + background-repeat: no-repeat; + padding: .4em .5em .4em 30px; } -#gSidebar .gBlock h2 { - background: none; +.gError { + background-color: #fcc; +} + +form .gError { + color: #f00; +} + +#gSiteStatus .gError, +#gMessage .gError, +form p.gError { + background-image: url('../images/ico-error.png'); } -#gPhotoStream { +.gInfo { background-color: #e8e8e8; } -#gPhotoStream .gBlockContent ul { - border-right: 1px solid #e8e8e8; - height: 135px; - overflow: auto; - overflow: -moz-scrollbars-horizontal; /* for FF */ - overflow-x: scroll; /* scroll horizontal */ - overflow-y: hidden; /* Hide vertical*/ +#gSiteStatus .gInfo, +#gMessage .gInfo { + background-image: url('../images/ico-info.png'); +} + +.gSuccess { + background-color: #96EF95; +} + +#gSiteStatus .gSuccess, +#gMessage .gSuccess { + background-image: url('../images/ico-success.png'); +} + +.gWarning { + background-color: #ff9; +} + +#gSiteStatus .gWarning, +#gMessage .gWarning { + background-image: url('../images/ico-warning.png'); } -#gContent #gPhotoStream .gItem { +form .gError, +.gPager .gInfo { background-color: #fff; - border: 1px solid #e8e8e8; - border-right-color: #ccc; - border-bottom-color: #ccc; +} + +#gAdminMaintenance .gError, +#gAdminMaintenance .gInfo, +#gAdminMaintenance .gWarning, +#gAdminMaintenance .gSuccess { + background-image: none; +} + +/* Inline layout (forms, lists) ~~~~~~~~~~ */ + +.gShortForm li { float: left; - height: 90px; - overflow: hidden; - text-align: center; - width: 90px; + padding: .4em 0; } -.rtl #gContent #gPhotoStream .gItem { - float: right; +.gShortForm input[type="text"] { + color: #666; + padding: .3em .6em; + width: 11em; } -#gSiteStatus { - margin-bottom: 0; +/*** ****************************************************************** + * 4) Page layout containers + *********************************************************************/ + +/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gView { + background-color: #fff; + border: 1px solid #ccc; + border-bottom: none; +} + +/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader { + background-color: #e8e8e8; + border-bottom: 1px solid #fff; + font-size: .8em; + margin-bottom: 1em; + padding: 1em 20px 0 20px; } -#gContent .gItem { +#gContent { + font-size: 1.2em; + padding-left: 20px; + width: 696px; +} + +#gSidebar { background-color: #fff; + font-size: .9em; + padding: 0 20px; + width: 220px; +} + +#gFooter { + background-color: #e8e8e8; + border-top: 1px solid #ccc; + font-size: .8em; + margin-top: 20px; + padding: 10px 20px; +} + +/** ******************************************************************* + * 5) Content blocks in specific layout containers + *********************************************************************/ + +/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader #gLogo img { + float: left; + margin: -4px 10px 0 0; +} + +#gHeader #gQuickSearchForm { + clear: right; + float: right; + margin: 1em 0; +} + +#gHeader #gQuickSearchForm input[type='text'] { + width: 17em; +} + +#gContent .gBlock h2 { + background-color: transparent; + padding-left: 0; +} + +#gSidebar .gBlockContent { + padding-left: 1em; +} + +/* Album content ~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gContent #gAlbumGrid { + margin: 1em 0; +} + +#gContent #gAlbumGrid .gItem { border: 1px solid #e8e8e8; border-right-color: #ccc; border-bottom-color: #ccc; - height: 90px; - padding: 14px 8px; + float: left; + font-size: .7em; + height: 240px; + overflow: hidden; + padding: 15px 8px 30px 8px; + position: relative; text-align: center; - width: 90px; + width: 213px; +} + +#gContent #gAlbumGrid .gItem h2 { + margin: 5px 0; } -#gAdminCommentsMenu { +#gContent #gAlbumGrid .gAlbum { + background-color: #e8e8e8; +} + +#gContent #gAlbumGrid .gAlbum h2 span { + background: transparent url('../images/ico-album.png') no-repeat top left !important; + display: inline-block; + height: 16px; + margin-right: 5px; + width: 16px; +} + +/* Individual photo content ~~~~~~~~~~~~~~ */ + +#gContent #gItem { + width: 99%; +} + +#gContent #gPhoto { + position: relative; +} + +#gContent #gItem .gFullSizeLink img { + display: block; + margin: 1em auto !important; +} + +#gContent #gComments { + margin-top: 2em; +} + +#gContent #gComments ul li { margin: 1em 0; } -#gAdminCommentsMenu a { - margin: 0; - padding: .2em .6em; +#gContent #gComments .gAuthor { + border-bottom: 1px solid #ccc; + color: #999; + height: 32px; + line-height: 32px; } -#gAdminGraphics .gAvailable .gBlock { - clear: none; - float: left; - height: 16em; - margin-right: 1em; - width: 30%; +#gContent #gComments ul li div { + padding: 0 8px 8px 43px; +} + +#gContent #gComments ul li #gRecaptcha { + padding: 0; +} + +#gContent #gComments ul li #gRecaptcha div { + padding: 0; +} + +#gContent #gComments .gAvatar { + height: 32px; + margin-right: .4em; + width: 32px; +} + +#gContent #gAddCommentForm { + margin-top: 2em; +} + +/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader #gLoginMenu li, +#gFooter #gCredits li { + display: inline; +} + +#gHeader #gLoginMenu li { + padding-left: 1.2em; +} + +#gFooter #gCredits li { + padding-right: 1.2em; +} + +#gContent #gSearchResults { + margin-top: 1em; + padding-top: 1em; +} + +/** ******************************************************************* + * 5) Navigation and menus + *********************************************************************/ + +#gSiteMenu, +.gBreadcrumbs, +#gTagCloud ul { + font-size: 1.2em; } -.rtl #gAdminGraphics .gAvailable .gBlock { +/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader #gLoginMenu { + color: #999; float: right; - margin-left: 1em; - margin-right: 0em; } -#gSiteTheme, -#gAdminTheme { +/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gSiteMenu { float: left; - width: 48%; + margin-top: 20px; + padding: 0 20px 0 0; } -.rtl #gSiteTheme, -.rtl #gAdminTheme { - float: right; +#gSiteMenu ul { + margin-bottom: 0; +} + +/* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gContent .gThumbMenu { + bottom: 0; + left: 0; + position: absolute; + width: 100%; } -#gSiteTheme { - margin-right: 1em; +#gContent .gThumbMenu li { + border-left: none; + border-right: none; + border-bottom: none; } -#gUserAdminList { +#gContent .gThumbMenu li li { + padding: .3em; +} + +#gContent .gThumbMenu a:hover { + text-decoration: none; +} + +/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gViewMenu { margin-bottom: 1em; } -#gUserAdminList td { - vertical-align: bottom; + +#gViewMenu a { + background-repeat: no-repeat; + background-position: 50% 50%; + height: 28px !important; + width: 43px !important; } -#gUserAdminList .gDraggable:hover { - border: 1px dashed black; +#gViewMenu #gHybridLink { + background-image: url('../images/ico-view-hybrid.png'); } -#gUserAdminList .admin { - color: #55f; - font-weight: bold; +#gViewMenu #gSlideshowLink { + background-image: url('../images/ico-view-slideshow.png'); +} + +#gViewMenu .gFullSizeLink { + background-image: url('../images/ico-view-fullsize.png'); } -.gActions a, -.gActions span { - margin-right: 3em; +#gViewMenu #gCommentsLink { + background-image: url('../images/ico-view-comments.png'); +} + +#gViewMenu #gDigibugLink { + background-image: url('../images/ico-print.png'); +} + +/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gBreadcrumbs { + background-color: #fff; + border-top: 1px solid #ccc; + clear: both; + margin: 0 -20px; + padding-left: 20px; } -li.gGroup { +.gBreadcrumbs li { + background: transparent url('../images/ico-separator.gif') no-repeat scroll left center; float: left; + padding: 10px 6px 10px 16px !important; +} + +.gBreadcrumbs li.root { + background: transparent; +} + +.gBreadcrumbs li a, +.gBreadcrumbs li span { display: block; - width: 200px; - border: 1px solid gray; - padding: 0; - margin: 0 1em 1em 0; } -.rtl li.gGroup { - float: right; +.gBreadcrumbs li.active, +.gBreadcrumbs li.active span { + font-weight: bold; } -li.gGroup h4 { - background-color: #EEEEEE; - border-bottom: 1px dashed #CCCCCC; - padding: .5em 0 .5em .5em; +#gAddPhotos .gBreadcrumbs { + font-size: .9em; } -li.gGroup .gButtonLink { - padding: 0; + +/* Tags and cloud ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gTagCloud ul { + text-align: justify; } -li.gGroup ul, li.gGroup div { - height: 180px; - margin: 1px; - overflow: auto; - padding-top: .2em; + +#gTagCloud ul li { + display: inline; + line-height: 1.5em; + text-align: justify; } -li.gGroup div p { - color: gray; - text-align: center; - padding: 2em .5em 0 .5em + +#gTagCloud ul li a { + text-decoration: none; } -li.gGroup .gUser { - padding: .2em 0 0 .5em; + +#gTagCloud ul li span { + display: none; } -li.gGroup .gUser .gButtonLink { - vertical-align: middle; + +#gTagCloud ul li.size1 a { + color: #9cf; + font-size: 80%; + font-weight: 100; +} + +#gTagCloud ul li.size2 a { + color: #69f; + font-size: 90%; + font-weight: 300; +} + +#gTagCloud ul li.size3 a { + color: #69c; + font-size: 100%; + font-weight: 500; +} + +#gTagCloud ul li.size4 a { + color: #369; + font-size: 110%; + font-weight: 700; } -li.gDefaultGroup h4, li.gDefaultGroup .gUser { - color: gray; +#gTagCloud ul li.size5 a { + color: #0e2b52; + font-size: 120%; + font-weight: 900; } -#gAdminAdvancedSettings tr.setting:hover { - background: #ffc; +#gTagCloud ul li.size6 a { + color: #0e2b52; + font-size: 130%; + font-weight: 900; +} + +#gTagCloud ul li.size7 a { + color: #0e2b52; + font-size: 140%; + font-weight: 900; +} + +#gTagCloud ul li a:hover { + color: #f30; + text-decoration: underline; +} + +/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gPager { + clear: both; + margin: 0; + padding: 5px 0 !important; + width: 100%; +} + +.gPager li { + float: left; + margin: 0; + width: 30%; +} + +.gPager .gInfo { + text-align: center; + width: 40%; } /** ******************************************************************* - * 5) Browser hacks + * 6) Browser hacks *********************************************************************/ +#gSiteMenu:after, #gHeader:after, -#gAdminCommentsMenu:after, -#gGroupAdmin:after, -.gSelected:after, -.gAvailable .gBlock:after, -#gModuleCreateForm ul li ul:after, -#gDeveloperTools:after, -#gPhotoStream:after { +.gBreadcrumbs:after, +#gAlbumGrid:after, +.gPager:after, +#gViewMenu:after { clear: both; content: "."; display: block; @@ -316,143 +777,315 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { } /** ******************************************************************* - * 6) jQuery and jQuery UI + * 7) jQuery and jQuery UI *********************************************************************/ -#gPanel { - display: none; - padding: 1em; +/* Superfish menu overrides ~~~~~~~~~~~~~~ */ + +.sf-menu li li, .sf-menu li li ul li { + background-color: #bdd2ff; } -#gPanel legend { - display: none; +.sf-menu li:hover { + background-color: #dfe9ff; } -#gPanel fieldset { - border: none; +/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ + +.gLoadingLarge { + background: #e8e8e8 url('../images/loading-lg.gif') no-repeat center center; + font-size: 0; +} + +.gDialogLoadingLarge { + background: url('../images/loading-lg.gif') no-repeat center center !important; + font-size: 0; } -.ui-draggable { +.gLoadingSmall { + background: #e8e8e8 url('../images/loading-sm.gif') no-repeat center center; + font-size: 0; +} + +.gDraggable { cursor: move; } -.gButtonSetVertical a { - width: 8em !important; +.gDropTarget { + background-color: #cfdeff; + border: 1px dotted #999; + height: 100px; + margin: 1em 0; +} + +/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ + +.ui-widget-overlay { + background: #000; + opacity: .7; + filter: Alpha(Opacity=70); } -#gAdminDashboard .ui-dialog-titlebar, -#gAdminDashboardSidebar .ui-dialog-titlebar { - padding: .2em .4em; +#gDialog { + text-align: left; } -/**** Stuff that needs a home! ****/ -#gTagAdmin { - table-layout: fixed; +#gDialog li { + padding-left: 0; } -#gTagAdmin td { - border: 0; + +#gDialog form input[type="text"], +#gDialog form input[type="password"] { + width: 100%; } -#gTagAdmin ul { - padding-bottom: .3em; + +#gDialog #gLoginForm, +#gDialog #gAddUserForm, +#gDialog #gAddGroupForm { + margin: 0 auto; + width: 270px; } -#gTagAdmin li { - padding: .1em 0 .2em .3em; + +#gDialog fieldset { + border: none; } -#gTagAdmin .gColumn { - float: left; - width: 200px; + +#gDialog legend { + display: none; } -.rtl #gTagAdmin .gColumn { - float: right; + +/* jQuery UI ThemeRoller buttons */ + +.gButtonLink { + display: inline-block; + margin: 0 4px 0 0; + padding: .2em .4em; + outline: 0; } -.gEditable { - padding: .1em .3em .2em .3em; + +.gButtonSet { + padding-left: 1px; } -.gEditable:hover { - background-color: #ffc; - cursor: text; + +.gButtonSet li { + float: left; } -#gRenameTagForm input { - padding: 0 .2em 0 .2em; - clear: none; + +.gButtonSet .gButtonLink { + margin: 0; +} + +.ui-icon-left .ui-icon { float: left; - margin: 0 .2em 0 0; + margin-right: .2em; } -.rtl #gRenameTagForm input { + +.ui-icon-right .ui-icon { float: right; + margin-left: .2em; } -#gRenameTagForm input[type="submit"] { - height: 25px; + +.ui-icon-rotate-ccw { + background-position: -192px -64px; } -#gRenameTagForm a, #gRenameTagForm span { - display: block; - float: left; - padding: .2em .2em 0 .1em; + +.ui-icon-rotate-cw { + background-position: -208px -64px; } -.rtl #gRenameTagForm a, #gRenameTagForm span { - float: right; + +/* STUFF THAT NEEDS A HOME */ + +#gMove ul { + padding-left: 1em; } -#gProgress button { - float: right; - margin-top: 1em; + +#gMove .selected { + background: #999; } -.rtl #gProgress button { + +/* Server Add */ + +#gServerAdd button { float: left; + margin-bottom: .5em; } -#gTaskLogDialog h1 { - font-size: 1.1em; +#gServerAddTree { + cursor: pointer; + padding-left: 4px; } -.gTaskLog { - border: 1pt solid; - font-size: .9em; - height: 400px; - margin: .5em 0; +#gServerAddTree li { + padding: 0; + float: none; +} + +#gServerAddTree span.selected { + background: #ddd; +} + +#gServerAddTree { + border: 1px solid #ccc; + height: 25em; overflow: auto; - padding: .5em + margin-bottom: .5em; + padding-top: .5em; + padding-bottom: .5em; } +#gServerAdd ul ul li { + padding-left: 1.2em; +} -/** ******************************************************************* - * 7) Server Add - *********************************************************************/ -#gServerAddAdmin { - margin:auto; - text-align: left; +#gServerAdd .gBreadcrumbs { + font-size: 1em; + padding: 0; + margin: 0; + border-top-width: 0; } -.rtl #gServerAddAdmin { - text-align: right; +#gServerAdd p { + margin: 0; } -#gServerAddAdmin form fieldset { - border: medium none; +#gServerAdd .gBreadcrumbs li { + padding: 10px 6px 10px 16px; } -#gServerAddAdmin legend { - display: none; +/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gPermissions .gDenied, +#gPermissions .gAllowed { + text-align: center; + vertical-align: middle; +} +#gPermissions .gDenied { + background-color: #fcc; } +#gPermissions .gAllowed { + background-color: #cfc; +} + +/*************** STUFF THAT NEEDS A HOME ****************/ -#gServerAddAdmin .gWarning { - background-color: #FFFF99; +.gProgressBar { + height: 1em; + width: 100%; + margin-top: .5em; + display: inline-block; } -#gAuthorizedPath { - margin: 0 !important; - padding: 0.3em 1.5em 0.3em 1em; +#gAddPhotos p { + margin: 0; + padding: 0; } -#gServerAdd Admin #path { - width: 80%; +#gAddPhotosCanvas { + height: 325px; + width: 450px; + overflow: auto; } -.gRemoveDir:hover { - cursor: pointer; +#gAddPhotosQueue .progressbar { + height: 4px; } -#gLanguageSettingsForm .checklist li { - width: 150px; - overflow: hidden; +#gAddPhotosQueue .title { + font-size: 1.25em; +} + +#gAddPhotosQueue .status { + font-size: .75em; +} + +#gAddPhotosQueue .box { + margin-bottom: 8px; + padding: 4px; +} + +#gAddPhotosQueue .pending { + background-color: #e8e8e8; + border: 1px solid #d7d7d7; +} + +#gAddPhotosQueue .error { + background-color: #fcc; + border: 1px solid #ebb; +} + +#gAddPhotosQueue .uploading { + background-color: #ff9; + border: 1px solid #ee8; +} + +#gAddPhotosQueue .complete { + background-color: #cfc; + border: 1px solid #beb; +} + +#gAdminG2ImportNotes { + padding-bottom: 20px; +} + +#gAdminG2ImportDetails { + padding-top: 20px; +} + +#gAdminG2ImportDetails .gWarning { + margin-top: 4px; +} + +#gAdminG2ImportDetails .gInfo { + padding: 2px; + border: 1px solid #999; + margin-bottom: 10px; +} + +#gAdminG2ImportNotes p, +#gAdminG2ImportDetails .gInfo p { + padding: 0; + margin: 0; +} + +#gAdminG2ImportNotes ul li, +#gAdminG2Import .gInfo ul li { + padding-left: 0; + margin-left: 20px; + list-style-type: disc; +} + +/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */ + +.rtl { + direction: rtl; +} + +.rtl caption, +.rtl th, +.rtl #gDialog { + text-align: right; +} + +.rtl #gHeader #gQuickSearchForm, +.rtl #gForgotPasswordLink, +.rtl #gHeader #gLoginMenu, +.rtl .ui-icon-right .ui-icon { + clear: left; + float: left; +} + +.rtl #gDialog .gCancel, +.rtl form ul ul li, +.rtl input[type="submit"], +.rtl input[type="reset"], +.rtl .gShortForm li, +.rtl #gHeader #gLogo img, +.rtl #gContent #gAlbumGrid .gItem, +.rtl #gSiteMenu, +.rtl .gBreadcrumbs li, +.rtl .gPager li, +.rtl .gButtonSet li, +.rtl .ui-icon-left .ui-icon { + float: right; } diff --git a/themes/admin_default/images/ico-print.png b/themes/admin_default/images/ico-print.png new file mode 100644 index 00000000..b82a8e1e Binary files /dev/null and b/themes/admin_default/images/ico-print.png differ diff --git a/themes/admin_default/images/ico-separator.gif b/themes/admin_default/images/ico-separator.gif new file mode 100644 index 00000000..3de2d0d3 Binary files /dev/null and b/themes/admin_default/images/ico-separator.gif differ diff --git a/themes/admin_default/images/ico-view-comments.png b/themes/admin_default/images/ico-view-comments.png new file mode 100644 index 00000000..e5d3630f Binary files /dev/null and b/themes/admin_default/images/ico-view-comments.png differ diff --git a/themes/admin_default/images/ico-view-fullsize.png b/themes/admin_default/images/ico-view-fullsize.png new file mode 100644 index 00000000..0be23e9b Binary files /dev/null and b/themes/admin_default/images/ico-view-fullsize.png differ diff --git a/themes/admin_default/images/ico-view-hybrid.png b/themes/admin_default/images/ico-view-hybrid.png new file mode 100644 index 00000000..ee902e55 Binary files /dev/null and b/themes/admin_default/images/ico-view-hybrid.png differ diff --git a/themes/admin_default/images/ico-view-slideshow.png b/themes/admin_default/images/ico-view-slideshow.png new file mode 100644 index 00000000..82f61f63 Binary files /dev/null and b/themes/admin_default/images/ico-view-slideshow.png differ diff --git a/themes/admin_default/images/loading-lg.gif b/themes/admin_default/images/loading-lg.gif new file mode 100644 index 00000000..cc70a7a8 Binary files /dev/null and b/themes/admin_default/images/loading-lg.gif differ diff --git a/themes/admin_default/images/loading-sm.gif b/themes/admin_default/images/loading-sm.gif new file mode 100644 index 00000000..d0bce154 Binary files /dev/null and b/themes/admin_default/images/loading-sm.gif differ diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index b0ddb6c5..d27f9260 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -7,28 +7,28 @@ <?= t("Admin Dashboard") ?> " type="image/x-icon" /> - css("lib/yui/reset-fonts-grids.css") ?> - css("lib/themeroller/ui.base.css") ?> - css("lib/superfish/css/superfish.css") ?> - css("themes/default/css/screen.css") ?> - theme_css("css/screen.css") ?> + css("yui/reset-fonts-grids.css") ?> + css("themeroller/ui.base.css") ?> + css("superfish/css/superfish.css") ?> + css("screen.css") ?> + css("admin_screen.css") ?> - script("lib/jquery.js") ?> - script("lib/jquery.form.js") ?> - script("lib/jquery-ui.js") ?> - script("lib/gallery.common.js") ?> + script("jquery.js") ?> + script("jquery.form.js") ?> + script("jquery-ui.js") ?> + script("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") ?> + script("gallery.dialog.js") ?> + script("superfish/js/superfish.js") ?> + script("jquery.dropshadow.js") ?> + script("ui.init.js") ?> admin_head() ?> diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index 5428d9fd..c903edf5 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -4,7 +4,7 @@ diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index 181a2c46..66282bae 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -23,13 +23,13 @@ - " type="image/x-icon" /> - css("lib/yui/reset-fonts-grids.css") ?> - css("lib/superfish/css/superfish.css") ?> - css("lib/themeroller/ui.base.css") ?> - theme_css("css/screen.css") ?> + " type="image/x-icon" /> + css("yui/reset-fonts-grids.css") ?> + css("superfish/css/superfish.css") ?> + css("themeroller/ui.base.css") ?> + css("screen.css") ?> page_type == 'album'): ?> @@ -45,26 +45,26 @@ - script("lib/jquery.js") ?> - script("lib/jquery.form.js") ?> - script("lib/jquery-ui.js") ?> - script("lib/gallery.common.js") ?> + script("jquery.js") ?> + script("jquery.form.js") ?> + script("jquery-ui.js") ?> + script("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") ?> + script("gallery.dialog.js") ?> + script("gallery.form.js") ?> + script("superfish/js/superfish.js") ?> + script("jquery.localscroll.js") ?> + script("ui.init.js") ?> head() they get combined */ ?> page_type == "photo"): ?> - script("lib/jquery.scrollTo.js") ?> - script("lib/gallery.show_full_size.js") ?> + script("jquery.scrollTo.js") ?> + script("gallery.show_full_size.js") ?> page_type == "movie"): ?> - script("lib/flowplayer.js") ?> + script("flowplayer.js") ?> head() ?> -- cgit v1.2.3 From d4104a23ec504e451e7a96f9798ea4ed695e9d97 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 22 Jul 2009 15:16:56 -0700 Subject: Add explicit unit tests for access::user_can --- modules/gallery/helpers/access.php | 1 + modules/gallery/tests/Access_Helper_Test.php | 37 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'modules') diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index 65316a8a..956b4e5c 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -209,6 +209,7 @@ class access_Core { $access = model_cache::get("access_intent", $album->id, "item_id"); $access->__set("{$perm_name}_{$group->id}", $value); $access->save(); + $album->reload(); if ($perm_name == "view") { self::_update_access_view_cache($group, $album); diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php index 1352b493..59cec453 100644 --- a/modules/gallery/tests/Access_Helper_Test.php +++ b/modules/gallery/tests/Access_Helper_Test.php @@ -64,6 +64,43 @@ class Access_Helper_Test extends Unit_Test_Case { $this->assert_false(array_key_exists("access_test_{$group->id}", $fields)); } + public function user_can_access_test() { + $access_test = group::create("access_test"); + + $root = ORM::factory("item", 1); + access::allow($access_test, "view", $root); + + $item = album::create($root, rand(), "test album"); + + access::deny(group::everybody(), "view", $item); + access::deny(group::registered_users(), "view", $item); + + $user = user::create("access_test", "Access Test", ""); + foreach ($user->groups as $group) { + $user->remove($group); + } + $user->add($access_test); + $user->save(); + + $this->assert_true(access::user_can($user, "view", $item), "Should be able to view"); + } + + public function user_can_no_access_test() { + $root = ORM::factory("item", 1); + $item = album::create($root, rand(), "test album"); + + access::deny(group::everybody(), "view", $item); + access::deny(group::registered_users(), "view", $item); + + $user = user::create("access_test", "Access Test", ""); + foreach ($user->groups as $group) { + $user->remove($group); + } + $user->save(); + + $this->assert_false(access::user_can($user, "view", $item), "Should be unable to view"); + } + public function adding_and_removing_items_adds_ands_removes_rows_test() { $root = ORM::factory("item", 1); $item = album::create($root, rand(), "test album"); -- cgit v1.2.3 From 85ed445e2333a884e140afebaeba35d08079cda6 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 22 Jul 2009 15:20:30 -0700 Subject: remove an extra ->reload() that was there for testing --- modules/gallery/helpers/access.php | 1 - 1 file changed, 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index 956b4e5c..65316a8a 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -209,7 +209,6 @@ class access_Core { $access = model_cache::get("access_intent", $album->id, "item_id"); $access->__set("{$perm_name}_{$group->id}", $value); $access->save(); - $album->reload(); if ($perm_name == "view") { self::_update_access_view_cache($group, $album); -- cgit v1.2.3 From 7c2cea01a50227088d9da567b08b9fde54b4b95f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 23 Jul 2009 07:02:10 -0700 Subject: Fix for ticket #502 This patch allows users with only view permission to request fullsize prints using Digibug. There is now a Digibug config file that contains the IP ranges of the Digibug servers. Any request for the full size image via the print proxy must come from within the ranges in the config file. The reason for the "if (!Test_Mode) {..." is that the print proxy makes a call to Kohana::close_buffers, which closes all the output buffers and then we see the image download on the console which messes up the test output. --- modules/digibug/config/digibug.php | 29 ++++++++ modules/digibug/controllers/digibug.php | 50 ++++++++++--- modules/digibug/helpers/digibug_menu.php | 2 +- modules/digibug/tests/Digibug_Controller_Test.php | 91 +++++++++++++++++++++++ 4 files changed, 159 insertions(+), 13 deletions(-) create mode 100644 modules/digibug/config/digibug.php create mode 100644 modules/digibug/tests/Digibug_Controller_Test.php (limited to 'modules') diff --git a/modules/digibug/config/digibug.php b/modules/digibug/config/digibug.php new file mode 100644 index 00000000..6cd165d1 --- /dev/null +++ b/modules/digibug/config/digibug.php @@ -0,0 +1,29 @@ + email address that appears as the from address + * line-length => word wrap length (PHP documentations suggest no larger tha 70 characters + * reply-to => what goes into the reply to header + */ +$config["ranges"] = array( + "Digibug1" => array("low" => "65.249.152.0", "high" => "65.249.159.255"), + "Digibug2" => array("low" => "208.122.55.0", "high" => "208.122.55.255") +); diff --git a/modules/digibug/controllers/digibug.php b/modules/digibug/controllers/digibug.php index d881db9b..e0f4b6bf 100644 --- a/modules/digibug/controllers/digibug.php +++ b/modules/digibug/controllers/digibug.php @@ -21,7 +21,7 @@ class Digibug_Controller extends Controller { public function print_photo($id) { access::verify_csrf(); $item = ORM::factory("item", $id); - access::required("view_full", $item); + access::required("view", $item); if (access::group_can(group::everybody(), "view_full", $item)) { $full_url = $item->file_url(true); @@ -56,6 +56,30 @@ class Digibug_Controller extends Controller { } public function print_proxy($type, $id) { + // If its a request for the full size then make sure we are coming from an + // authorized address + if ($type == "full") { + $remote_addr = ip2long($this->input->server("REMOTE_ADDR")); + if ($remote_addr === false) { + Kohana::show_404(); + } + $config = Kohana::config("digibug"); + + $authorized = false; + foreach ($config["ranges"] as $ip_range) { + $low = ip2long($ip_range["low"]); + $high = ip2long($ip_range["high"]); + $authorized = $low !== false && $high !== false && + $low <= $remote_addr && $remote_addr <= $high; + if ($authorized) { + break; + } + } + if (!$authorized) { + Kohana::show_404(); + } + } + $proxy = ORM::factory("digibug_proxy", array("uuid" => $id)); if (!$proxy->loaded || !$proxy->item->loaded) { Kohana::show_404(); @@ -69,16 +93,18 @@ class Digibug_Controller extends Controller { // We don't need to save the session for this request Session::abort_save(); - // Dump out the image - header("Content-Type: $proxy->item->mime_type"); - Kohana::close_buffers(false); - $fd = fopen($file, "rb"); - fpassthru($fd); - fclose($fd); + if (!TEST_MODE) { + // Dump out the image + header("Content-Type: $proxy->item->mime_type"); + Kohana::close_buffers(false); + $fd = fopen($file, "rb"); + fpassthru($fd); + fclose($fd); - // If the request was for the image and not the thumb, then delete the proxy. - if ($type == "full") { - $proxy->delete(); + // If the request was for the image and not the thumb, then delete the proxy. + if ($type == "full") { + $proxy->delete(); + } } $this->_clean_expired(); @@ -89,8 +115,8 @@ class Digibug_Controller extends Controller { } private function _clean_expired() { - Database::instance()>query( - "DELETE FROM {digibug_proxy} " . + Database::instance()->query( + "DELETE FROM {digibug_proxies} " . "WHERE request_date <= (CURDATE() - INTERVAL 10 DAY) " . "LIMIT 20"); } diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php index c95cada2..3f70fa24 100644 --- a/modules/digibug/helpers/digibug_menu.php +++ b/modules/digibug/helpers/digibug_menu.php @@ -37,7 +37,7 @@ class digibug_menu { } static function thumb($menu, $theme, $item) { - if ($item->type == "photo" && access::can("view_full", $item)) { + if ($item->type == "photo") { $menu->get("options_menu") ->append( Menu::factory("link") diff --git a/modules/digibug/tests/Digibug_Controller_Test.php b/modules/digibug/tests/Digibug_Controller_Test.php new file mode 100644 index 00000000..6838da5c --- /dev/null +++ b/modules/digibug/tests/Digibug_Controller_Test.php @@ -0,0 +1,91 @@ +_server; + + if ($this->_proxy) { + $this->_proxy->delete(); + } + } + + public function setup() { + $this->_server = $_SERVER; + + $root = ORM::factory("item", 1); + $this->_album = album::create($root, rand(), "test album"); + access::deny(group::everybody(), "view_full", $this->_album); + access::deny(group::registered_users(), "view_full", $this->_album); + + $rand = rand(); + $this->_item = photo::create($this->_album, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", + $rand, $rand); + $this->_proxy = ORM::factory("digibug_proxy"); + $this->_proxy->uuid = md5(rand()); + $this->_proxy->item_id = $this->_item->id; + $this->_proxy->save(); + } + + public function digibug_request_thumb_test() { + try { + $controller = new Digibug_Controller(); + $controller->print_proxy("thumb", $this->_proxy->uuid); + } catch (Exception $e) { + $this->assert_true(false, "Exception Occurred\n" . $e->__toString()); + } + } + + public function digibug_request_full_malicious_ip_test() { + $_SERVER["REMOTE_ADDR"] = "123.456.789.012"; + try { + $controller = new Digibug_Controller(); + $controller->print_proxy("full", $this->_proxy->uuid); + $this->assert_true(false, "Should have failed with an 404 exception"); + } catch (Exception $e) { + if (get_class($e) !== "Kohana_404_Exception") { + $this->assert_true(false, "Exception Occurred\n" . $e->__toString()); + } + } + } + + public function digibug_request_full_authorized_ip_test() { + $config = Kohana::config("digibug"); + if (empty($config)) { + $this->assert_true(false, "The Digibug config is empty"); + } + $ranges = array_values($config["ranges"]); + $low = ip2long($ranges[0]["low"]); + $high = ip2long($ranges[0]["high"]); + + $_SERVER["REMOTE_ADDR"] = long2ip(rand($low, $high)); + try { + $controller = new Digibug_Controller(); + $controller->print_proxy("full", $this->_proxy->uuid); + $results = ob_get_contents(); + } catch (Exception $e) { + $this->assert_true(false, "Exception Occurred\n" . $e->__toString()); + } + } + +} -- cgit v1.2.3 From 6a8cace027525e50070681d6e962b4c61cac3c2e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 23 Jul 2009 08:37:39 -0700 Subject: Test cleanup: 1) Specifically catch Kohana_404_Exception and let other exceptions pass, the test framework will report them as errors 2) Simplify some testing idioms 3) Change malicious address to a legal addr --- modules/digibug/tests/Digibug_Controller_Test.php | 33 +++++++---------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'modules') diff --git a/modules/digibug/tests/Digibug_Controller_Test.php b/modules/digibug/tests/Digibug_Controller_Test.php index 6838da5c..859ff637 100644 --- a/modules/digibug/tests/Digibug_Controller_Test.php +++ b/modules/digibug/tests/Digibug_Controller_Test.php @@ -42,50 +42,37 @@ class Digibug_Controller_Test extends Unit_Test_Case { $this->_item = photo::create($this->_album, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand); $this->_proxy = ORM::factory("digibug_proxy"); - $this->_proxy->uuid = md5(rand()); + $this->_proxy->uuid = md5(rand()); $this->_proxy->item_id = $this->_item->id; $this->_proxy->save(); } public function digibug_request_thumb_test() { - try { - $controller = new Digibug_Controller(); - $controller->print_proxy("thumb", $this->_proxy->uuid); - } catch (Exception $e) { - $this->assert_true(false, "Exception Occurred\n" . $e->__toString()); - } + $controller = new Digibug_Controller(); + $controller->print_proxy("thumb", $this->_proxy->uuid); } public function digibug_request_full_malicious_ip_test() { - $_SERVER["REMOTE_ADDR"] = "123.456.789.012"; + $_SERVER["REMOTE_ADDR"] = "123.123.123.123"; try { $controller = new Digibug_Controller(); $controller->print_proxy("full", $this->_proxy->uuid); $this->assert_true(false, "Should have failed with an 404 exception"); - } catch (Exception $e) { - if (get_class($e) !== "Kohana_404_Exception") { - $this->assert_true(false, "Exception Occurred\n" . $e->__toString()); - } + } catch (Kohana_404_Exception $e) { + // expected behavior } } public function digibug_request_full_authorized_ip_test() { $config = Kohana::config("digibug"); - if (empty($config)) { - $this->assert_true(false, "The Digibug config is empty"); - } + $this->assert_true(!empty($config), "The Digibug config is empty"); + $ranges = array_values($config["ranges"]); $low = ip2long($ranges[0]["low"]); $high = ip2long($ranges[0]["high"]); $_SERVER["REMOTE_ADDR"] = long2ip(rand($low, $high)); - try { - $controller = new Digibug_Controller(); - $controller->print_proxy("full", $this->_proxy->uuid); - $results = ob_get_contents(); - } catch (Exception $e) { - $this->assert_true(false, "Exception Occurred\n" . $e->__toString()); - } + $controller = new Digibug_Controller(); + $controller->print_proxy("full", $this->_proxy->uuid); } - } -- cgit v1.2.3 From 5999ccb512d65ad9ae06a0a5542eb1123b44e9db Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 23 Jul 2009 08:40:00 -0700 Subject: Remove extra error log line --- modules/notification/helpers/notification.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'modules') diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php index c3ffeb18..d91a37e8 100644 --- a/modules/notification/helpers/notification.php +++ b/modules/notification/helpers/notification.php @@ -79,8 +79,6 @@ class notification { $subscribers = array(); foreach ($users as $user) { - Kohana::log("error", "user: $user->name"); - if (access::user_can($user, "view", $item)) { $subscribers[$user->email] = 1; } -- cgit v1.2.3