Commit Graph

61 Commits

Author SHA1 Message Date
Bharat Mediratta
ab598b2931 Put the theme CSS at the end of the module CSS so that the theme has
the final say.  Fixes ticket #1315.
2010-08-29 21:15:58 -07:00
Bharat Mediratta
400c248e2d default maintenance_mode from false -> 0 for consistency with the value we set in the db 2010-08-01 21:10:27 -07:00
Bharat Mediratta
c33b24c9fa Make maintenance mode a variable instead of a config. Then create
links on the Admin > Maintenance page to allow you to turn it on and
off.  This should be efficient since we cache all vars and look them
up on every request anyway.

This also allows us to have the Fix task enable maintenance mode while
it's running which greatly reduces the chances that somebody will come
along and hork the database while we're tinkering with MPTT pointers.

Fixes ticket #1259.
2010-08-01 21:00:30 -07:00
Bharat Mediratta
1240878df0 Fix-ups for d98b85f7d3
- Pass the CSS selector of the active image in as an arg to site_menu
  so that quick operations know what they're operating on.
- Change the ids from g-{photo,movie}-id to the generic g-item-id
- Initialize ajax handlers for site menu on the photo and movie page
- Drop the movie context menu, it's now in the site menu
2010-05-14 16:55:15 -07:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Tim Almdal
bd9f945e3f Remove the display of the "body_attributes" div when in debug mode. debug mode is by default set up to add new div's to display the location of the content. "body_attributes" are attributes on the body tag and trying to add content introduces an extra > in the html stream. 2010-01-08 12:49:16 -08:00
Bharat Mediratta
3d4672ba88 Give the theme a chance to handle theme function callbacks as well. 2009-11-28 23:48:38 -08:00
Bharat Mediratta
22149b52c3 Move the theme fallback checking into theme::load_themes() so that
we're calling it once per request.
2009-11-27 17:12:13 -08:00
Bharat Mediratta
9d40f6fc00 Paginator: don't try to set the position for "other" page types. 2009-11-20 20:29:49 -08:00
Tim Almdal
57adefc5ba Revert "Create theme::get_var(), theme::set_var() methods to set the options of the active site theme. Change all refrences to theme options to use these methods. Update the version number of Gallery to 20 and move any them related options to the be stored under the active theme."
This reverts commit 26114972c3.
2009-11-19 11:44:01 -08:00
Tim Almdal
26114972c3 Create theme::get_var(), theme::set_var() methods to set the options of the active site theme. Change all refrences to theme options to use these methods. Update the version number of Gallery to 20 and move any them related options to the be stored under the active theme. 2009-11-18 15:36:13 -08:00
Bharat Mediratta
670312ff10 For album pagination, don't let the last_visible_position exceed the
total.  Fixes ticket #903.
2009-11-18 11:26:19 -08:00
Bharat Mediratta
1067e68292 Redesign the way that we consider page types to create buckets of page
types, and a subtype for specifics.  Currently the top level bucket

   collection, item, other

Here are the core subtypes so far:

   collection: album, search, tag
   item: movie, photo
   other: login, reset, comment-fragment, comment

It's legal to create new page_subtypes whenever you want.  Use the
appropriate page_type to get the coarse grain behavior that you want.
2009-11-17 14:04:45 -08:00
Bharat Mediratta
5df00737c9 Fix a couple of errors in the refctored paginator code:
1) We weren't showing previous page links for albums when we should have
2) We needed to wrap the results of url::merge() in url::site() so that we
   generate server-relative urls.
2009-11-15 15:24:49 -08:00
Bharat Mediratta
aa1ddba155 Oops. Fix a typo that the forced page_type to always be "tag" 2009-11-14 16:36:25 -08:00
Bharat Mediratta
cd8663b81d Fix pagination so that it does not require any domain specific logic
to support tags and search.  Instead, just modify the page param to
the current page.
2009-11-14 16:31:56 -08:00
Bharat Mediratta
29efb6ba9f Rename "pager" to "paginator" so that we differentiate page.html.php
from paginator.html.php
2009-11-14 16:20:36 -08:00
Bharat Mediratta
081ce9f6ca Normalize pagination so that pager.html.php can handle pagination for
both albums and movies.  Kohana's paginator is not quite sufficient
for this, so create our own pagination logic in Theme_View with only
the stuff we need.

Clearly document the variables available in pager.html so that themers
know how to use it.

Fixes ticket #626.
2009-11-14 14:25:39 -08:00
Tim Almdal
0fe32a61f6 Standardize the name of the blocks. 2009-11-13 13:56:05 -08:00
Tim Almdal
b5f2dbc2c4 Create a user_menu for the top of the page. Change the login, edit profile and logout portions of the banner to be rendered by the Theme_View::user_menu callback. This fires the user_menu event. Fixes Ticket #871. 2009-11-06 14:08:46 -08:00
Bharat Mediratta
13faf6035d Remove Menu::compact() in favor of putting an if-then clause in
menu.html.php.  This serves two purposes:

1) It's more efficient since we're doing less passes over the Menu tree
2) We're allowing themers to decide whether or not to show empty menus
2009-10-27 14:00:32 -07:00
Bharat Mediratta
76c0c7f3a1 Change our menu building blocks to use PHP templates so that themes
can override them and define their own menu formats.  I worry a little
bit that this approach may be too heavy since we're now doing a lot
more template includes than we were before.  Also, I had to change the
Menu API to stop using __toString() because you can't throw exceptions
from __toString() which would make it an unhappy experience for
developers.
2009-10-27 13:48:41 -07:00
Tim Almdal
3c936d661a Change the name of identity library from Identity to IdentityProvider. Create a helper class called identity to simplify call the Identity Provider. Move the contents of MY_Session.php to the new helper class and remove the MY_Session class 2009-10-22 13:11:03 -07:00
Tim Almdal
78ee4193b7 Remove all non Identity API methods from Identity.php. Created an MY_Session class to provide the user state changes in the session and a login.php helper that has the login form. 2009-10-16 10:06:58 -07:00
Tim Almdal
00eacd659f Start simplifying the interface by moving the static methods from user.php and group.php. Tried creating a identity helper, but the helper identity.php was confused with the library Identity.php. So got around this by making the methods on Identity static and calling the instance within the static methods. Also temporarily moved the user.php and group.php back into the user module. 2009-10-16 08:53:31 -07:00
Chad Kieffer
3e6ba7acc3 Renamed most, if not all css selectors from gName to g-name. Moved a few shared images from wind to lib. Deleted unused images in the admin_wind. This will likely break a few ajax features. 2009-10-04 00:27:22 -06:00
Tim Almdal
60d35b8992 Use the block_manager to manage site sidebar panels. Fixes ticket #110.
* Extend block_manager to handle sidebar blocks. get_available has become get_available_admin_blocks, get_list becomes get_admin_list.
* Create new functions get_available_site_blocks which will look for gallery_block get_available_site_blocks.
* Refactor sidebar_blocks into a separate function and then call block_manager::get_html(site.sidebar). Convert image_block to use block management instead of theme::sidebar_blocks
* Change the block_manager api so that the theme is passed into the get method. convert info to the new sidebar block approach
* Convert the user module to use the new sidebar block structure. remove the installers for info and image_block modules.
* Convert tag and rss modules to the new sidebar framework. reset the version number to 1 for info and image_block modules.
* Change the get_html method to ignore empty blocks and change the individual handlers to return an empty string if no block is generated
* Add a warning message if no sidebar blocks are active and provide a link to the admin page that configures the sidebar.
2009-09-30 07:31:12 -07:00
Tim Almdal
89a67dba63 * Remove the @todo in module event and always try to call gallery_event::$function first
* Refactor gallery.php to move site_menu, admin_menu, and context_menu to gallery_event.php
* Change Theme_View and Admin_view to call module::event("site_menu|admin_menu|context_menu"...)
2009-09-29 08:50:53 -07:00
Tim Almdal
c51c76dcaa Fix Admin_View to look for the the variable active_admin_theme instead of active_site_theme. In addition check for the existence of THEMEPATH . instead of theme/ 2009-09-24 15:06:40 -07:00
Tim Almdal
59c1c36639 Hopefully the last 2 errant occurrences of default as it relates to theme names 2009-09-24 14:50:30 -07:00
Bharat Mediratta
4e1e24ba1a Add a movie_menu() theme callback, and have the default theme call it
in the sidebar on movie page types.
2009-09-16 20:34:42 -07:00
Bharat Mediratta
cbba45fffc Create the concept of an "ajax link" and use it for thumbnail rotation
and album covers in the context menu.

Notes:
- This requires context_menu() to have a CSS selector that refers to the
  <img> that we're operating on, otherwise we don't know how to find the
  thumbnail, etc.
- Create Menu_Element_Ajax_Link which has an ajax_handler attribute
  that contains a snippet of JS that we're going to run when the ajax
  call returns.
- Add $.gallery_replace_image in gallery.common.js
- Add lib/gallery.ajax.js which can be used to ajaxify any link, and have
  ui.init.js in the themes call that on all .gAjaxLink elements.
2009-08-10 23:07:50 -07:00
Bharat Mediratta
f7a23e0a9c Fix up context menus a bit.
- Update digibug_event::context_menu() to take the actual item
- Change gallery::context_menu() to not require the page_type as an argument
2009-08-09 23:08:35 -07:00
Bharat Mediratta
52147cf6f8 Combine the quick menu and the thumb menu into a single menu called
the "context" menu.

This new context menu is generated using the typical event processing
system, like our other menus.  The specialized quick CSS and JS is now
gone, replaced by our generic menu handling code.  It's all rolled
together currently using the thumb_menu UI for easy packaging.  All
the CSS and JS is updated.

NOTE: the non-dialog links (rotate, album_cover) have a broken UI
because they return JSON which the quick.js code handled specially,
but we don't handle properly now.  I need to fix this.
2009-08-03 21:45:54 -07:00
Bharat Mediratta
15f148349e Make body_attributes() a theme callback instead of a method on the
View.  This allows modules to piggyback on it.
2009-07-29 17:25:53 -07:00
Bharat Mediratta
30586236a5 Make sure the thumb_menu has the gThumbMenu CSS class. 2009-07-28 20:44:50 -07:00
Bharat Mediratta
544e92adc9 Move site_menu and admin_menu into gallery helper so that site_menu
can call admin_menu.
2009-07-28 20:32:11 -07:00
Bharat Mediratta
1e90e40d3a 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.
2009-07-28 13:47:22 -07:00
Bharat Mediratta
895fbfd95b Get the thumbnail menu working.
1) Stop changing the menu classes in JS, instead allow us to specify
it in the Menu class itself and then set it to be gThumbMenu in Theme_View

2) Move the gThumbMenu init code to the bottom of the $(document).ready() block;
something in there was interfering with it.
2009-07-11 17:59:55 -07:00
Bharat Mediratta
86a7b15d20 Compact all menus. This fixes the problem that the new [Options]
thumb menu shows up when it has nothing in it.
2009-07-10 10:39:59 -07:00
Bharat Mediratta
95b900d4f4 Fix some bugs in the combined JS/CSS code (most of which I introduced
in my last refactor):

1) Actually combine the JS (I was only combining the CSS)
2) Add line breaks between the files and comment them so that we can
   find a specific file inside the blob.
3) Add an HTML comment to help developers figure out why they can't
   find their CSS/JS.
2009-06-29 19:11:59 -07:00
Bharat Mediratta
fa8ca2f7ad Refactor combine_xxx() functions together into combine_files() and use
html functions to generate the resulting elements.  Add phpdoc.
2009-06-29 18:12:53 -07:00
Tim Almdal
10b4eda6f0 Merge branch 'master' of git@github.com:gallery/gallery3
Conflicts:
	modules/gallery/libraries/Theme_View.php
	themes/admin_default/views/admin.html.php
2009-06-29 06:44:05 -07:00
Tim Almdal
42c82ef7f0 Temporary checkin to allow merge with trunk... don't integrate 2009-06-29 06:08:50 -07:00
Bharat Mediratta
c4f991bb7d Clean up the combined javascript change and refactor out the
Gallery_View base class from Theme_View and Admin_View.

1) Move all the theme specific jquery stuff from gallery_theme::head()
and admin_head() into the theme files.  Use $theme->script() as
appropriate.

2) Get rid of the extra boolean on $theme->url() that we were using so
that we could call $theme->script($theme->url(...)) -- add
$theme->theme_script() instead (poorly named, but still clearer than
what we had before)

3) Fix the bug that combined scripts didn't work at all in the admin
theme.

4) Get rid of $theme->display() in favor of new View(...)
2009-06-28 19:45:11 -07:00
Tim Almdal
d90e30c378 Rename the combined javascript controller from javascript/combined to combined/javascript. 2009-06-28 17:07:12 -07:00
Bharat Mediratta
aa31e1f009 Tweak the cache implementation
1) Drop the *_modified key, we don't really need it.  The modification date is not
   relevant to our browser caching strategy.
2) Fix multiple issues with the Expires header and just hardcode it to the biggest
   possibly value for code clarity.
3) print the $content out directly instead of using fwrite
4) Minor cleanups in the installer.
2009-06-28 16:24:51 -07:00
Tim Almdal
bf26ca727e Change the combined javascript to use the new caching functionality and respect the HTTP_IF_MODIFIED_SINCE header request. 2009-06-28 15:30:13 -07:00
Tim Almdal
4707a97b82 Merge branch 'master' of git@github.com:gallery/gallery3 2009-06-27 16:57:38 -07:00
Bharat Mediratta
aad0dd357f Create a new thumb_menu() and convert Digibug over to use it.
1) Eliminate digibug_album.html

2) Get rid of the $(document).ready() in digibug.js and rename popUp() to
   digibug_popup() then just make direct calls to digibug_popup() in the
   menu urls.
2009-06-27 16:29:09 -07:00