From 0f766b149d0cee7af664f2321fddc6f04cda70ac Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 16 Jul 2009 12:29:16 -0700 Subject: Second non-trivial change to the event code. We now publish model related events from within the model handling code. The only exception to this currently is item_created which is challenging because we have to save the item using ORM_MPTT::add_to_parent() before the object itself is fully set up. When we get that down to one call to save() we can publish that event from within the model also. --- modules/user/helpers/group.php | 1 - modules/user/helpers/user.php | 1 - 2 files changed, 2 deletions(-) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php index 1dace840..04e6efd6 100644 --- a/modules/user/helpers/group.php +++ b/modules/user/helpers/group.php @@ -39,7 +39,6 @@ class group_Core { $group->name = $name; $group->save(); - module::event("group_created", $group); return $group; } diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index a59588f8..4105d745 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -202,7 +202,6 @@ class user_Core { $user->add(group::registered_users()); $user->save(); - module::event("user_created", $user); return $user; } -- cgit v1.2.3 From df22832a5b7e7c1962940becab1c90aaec3392f9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 17 Jul 2009 18:35:06 -0700 Subject: Rename "locale" helper to "locales" to avoid conflicting with PHP 5.3. Fixes ticket #194 --- modules/gallery/controllers/admin_languages.php | 6 +- modules/gallery/helpers/l10n_client.php | 2 +- modules/gallery/helpers/locale.php | 124 ------------------------ modules/gallery/helpers/locales.php | 124 ++++++++++++++++++++++++ modules/gallery/libraries/MY_View.php | 2 +- modules/gallery/views/l10n_client.html.php | 2 +- modules/user/helpers/user.php | 2 +- 7 files changed, 131 insertions(+), 131 deletions(-) delete mode 100644 modules/gallery/helpers/locale.php create mode 100644 modules/gallery/helpers/locales.php (limited to 'modules/user/helpers') diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index d1b805da..ae90ad07 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -36,7 +36,7 @@ class Admin_Languages_Controller extends Admin_Controller { $form = $this->_languages_form(); if ($form->validate()) { module::set_var("gallery", "default_locale", $form->choose_language->locale->value); - locale::update_installed($form->choose_language->installed_locales->value); + locales::update_installed($form->choose_language->installed_locales->value); message::success(t("Settings saved")); } url::redirect("admin/languages"); @@ -89,8 +89,8 @@ class Admin_Languages_Controller extends Admin_Controller { } private function _languages_form() { - $all_locales = locale::available(); - $installed_locales = locale::installed(); + $all_locales = locales::available(); + $installed_locales = locales::installed(); $form = new Forge("admin/languages/save", "", "post", array("id" => "gLanguageSettingsForm")); $group = $form->group("choose_language") ->label(t("Language settings")); diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php index 6d4da0eb..b576b4e1 100644 --- a/modules/gallery/helpers/l10n_client.php +++ b/modules/gallery/helpers/l10n_client.php @@ -74,7 +74,7 @@ class l10n_client_Core { $request->locales = array(); $request->messages = new stdClass(); - $locales = locale::installed(); + $locales = locales::installed(); foreach ($locales as $locale => $locale_data) { $request->locales[] = $locale; } diff --git a/modules/gallery/helpers/locale.php b/modules/gallery/helpers/locale.php deleted file mode 100644 index 41b78834..00000000 --- a/modules/gallery/helpers/locale.php +++ /dev/null @@ -1,124 +0,0 @@ -$code)) { - $installed[$code] = $available[$code]; - } - } - return $installed; - } - - static function update_installed($locales) { - // Ensure that the default is included... - $default = module::get_var("gallery", "default_locale"); - $locales = in_array($default, $locales) - ? $locales - : array_merge($locales, array($default)); - - module::set_var("gallery", "installed_locales", join("|", $locales)); - } - - // @todo Might want to add a localizable language name as well. - private static function _init_language_data() { - $l["af_ZA"] = "Afrikaans"; // Afrikaans - $l["ar_SA"] = "العربية"; // Arabic - $l["be_BY"] = "Беларускі"; // Belarusian - $l["bg_BG"] = "Български"; // Bulgarian - $l["ca_ES"] = "Catalan"; // Catalan - $l["cs_CZ"] = "Česky"; // Czech - $l["da_DK"] = "Dansk"; // Danish - $l["de_DE"] = "Deutsch"; // German - $l["el_GR"] = "Greek"; // Greek - $l["en_GB"] = "English (UK)"; // English (UK) - $l["en_US"] = "English (US)"; // English (US) - $l["es_AR"] = "Español (AR)"; // Spanish (AR) - $l["es_ES"] = "Español"; // Spanish (ES) - $l["es_MX"] = "Español (MX)"; // Spanish (MX) - $l["et_EE"] = "Eesti"; // Estonian - $l["eu_ES"] = "Euskara"; // Basque - $l["fa_IR"] = "فارسي"; // Farsi - $l["fi_FI"] = "Suomi"; // Finnish - $l["fr_FR"] = "Français"; // French - $l["ga_IE"] = "Gaeilge"; // Irish - $l["he_IL"] = "עברית"; // Hebrew - $l["hu_HU"] = "Magyar"; // Hungarian - $l["is_IS"] = "Icelandic"; // Icelandic - $l["it_IT"] = "Italiano"; // Italian - $l["ja_JP"] = "日本語"; // Japanese - $l["ko_KR"] = "한국말"; // Korean - $l["lt_LT"] = "Lietuvių"; // Lithuanian - $l["lv_LV"] = "Latviešu"; // Latvian - $l["nl_NL"] = "Nederlands"; // Dutch - $l["no_NO"] = "Norsk bokmål"; // Norwegian - $l["pl_PL"] = "Polski"; // Polish - $l["pt_BR"] = "Português Brasileiro"; // Portuguese (BR) - $l["pt_PT"] = "Português"; // Portuguese (PT) - $l["ro_RO"] = "Română"; // Romanian - $l["ru_RU"] = "Русский"; // Russian - $l["sk_SK"] = "Slovenčina"; // Slovak - $l["sl_SI"] = "Slovenščina"; // Slovenian - $l["sr_CS"] = "Srpski"; // Serbian - $l["sv_SE"] = "Svenska"; // Swedish - $l["tr_TR"] = "Türkçe"; // Turkish - $l["uk_UA"] = "Українська"; // Ukrainian - $l["vi_VN"] = "Tiếng Việt"; // Vietnamese - $l["zh_CN"] = "简体中文"; // Chinese (CN) - $l["zh_TW"] = "繁體中文"; // Chinese (TW) - asort($l, SORT_LOCALE_STRING); - self::$locales = $l; - } - - static function display_name($locale=null) { - if (empty(self::$locales)) { - self::_init_language_data(); - } - $locale or $locale = I18n::instance()->locale(); - - return self::$locales["$locale"]; - } - - static function is_rtl($locale=null) { - $locale or $locale = I18n::instance()->locale(); - list ($language, $territory) = explode('_', $locale . "_"); - return in_array($language, array("he", "fa", "ar")); - } -} \ No newline at end of file diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php new file mode 100644 index 00000000..3762b97b --- /dev/null +++ b/modules/gallery/helpers/locales.php @@ -0,0 +1,124 @@ +$code)) { + $installed[$code] = $available[$code]; + } + } + return $installed; + } + + static function update_installed($locales) { + // Ensure that the default is included... + $default = module::get_var("gallery", "default_locale"); + $locales = in_array($default, $locales) + ? $locales + : array_merge($locales, array($default)); + + module::set_var("gallery", "installed_locales", join("|", $locales)); + } + + // @todo Might want to add a localizable language name as well. + private static function _init_language_data() { + $l["af_ZA"] = "Afrikaans"; // Afrikaans + $l["ar_SA"] = "العربية"; // Arabic + $l["be_BY"] = "Беларускі"; // Belarusian + $l["bg_BG"] = "Български"; // Bulgarian + $l["ca_ES"] = "Catalan"; // Catalan + $l["cs_CZ"] = "Česky"; // Czech + $l["da_DK"] = "Dansk"; // Danish + $l["de_DE"] = "Deutsch"; // German + $l["el_GR"] = "Greek"; // Greek + $l["en_GB"] = "English (UK)"; // English (UK) + $l["en_US"] = "English (US)"; // English (US) + $l["es_AR"] = "Español (AR)"; // Spanish (AR) + $l["es_ES"] = "Español"; // Spanish (ES) + $l["es_MX"] = "Español (MX)"; // Spanish (MX) + $l["et_EE"] = "Eesti"; // Estonian + $l["eu_ES"] = "Euskara"; // Basque + $l["fa_IR"] = "فارسي"; // Farsi + $l["fi_FI"] = "Suomi"; // Finnish + $l["fr_FR"] = "Français"; // French + $l["ga_IE"] = "Gaeilge"; // Irish + $l["he_IL"] = "עברית"; // Hebrew + $l["hu_HU"] = "Magyar"; // Hungarian + $l["is_IS"] = "Icelandic"; // Icelandic + $l["it_IT"] = "Italiano"; // Italian + $l["ja_JP"] = "日本語"; // Japanese + $l["ko_KR"] = "한국말"; // Korean + $l["lt_LT"] = "Lietuvių"; // Lithuanian + $l["lv_LV"] = "Latviešu"; // Latvian + $l["nl_NL"] = "Nederlands"; // Dutch + $l["no_NO"] = "Norsk bokmål"; // Norwegian + $l["pl_PL"] = "Polski"; // Polish + $l["pt_BR"] = "Português Brasileiro"; // Portuguese (BR) + $l["pt_PT"] = "Português"; // Portuguese (PT) + $l["ro_RO"] = "Română"; // Romanian + $l["ru_RU"] = "Русский"; // Russian + $l["sk_SK"] = "Slovenčina"; // Slovak + $l["sl_SI"] = "Slovenščina"; // Slovenian + $l["sr_CS"] = "Srpski"; // Serbian + $l["sv_SE"] = "Svenska"; // Swedish + $l["tr_TR"] = "Türkçe"; // Turkish + $l["uk_UA"] = "Українська"; // Ukrainian + $l["vi_VN"] = "Tiếng Việt"; // Vietnamese + $l["zh_CN"] = "简体中文"; // Chinese (CN) + $l["zh_TW"] = "繁體中文"; // Chinese (TW) + asort($l, SORT_LOCALE_STRING); + self::$locales = $l; + } + + static function display_name($locale=null) { + if (empty(self::$locales)) { + self::_init_language_data(); + } + $locale or $locale = I18n::instance()->locale(); + + return self::$locales["$locale"]; + } + + static function is_rtl($locale=null) { + $locale or $locale = I18n::instance()->locale(); + list ($language, $territory) = explode('_', $locale . "_"); + return in_array($language, array("he", "fa", "ar")); + } +} \ No newline at end of file diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php index 96dcc71b..84ee0892 100644 --- a/modules/gallery/libraries/MY_View.php +++ b/modules/gallery/libraries/MY_View.php @@ -45,7 +45,7 @@ class View extends View_Core { } public function body_attributes() { - if (locale::is_rtl()) { + if (locales::is_rtl()) { return 'class="rtl"'; } return ''; diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index c0cbbfa2..c73719ca 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -9,7 +9,7 @@

locale::display_name())) ?>

+ array("language" => locales::display_name())) ?>
    diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 4105d745..53e9052c 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -79,7 +79,7 @@ class user_Core { } private static function _add_locale_dropdown(&$form, $user=null) { - $locales = locale::installed(); + $locales = locales::installed(); if (count($locales) > 1) { // Put "none" at the first position in the array $locales = array_merge(array("" => t("« none »")), $locales); -- 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/user/helpers') 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 1fbdf1a1e00a176686b051bb932d998ad683b2be Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 23 Jul 2009 10:33:04 -0700 Subject: Add form processing events: user_add_form_admin admin adding a user user_edit_form_admin admin editing a user user_add_form_admin_completed successfully added a user (admin) user_edit_form user editing their own settings user_edit_form_completed successfully edited a user (admin and user editing own settings) --- modules/user/controllers/admin_users.php | 4 +++- modules/user/controllers/users.php | 1 + modules/user/helpers/user.php | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/user/helpers') diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index b5dc6cb5..0a0086ff 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -48,8 +48,10 @@ class Admin_Users_Controller extends Controller { $desired_locale = $form->add_user->locale->value; $user->locale = $desired_locale == "none" ? null : $desired_locale; } - $user->save(); + + module::event("user_add_form_admin_completed", $user, $form); + message::success(t("Created user %user_name", array("user_name" => p::clean($user->name)))); print json_encode(array("result" => "success")); } else { diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php index 46f799c5..0bf2e81d 100644 --- a/modules/user/controllers/users.php +++ b/modules/user/controllers/users.php @@ -39,6 +39,7 @@ class Users_Controller extends REST_Controller { $user->locale = $desired_locale == "none" ? null : $desired_locale; } $user->save(); + module::event("user_edit_form_completed", $user, $form); message::success(t("User information updated.")); print json_encode( diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 53e9052c..a153ab69 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -36,6 +36,8 @@ class user_Core { $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); $group->submit("")->value(t("Save")); $form->add_rules_from($user); + + module::event("user_edit_form", $user); return $form; } @@ -56,6 +58,8 @@ class user_Core { $group->submit("")->value(t("Modify User")); $form->add_rules_from($user); $form->edit_user->password->rules("-required"); + + module::event("user_edit_form_admin", $user); return $form; } @@ -75,6 +79,8 @@ class user_Core { $group->submit("")->value(t("Add User")); $user = ORM::factory("user"); $form->add_rules_from($user); + + module::event("user_add_form_admin", $user); return $form; } -- cgit v1.2.3 From 7a6952720c5aa210d76c3cc716e536edd710cf56 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 25 Jul 2009 14:48:10 -0700 Subject: Pass the variable when the "user_edit_form" event is fired. --- modules/user/helpers/user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index a153ab69..b1722a1e 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -37,7 +37,7 @@ class user_Core { $group->submit("")->value(t("Save")); $form->add_rules_from($user); - module::event("user_edit_form", $user); + module::event("user_edit_form", $user, $form); return $form; } @@ -59,7 +59,7 @@ class user_Core { $form->add_rules_from($user); $form->edit_user->password->rules("-required"); - module::event("user_edit_form_admin", $user); + module::event("user_edit_form_admin", $user, $form); return $form; } -- cgit v1.2.3 From 1e90e40d3a9fe2cb826b56686f23a33879418048 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 28 Jul 2009 13:47:22 -0700 Subject: Use events to generate menus, instead of having xxx_menu helpers. This is the first step towards having a simple, lightweight and unified API for module interaction. --- modules/akismet/helpers/akismet_event.php | 16 ++ modules/akismet/helpers/akismet_menu.php | 36 ----- modules/comment/helpers/comment_event.php | 17 +++ modules/comment/helpers/comment_menu.php | 37 ----- modules/digibug/helpers/digibug_event.php | 50 +++++++ modules/digibug/helpers/digibug_menu.php | 50 ------- modules/g2_import/helpers/g2_import_event.php | 9 ++ modules/g2_import/helpers/g2_import_menu.php | 29 ---- modules/gallery/helpers/gallery_menu.php | 164 --------------------- modules/gallery/libraries/Admin_View.php | 70 +++++++-- modules/gallery/libraries/Theme_View.php | 105 +++++++++---- .../notification/helpers/notification_event.php | 19 +++ modules/notification/helpers/notification_menu.php | 39 ----- modules/organize/helpers/organize_event.php | 33 +++++ modules/organize/helpers/organize_menu.php | 33 ----- modules/recaptcha/helpers/recaptcha_event.php | 8 + modules/recaptcha/helpers/recaptcha_menu.php | 28 ---- modules/server_add/helpers/server_add_event.php | 64 ++++++++ modules/server_add/helpers/server_add_menu.php | 64 -------- modules/slideshow/helpers/slideshow_event.php | 30 ++++ modules/slideshow/helpers/slideshow_menu.php | 51 ------- modules/tag/helpers/tag_event.php | 8 + modules/tag/helpers/tag_menu.php | 28 ---- modules/user/helpers/user_event.php | 8 + modules/user/helpers/user_menu.php | 28 ---- modules/watermark/helpers/watermark_event.php | 29 ++++ modules/watermark/helpers/watermark_menu.php | 29 ---- 27 files changed, 426 insertions(+), 656 deletions(-) delete mode 100644 modules/akismet/helpers/akismet_menu.php delete mode 100644 modules/comment/helpers/comment_menu.php create mode 100644 modules/digibug/helpers/digibug_event.php delete mode 100644 modules/digibug/helpers/digibug_menu.php delete mode 100644 modules/g2_import/helpers/g2_import_menu.php delete mode 100644 modules/gallery/helpers/gallery_menu.php delete mode 100644 modules/notification/helpers/notification_menu.php create mode 100644 modules/organize/helpers/organize_event.php delete mode 100644 modules/organize/helpers/organize_menu.php delete mode 100644 modules/recaptcha/helpers/recaptcha_menu.php create mode 100644 modules/server_add/helpers/server_add_event.php delete mode 100644 modules/server_add/helpers/server_add_menu.php delete mode 100644 modules/slideshow/helpers/slideshow_menu.php delete mode 100644 modules/tag/helpers/tag_menu.php delete mode 100644 modules/user/helpers/user_menu.php create mode 100644 modules/watermark/helpers/watermark_event.php delete mode 100644 modules/watermark/helpers/watermark_menu.php (limited to 'modules/user/helpers') diff --git a/modules/akismet/helpers/akismet_event.php b/modules/akismet/helpers/akismet_event.php index bffc0fd7..d6cde222 100644 --- a/modules/akismet/helpers/akismet_event.php +++ b/modules/akismet/helpers/akismet_event.php @@ -51,4 +51,20 @@ class akismet_event_Core { akismet::submit_ham($new); } } + + static function admin_menu($menu, $theme) { + $menu->get("settings_menu") + ->append(Menu::factory("link") + ->id("akismet") + ->label(t("Akismet")) + ->url(url::site("admin/akismet"))); + + if (module::get_var("akismet", "api_key")) { + $menu->get("statistics_menu") + ->append(Menu::factory("link") + ->id("akismet") + ->label(t("Akismet")) + ->url(url::site("admin/akismet/stats"))); + } + } } diff --git a/modules/akismet/helpers/akismet_menu.php b/modules/akismet/helpers/akismet_menu.php deleted file mode 100644 index ebd948d6..00000000 --- a/modules/akismet/helpers/akismet_menu.php +++ /dev/null @@ -1,36 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("akismet") - ->label(t("Akismet")) - ->url(url::site("admin/akismet"))); - - if (module::get_var("akismet", "api_key")) { - $menu->get("statistics_menu") - ->append(Menu::factory("link") - ->id("akismet") - ->label(t("Akismet")) - ->url(url::site("admin/akismet/stats"))); - } - } -} diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index 3850a001..614c7c65 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -21,4 +21,21 @@ class comment_event_Core { static function item_deleted($item) { Database::instance()->delete("comments", array("item_id" => $item->id)); } + + static function admin_menu($menu, $theme) { + $menu->get("content_menu") + ->append(Menu::factory("link") + ->id("comments") + ->label(t("Comments")) + ->url(url::site("admin/comments"))); + } + + static function photo_menu($menu, $theme) { + $menu + ->append(Menu::factory("link") + ->id("comments") + ->label(t("View comments on this item")) + ->url("#comments") + ->css_id("gCommentsLink")); + } } diff --git a/modules/comment/helpers/comment_menu.php b/modules/comment/helpers/comment_menu.php deleted file mode 100644 index 01881921..00000000 --- a/modules/comment/helpers/comment_menu.php +++ /dev/null @@ -1,37 +0,0 @@ -get("content_menu") - ->append(Menu::factory("link") - ->id("comments") - ->label(t("Comments")) - ->url(url::site("admin/comments"))); - } - - static function photo($menu, $theme) { - $menu - ->append(Menu::factory("link") - ->id("comments") - ->label(t("View comments on this item")) - ->url("#comments") - ->css_id("gCommentsLink")); - } -} diff --git a/modules/digibug/helpers/digibug_event.php b/modules/digibug/helpers/digibug_event.php new file mode 100644 index 00000000..c4f9e560 --- /dev/null +++ b/modules/digibug/helpers/digibug_event.php @@ -0,0 +1,50 @@ +get("settings_menu") + ->append(Menu::factory("link") + ->id("digibug_menu") + ->label(t("Digibug")) + ->url(url::site("admin/digibug"))); + } + + static function photo_menu($menu, $theme) { + $item = $theme->item(); + $menu->append( + Menu::factory("link") + ->id("digibug") + ->label(t("Print with Digibug")) + ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) + ->css_id("gDigibugLink")); + } + + static function thumb_menu($menu, $theme, $item) { + if ($item->type == "photo") { + $menu->get("options_menu") + ->append( + Menu::factory("link") + ->id("digibug") + ->label(t("Print with Digibug")) + ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) + ->css_id("gDigibugLink")); + } + } +} diff --git a/modules/digibug/helpers/digibug_menu.php b/modules/digibug/helpers/digibug_menu.php deleted file mode 100644 index 3f70fa24..00000000 --- a/modules/digibug/helpers/digibug_menu.php +++ /dev/null @@ -1,50 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("digibug_menu") - ->label(t("Digibug")) - ->url(url::site("admin/digibug"))); - } - - static function photo($menu, $theme) { - $item = $theme->item(); - $menu->append( - Menu::factory("link") - ->id("digibug") - ->label(t("Print with Digibug")) - ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) - ->css_id("gDigibugLink")); - } - - static function thumb($menu, $theme, $item) { - if ($item->type == "photo") { - $menu->get("options_menu") - ->append( - Menu::factory("link") - ->id("digibug") - ->label(t("Print with Digibug")) - ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) - ->css_id("gDigibugLink")); - } - } -} diff --git a/modules/g2_import/helpers/g2_import_event.php b/modules/g2_import/helpers/g2_import_event.php index 77b489a7..609e1a45 100644 --- a/modules/g2_import/helpers/g2_import_event.php +++ b/modules/g2_import/helpers/g2_import_event.php @@ -25,4 +25,13 @@ class g2_import_event_Core { static function item_created($item) { g2_import::copy_matching_thumbnails_and_resizes($item); } + + static function admin_menu($menu, $theme) { + $menu + ->get("settings_menu") + ->append(Menu::factory("link") + ->id("g2_import") + ->label(t("Gallery 2 Import")) + ->url(url::site("admin/g2_import"))); + } } diff --git a/modules/g2_import/helpers/g2_import_menu.php b/modules/g2_import/helpers/g2_import_menu.php deleted file mode 100644 index 68d75cb4..00000000 --- a/modules/g2_import/helpers/g2_import_menu.php +++ /dev/null @@ -1,29 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("g2_import") - ->label(t("Gallery 2 Import")) - ->url(url::site("admin/g2_import"))); - } -} diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php deleted file mode 100644 index 040b19e1..00000000 --- a/modules/gallery/helpers/gallery_menu.php +++ /dev/null @@ -1,164 +0,0 @@ -append(Menu::factory("link") - ->id("home") - ->label(t("Home")) - ->url(url::site("albums/1"))); - - $item = $theme->item(); - - $can_edit = $item && access::can("edit", $item); - $can_add = $item && access::can("add", $item); - - if ($can_add) { - $menu->append(Menu::factory("dialog") - ->id("add_photos_item") - ->label(t("Add photos")) - ->url(url::site("simple_uploader/app/$item->id"))); - } - - $menu->append($options_menu = Menu::factory("submenu") - ->id("options_menu") - ->label(t("Options"))); - if ($item && ($can_edit || $can_add)) { - if ($can_edit) { - $options_menu - ->append(Menu::factory("dialog") - ->id("edit_item") - ->label($item->is_album() ? t("Edit album") : t("Edit photo")) - ->url(url::site("form/edit/{$item->type}s/$item->id"))); - } - - // @todo Move album options menu to the album quick edit pane - if ($item->is_album()) { - if ($can_add) { - $options_menu - ->append(Menu::factory("dialog") - ->id("add_album") - ->label(t("Add an album")) - ->url(url::site("form/add/albums/$item->id?type=album"))); - } - - if ($can_edit) { - $options_menu - ->append(Menu::factory("dialog") - ->id("edit_permissions") - ->label(t("Edit permissions")) - ->url(url::site("permissions/browse/$item->id"))); - } - } - } - - if (user::active()->admin) { - $menu->append($admin_menu = Menu::factory("submenu") - ->id("admin_menu") - ->label(t("Admin"))); - self::admin($admin_menu, $theme); - foreach (module::active() as $module) { - if ($module->name == "gallery") { - continue; - } - $class = "{$module->name}_menu"; - if (method_exists($class, "admin")) { - call_user_func_array(array($class, "admin"), array(&$admin_menu, $theme)); - } - } - } - } - - static function album($menu, $theme) { - } - - static function tag($menu, $theme) { - } - - static function thumb($menu, $theme, $item) { - $menu->append(Menu::factory("submenu") - ->id("options_menu") - ->label(t("Options")) - ->css_class("gThumbMenu")); - } - - static function photo($menu, $theme) { - if (access::can("view_full", $theme->item())) { - $menu->append(Menu::factory("link") - ->id("fullsize") - ->label(t("View full size")) - ->url($theme->item()->file_url()) - ->css_class("gFullSizeLink")); - } - } - - static function admin($menu, $theme) { - $menu - ->append(Menu::factory("link") - ->id("dashboard") - ->label(t("Dashboard")) - ->url(url::site("admin"))) - ->append(Menu::factory("submenu") - ->id("settings_menu") - ->label(t("Settings")) - ->append(Menu::factory("link") - ->id("graphics_toolkits") - ->label(t("Graphics")) - ->url(url::site("admin/graphics"))) - ->append(Menu::factory("link") - ->id("languages") - ->label(t("Languages")) - ->url(url::site("admin/languages"))) - ->append(Menu::factory("link") - ->id("l10n_mode") - ->label(Session::instance()->get("l10n_mode", false) - ? t("Stop translating") : t("Start translating")) - ->url(url::site("l10n_client/toggle_l10n_mode?csrf=" . - access::csrf_token()))) - ->append(Menu::factory("link") - ->id("advanced") - ->label(t("Advanced")) - ->url(url::site("admin/advanced_settings")))) - ->append(Menu::factory("link") - ->id("modules") - ->label(t("Modules")) - ->url(url::site("admin/modules"))) - ->append(Menu::factory("submenu") - ->id("content_menu") - ->label(t("Content"))) - ->append(Menu::factory("submenu") - ->id("appearance_menu") - ->label(t("Appearance")) - ->append(Menu::factory("link") - ->id("themes") - ->label(t("Theme Choice")) - ->url(url::site("admin/themes"))) - ->append(Menu::factory("link") - ->id("theme_options") - ->label(t("Theme Options")) - ->url(url::site("admin/theme_options")))) - ->append(Menu::factory("submenu") - ->id("statistics_menu") - ->label(t("Statistics"))) - ->append(Menu::factory("link") - ->id("maintenance") - ->label(t("Maintenance")) - ->url(url::site("admin/maintenance"))); - } -} diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 47770a90..2a48d1e3 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -44,22 +44,66 @@ class Admin_View_Core extends Gallery_View { $this->set_global("user", user::active()); } - public function admin_menu() { - $menu = Menu::factory("root"); - gallery_menu::admin($menu, $this); - - foreach (module::active() as $module) { - if ($module->name == "gallery") { - continue; - } - $class = "{$module->name}_menu"; - if (method_exists($class, "admin")) { - call_user_func_array(array($class, "admin"), array(&$menu, $this)); - } + public function admin_menu($menu=null) { + if (!$menu) { + $menu = Menu::factory("root"); } + $menu + ->append(Menu::factory("link") + ->id("dashboard") + ->label(t("Dashboard")) + ->url(url::site("admin"))) + ->append(Menu::factory("submenu") + ->id("settings_menu") + ->label(t("Settings")) + ->append(Menu::factory("link") + ->id("graphics_toolkits") + ->label(t("Graphics")) + ->url(url::site("admin/graphics"))) + ->append(Menu::factory("link") + ->id("languages") + ->label(t("Languages")) + ->url(url::site("admin/languages"))) + ->append(Menu::factory("link") + ->id("l10n_mode") + ->label(Session::instance()->get("l10n_mode", false) + ? t("Stop translating") : t("Start translating")) + ->url(url::site("l10n_client/toggle_l10n_mode?csrf=" . + access::csrf_token()))) + ->append(Menu::factory("link") + ->id("advanced") + ->label(t("Advanced")) + ->url(url::site("admin/advanced_settings")))) + ->append(Menu::factory("link") + ->id("modules") + ->label(t("Modules")) + ->url(url::site("admin/modules"))) + ->append(Menu::factory("submenu") + ->id("content_menu") + ->label(t("Content"))) + ->append(Menu::factory("submenu") + ->id("appearance_menu") + ->label(t("Appearance")) + ->append(Menu::factory("link") + ->id("themes") + ->label(t("Theme Choice")) + ->url(url::site("admin/themes"))) + ->append(Menu::factory("link") + ->id("theme_options") + ->label(t("Theme Options")) + ->url(url::site("admin/theme_options")))) + ->append(Menu::factory("submenu") + ->id("statistics_menu") + ->label(t("Statistics"))) + ->append(Menu::factory("link") + ->id("maintenance") + ->label(t("Maintenance")) + ->url(url::site("admin/maintenance"))); + + module::event("admin_menu", $menu, $this); $menu->compact(); - print $menu; + return $menu; } /** diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index fa45ec89..60471f75 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -81,52 +81,103 @@ class Theme_View_Core extends Gallery_View { public function site_menu() { $menu = Menu::factory("root"); if ($this->page_type != "login") { - gallery_menu::site($menu, $this); + $menu->append(Menu::factory("link") + ->id("home") + ->label(t("Home")) + ->url(url::site("albums/1"))); - foreach (module::active() as $module) { - if ($module->name == "gallery") { - continue; + $item = $this->item(); + + $can_edit = $item && access::can("edit", $item); + $can_add = $item && access::can("add", $item); + + if ($can_add) { + $menu->append(Menu::factory("dialog") + ->id("add_photos_item") + ->label(t("Add photos")) + ->url(url::site("simple_uploader/app/$item->id"))); + } + + $menu->append($options_menu = Menu::factory("submenu") + ->id("options_menu") + ->label(t("Options"))); + if ($item && ($can_edit || $can_add)) { + if ($can_edit) { + $options_menu + ->append(Menu::factory("dialog") + ->id("edit_item") + ->label($item->is_album() ? t("Edit album") : t("Edit photo")) + ->url(url::site("form/edit/{$item->type}s/$item->id"))); } - $class = "{$module->name}_menu"; - if (method_exists($class, "site")) { - call_user_func_array(array($class, "site"), array(&$menu, $this)); + + // @todo Move album options menu to the album quick edit pane + if ($item->is_album()) { + if ($can_add) { + $options_menu + ->append(Menu::factory("dialog") + ->id("add_album") + ->label(t("Add an album")) + ->url(url::site("form/add/albums/$item->id?type=album"))); + } + + if ($can_edit) { + $options_menu + ->append(Menu::factory("dialog") + ->id("edit_permissions") + ->label(t("Edit permissions")) + ->url(url::site("permissions/browse/$item->id"))); + } } } + + if (user::active()->admin) { + $menu->append($admin_menu = Menu::factory("submenu") + ->id("admin_menu") + ->label(t("Admin"))); + Admin_View::admin_menu($admin_menu, $this); + module::event("admin_menu", $admin_menu, $this); + } + + module::event("site_menu", $menu, $this); } - $menu->compact(); - print $menu; + return $menu->compact(); } public function album_menu() { - print $this->_menu("album"); + $menu = Menu::factory("root"); + module::event("album_menu", $menu, $this); + return $menu->compact(); } public function tag_menu() { - print $this->_menu("tag"); + $menu = Menu::factory("root"); + module::event("tag_menu", $menu, $this); + return $menu->compact(); } public function photo_menu() { - print $this->_menu("photo"); - } + $menu = Menu::factory("root"); + if (access::can("view_full", $this->item())) { + $menu->append(Menu::factory("link") + ->id("fullsize") + ->label(t("View full size")) + ->url($this->item()->file_url()) + ->css_class("gFullSizeLink")); + } - public function thumb_menu($item) { - print $this->_menu("thumb", $item)->css_class("gThumbMenu"); + module::event("photo_menu", $menu, $this); + return $menu->compact(); } - private function _menu($type, $item=null) { - $menu = Menu::factory("root"); - 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, $item)); - } - } + public function thumb_menu($item) { + $menu = Menu::factory("root") + ->append(Menu::factory("submenu") + ->id("options_menu") + ->label(t("Options")) + ->css_class("gThumbMenu")); + module::event("thumb_menu", $menu, $this, $item); return $menu->compact(); } diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php index 536557c6..c6e770a7 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -55,4 +55,23 @@ class notification_event_Core { static function batch_complete() { notification::send_pending_notifications(); } + + static function site_menu($menu, $theme) { + if (!user::active()->guest) { + $item = $theme->item(); + + if ($item && $item->is_album() && access::can("view", $item)) { + $watching = notification::is_watching($item); + + $label = $watching ? t("Remove notifications") : t("Enable notifications"); + + $menu->get("options_menu") + ->append(Menu::factory("link") + ->id("watch") + ->label($label) + ->css_id("gNotifyLink") + ->url(url::site("notification/watch/$item->id?csrf=" . access::csrf_token()))); + } + } + } } \ No newline at end of file diff --git a/modules/notification/helpers/notification_menu.php b/modules/notification/helpers/notification_menu.php deleted file mode 100644 index 73d1dd03..00000000 --- a/modules/notification/helpers/notification_menu.php +++ /dev/null @@ -1,39 +0,0 @@ -guest) { - $item = $theme->item(); - - if ($item && $item->is_album() && access::can("view", $item)) { - $watching = notification::is_watching($item); - - $label = $watching ? t("Remove notifications") : t("Enable notifications"); - - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("watch") - ->label($label) - ->css_id("gNotifyLink") - ->url(url::site("notification/watch/$item->id?csrf=" . access::csrf_token()))); - } - } - } -} diff --git a/modules/organize/helpers/organize_event.php b/modules/organize/helpers/organize_event.php new file mode 100644 index 00000000..99a28673 --- /dev/null +++ b/modules/organize/helpers/organize_event.php @@ -0,0 +1,33 @@ +item(); + + if ($item && access::can("edit", $item) && $item->is_album()) { + $menu->get("options_menu") + ->append(Menu::factory("link") + ->id("organize") + ->label(t("Organize Album")) + ->css_id("gOrganizeLink") + ->url(url::site("organize/index/{$item->id}"))); + } + } +} diff --git a/modules/organize/helpers/organize_menu.php b/modules/organize/helpers/organize_menu.php deleted file mode 100644 index 850c1eab..00000000 --- a/modules/organize/helpers/organize_menu.php +++ /dev/null @@ -1,33 +0,0 @@ -item(); - - if ($item && access::can("edit", $item) && $item->is_album()) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("organize") - ->label(t("Organize Album")) - ->css_id("gOrganizeLink") - ->url(url::site("organize/index/{$item->id}"))); - } - } -} diff --git a/modules/recaptcha/helpers/recaptcha_event.php b/modules/recaptcha/helpers/recaptcha_event.php index 932ddee6..d23a0c74 100644 --- a/modules/recaptcha/helpers/recaptcha_event.php +++ b/modules/recaptcha/helpers/recaptcha_event.php @@ -23,4 +23,12 @@ class recaptcha_event_Core { $form->add_comment->recaptcha("recaptcha")->label("")->id("gRecaptcha"); } } + + static function admin_menu($menu, $theme) { + $menu->get("settings_menu") + ->append(Menu::factory("link") + ->id("recaptcha") + ->label(t("reCAPTCHA")) + ->url(url::site("admin/recaptcha"))); + } } diff --git a/modules/recaptcha/helpers/recaptcha_menu.php b/modules/recaptcha/helpers/recaptcha_menu.php deleted file mode 100644 index 047abf8f..00000000 --- a/modules/recaptcha/helpers/recaptcha_menu.php +++ /dev/null @@ -1,28 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("recaptcha") - ->label(t("reCAPTCHA")) - ->url(url::site("admin/recaptcha"))); - } -} diff --git a/modules/server_add/helpers/server_add_event.php b/modules/server_add/helpers/server_add_event.php new file mode 100644 index 00000000..b53e72d1 --- /dev/null +++ b/modules/server_add/helpers/server_add_event.php @@ -0,0 +1,64 @@ +get("settings_menu") + ->append(Menu::factory("link") + ->id("server_add") + ->label(t("Server Add")) + ->url(url::site("admin/server_add"))); + } + + static function site_menu($menu, $theme) { + $item = $theme->item(); + $paths = unserialize(module::get_var("server_add", "authorized_paths")); + + if ($item && user::active()->admin && $item->is_album() && !empty($paths)) { + // This is a little tricky. Normally there's an "Add Photo" menu option, but we want to + // turn that into a dropdown if there are two different ways to add things. Do that in a + // portable way for now. If we find ourselves duplicating this pattern, we should make an + // API method for this. + $server_add = Menu::factory("dialog") + ->id("server_add") + ->label(t("Add from server")) + ->url(url::site("server_add/browse/$item->id")); + $add_photos_item = $menu->get("add_photos_item"); + $add_photos_menu = $menu->get("add_photos_menu"); + + if ($add_photos_item && !$add_photos_menu) { + // Assuming that $add_menu is unset, create add_menu and add our item + $menu->add_after( + "add_photos_item", + Menu::factory("submenu") + ->id("add_photos_menu") + ->label($add_photos_item->label) + ->append(Menu::factory("dialog") + ->id("add_photos_submenu_item") + ->label(t("Simple Uploader")) + ->url($add_photos_item->url)) + ->append($server_add)); + $menu->remove("add_photos_item"); + } else if ($add_photos_menu) { + // Append to the existing sub-menu + $add_photos_menu->append($server_add); + } + } + } +} diff --git a/modules/server_add/helpers/server_add_menu.php b/modules/server_add/helpers/server_add_menu.php deleted file mode 100644 index 0f01eb64..00000000 --- a/modules/server_add/helpers/server_add_menu.php +++ /dev/null @@ -1,64 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("server_add") - ->label(t("Server Add")) - ->url(url::site("admin/server_add"))); - } - - static function site($menu, $theme) { - $item = $theme->item(); - $paths = unserialize(module::get_var("server_add", "authorized_paths")); - - if ($item && user::active()->admin && $item->is_album() && !empty($paths)) { - // This is a little tricky. Normally there's an "Add Photo" menu option, but we want to - // turn that into a dropdown if there are two different ways to add things. Do that in a - // portable way for now. If we find ourselves duplicating this pattern, we should make an - // API method for this. - $server_add = Menu::factory("dialog") - ->id("server_add") - ->label(t("Add from server")) - ->url(url::site("server_add/browse/$item->id")); - $add_photos_item = $menu->get("add_photos_item"); - $add_photos_menu = $menu->get("add_photos_menu"); - - if ($add_photos_item && !$add_photos_menu) { - // Assuming that $add_menu is unset, create add_menu and add our item - $menu->add_after( - "add_photos_item", - Menu::factory("submenu") - ->id("add_photos_menu") - ->label($add_photos_item->label) - ->append(Menu::factory("dialog") - ->id("add_photos_submenu_item") - ->label(t("Simple Uploader")) - ->url($add_photos_item->url)) - ->append($server_add)); - $menu->remove("add_photos_item"); - } else if ($add_photos_menu) { - // Append to the existing sub-menu - $add_photos_menu->append($server_add); - } - } - } -} diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php index c6cd7dc7..cf79f71a 100644 --- a/modules/slideshow/helpers/slideshow_event.php +++ b/modules/slideshow/helpers/slideshow_event.php @@ -29,4 +29,34 @@ class slideshow_event_Core { site_status::clear("slideshow_needs_rss"); } } + + static function album_menu($menu, $theme) { + $menu + ->append(Menu::factory("link") + ->id("slideshow") + ->label(t("View slideshow")) + ->url("javascript:PicLensLite.start(" . + "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") + ->css_id("gSlideshowLink")); + } + + static function photo_menu($menu, $theme) { + $menu + ->append(Menu::factory("link") + ->id("slideshow") + ->label(t("View slideshow")) + ->url("javascript:PicLensLite.start(" . + "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") + ->css_id("gSlideshowLink")); + } + + static function tag_menu($menu, $theme) { + $menu + ->append(Menu::factory("link") + ->id("slideshow") + ->label(t("View slideshow")) + ->url("javascript:PicLensLite.start(" . + "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") + ->css_id("gSlideshowLink")); + } } diff --git a/modules/slideshow/helpers/slideshow_menu.php b/modules/slideshow/helpers/slideshow_menu.php deleted file mode 100644 index ee975d88..00000000 --- a/modules/slideshow/helpers/slideshow_menu.php +++ /dev/null @@ -1,51 +0,0 @@ -append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url("javascript:PicLensLite.start(" . - "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") - ->css_id("gSlideshowLink")); - } - - static function photo($menu, $theme) { - $menu - ->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url("javascript:PicLensLite.start(" . - "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") - ->css_id("gSlideshowLink")); - } - - static function tag($menu, $theme) { - $menu - ->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url("javascript:PicLensLite.start(" . - "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") - ->css_id("gSlideshowLink")); - } - -} diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 0fe8a393..f5fa6d4c 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -85,4 +85,12 @@ class tag_event_Core { } tag::compact(); } + + static function admin_menu($menu, $theme) { + $menu->get("content_menu") + ->append(Menu::factory("link") + ->id("tags") + ->label(t("Tags")) + ->url(url::site("admin/tags"))); + } } diff --git a/modules/tag/helpers/tag_menu.php b/modules/tag/helpers/tag_menu.php deleted file mode 100644 index e1b61a93..00000000 --- a/modules/tag/helpers/tag_menu.php +++ /dev/null @@ -1,28 +0,0 @@ -get("content_menu") - ->append(Menu::factory("link") - ->id("tags") - ->label(t("Tags")) - ->url(url::site("admin/tags"))); - } -} diff --git a/modules/user/helpers/user_event.php b/modules/user/helpers/user_event.php index 6515fbfb..4bde224b 100644 --- a/modules/user/helpers/user_event.php +++ b/modules/user/helpers/user_event.php @@ -30,4 +30,12 @@ class user_event_Core { I18n::instance()->locale($locale); } } + + static function admin_menu($menu, $theme) { + $menu->add_after("appearance_menu", + Menu::factory("link") + ->id("users_groups") + ->label(t("Users/Groups")) + ->url(url::site("admin/users"))); + } } diff --git a/modules/user/helpers/user_menu.php b/modules/user/helpers/user_menu.php deleted file mode 100644 index 05e401f9..00000000 --- a/modules/user/helpers/user_menu.php +++ /dev/null @@ -1,28 +0,0 @@ -add_after("appearance_menu", - Menu::factory("link") - ->id("users_groups") - ->label(t("Users/Groups")) - ->url(url::site("admin/users"))); - } -} diff --git a/modules/watermark/helpers/watermark_event.php b/modules/watermark/helpers/watermark_event.php new file mode 100644 index 00000000..45b410f9 --- /dev/null +++ b/modules/watermark/helpers/watermark_event.php @@ -0,0 +1,29 @@ +get("content_menu") + ->append( + Menu::factory("link") + ->id("watermarks") + ->label(t("Watermarks")) + ->url(url::site("admin/watermarks"))); + } +} diff --git a/modules/watermark/helpers/watermark_menu.php b/modules/watermark/helpers/watermark_menu.php deleted file mode 100644 index bc3a4fed..00000000 --- a/modules/watermark/helpers/watermark_menu.php +++ /dev/null @@ -1,29 +0,0 @@ -get("content_menu") - ->append( - Menu::factory("link") - ->id("watermarks") - ->label(t("Watermarks")) - ->url(url::site("admin/watermarks"))); - } -} -- cgit v1.2.3 From 67d4ae21d5f7363f54782c23d2a7ff1d9e9f0505 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 29 Jul 2009 17:43:12 -0700 Subject: Clean up user form events. Thanks to Ben Smith (glooper). --- modules/user/controllers/admin_users.php | 2 +- modules/user/helpers/user.php | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'modules/user/helpers') diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 043a4ee5..f87602b8 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -49,7 +49,6 @@ class Admin_Users_Controller extends Controller { $user->locale = $desired_locale == "none" ? null : $desired_locale; } $user->save(); - module::event("user_add_form_admin_completed", $user, $form); message::success(t("Created user %user_name", array("user_name" => p::clean($user->name)))); @@ -141,6 +140,7 @@ class Admin_Users_Controller extends Controller { $user->admin = $form->edit_user->admin->checked; } $user->save(); + module::event("user_edit_form_admin_completed", $user, $form); message::success(t("Changed user %user_name", array("user_name" => p::clean($user->name)))); print json_encode(array("result" => "success")); diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index b1722a1e..69a6ecb3 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -34,15 +34,16 @@ class user_Core { ->matches($group->password); $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email); $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); - $group->submit("")->value(t("Save")); $form->add_rules_from($user); module::event("user_edit_form", $user, $form); + $group->submit("")->value(t("Save")); return $form; } static function get_edit_form_admin($user) { - $form = new Forge("admin/users/edit_user/$user->id", "", "post", array("id" => "gEditUserForm")); + $form = new Forge( + "admin/users/edit_user/$user->id", "", "post", array("id" => "gEditUserForm")); $group = $form->group("edit_user")->label(t("Edit User")); $group->input("name")->label(t("Username"))->id("gUsername")->value($user->name); $group->inputs["name"]->error_messages( @@ -55,11 +56,11 @@ class user_Core { $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email); $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); $group->checkbox("admin")->label(t("Admin"))->id("gAdmin")->checked($user->admin); - $group->submit("")->value(t("Modify User")); $form->add_rules_from($user); $form->edit_user->password->rules("-required"); module::event("user_edit_form_admin", $user, $form); + $group->submit("")->value(t("Modify User")); return $form; } @@ -76,11 +77,11 @@ class user_Core { $group->input("url")->label(t("URL"))->id("gUrl"); self::_add_locale_dropdown($group); $group->checkbox("admin")->label(t("Admin"))->id("gAdmin"); - $group->submit("")->value(t("Add User")); $user = ORM::factory("user"); $form->add_rules_from($user); - module::event("user_add_form_admin", $user); + module::event("user_add_form_admin", $user, $form); + $group->submit("")->value(t("Add User")); return $form; } -- cgit v1.2.3 From b826182b7a7b2d630b478d3e2bcf0628989a92d9 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 6 Aug 2009 22:22:24 +0800 Subject: Cleanup the javascript for enabling dialog or panel links. 1) We don't need to loop over the elements to bind the event handler. 2) Just include gallery.panel.js for all the admin pages. Signed-off-by: Tim Almdal --- modules/gallery/helpers/gallery_theme.php | 1 + modules/user/helpers/user_theme.php | 6 ------ themes/admin_default/js/ui.init.js | 12 +++--------- themes/default/js/ui.init.js | 5 +---- 4 files changed, 5 insertions(+), 19 deletions(-) (limited to 'modules/user/helpers') diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index d3751b80..903827cc 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -78,6 +78,7 @@ class gallery_theme_Core { } static function admin_head($theme) { + $theme->script("gallery.panel.js"); $session = Session::instance(); if ($session->get("debug")) { $theme->css("debug.css"); diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index c5351f8e..69042aed 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -23,10 +23,4 @@ class user_theme_Core { $view->user = user::active(); return $view->render(); } - - static function admin_head($theme) { - if (strpos(Router::$current_uri, "admin/users") !== false) { - $theme->script("gallery.panel.js"); - } - } } diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js index 3f062a27..06cc1cd5 100644 --- a/themes/admin_default/js/ui.init.js +++ b/themes/admin_default/js/ui.init.js @@ -1,5 +1,5 @@ $(document).ready(function(){ - + // Initialize Superfish menus $("#gSiteAdminMenu ul.gMenu").addClass("sf-menu"); $("ul.gMenu").addClass("sf-menu"); @@ -18,16 +18,10 @@ $(document).ready(function(){ $("#gMessage li").showMessage(); // Initialize modal dialogs - var dialogLinks = $(".gDialogLink"); - for (var i=0; i < dialogLinks.length; i++) { - $(dialogLinks[i]).bind("click", handleDialogEvent); - } + $(".gDialogLink").bind("click", handleDialogEvent); // Initialize panels - var panelLinks = $(".gPanelLink"); - for (i=0; i Date: Thu, 6 Aug 2009 13:32:41 +0800 Subject: Don't show the ajaxy login link in the top right corner if we're on the login page itself. Signed-off-by: Bharat Mediratta --- modules/user/helpers/user_theme.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 69042aed..8de2d248 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -19,8 +19,10 @@ */ class user_theme_Core { static function header_top($theme) { - $view = new View("login.html"); - $view->user = user::active(); - return $view->render(); + if ($theme->page_type != "login") { + $view = new View("login.html"); + $view->user = user::active(); + return $view->render(); + } } } -- cgit v1.2.3 From 4828db003f3ee505eb9e6d056cdb142da34b78ff Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 27 Aug 2009 15:47:54 -0700 Subject: Remove 'ENGINE=InnoDB' specification from tables that we create. Use the system's default table specification. Fixes ticket #597. --- installer/install.sql | 44 +++++++++++----------- modules/comment/helpers/comment_installer.php | 2 +- modules/digibug/helpers/digibug_installer.php | 2 +- modules/exif/helpers/exif_installer.php | 2 +- modules/g2_import/helpers/g2_import_installer.php | 2 +- modules/gallery/controllers/packager.php | 4 ++ modules/gallery/helpers/gallery_installer.php | 32 ++++++++-------- .../helpers/notification_installer.php | 4 +- modules/search/helpers/search_installer.php | 2 +- .../server_add/helpers/server_add_installer.php | 4 +- modules/tag/helpers/tag_installer.php | 4 +- modules/user/helpers/user_installer.php | 6 +-- modules/watermark/helpers/watermark_installer.php | 2 +- 13 files changed, 57 insertions(+), 53 deletions(-) (limited to 'modules/user/helpers') diff --git a/installer/install.sql b/installer/install.sql index 48b504ba..21464379 100755 --- a/installer/install.sql +++ b/installer/install.sql @@ -11,7 +11,7 @@ CREATE TABLE {access_caches} ( `edit_2` binary(1) NOT NULL default '0', `add_2` binary(1) NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {access_caches} VALUES (1,1,'1','0','0','1','0','0'); DROP TABLE IF EXISTS {access_intents}; @@ -29,7 +29,7 @@ CREATE TABLE {access_intents} ( `edit_2` binary(1) default NULL, `add_2` binary(1) default NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {access_intents} VALUES (1,1,'1','1','0','0','1','1','0','0'); DROP TABLE IF EXISTS {caches}; @@ -43,7 +43,7 @@ CREATE TABLE {caches} ( `cache` longblob, PRIMARY KEY (`id`), KEY `tags` (`tags`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {comments}; SET @saved_cs_client = @@character_set_client; @@ -72,7 +72,7 @@ CREATE TABLE {comments} ( `text` text, `updated` int(9) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {graphics_rules}; SET @saved_cs_client = @@character_set_client; @@ -86,7 +86,7 @@ CREATE TABLE {graphics_rules} ( `priority` int(9) NOT NULL, `target` varchar(32) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','resize',100,'thumb'); INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','resize',100,'resize'); @@ -99,7 +99,7 @@ CREATE TABLE {groups} ( `special` tinyint(1) default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {groups} VALUES (1,'Everybody',1); INSERT INTO {groups} VALUES (2,'Registered Users',1); @@ -111,7 +111,7 @@ CREATE TABLE {groups_users} ( `user_id` int(9) NOT NULL, PRIMARY KEY (`group_id`,`user_id`), UNIQUE KEY `user_id` (`user_id`,`group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {groups_users} VALUES (1,1); INSERT INTO {groups_users} VALUES (1,2); @@ -129,7 +129,7 @@ CREATE TABLE {incoming_translations} ( PRIMARY KEY (`id`), UNIQUE KEY `key` (`key`,`locale`), KEY `locale_key` (`locale`,`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {items}; SET @saved_cs_client = @@character_set_client; @@ -171,7 +171,7 @@ CREATE TABLE {items} ( KEY `type` (`type`), KEY `random` (`rand_key`), KEY `weight` (`weight`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,NULL,0,NULL,'',1,NULL,NULL,2,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1'); DROP TABLE IF EXISTS {items_tags}; @@ -184,7 +184,7 @@ CREATE TABLE {items_tags} ( PRIMARY KEY (`id`), KEY `tag_id` (`tag_id`,`id`), KEY `item_id` (`item_id`,`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {logs}; SET @saved_cs_client = @@character_set_client; @@ -200,7 +200,7 @@ CREATE TABLE {logs} ( `url` varchar(255) default NULL, `user_id` int(9) default '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {messages}; SET @saved_cs_client = @@character_set_client; @@ -212,7 +212,7 @@ CREATE TABLE {messages} ( `value` varchar(255) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `key` (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {modules}; SET @saved_cs_client = @@character_set_client; @@ -224,7 +224,7 @@ CREATE TABLE {modules} ( `version` int(9) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {modules} VALUES (1,1,'gallery',10); INSERT INTO {modules} VALUES (2,1,'user',1); @@ -248,7 +248,7 @@ CREATE TABLE {outgoing_translations} ( PRIMARY KEY (`id`), UNIQUE KEY `key` (`key`,`locale`), KEY `locale_key` (`locale`,`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {permissions}; SET @saved_cs_client = @@character_set_client; @@ -259,7 +259,7 @@ CREATE TABLE {permissions} ( `name` varchar(64) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {permissions} VALUES (1,'View','view'); INSERT INTO {permissions} VALUES (2,'View Full Size','view_full'); @@ -276,7 +276,7 @@ CREATE TABLE {search_records} ( PRIMARY KEY (`id`), KEY `item_id` (`item_id`), FULLTEXT KEY `data` (`data`) -) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {search_records} VALUES (1,1,0,' Gallery'); DROP TABLE IF EXISTS {sessions}; @@ -287,7 +287,7 @@ CREATE TABLE {sessions} ( `data` text NOT NULL, `last_activity` int(10) unsigned NOT NULL, PRIMARY KEY (`session_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {tags}; SET @saved_cs_client = @@character_set_client; @@ -298,7 +298,7 @@ CREATE TABLE {tags} ( `count` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {tasks}; SET @saved_cs_client = @@character_set_client; @@ -316,7 +316,7 @@ CREATE TABLE {tasks} ( `updated` int(9) default NULL, PRIMARY KEY (`id`), KEY `owner_id` (`owner_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS {themes}; SET @saved_cs_client = @@character_set_client; @@ -327,7 +327,7 @@ CREATE TABLE {themes} ( `version` int(9) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {themes} VALUES (1,'default',1); INSERT INTO {themes} VALUES (2,'admin_default',1); @@ -350,7 +350,7 @@ CREATE TABLE {users} ( PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), UNIQUE KEY `hash` (`hash`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {users} VALUES (1,'guest','Guest User','',0,0,NULL,0,1,NULL,NULL,NULL); INSERT INTO {users} VALUES (2,'admin','Gallery Administrator','',0,0,NULL,1,0,NULL,NULL,NULL); @@ -364,7 +364,7 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','default'); INSERT INTO {vars} VALUES (2,'gallery','active_admin_theme','admin_default'); diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php index edf2427c..80594c16 100644 --- a/modules/comment/helpers/comment_installer.php +++ b/modules/comment/helpers/comment_installer.php @@ -44,7 +44,7 @@ class comment_installer { `text` text, `updated` int(9) NOT NULL, PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); block_manager::add("dashboard_center", "comment", "recent_comments"); module::set_var("comment", "spam_caught", 0); diff --git a/modules/digibug/helpers/digibug_installer.php b/modules/digibug/helpers/digibug_installer.php index 1cd78b44..7e8145d2 100644 --- a/modules/digibug/helpers/digibug_installer.php +++ b/modules/digibug/helpers/digibug_installer.php @@ -26,7 +26,7 @@ class digibug_installer { `request_date` TIMESTAMP NOT NULL DEFAULT current_timestamp, `item_id` int(9) NOT NULL, PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_var("digibug", "company_id", "3153"); module::set_var("digibug", "event_id", "8491"); diff --git a/modules/exif/helpers/exif_installer.php b/modules/exif/helpers/exif_installer.php index 0233f2bb..66226061 100644 --- a/modules/exif/helpers/exif_installer.php +++ b/modules/exif/helpers/exif_installer.php @@ -28,7 +28,7 @@ class exif_installer { `dirty` BOOLEAN default 1, PRIMARY KEY (`id`), KEY(`item_id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("exif", 1); } diff --git a/modules/g2_import/helpers/g2_import_installer.php b/modules/g2_import/helpers/g2_import_installer.php index 0f87da6c..feacb518 100644 --- a/modules/g2_import/helpers/g2_import_installer.php +++ b/modules/g2_import/helpers/g2_import_installer.php @@ -26,7 +26,7 @@ class g2_import_installer { `g3_id` int(9) NOT NULL, PRIMARY KEY (`id`), KEY (`g2_id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("g2_import", 1); mkdir(VARPATH . "modules/g2_import"); diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php index 7b4d68f6..fbb1d07d 100644 --- a/modules/gallery/controllers/packager.php +++ b/modules/gallery/controllers/packager.php @@ -123,6 +123,10 @@ class Packager_Controller extends Controller { // Normalize dates $line = preg_replace("/,$root_created_timestamp,/", ",UNIX_TIMESTAMP(),", $line); $line = preg_replace("/,$root_updated_timestamp,/", ",UNIX_TIMESTAMP(),", $line); + + // Remove ENGINE= specifications + $line = preg_replace("/ENGINE=\S+ /", "", $line); + $buf .= $line; } $fd = fopen($sql_file, "wb"); diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index d12dad70..a212ef85 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -24,13 +24,13 @@ class gallery_installer { `id` int(9) NOT NULL auto_increment, `item_id` int(9), PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {access_intents} ( `id` int(9) NOT NULL auto_increment, `item_id` int(9), PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {caches} ( `id` int(9) NOT NULL auto_increment, @@ -40,7 +40,7 @@ class gallery_installer { `cache` longblob, PRIMARY KEY (`id`), KEY (`tags`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {graphics_rules} ( `id` int(9) NOT NULL auto_increment, @@ -51,7 +51,7 @@ class gallery_installer { `priority` int(9) NOT NULL, `target` varchar(32) NOT NULL, PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {incoming_translations} ( `id` int(9) NOT NULL auto_increment, @@ -63,7 +63,7 @@ class gallery_installer { PRIMARY KEY (`id`), UNIQUE KEY(`key`, `locale`), KEY `locale_key` (`locale`, `key`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {items} ( `id` int(9) NOT NULL auto_increment, @@ -100,7 +100,7 @@ class gallery_installer { KEY `type` (`type`), KEY `random` (`rand_key`), KEY `weight` (`weight` DESC)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {logs} ( `id` int(9) NOT NULL auto_increment, @@ -113,7 +113,7 @@ class gallery_installer { `url` varchar(255) default NULL, `user_id` int(9) default 0, PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {messages} ( `id` int(9) NOT NULL auto_increment, @@ -122,7 +122,7 @@ class gallery_installer { `value` varchar(255) default NULL, PRIMARY KEY (`id`), UNIQUE KEY(`key`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {modules} ( `id` int(9) NOT NULL auto_increment, @@ -131,7 +131,7 @@ class gallery_installer { `version` int(9) default NULL, PRIMARY KEY (`id`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {outgoing_translations} ( `id` int(9) NOT NULL auto_increment, @@ -143,7 +143,7 @@ class gallery_installer { PRIMARY KEY (`id`), UNIQUE KEY(`key`, `locale`), KEY `locale_key` (`locale`, `key`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {permissions} ( `id` int(9) NOT NULL auto_increment, @@ -151,14 +151,14 @@ class gallery_installer { `name` varchar(64) default NULL, PRIMARY KEY (`id`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {sessions} ( `session_id` varchar(127) NOT NULL, `data` text NOT NULL, `last_activity` int(10) UNSIGNED NOT NULL, PRIMARY KEY (`session_id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {tasks} ( `id` int(9) NOT NULL auto_increment, @@ -173,7 +173,7 @@ class gallery_installer { `updated` int(9) default NULL, PRIMARY KEY (`id`), KEY (`owner_id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {themes} ( `id` int(9) NOT NULL auto_increment, @@ -181,7 +181,7 @@ class gallery_installer { `version` int(9) default NULL, PRIMARY KEY (`id`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {vars} ( `id` int(9) NOT NULL auto_increment, @@ -190,7 +190,7 @@ class gallery_installer { `value` text, PRIMARY KEY (`id`), UNIQUE KEY(`module_name`, `name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); foreach (array("albums", "logs", "modules", "resizes", "thumbs", "tmp", "uploads") as $dir) { @mkdir(VARPATH . $dir); @@ -284,7 +284,7 @@ class gallery_installer { `cache` text, PRIMARY KEY (`id`), KEY (`tags`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("gallery", $version = 4); } diff --git a/modules/notification/helpers/notification_installer.php b/modules/notification/helpers/notification_installer.php index 3d450258..aa2e09f7 100644 --- a/modules/notification/helpers/notification_installer.php +++ b/modules/notification/helpers/notification_installer.php @@ -27,14 +27,14 @@ class notification_installer { PRIMARY KEY (`id`), UNIQUE KEY (`item_id`, `user_id`), UNIQUE KEY (`user_id`, `item_id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE IF NOT EXISTS {pending_notifications} ( `id` int(9) NOT NULL auto_increment, `email` varchar(128) NOT NULL, `subject` varchar(255) NOT NULL, `text` text, PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("notification", 1); } diff --git a/modules/search/helpers/search_installer.php b/modules/search/helpers/search_installer.php index cd253be4..10d8211f 100644 --- a/modules/search/helpers/search_installer.php +++ b/modules/search/helpers/search_installer.php @@ -28,7 +28,7 @@ class search_installer { PRIMARY KEY (`id`), KEY(`item_id`), FULLTEXT INDEX (`data`)) - ENGINE=MyISAM DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("search", 1); } diff --git a/modules/server_add/helpers/server_add_installer.php b/modules/server_add/helpers/server_add_installer.php index cd278eb7..c3c1572d 100644 --- a/modules/server_add/helpers/server_add_installer.php +++ b/modules/server_add/helpers/server_add_installer.php @@ -27,7 +27,7 @@ class server_add_installer { `parent_id` int(9), `task_id` int(9) NOT NULL, PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("server_add", 3); server_add::check_config(); } @@ -40,7 +40,7 @@ class server_add_installer { `task_id` int(9) NOT NULL, `file` varchar(255) NOT NULL, PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("server_add", $version = 2); } diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php index 3c16e3f3..bcb830e4 100644 --- a/modules/tag/helpers/tag_installer.php +++ b/modules/tag/helpers/tag_installer.php @@ -26,7 +26,7 @@ class tag_installer { `count` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE IF NOT EXISTS {items_tags} ( `id` int(9) NOT NULL auto_increment, @@ -35,7 +35,7 @@ class tag_installer { PRIMARY KEY (`id`), KEY(`tag_id`, `id`), KEY(`item_id`, `id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); module::set_version("tag", 1); } diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php index 1959d038..8ef4f13d 100644 --- a/modules/user/helpers/user_installer.php +++ b/modules/user/helpers/user_installer.php @@ -36,7 +36,7 @@ class user_installer { PRIMARY KEY (`id`), UNIQUE KEY(`hash`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE IF NOT EXISTS {groups} ( `id` int(9) NOT NULL auto_increment, @@ -44,14 +44,14 @@ class user_installer { `special` BOOLEAN default 0, PRIMARY KEY (`id`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE IF NOT EXISTS {groups_users} ( `group_id` int(9) NOT NULL, `user_id` int(9) NOT NULL, PRIMARY KEY (`group_id`, `user_id`), UNIQUE KEY(`user_id`, `group_id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); $everybody = group::create("Everybody"); $everybody->special = true; diff --git a/modules/watermark/helpers/watermark_installer.php b/modules/watermark/helpers/watermark_installer.php index 705b89d4..b3e91044 100644 --- a/modules/watermark/helpers/watermark_installer.php +++ b/modules/watermark/helpers/watermark_installer.php @@ -30,7 +30,7 @@ class watermark_installer { `mime_type` varchar(64) default NULL, PRIMARY KEY (`id`), UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + DEFAULT CHARSET=utf8;"); @mkdir(VARPATH . "modules/watermark"); module::set_version("watermark", 1); -- cgit v1.2.3 From 50c624ed1b5a09d965d4e0f18a32bf3c2a94db15 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 29 Aug 2009 12:20:03 -0700 Subject: Fix active() to not use user::guest() as the fallback for our Session::get() call. --- modules/user/helpers/user.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 69a6ecb3..40acc2ec 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -159,7 +159,12 @@ class user_Core { */ static function active() { // @todo (maybe) cache this object so we're not always doing session lookups. - $user = Session::instance()->get("user", self::guest()); + $user = Session::instance()->get("user", null); + if (!isset($user)) { + // Don't do this as a fallback in the Session::get() call because it can trigger unnecessary + // work. + $user = user::guest(); + } return $user; } -- cgit v1.2.3 From 001623c755777846a468255d4396d30b253dcdfb Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Fri, 4 Sep 2009 11:06:20 -0700 Subject: Add new locale preferences: Adding per session (cookie) locale preferences and check the browser's / OS' locale preferences. Ticket 582. --- modules/gallery/helpers/locales.php | 85 +++++++++++++++++++++++++++++++++++++ modules/user/helpers/user.php | 18 ++++++++ modules/user/helpers/user_event.php | 24 ++++++++--- modules/user/helpers/user_theme.php | 24 +++++++++++ 4 files changed, 145 insertions(+), 6 deletions(-) (limited to 'modules/user/helpers') diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index 3762b97b..1320c155 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -23,6 +23,7 @@ */ class locales_Core { private static $locales; + private static $language_subtag_to_locale; /** * Return the list of available locales. @@ -105,6 +106,16 @@ class locales_Core { $l["zh_TW"] = "繁體中文"; // Chinese (TW) asort($l, SORT_LOCALE_STRING); self::$locales = $l; + + // Language subtag to (default) locale mapping + foreach ($l as $locale => $name) { + list ($language) = explode("_", $locale . "_"); + // The first one mentioned is the default + if (!isset($d[$language])) { + $d[$language] = $locale; + } + } + self::$language_subtag_to_locale = $d; } static function display_name($locale=null) { @@ -121,4 +132,78 @@ class locales_Core { list ($language, $territory) = explode('_', $locale . "_"); return in_array($language, array("he", "fa", "ar")); } + + /** + * Returns the best match comparing the HTTP accept-language header + * with the installed locales. + */ + static function locale_from_http_request() { + $http_accept_language = Input::instance()->server("HTTP_ACCEPT_LANGUAGE"); + if ($http_accept_language) { + // Parse the HTTP header and build a preference list + // Example value: "de,en-us;q=0.7,en-uk,fr-fr;q=0.2" + $locale_preferences = array(); + foreach (explode(",", $http_accept_language) as $code) { + list ($requested_locale, $qvalue) = explode(";", $code . ";"); + $requested_locale = trim($requested_locale); + $qvalue = trim($qvalue); + if (preg_match("/^([a-z]{2,3})(?:[_-]([a-zA-Z]{2}))?/", $requested_locale, $matches)) { + $requested_locale = strtolower($matches[1]); + if (!empty($matches[2])) { + $requested_locale .= "_" . strtoupper($matches[2]); + } + $requested_locale = trim(str_replace("-", "_", $requested_locale)); + if (!strlen($qvalue)) { + // If not specified, default to 1. + $qvalue = 1; + } else { + // qvalue is expected to be something like "q=0.7" + list ($ignored, $qvalue) = explode("=", $qvalue . "=="); + $qvalue = floatval($qvalue); + } + $locale_preferences[] = array($requested_locale, $qvalue); + } + } + + // Compare and score requested locales with installed ones + $matched_locales = array(); + foreach ($locale_preferences as $requested_value) { + $scored_locale_match = self::_locale_match_score($requested_value); + if ($scored_locale_match) { + $scored_locales[] = $scored_locale_match; + } + } + + usort($matched_locales, array("locales", "_compare_locale_by_qvalue")); + + $best_match = array_shift($scored_locales); + if ($best_match) { + return $best_match[0]; + } + } + + return null; + } + + static function _compare_locale_by_qvalue($a, $b) { + $a = $a[1]; + $b = $b[1]; + if ($a == $b) { + return 0; + } + return $a < $b ? 1 : -1; + } + + private static function _locale_match_score($requested_locale_and_qvalue) { + list ($requested_locale, $qvalue) = $requested_locale_and_qvalue; + $installed = self::installed(); + if (isset($installed[$requested_locale])) { + return $requested_locale_and_qvalue; + } + list ($language) = explode("_", $requested_locale . "_"); + if (isset(self::$language_subtag_to_locale[$language])) { + return array(self::$language_subtag_to_locale[$language], $qvalue * 0.66); + } + return null; + } } \ No newline at end of file diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 40acc2ec..b9162b92 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -87,6 +87,9 @@ class user_Core { private static function _add_locale_dropdown(&$form, $user=null) { $locales = locales::installed(); + foreach ($locales as $locale => $display_name) { + $locales[$locale] = SafeString::of_safe_html($display_name); + } if (count($locales) > 1) { // Put "none" at the first position in the array $locales = array_merge(array("" => t("« none »")), $locales); @@ -336,4 +339,19 @@ class user_Core { } return $salt . md5($salt . $password); } + + static function cookie_locale() { + $cookie_data = Input::instance()->cookie("g_locale"); + $locale = null; + if ($cookie_data) { + if (preg_match("/^([a-z]{2,3}(?:_[A-Z]{2})?)$/", trim($cookie_data), $matches)) { + $requested_locale = $matches[1]; + $installed_locales = locales::installed(); + if (isset($installed_locales[$requested_locale])) { + $locale = $requested_locale; + } + } + } + return $locale; + } } \ No newline at end of file diff --git a/modules/user/helpers/user_event.php b/modules/user/helpers/user_event.php index 4bde224b..ede4e515 100644 --- a/modules/user/helpers/user_event.php +++ b/modules/user/helpers/user_event.php @@ -23,12 +23,7 @@ class user_event_Core { */ static function gallery_ready() { user::load_user(); - - $locale = user::active()->locale; - if (!empty($locale)) { - // TODO(andy_st): Check session data as well. - I18n::instance()->locale($locale); - } + self::set_request_locale(); } static function admin_menu($menu, $theme) { @@ -38,4 +33,21 @@ class user_event_Core { ->label(t("Users/Groups")) ->url(url::site("admin/users"))); } + + static function set_request_locale() { + // 1. Check the session specific preference (cookie) + $locale = user::cookie_locale(); + // 2. Check the user's preference + if (!$locale) { + $locale = user::active()->locale; + } + // 3. Check the browser's / OS' preference + if (!$locale) { + $locale = locales::locale_from_http_request(); + } + // If we have any preference, override the site's default locale + if ($locale) { + I18n::instance()->locale($locale); + } + } } diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 8de2d248..5b973ef3 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -18,6 +18,14 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class user_theme_Core { + static function head($theme) { + if (count(locales::installed())) { + // Needed by the languages block + $theme->script("jquery.cookie.js"); + } + return ""; + } + static function header_top($theme) { if ($theme->page_type != "login") { $view = new View("login.html"); @@ -25,4 +33,20 @@ class user_theme_Core { return $view->render(); } } + + static function sidebar_blocks($theme) { + $locales = locales::installed(); + foreach ($locales as $locale => $display_name) { + $locales[$locale] = SafeString::of_safe_html($display_name); + } + if (count($locales) > 1) { + $block = new Block(); + $block->css_id = "gUserLanguageBlock"; + $block->title = t("Select Language Preference"); + $block->content = new View("user_languages_block.html"); + $block->content->installed_locales = array_merge(array("" => t("« none »")), $locales); + $block->content->selected = (string) user::cookie_locale(); + return $block; + } + } } -- cgit v1.2.3 From a25640f9b26c75e14109f07fcc4863adc300f062 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 4 Sep 2009 20:28:46 -0700 Subject: Shorten the name in the block so that it doesn't wrap. Use « and » in the << none >> text. --- modules/user/helpers/user_theme.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 5b973ef3..184a2bc9 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -42,9 +42,10 @@ class user_theme_Core { if (count($locales) > 1) { $block = new Block(); $block->css_id = "gUserLanguageBlock"; - $block->title = t("Select Language Preference"); + $block->title = t("Language Preference"); $block->content = new View("user_languages_block.html"); - $block->content->installed_locales = array_merge(array("" => t("« none »")), $locales); + $block->content->installed_locales = + array_merge(array("" => t("« none »")), $locales); $block->content->selected = (string) user::cookie_locale(); return $block; } -- cgit v1.2.3 From beb232a1cc6f081b432f32a72bddadcaf3f90df4 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Sat, 5 Sep 2009 17:43:47 -0700 Subject: Revert previous edit. Prefer « none » (sweet, nice Unicode characters) instead of HTML entities. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/helpers/user_theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 184a2bc9..098d87fd 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -45,7 +45,7 @@ class user_theme_Core { $block->title = t("Language Preference"); $block->content = new View("user_languages_block.html"); $block->content->installed_locales = - array_merge(array("" => t("« none »")), $locales); + array_merge(array("" => t("« none »")), $locales); $block->content->selected = (string) user::cookie_locale(); return $block; } -- cgit v1.2.3