Commit Graph

56 Commits

Author SHA1 Message Date
Bharat Mediratta
85239ec750 Ignore gallery_unit_test/views/kohana_*.php 2008-12-08 10:46:06 +00:00
Bharat Mediratta
b878ed174d Refactor Menu code to create allow you to create menus using a
chainable factory interface and retrieve them by ids.  Streamlined the
HTML creation code a little bit in the process, moved the basic menu
functionality into Theme_View and created the option to have different
menus other than site_navigation().
2008-12-08 06:14:34 +00:00
Tim Almdal
ee2299d6d0 Restructure Menu processing to respect the differnent types of menu items (Menu's, Menu_Link, Menu_Dialog) 2008-12-08 00:23:33 +00:00
Tim Almdal
954fcf0342 Merge gallery3/branches/menus back into gallery3/trunk 2008-12-07 19:45:46 +00:00
Bharat Mediratta
5d23a6515d Finish writing unit tests for Access. No bugs found! 2008-12-07 10:56:44 +00:00
Bharat Mediratta
bf7ab8904a Change ORM_MPTT::add_to_parent() to take an ORM instead of an id so
that it's consistent with ORM_MPTT::move_to()
2008-12-07 08:46:44 +00:00
Bharat Mediratta
055aa04497 Rename moveTo to move_to and extend the test a bit. 2008-12-07 08:23:22 +00:00
Tim Almdal
8d1790a0b4 * Add a moveTo unit test
* Pass the module::event(..., $data) by reference to the handlers
2008-12-05 04:56:33 +00:00
Bharat Mediratta
bae905a4cb Improvements to access helper.
o Rename access::remove_group() to access::delete_group() for
  consistency.

o Wrote more unit tests

o Tests found a bug in access::remove_item() .. yay!
2008-12-04 06:40:35 +00:00
Bharat Mediratta
375e7c675e Implement ORM_MPTT::delete() properly.
Inline ORM_MPTT::_grow() for now
Rewrite ORM_MPTT tests to be domain specific; they no longer use album/photo helpers.
2008-12-04 05:47:05 +00:00
Bharat Mediratta
89a346c1e1 Rename Directory_Helper_Test to Dir_Helper_Test 2008-12-04 05:45:00 +00:00
Bharat Mediratta
24cbff29cc Replace grow_test and constrict_test with add_hierarchy_test and
delete_hierarchy_test.

Our tests will be more robust if we test the public API and not the
internal private functions.  If we get to the point where we have to
test the private functions, we should probably move those functions
into their own separate class with a public API.
2008-12-04 05:15:21 +00:00
Tim Almdal
5c095cbd78 Add unit tests to test growing and contracting the left and right pointers
Added a delete method to ORM_MPTT that contracts the tree when an item is deleted
2008-12-04 01:12:44 +00:00
Bharat Mediratta
ccee9854c2 Rename file::unlink() to dir::unlink(). This creates an API that is
clearer about its actions, otherwise we may accidentally blow away an
entire hierarchy when we think we're deleting a single file (there's a
reason why rm won't let you delete dirs that aren't empty!)

Name it "dir" instead of "directory" because apparently "directory" is
already reserved.

Move the delete call out of Items_Controller and into the model.  The
model is responsible for keeping state integrity, not the controller.
2008-12-03 23:31:10 +00:00
Tim Almdal
7bb4b6029d Add a MY_file class that extends the file helper by creating an unlink method that deletes a file or an album directory.
Modify Items_Controller::_delete to call this new helper method when deleting an item
2008-12-03 22:39:57 +00:00
Bharat Mediratta
d8511f2fde Implement two tests 2008-12-03 19:10:23 +00:00
Bharat Mediratta
efc6270295 Test stubs 2008-12-03 17:17:59 +00:00
Tim Almdal
bac4ff2046 1) Create a Theme_View class that combines the functionality of the Theme class with the View class.
2) Only define the form.html.php::DrawForm method once if there are multiple forms on the page (i.e. comments and add tags)
2008-11-27 16:19:07 +00:00
Andy Staudacher
38e1eef547 Some code audit fixes and adding some directory separator normalization code to make it work on Windows as well. 2008-11-26 20:21:39 +00:00
Andy Staudacher
66f51f3c17 Initial commit of the translation class, I18n_Core and some tests.
- Port of Ruby's I18n gem (http://rails-i18n.org/)
- Added proper plural handling on top of that.
- Using CLDR 1.6's plural form data
- See I18n_Test for example usage.
- Not integrated into G3 templates yet. Probably adding __() as alias for I18n::instance->translate().
- No specific plan yet where localization files should live.
2008-11-26 11:46:56 +00:00
Jozef Selesi
bb53a0b99f * Added test for rest::request_method().
* Implemented delete in comment.
2008-11-22 01:31:15 +00:00
Jozef Selesi
88f799be6f Fixed a bug in the REST controller dispatcher and added a test case that excercises it. 2008-11-21 21:07:36 +00:00
Bharat Mediratta
66192bb214 Break dispatch tests up into little ones. 2008-11-20 06:37:26 +00:00
Tim Almdal
6fd261c8b0 Add unittest and caching for ORM_MTPP::descendants 2008-11-20 06:05:22 +00:00
Tim Almdal
4c587bdb01 Limit File_Structure_Test to only apply the regex expression if views is contained in the path name. 2008-11-20 05:24:24 +00:00
Tim Almdal
604e58346b Add unittest and caching to ORM_MTPP::descendants_count 2008-11-20 05:06:24 +00:00
Jozef Selesi
c3fc1cb7ec * Added HTTP status constants and helper functions to REST helper.
* HTTP header setting in comment module now going through REST helper API.
* Fixed items controller test.
* Fixed user installer test.
* Fixed _create() handling in the REST controller.
* Fixed routing for edit and add forms.
* Added some tests for the REST controller.
* Set svn:eol-style to LF on a bunch of files.
* Added preamble to MY_Forge.php.
2008-11-20 01:25:29 +00:00
Tim Almdal
103bd8e8d2 Add the original item height and width to the item table 2008-11-19 22:45:30 +00:00
Tim Almdal
c8dc84d502 Change the regex to assert true for files that match the pattern "#/views/.*?(\.html|mrss)\.php$#" 2008-11-19 22:39:44 +00:00
Tim Almdal
8825687d03 Change the view_files_end_in_html_dot_php_test to view_files_correct_suffix_test and change it to also accept mrss as a valid suffix 2008-11-19 22:20:23 +00:00
Bharat Mediratta
89bb3c42f7 Update the unit test for mime types. Can't test it right now because routing is broken for the test framework so we have to fix that first. 2008-11-19 03:39:12 +00:00
Bharat Mediratta
ee413f5f39 Updated for recent Item_Controller API change 2008-11-11 13:00:11 +00:00
Tim Almdal
9f261213a5 Reset PasswordHash.php to its original state and exclude it from the file_structure_test 2008-11-11 06:21:21 +00:00
Bharat Mediratta
7a1b2b0ca7 Add a test to make sure that we have no windows-style line endings. 2008-11-10 15:33:55 +00:00
Bharat Mediratta
085ba7cd46 Tests for Item_Controller 2008-11-10 00:16:41 +00:00
Bharat Mediratta
223cba531e Rename tests to make room for controller tests
Album_Test -> Album_Helper_Test
  Photo_Test -> Photo_Helper_Test
2008-11-09 23:49:09 +00:00
Bharat Mediratta
e7155c09c5 Implement Item_Controller::put() and delete()
Adjust/simplify photo::create
Add image uploading to the scaffolding
2008-11-09 23:40:28 +00:00
Bharat Mediratta
936decb437 Add children_count() to ORM_MPTT 2008-11-07 06:46:38 +00:00
Bharat Mediratta
ae00f73944 * Add thumbnail and resize dimensions to the item table and use them
properly in the theme.
* Move thumbnail and resize generation down into the model for
  consistency.
* Add a sample thumbnail for albums
* Fix a bug in the ORM to clear the cache when we reload an object.
* Add Kohana docs to the scaffold.
2008-11-05 09:42:47 +00:00
Bharat Mediratta
e44ff9bb60 ORM_MPTT::parents() should not include the node itself. 2008-11-05 07:47:19 +00:00
Bharat Mediratta
581e931c43 Change the default theme to actually render what's in the Gallery.
Currently only the album view works, albums have no thumbnails, and
there's only 1 image in use.

Improved Item_Model to have the following API methods
  file_path() -- returns the path to the source image or album dir
  thumbnail_path(), thumbnail_url() -- returns path/url to the thumbnail
  resize_path(), resize_url() -- returns path/url to the resize

All tests updated.
2008-11-05 07:13:46 +00:00
Bharat Mediratta
b82332192a The carousel block is now off into its own module. The
sidebar.html.php file loops over $theme->blocks() which in turn calls
carousel::block() which uses the Block object to create a standard
block UI.  Hooray!
2008-11-05 05:20:20 +00:00
Bharat Mediratta
190b439807 Moved MPTT related tests to ORM_MPTT_Test 2008-11-05 01:39:21 +00:00
Bharat Mediratta
212e6a0778 New tests for the ORM_MPTT class. 2008-11-04 23:16:42 +00:00
Bharat Mediratta
605d2de336 Lots of new stuff!
Replace theme HTML with *almost* the latest stuff from the
mockups.  (it doesn't include r18467 yet).

Our theme format is now modelled after WordPress / Habari's style
where you have one entry point per type (eg: album.php) which can
load up whatever parts it needs (eg: $theme->display("header"))

Created album and photo helpers which have create() functions
that form the base of our new API, along with tests for them.

Created our own version of the ORM_MPTT since the existing
versions were too buggy and unsupported to depend upon.  Only has
a minimal implementation so far, and the tests are not yet
committed.

Added path(), thumbnail_path() and resize_path() to Item_Model

Extended the scaffolding to allow you to add lots of
photos/albums into your hierarchy.

Deleted modules/mptt -- we're not going to use this anymore.
2008-11-04 21:24:42 +00:00
Bharat Mediratta
ade1650846 Add a test to detect tabs in our code, and convert all tabs to spaces
so that the test passes.
2008-11-04 05:22:06 +00:00
Bharat Mediratta
630b0f26fc Restructure the theme code to be more like WordPress / Habari. Now,
the controller initiates a request to a top level page (eg:
album.html.php) which is then free to include whatever other page
chunks it wants with calls like <?= $theme->display('header.html') ?>

Variables like $item and $children are in the global space for all
views.

theme.php helper is now Theme.php library which lets us store the name
of the theme inside the variable itself.  This means that the theme
does not have to know its own name because you can use $theme->url()
for all urls to stuff inside the theme itself, which makes it possible
to cline a theme without changing a single line.

Still using the mock album UI.
2008-11-04 05:02:37 +00:00
Bharat Mediratta
8a4ab78bfb Oops, injecting the function name caused an extra call in the call
stack.  The test passed, but the actual code failed.  Fixed now.
2008-11-03 06:02:40 +00:00
Bharat Mediratta
6da6b8ed52 Theme helper. Right now it has one api method, theme::url which
returns a url local to the theme that you're in.  For example, if
you're in themes/foo/views/page_header.html.php and you call
theme::url("images/foo.png") then it'll create a url to:
themes/foo/images/foo.png
2008-11-03 05:52:13 +00:00
Bharat Mediratta
8831e89f40 More bootstrap code.
* core_installer::install now creates the root album and the albums/thumbnails
  directories under VARPATH.
* Add a test for core_installer
2008-11-03 02:08:07 +00:00