Commit Graph

93 Commits

Author SHA1 Message Date
Bharat Mediratta
7aac471b82 Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_branch
Conflicts:
	modules/gallery/js/quick.js
2009-08-08 20:56:06 -07:00
Bharat Mediratta
c9f5000e65 Improve the graphics toolkit detection code so that properly
identifies situations where its restricted by open_basedir.

We now track more informatoin about the toolkit including the version
and any errors we encountered while doing the detection so that we can
provide more info downstream.  This makes graphics::detect_toolkits()
a little heavier, but that's ok because it should not be called very
often.

In the process, refactor the controller and view hierarchy so that
it's a little more straightforward in the code.

Fixes ticket #616.
2009-08-08 20:31:16 -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
Tim Almdal
f5c4d23e57 Convert the album add dialog to use the new Form_Script library
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-07-28 21:39:05 +08:00
Tim Almdal
dfaf870310 Convert the album add dialog to use the new Form_Script library 2009-07-28 06:33:25 -07:00
Tim Almdal
a7f4d7aced Revert commit 078c77a62b and change the
tag_event:item_edit_form to use the new Form_Script library to inject
script into a form.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-07-28 21:00:25 +08:00
Tim Almdal
2e8f73d4e9 Revert commit 078c77a62b and change the
tag_event:item_edit_form to use the new Form_Script library to inject
script into a form.
2009-07-28 05:40:28 -07:00
Tim Almdal
078c77a62b Add tag autocomplete to the album and photo edit pop up dialogs.
This required putting a wrapper view around the forms and passing
this view as the parameter to the item_edit_form event.  The view
contains a $script variable that the modules can add script to be
included in the form html when rendered as part of the ajax response.
2009-07-24 14:18:15 -07:00
Bharat Mediratta
f83db99d39 Properly display thumbnails for private movies by backtracking from
the thumbnail to the movie and then showing it as a JPG.  Fixes ticket
#570.
2009-07-21 12:26:16 -07:00
Bharat Mediratta
8f1bca7459 Remove the fallback code. It should trigger extremely rarely and seems highly inefficient to me, so let's see if we can live without it. 2009-07-21 12:18:49 -07:00
Bharat Mediratta
60d6058880 Make some API changes simplify the tag editing code. We now have a
good pattern for allowing modules to add their own hooks to item forms!

1) Album, photo and movie forms now all use edit_item as the group and
   we publish item_edit_form and item_edit_form_completed events which
   makes it much easier in the module to handle all events.  They can
   still differentiate based on $item->type if they want to.

2) Added tag::clear_all() and tag::compact() functions which takes the
   place of hiwilson's tag::update() function and is now used in
   tag_event::item_delete().  This provides a simple API that allows
   us to have a lot less event handling code.  It's less efficient
   than what hiwilson was doing before in that it will delete and
   re-add tags, but if that ever turns out to be a performance issue
   we can do something about it then.
2009-07-20 08:51:12 -07:00
hiwilson
709d6c5faf (1)Add tag edit field in album/photo edit form. (2)provide edit functionality. (3)support multi-word tagging. 2009-07-20 08:02:07 -07:00
Bharat Mediratta
df22832a5b Rename "locale" helper to "locales" to avoid conflicting with PHP 5.3.
Fixes ticket #194
2009-07-17 18:35:06 -07:00
Bharat Mediratta
e7c6861507 Don't send back the gzipped version if we're using
zlib.output_compression in PHP, since that means that the stream is
already compressed.  Fixes ticket 555.
2009-07-17 16:58:00 -07:00
Bharat Mediratta
0f766b149d 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.
2009-07-16 12:31:40 -07:00
Bharat Mediratta
5b3b675b6d Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items.
   Instead we overload ORM to track the original data and make
   that available via the item.  This will allow us to move event
   publishing down into the API methods which in turn will give us
   more stability since we won't require each controller to remember
   to do it.

2) ORM class now tracks the original values.  It doesn't track
   the original relationships (no need for that, yet)

3) Added new events:
     item_deleted
     group_deleted
     user_deleted
2009-07-16 11:19:34 -07:00
Bharat Mediratta
d9f3e0bc0e Remove spurious blank line at the top of the file introduced in 09c9b1a755 2009-07-16 10:27:18 -07:00
Bharat Mediratta
c4fce2cc68 Remove a completed @todo. 2009-07-15 20:32:53 -07:00
Tim Almdal
2cba5d9395 Fix 542 by changing the wording from you to your, thanks Floridave
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-07-15 07:58:30 +08:00
Bharat Mediratta
9588e8604d Use %27 instead of &#039; (the latter is the wrong form of escaping for urls). 2009-07-12 20:08:02 -07:00
Bharat Mediratta
9809238399 Unescape &#039; also (single quote) 2009-07-11 19:17:12 -07:00
Bharat Mediratta
e2967aa1c1 Fix a problem in delete() where we were referencing $parent without
saving its value before $item got deleted.  Further fix for #528.
2009-07-11 07:45:41 -07:00
Bharat Mediratta
4d0099e716 Fix a bug where we're referring to $photo when we just uploaded a
$movie, that causes the simpler uploader to throw an error for all
movies.
2009-07-11 06:24:10 -07:00
Bharat Mediratta
6281ed03d5 Turn off extended inserts when creating install.sql so that it's
easier to see what's changed.
2009-07-11 05:36:31 -07:00
Tim Almdal
09c9b1a755 Added the upload::required validation in order to insure that failed uploads
are not treated as successful.
Log any exceptions to the Kohana log and return the error message
2009-07-10 11:35:28 -07:00
Tim Almdal
5d9e334fe6 Added a wee bit of phpDoc.
Changed the name of the method get_task_log to get_log
Changed the default name of the file when the log is downloaded to
gallery3_task_log.txt
2009-07-07 12:49:21 -07:00
Tim Almdal
493fb27825 Cleanup remove task processing. Change Task_Model::delete to call parent::delete
instead of parent::save. :-) Also change admin_maintenance_controller to delete
via looping over all of the completed tasks and delete individually, so we can
delete the associated cache entries at the same time.
2009-07-06 22:20:04 -07:00
Tim Almdal
04f02b49c5 Add task logging functionality. When a task runs, it creates a log that is
stored in the persistant cache for 30 days.  On the admin_maintenance page
there is a new link for completed tasks "browse log".  Clicking this will
open a dialog box that has the the contents of the log displayed.

The user can then view the log and close the dialog, or press the save button
to download the log to their local machine.
2009-07-05 17:38:49 -07:00
Tim Almdal
54ffea2419 Split the clean method into two clean and purify. clean is a light weight
approach using html::specialchars and purify uses HTMLPurifier to intelligently
cleanse the output fields. Use purifier for text and title fields where it is
likely that a user would enter html to format their data.
2009-07-03 21:44:10 -07:00
Andy Staudacher
bafbe5a2d2 Fix for ticket 510: i18n fixes - localize module / theme name in some status messages 2009-07-03 14:58:33 -07:00
Bharat Mediratta
8f9a943f55 Fix a bunch of XSS vulnerabilities turned up by manual inspection
using the checklist in ticket #385.
2009-07-01 17:57:39 -07:00
Bharat Mediratta
132bd8306e Re-add Session::abort_save(). It was reverted as part of the earlier
change, but this is the part that we want to keep.
2009-06-30 20:51:02 -07:00
Bharat Mediratta
666c807fcc Revert "Add Session::abort_save() to Kohana."
Obsoleted by upstream fix.

This reverts commit 06f066164f.
2009-06-30 20:47:51 -07:00
Bharat Mediratta
5e8e3ab6b5 Rejigger the way we handle "done" status in the upgrader. Now we
present the done box if you're done and let you get rid of it if you
want.  It's not beautiful, by any means, but it gives you an easy link
back to your Gallery when you're finished.

Fixes ticket #479.
2009-06-30 18:28:55 -07:00
Andy Staudacher
3bd5990056 i18n theme name / description in admin themes. Partial fix for ticket 471. 2009-06-29 22:22:27 -07:00
Bharat Mediratta
c9e8ff8fcb Use the appropriate content-type for javascript (application/javascript). 2009-06-29 21:59:00 -07:00
Bharat Mediratta
02b46833d6 Pass back Cache-Control and Expires headers when we send back a 304,
otherwise some browsers (Firefox, at least) thinks that it needs to
revalidate.  At least in my case, it appears that my proxy tacks on
restrictive Cache-Control headers if they aren't there.
2009-06-29 21:52:42 -07:00
Bharat Mediratta
980c589e3d Fix a few more issues
1) Don't use $_SERVER, use Input::instance()->server().  This fixes the problem
   that when you use a browser that doesn't pass in an Accept-Encoding, we'd
   barf on a missing array key

2) Don't bother looking up the _gz key if we don't have gzencode, because we
   probably didn't store one.

3) Only emit the gzip Content-Encoding header if we're actually sending back
   gzipped data.
2009-06-29 21:38:04 -07:00
Bharat Mediratta
df84861833 If the argument to app() is not an album id, switch to the item parent.
Fixes ticket #489.
2009-06-29 20:23:23 -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
Bharat Mediratta
3080317d6e Refactor combined controller a bit
1) Create public javascript() and css() functions and turn __call()
   into a private function to protect us against having some random
   type show up in there.  Otherwise anything you put in the 2nd
   argument gets emitted in the header which is a security hole.

2) Fix a bug ("$key = $key[0]") which was breaking functionality.
   Eliminate the hex check, it's not really necessary in the majority
   case and doesn't hurt us in edge cases.

3) Convert some empty() calls to !, no need for a function call there.

4) Add phpDoc.
2009-06-29 17:44:02 -07:00
Tim Almdal
006b63030a Combine the Combined::javascript and Combined::css into a single method implemented
by the magic method __call. The first parameter is the content type for text/xxxx
and the 2nd parameter is the key of the combined file.
2009-06-29 15:38:55 -07:00
Tim Almdal
34c76c0906 A Combined javascript seems to work.
1) CSS files are added to the combined version by use of $theme->css() or $theme->css_theme() methods
2) url references in the css are converted to full paths as opposed to relative
3) @import statements in the css are resolved as well.
4) need to move the [if IE] statements into the css files so the will be honored in the browser. currently the ie fix css are always included.
2009-06-29 12:32:11 -07:00
Tim Almdal
6ec293dfe7 *Note* work in progress.
Implement the combined css functionality.  Local url references and replace with absolute urls instead of relative.
2009-06-29 08:24:42 -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
11f08ee439 Implement the combined javascript controller. 2009-06-26 21:42:02 -07:00
Tim Almdal
f4778699fc Change the movie controller to set the page type to "movie". Ticket #467 2009-06-26 08:19:06 -07:00
Bharat Mediratta
e44053f692 Cache the page_type in pane() instead of looking it up twice. 2009-06-23 21:42:25 -07:00