Commit Graph

309 Commits

Author SHA1 Message Date
Tim Almdal
bd532f6c88 Merge branch 'master' of git@github.com:gallery/gallery3 2010-09-12 10:57:41 -07:00
Tim Almdal
ac64614d4d Path for ticket #1140. Add a size0 to the tag cloud. 2010-09-12 10:53:06 -07:00
Bharat Mediratta
cef7ca9cf2 Change tag url form to be /tag/{name} from /tags/show/{id}. This is
a much friendlier url format.  Fixes ticket #1363.
2010-09-11 10:26:48 -07:00
Bharat Mediratta
d398651c08 Disable selectFirst in the autocomplete box, which makes it a little
harder to select pre-existing tags, but avoids the problem where we
force the user to pick from existing tags.  Fixes ticket #1339
2010-09-07 00:34:41 -07:00
Bharat Mediratta
db75ac642a Use the title of the root album as the site title for all RSS feeds.
Fixes ticket #1307.
2010-09-04 13:40:39 -07:00
Bharat Mediratta
7607e1f932 Full pass over all the JSON encoding and JS dialog code. We now abide
by the following rules:

1) An initial dialog or panel load can take either HTML or JSON, but
   the mime type must accurately reflect its payload.

2) dialog form submits can handle a pure HTML response, but the mime
   type must also be correct.  This properly resolves the problem
   where the reauth code gets a JSON response first from the reauth
   code, and then an HTML response when you reauth and continue on to
   a given form -- try it out with Admin > Settings > Advanced.

3) All JSON replies must set the mime type correctly.  The json::reply
   convenience function does this for us.

4) By default, any HTML content sent back in the JSON response should be
   in the "html" field, no longer the "form" field.

The combination of these allows us to stop doing boilerplate code like
this in our controllers:

  // Print our view, JSON encoded
  json::reply(array("form" => (string) $view));

instead, controllers can just return HTML, eg:

  // Print our view
  print $view;

That's much more intuitive for developers.
2010-07-31 21:16:17 -07:00
Tim Almdal
91a2c04a24 More patches as part of #1225. Change the 'core' modules to use the json::reply
method to set the content type header and encode the response as a json object
2010-07-31 15:44:55 -07:00
Bharat Mediratta
887154a3b7 Merge branch 'master' of github.com:gallery/gallery3 2010-07-13 12:30:03 -07:00
Bharat Mediratta
5eb4b8ff6c Check for the existence of uploadify() in the add_photos_form. The HTML uploader won't have that field. 2010-07-13 12:16:52 -07:00
Tim Almdal
dbf3199e46 Fix for ticket #1181. Use $.getJSON to retrieve the json contents of the dialog. Convert all the controllers
that create the data to go into a dialog to return the html as part of a json object.
2010-07-06 14:12:01 -07:00
Bharat Mediratta
f75ce45b6b When detecting encodings, give priority to ISO-8859-1 which seems to
solve the umlaut problem in IPTC data.  Fixes ticket #1144.
2010-06-27 12:14:56 -07:00
Bharat Mediratta
5335e4c0b4 Fix the autocomplete callback in item_edit_form(). We were
incorrectly matching the form input in the jQuery selector.  Did this
ever work?  Fixes ticket #1168
2010-06-27 11:25:31 -07:00
Bharat Mediratta
48af5e6b50 Rename "children" to "items" in our feed view because it makes more
semantic sense.
2010-06-20 17:25:23 -07:00
Bharat Mediratta
2992daa00e Add "Tag: %s" in the title on tag pages. Fixes ticket #1097. 2010-06-20 16:55:42 -07:00
Bharat Mediratta
f451804c6d $request->params might not exist. 2010-06-19 15:00:44 -07:00
Bharat Mediratta
1ba9d079bf post_test() should be using admin, not guest. 2010-06-19 15:00:33 -07:00
Tim Almdal
84c8d1c79a Fix ticket #1155. For compatibility with gallery2 increase the size of the tag name field from 64 bytes to 128 bytes. 2010-06-18 06:51:02 -07:00
Bharat Mediratta
bd496cc95c Add start/num query parameters to tags::get() 2010-06-16 16:09:29 -07:00
ckieffer
f1076590f1 Add page_title to admin views. Closes #1038. 2010-04-30 00:08:37 -06:00
ckieffer
e30849d310 Applied capitalization rules to title, changed from Tag admin to Manage tags 2010-04-29 23:59:20 -06:00
Chad Kieffer
67ced571c7 HTML validation and accessibility fix, add id attr to add tag input. 2010-04-21 22:48:33 -06:00
Bharat Mediratta
af71df3d0f Update tests to reflect recent changes to the REST API. 2010-04-17 15:35:09 -07:00
Bharat Mediratta
5679e30ef6 REST changes: Allow PUT and POST requests to modify members, not
just entity.

TESTS ARE NOT UPDATED YET.

- Fix item_rest::get() to maintain the proper sort order, which
  requires duplicating some Item_Model code.

- Elide "weight" from the REST version of item

- Adjust the weight of members according to the order they're returned
  from the client.  You can't add or remove members here, you can only
  reorder them.

- Changed the wire protocol to handle more complex values.
  Now "entity" and "members" are JSON encoded.  The Gallery3
  helper does this correctly.

- Changed the wire protocol for tag_item -- now it stores the
  tag and item urls in the entity, not as members.  This is more
  consistent.

- Added missing security for renaming and deleting tags.

- Got rid of vestigial tag_rest::post().  We add/remove tags
  via the relationship.
2010-04-04 11:55:54 -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
Bharat Mediratta
d4423eb349 Reset the active user to admin in all test cases where we change the
user to something else.
2010-02-23 13:50:57 -08:00
Andy Staudacher
7099fc71f1 Fix for ticket 1004: Replace all uses of split with explode (none actually required regular expressions). Thanks to Brian Hartsock for providing a patch! 2010-02-06 13:05:44 -08:00
Tim Almdal
e98991b90f return a location method so the page reloads properly if the edit was successful. 2010-01-31 16:58:42 -08:00
Bharat Mediratta
c050acf30a Fix lots of warnings that pop up when we're in E_STRICT mode. They're
mostly issues around uninitialized variables, calling non-static
functions in a static context, calling Session functions directly
instead of on its singleton, passing non-variables by reference, and
subclasses not using the same interface as the parent class.
2010-01-31 16:07:41 -08:00
Bharat Mediratta
359f6108b9 Remove edit permissions across the board. 2010-01-30 23:42:32 -08:00
Bharat Mediratta
923a515ffb The user must have some edit permission somewhere to create a tag 2010-01-30 11:48:43 -08:00
Bharat Mediratta
a04d0d2789 Add missing permission checks.
Make the tag relationship an associative array.
2010-01-29 19:42:38 -08:00
Bharat Mediratta
4b32a71afc Convert back to using ORM::factory(..., $id) instead of calling where(). 2010-01-27 22:34:11 -08:00
Bharat Mediratta
cfbbf9ef60 Convert __toString() to use (string) cast instead. 2010-01-27 21:58:06 -08:00
Bharat Mediratta
ec0f89f10a Change "resource" to "entity" in REST responses. They're all
resources, but we differentiate resources as collections and entities.
2010-01-27 21:40:48 -08:00
Bharat Mediratta
7667864d61 Minor test-only fixes. 2010-01-27 09:55:00 -08:00
Bharat Mediratta
f268128043 Add support for adding tags in the item_tags and tag_items
relationship collections.
2010-01-26 00:24:10 -08:00
Bharat Mediratta
cc79abd0af Simplify tag::add(). 2010-01-24 14:00:07 -08:00
Bharat Mediratta
a609694018 Update tests for recent REST changes. 2010-01-23 12:13:14 -08:00
Bharat Mediratta
eea27c39f1 Create symmetrical relationship collections: item_tags and tag_items
Now when we represent a relationship collection we can refer to it in
proper semantic terms.
2010-01-22 09:43:02 -08:00
Bharat Mediratta
a445a64bcb Return the url of the newly created item from post(). 2010-01-22 01:10:00 -08:00
Bharat Mediratta
ca909a49ae New tests for tag_item_rest 2010-01-22 01:09:38 -08:00
Bharat Mediratta
10dfe9767d Updated tests to pass after recent refactor of tag_rest. 2010-01-22 00:59:37 -08:00
Bharat Mediratta
27acb156bc Updated tests to pass after recent refactor of tags_rest. 2010-01-22 00:51:23 -08:00
Bharat Mediratta
bcf1caad14 Reshape the rest code to be more consistent with regards to
relationships.  Now when you view a resource, it has 4 top level
elements:

url: the url of this resource
resource: array of key value pairs describing the resource
members: array of urls to members of this collection
relationships: array of array of members.

Relationships are a special type of collection that links two
different resources together.  To remove a relationship, just
DELETE its url.  To create a relationship, POST to its
collection.

Individual modules can add their own relationships to any
resource via a callback mechanism.

Example:
  Array(
    [url] => http://g3.com/rest/item/1
    [resource] => Array (
      [id] => 1
      [album_cover_item_id] => 4
      [captured] =>
      [created] => 1264056417
      [description] =>
      [height] =>
      ...
    )
    [members] => Array(
      [0] => http://g3.com/rest/item/2
      [1] => http://g3.com/rest/item/3
      [2] => http://g3.com/rest/item/4
      [3] => http://g3.com/rest/item/5
      ...
    )
    [relationships] => Array(
      [tags] => Array (
      [0] => http://g3.com/rest/tag_item/2,1
      [1] => http://g3.com/rest/tag_item/23,1
      )
    )
  )
2010-01-22 00:27:00 -08:00
Bharat Mediratta
3665391f8b Guard against division by zero. 2010-01-21 21:29:42 -08:00
Bharat Mediratta
6be5a71cc2 Actually deny permissions in delete_item_from_tag_fails_without_permissions_test().. 2010-01-21 20:16:57 -08:00
Bharat Mediratta
697d84457f Rewrite and greatly simplify the tests for the new tag_rest implementation. 2010-01-20 21:15:11 -08:00
Bharat Mediratta
3d4a6d6336 Remove unused untagging code from put()
Add access permissions to delete()
Remove unnecessary return value from delete()
2010-01-20 21:14:40 -08:00
Bharat Mediratta
8bf73d4b4c New test for tags_rest.php 2010-01-20 00:52:32 -08:00
Bharat Mediratta
276d7de5b6 Simplify and update for model based validation. 2010-01-20 00:14:05 -08:00