Commit Graph

75 Commits

Author SHA1 Message Date
Bharat Mediratta
5f86332db9 Convert tabs to spaces. 2009-08-27 11:41:19 -07:00
Andy Staudacher
0be38d143c Workaround to make G3 work with Turkish locale.
Thanks to katpatuka for providing the fix.
2009-08-25 13:32:57 -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
c09e2ef7af Merge branch 'master' of git@github.com:bharat/gallery3 into bharat_branch 2009-08-06 12:44:39 -07:00
Bharat Mediratta
b394b0b2c6 Fix the default $orderby to be an associative array in descendants() and children(), thanks Tim! 2009-08-05 11:01:48 -07:00
Bharat Mediratta
e8c57290a2 Change the children and descendants APIs to be more consistent and to
remove Gallery3 concepts from ORM_MPTT.

The following API methods:
  ORM_MPTT::children
  ORM_MPTT::children_count
  ORM_MPTT::descendants
  ORM_MPTT::descendants_count

All now take a $where clause that allow you to pass through additional
field parameters.

old API:
  $album->children(10, 0, "photos")
  $album->children_count("photos")

new API:
  $album->children(10, 0, array("type" => "photos"))
  $album->children_count(array("type" => "photos"))

This gives us a more flexible API and simplifies the code.  While I
was in there, I changed the way we deal with default orderby values so
that we just assign the default value in the function definition,
which allows us to get rid of all conditionals in the implementation
which results in simpler code.
2009-08-05 10:38:53 -07:00
Tim Almdal
187d4b209d Change the children methods on Item_Core and ORM_MPTT in order to
specify a type parameter, so tht we can filter the children based
on type (i.e. album, photo, etc).
In addition, expose the sort order, so that we can specify the order
we want to return the children.
2009-08-05 07:38: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
7ad0808a11 Change the API for getting to the original state of an ORM.
Old API:  $obj->original("field_name")
  New API:  $obj->original()->field_name

This allows us to revert the varous xxx_updated events back to passing
an original ORM as well as the the updated one.  This makes for a
cleaner event API.

  Old API:  comment_updated($comment) { $comment->original("field_name") }
  Old API:  comment_updated($old, $new) { $old->field_name }
2009-08-02 12:09:00 -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
Tim Almdal
2f969c80eb Create A Forge Script element. Form_Script allows the specification
of either a url to a script file or in line text which will be included
in a script block.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-07-28 12:04:23 +08:00
Romain LE DISEZ
23bb6eb7e3 Rename columns that use reserved SQL words : items.left and items.right 2009-07-25 19:06:54 +02:00
Bharat Mediratta
dbeadc1407 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
2009-07-22 14:27:57 -07:00
Bharat Mediratta
3aea4dd118 Dump out the error message along with the stack trace when we catch an
exception from View::render()
2009-07-20 18:47:32 -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
d692002bcf Don't show the combined CSS/JS elements if we didn't combine anything.
Fixes ticket #554.
2009-07-17 18:24:31 -07:00
Bharat Mediratta
6200955003 Don't bother making gzencoded version of combined CSS/JS if zlib.output_compression=On 2009-07-17 18:19:43 -07:00
Bharat Mediratta
cd907c2b42 Change model_cache::clear() API to clear everything. This prevents
old ORM relationships from hanging around, which was causing problems
when doing MPTT manipulations (resulting in incorrect permission
propagation-- very bad!)
2009-07-17 12:51:27 -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
Kevin Nehls
85b0f58029 move fix for backslashes on windows outside of loop per bharat's suggestion
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-07-16 21:36:51 +08:00
Kevin Nehls
5cb2f42628 Fix backslashes in relative URLs of combined css files.
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-07-16 21:36:50 +08:00
Tim Almdal
94e33c821f Removed unnecessary contructor from the HTMLPurifier.php library class 2009-07-14 06:42:50 -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
b4c279ebb4 Fix whitespace typo. 2009-07-11 17:40:32 -07:00
Tim Almdal
4132d6c55e Put quotes around the href param (href="#") 2009-07-11 15:47:04 -07:00
Tim Almdal
f1b2a14f4f Add a title attribute to the li of a menu 2009-07-10 23:45:29 -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
Tim Almdal
f6d847739a Update the source so the third party code passes the File Structure Test 2009-07-03 14:18:45 -07:00
Tim Almdal
b6e5bf6eaa Fix for ticket #400: Add HTMLPurifier to gallery3 and change p::clean() to call HTMLPurifier->purify() 2009-07-03 12:56:29 -07:00
Bharat Mediratta
a674170bf7 2 fixes:
1) Include the url in the cache key so that if the Gallery moves, we
   don't use old cached entries.

2) Use the relative path to files in the comments that we embed in our
   files so that we don't leak local paths.
2009-07-01 22:55:43 -07:00
Tim Almdal
6e80330e19 Remove the testing code to force rebuilding the cache. 2009-06-29 21:16:42 -07:00
Bharat Mediratta
77a78b4990 Revert to serializing and deserializing data. The cache table can't
accept PHP constructs like arrays (the tests were choking on this).

Update tests to reflect the new `key` column.
2009-06-29 20:53:55 -07:00
Bharat Mediratta
b579db5173 Oops, "head" => "admin_head" to make the admin dashboard work. 2009-06-29 20:08:35 -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
325203e1ca Add a media type using the most common media type from our CSS. This
doesn't fix the problem that we need to support multiple media types
(the original code had superfish using just "screen", and some other
deviations).

There's no code yet to support multiple media types, but it would not
be too difficult to create buckets based on media.
2009-06-29 18:27:29 -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
86596f9595 Merge branch 'master' of git@github.com:gallery/gallery3 2009-06-29 15:04:15 -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
Bharat Mediratta
16d4922e3a Remove unused $theme_relative arg from theme_script(). 2009-06-29 09:07:29 -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
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
6e8a8c53e6 Rename $theme->url() to $theme->theme_url() for consistency wiht
$theme->theme_script().
2009-06-28 19:49:48 -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
fcc57a4182 Modify the cache table to make id the primary key for consistency with
other gallery 3 tables.  Update the driver to match, add more upgrader
code, update the installer block and change the gallery module version
to 6.
2009-06-28 16:48:29 -07:00