From 4f1538d87b1093d430523aeb717e375b2c8b1c92 Mon Sep 17 00:00:00 2001 From: Serguei Dosyukov Date: Thu, 3 Dec 2009 00:00:03 -0600 Subject: [PATCH] Grey Dragon Theme - version 1.5.8 --- .../admin/controllers/admin_theme_options.php | 146 ++++++++++++++++++ themes/greydragon/changelog.txt | 13 ++ themes/greydragon/css/screen.css | 6 +- themes/greydragon/images/logo.png | Bin 6027 -> 0 bytes themes/greydragon/theme.info | 2 +- themes/greydragon/views/album.html.php | 7 + themes/greydragon/views/dynamic.html.php | 6 + themes/greydragon/views/page.html.php | 68 +++++--- themes/greydragon/views/photo.html.php | 10 +- themes/greydragon/views/search.html.php | 11 +- 10 files changed, 234 insertions(+), 35 deletions(-) create mode 100644 themes/greydragon/admin/controllers/admin_theme_options.php delete mode 100644 themes/greydragon/images/logo.png diff --git a/themes/greydragon/admin/controllers/admin_theme_options.php b/themes/greydragon/admin/controllers/admin_theme_options.php new file mode 100644 index 00000000..ed4d0426 --- /dev/null +++ b/themes/greydragon/admin/controllers/admin_theme_options.php @@ -0,0 +1,146 @@ +"g-theme-options-form")); + + $group = $form->group("requirements")->label("Prerequisites checklist"); + $group->checkbox("shadowbox")->label(t("Shadowbox module")) + ->checked((module::is_active("shadowbox")))->disabled(true); + + $file = THEMEPATH . "greydragon/theme.info"; + $theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); + + $group = $form->group("edit_theme")->label(t("Grey Dragon Theme") . " - " . t("v.") . $theme_info->version); + $group->input("row_count")->label(t("Rows per album page"))->id("g-page-size") + ->rules("required|valid_digit") + ->value(module::get_var("gallery", "page_size") / 3); + + $group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("g-resize-size") + ->rules("required|valid_digit") + ->value(module::get_var("gallery", "resize_size")); + $group->checkbox("build_resize")->label(t("Mark to build all resizes (from Maintenace page)"))->id("g-build-resize")->value(false); + $group->checkbox("build_thumbs")->label(t("Mark to build all thumbnails (200x200) (from Maintenace page)"))->id("g-build-thumb")->value(false); + + $group->checkbox("photonav_top")->label(t("Show top photo navigator")) + ->checked(module::get_var("th_greydragon", "photonav_top")); + $group->checkbox("photonav_bottom")->label(t("Show bottom photo navigator")) + ->checked(module::get_var("th_greydragon", "photonav_bottom")); + + $group->dropdown("sidebar_allowed")->label(t("Allowed SideBar Positions")) + ->options(array("any" => t("Any"), "left" => t("Left"), "right" => t("Right"), "none" => t("None"))) + ->selected(module::get_var("th_greydragon", "sidebar_allowed")); + $group->dropdown("sidebar_visible")->label(t("Default SideBar Position")) + ->options(array("right" => t("Right"), "left" => t("Left"), "none" => t("None"))) + ->selected(module::get_var("th_greydragon", "sidebar_visible")); + + $group->input("header_text")->label(t("Header text"))->id("g-header-text") + ->value(module::get_var("gallery", "header_text")); + $group->input("footer_text")->label(t("Footer text"))->id("g-footer-text") + ->value(module::get_var("gallery", "footer_text")); + $group->checkbox("show_credits")->label(t("Show site credits"))->id("g-footer-text") + ->checked(module::get_var("gallery", "show_credits")); + + $group->input("copyright")->label(t("Copyright message to display on footer"))->id("g-theme-copyright") + ->value(module::get_var("th_greydragon", "copyright")); + $group->input("logo_path")->label(t("URL or path to alternate logo image"))->id("g-site-logo") + ->value(module::get_var("th_greydragon", "logo_path")); + + module::event("theme_edit_form", $form); + + $group = $form->group("buttons"); + $group->submit("")->value(t("Save")); + return $form; + } + + public function index() { + $view = new Admin_View("admin.html"); + $view->content = new View("admin_theme_options.html"); + $view->content->form = self::get_edit_form_admin(); + print $view; + } + + public function save() { + access::verify_csrf(); + + $form = self::get_edit_form_admin(); + if ($form->validate()) { + $edit_theme = $form->edit_theme; + + module::set_var("gallery", "page_size", $edit_theme->row_count->value * 3); + + $resize_size = $edit_theme->resize_size->value; + $thumb_size = 200; + $build_resize = $edit_theme->build_resize->value; + $build_thumbs = $edit_theme->build_thumbs->value; + + if (module::get_var("gallery", "resize_size") != $resize_size) { + module::set_var("gallery", "resize_size", $resize_size); + $build_resize = true; + } + if (module::get_var("gallery", "thumb_size") != $thumb_size) { + module::set_var("gallery", "thumb_size", $thumb_size); + } + + if ($build_resize) { + graphics::remove_rule("gallery", "resize", "gallery_graphics::resize"); + graphics::add_rule("gallery", "resize", "gallery_graphics::resize", + array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO), 100); + } + + if ($build_thumbs) { + graphics::remove_rule("gallery", "thumb", "gallery_graphics::resize"); + graphics::add_rule("gallery", "thumb", "gallery_graphics::resize", + array("width" => 200, "height" => 200, "master" => Image::AUTO), 100); + } + + module::set_var("th_greydragon", "photonav_top", $edit_theme->photonav_top->value); + module::set_var("th_greydragon", "photonav_bottom", $edit_theme->photonav_bottom->value); + + $sidebar_allowed = $edit_theme->sidebar_allowed->value; + $sidebar_visible = $edit_theme->sidebar_visible->value; + + if ($sidebar_allowed == "none") { $sidebar_visible = "none"; } + if ($sidebar_allowed == "right") { $sidebar_visible = "right"; } + if ($sidebar_allowed == "left") { $sidebar_visible = "left"; } + + module::set_var("th_greydragon", "sidebar_allowed", $sidebar_allowed); + module::set_var("th_greydragon", "sidebar_visible", $sidebar_visible); + + module::set_var("gallery", "header_text", $edit_theme->header_text->value); + module::set_var("gallery", "footer_text", $edit_theme->footer_text->value); + module::set_var("gallery", "show_credits", $edit_theme->show_credits->value); + + module::set_var("th_greydragon", "copyright", $edit_theme->copyright->value); + module::set_var("th_greydragon", "logo_path", $edit_theme->logo_path->value); + + module::event("theme_edit_form_completed", $form); + + message::success(t("Updated theme details")); + url::redirect("admin/theme_options"); + } else { + $view = new Admin_View("admin.html"); + $view->content = $form; + print $view; + } + } +} + diff --git a/themes/greydragon/changelog.txt b/themes/greydragon/changelog.txt index 6db84369..f6750d23 100644 --- a/themes/greydragon/changelog.txt +++ b/themes/greydragon/changelog.txt @@ -1,5 +1,18 @@ Grey Dragon Theme Changelog +version 1.5.8 +- Finally admin module for theme is there. After theme installation, visit Appearance/Theme Options to configure the theme. + If you had older version of the theme, initial setup is also required. + The following settings are available: + - Rows per album page - theme uses 3 columns layout for pictures, therefore default page_size is computed in x3 increments + - Thumb size is restricted to 200 and therefore not available for administration + - Mark to build resizes/thumbs - allows force rebuilding of images + - Show/Hide top/bottom photo navigators + - Specify allowed and default sidebar position + - Administrator can now specify Copyright message to display in the footer + - Site logo is now default to Gallery 3 logo, but admin can provide a path to custom logo. +- Sidebar session cookie is set to expire in 365 days + version 1.5.7 - Status message has been moved into header as popup to prevent obstruction of the main view. jQuery is used to fade it out in 10 sec. diff --git a/themes/greydragon/css/screen.css b/themes/greydragon/css/screen.css index 86d28b45..974521a1 100644 --- a/themes/greydragon/css/screen.css +++ b/themes/greydragon/css/screen.css @@ -81,7 +81,7 @@ h5 { font-weight: bold; } /* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.g-paginator { display: inline-block; width: 100%; padding: 4px 0 6px 0; font-size: 80%; zoom: 1; } +.g-paginator { display: inline-block; width: 100%; padding: 4px 0 0 0; font-size: 80%; zoom: 1; } .g-paginator li { display: inline; float: left; margin-left: 0; zoom: 1; } .g-paginator a { padding: 0 0 0 2px; } @@ -91,7 +91,7 @@ h5 { font-weight: bold; } /* Album grid ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ .g-thumbcrop { overflow: hidden; position: relative; width: 200px; height: 150px; } -#g-album-grid { padding: 0px; width: 100%; } +#g-album-grid { padding: 6px 0 0 0; width: 100%; } #g-album-grid .g-item { position: relative; float: left; padding: 10px 9px 0px 9px; width: 30.5%; height: 190px; background: url('../images/image_thumb.gif') no-repeat; } #g-album-grid .g-item p { text-align: center; } #g-album-grid h2 { position: absolute; top: 164px; left: 12px; width: 150px; font: 100%/100% Arial, Helvetica, sans-serif; } @@ -119,7 +119,7 @@ h5 { font-weight: bold; } #g-info h1 { padding-bottom: 1px; border-bottom: 1px solid #888; } #g-info .g-description { display: none; } /* #g-info h1:hover .g-description { position: relative; z-index: 10; top: 10px; left: 0px; width: 90%; display: block; afloat: left; border: 1px solid #888; padding: 6px; }*/ -#g-photo { padding: 6px 0 0 6px; text-align: center; } +#g-photo { padding: 6px 0 6px 6px; text-align: center; } #g-albumheader h1 { padding-bottom: 1px; margin-bottom: 6px; border-bottom: 1px solid #888; } /* Footer section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/themes/greydragon/images/logo.png b/themes/greydragon/images/logo.png deleted file mode 100644 index 2a06cd6ca5a7c3c745a47f9887b3997895fd6ed2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6027 zcmV;67j)=}P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$Dy+xzR000)|Nkl6_;Koh1EN}+`QC;eZ4K!i0?*H&*W3x9<*s#FepF?0)=KiZ-6X zg4P|SJ*TEtSU@p~-HmY!2$S~j-#@3Pr|141J9d0~=gysVST>n{<8?+WP^hUD9#9l9 zQy`F-jL#<@IdbIuW5WYgYNQyW=~qJ&)v(jm^p_xJDF zv*)*PKQ;N(&r$}Mu`F(ui0`8{-CIp<1Of#Oes(Qp<8w_{SJ(dm zC{_|sAgAJSEdK!7d1&Xbjxhy4l`|7LnOga07VRTwm!n-w?g=vt0*(uil=V628Xw|ivpGsau1uv#)MC+8 z>qOMlMgUNphZ>KYw{G2fC&bJh1QeuIK+wDeA1R-LlCM6F_EEGe2|Tb~-CJ+HbqCga z9Ds2f)+4~Uhy+j;N1d>$(KT4VP_R%_%Qv84jbR2egey8aI$8i2YY8YQObS8sD_DLz z8bv^EMb_pIcJ12r0stij;q!kF9z6IWWpTd!_S>!4F3e!^4-6QyjR;DiRRs$*wGjXm z82Dd0aNxjK!4UQvodQ7c6n^_UH2}vS&`!jKojB1O=TItX8ogi{e}((fXJ3CvV=od7PH3tEuG?P_Qdd&Jm3BDZ&9@_!DUq0E+$06pjNB7NfOF zFu>v{mOTje@l&vj4jU}6>=??_AEA_R(mznTekQ`Lr$EanUAuPe7>$I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WHn{`Pyvi;OdXa;gn#FCH4 z{T@krB07vFDU=yYOXHIUj01E{S?LaaPwfWxfA`;apZ=3@$(oYS#g2N2WwK9_qDo@m zyI^6RfB(LTCW+VqfTDz?6UU=c2wzds_#v911%r+bb zEwSgt)X|quT7|18#0CL;qHa=_?cT`fh@|d)p~q$c6y6$z*|%g5eZZ7D8qqhPqrM4b z>07MdHugCiSHM2@KtN%xhYZ^~?5fU+R>geX9tm1~(V9rwYiz=s(v2W?KyC!-4ftC@ zpNS#Rasq%vTR#!omEj#8_qMlh{G$O0+J|||mx4r|n|o8`6et?{1A`DvzE|-&3<^>c<>-zwO&>T`OljmpYG>K!cNv}P5xJf=h z;Y2PBNVK=dZlzcJkqbc)3`99A=~aIW9OYPdGC*Mx-bOxm&6+jO_F-?A5KbeOFV9a)vuzexj;>$dPmeL* zBfc(*aWCxiGskH(i+5tohIL4(?aHy12e zaB*vE>+b;&aj=MWTefVz8!TZqz4DJh148Ds4I4IGzIyfQ$M8;%7oU0NnU4~ySigS# zMDvy}1qn5^ykLq^4(B$c1QiJs#3snSAm;G=^MCrz&YhjBzz}-LP|($h_5@x~yy%rz zURe%C@g#uaN<=title) ?>
description)? bb2html(html::purify($item->description), 1) : null; ?>
+ + paginator() ?> + +
    $child): ?> @@ -41,4 +45,7 @@
album_bottom() ?> + + paginator() ?> + diff --git a/themes/greydragon/views/dynamic.html.php b/themes/greydragon/views/dynamic.html.php index 6f7699dd..e136fd53 100644 --- a/themes/greydragon/views/dynamic.html.php +++ b/themes/greydragon/views/dynamic.html.php @@ -6,6 +6,10 @@

+ +paginator() ?> + +
    $child): ?>
  • "> @@ -26,4 +30,6 @@
dynamic_bottom() ?> + paginator() ?> + \ No newline at end of file diff --git a/themes/greydragon/views/page.html.php b/themes/greydragon/views/page.html.php index 50538660..d6e65b2d 100644 --- a/themes/greydragon/views/page.html.php +++ b/themes/greydragon/views/page.html.php @@ -5,16 +5,25 @@ - @@ -70,7 +79,9 @@ @@ -99,14 +110,22 @@
+
    - -
  • '; ?>">Sidebar Left"; ?>
  • - -
  • '; ?>">No Sidebar"; ?>
  • - -
  • '; ?>">Sidebar Right"; ?>
  • + + +
  • '; ?>">Sidebar Left"; ?>
  • + + + +
  • '; ?>">No Sidebar"; ?>
  • + + + +
  • '; ?>">Sidebar Right"; ?>
  • +
+
@@ -120,21 +139,21 @@
- + ' ?> - + ' ?> -page_subtype != "login") && ($sidebaralign != "full")): ?> +page_subtype != "login") && ($sidebarvisible != "none")): ?> -" : null ?> +" : null ?> - + ' ?> - + ' ?> ' ?> @@ -163,18 +182,17 @@ - page_bottom() ?> - - + + +// // <bgsound src="/music/collection.m3u"> -?> - - // // // diff --git a/themes/greydragon/views/photo.html.php b/themes/greydragon/views/photo.html.php index d79dbb56..d4256215 100644 --- a/themes/greydragon/views/photo.html.php +++ b/themes/greydragon/views/photo.html.php @@ -7,8 +7,9 @@

title) ?>

description), 1) ?>
- paginator() ?> - + +paginator() ?> +
resize_top($item) ?> @@ -22,7 +23,8 @@ resize_bottom($item) ?>
- paginator() ?> - + +paginator() ?> + photo_bottom() ?>
diff --git a/themes/greydragon/views/search.html.php b/themes/greydragon/views/search.html.php index c934c99a..d8045c7d 100644 --- a/themes/greydragon/views/search.html.php +++ b/themes/greydragon/views/search.html.php @@ -4,7 +4,11 @@

$q)) ?>

- pager() ?> + + +paginator() ?> + +
    @@ -19,7 +23,10 @@
- pager() ?> + + +paginator() ?> +