[dev] category_order addition to Horde_Category

Marko marko@oblo.com
Tue Nov 26 10:00:51 2002


this is my attempt to have a category_order field added to the horde_categories
table and subsequently integrated to provide user defined ordering.

would be good if someone could have a look at it, to see how reliable/efficient
it is. some points:

- addCategory and removeCategory subsequently call reorderCategory to fix up the
order of sub categories - shift one along for an addition and shift one down for
a removal.
- for ease of logic i decided that all additions (without a specified order
position) will have the 0 order position, ie. will be tagged on to the front.
the alternative i suppose would have been to figure out how many there are
already and tag it on to the end.
- in addition the reorderCategory function can be called through the classes and
have the var $order passed as an array holding the new order of the sub cats.
- i think i may be missing some data integrity checking, but i tried to cover
most parts, for example there is no explicit passing of the order positions as
an array. either an array is passed, which is checked to match the expected
number of elements and they are picked off one by one in that order and
reinserted into the db, or one can pass the order position as a string which is
the only allowed explicit passing. in this case, it is removed from the order
list by moving sub cats above it down a step and reinserted into the new
position moving up everything above it.

would be grateful if someone gives this a look... i need a break!

thanks,

marko-------------- next part --------------
z'µìmjÛZržžÜ²Ç+¹¶ÞtÖ¦yÆ­z
+‰ë)j×!O*^jše‰Æ­Š‰ÿ¡Ë^¶Ëky©’‹7µën;o+^°7¬rz-jö¢•¦åyJå†Ûiÿùb²Û!¢·^¢¸?j·!Š÷¬ýׯý«miÈfz{lÿm4Û]vëý<÷}u{ÏÜj× ¢¸ž²†ã


More information about the dev mailing list