[trean] adding to My Bookmarks **Patch II**
Chris Albertson
alb@chrisalbertson.com
Sat, 5 Oct 2002 14:30:27 -0500
This message is in MIME format.
---------------------- multipart/mixed attachment
Yup. That bothered me as well. Another thing is that when you select add
bookmark from within a category, it didn't select that category by default.
So....
Here is a patch to fix those two items.
1) Removed "My_Bookmarks" as a selection in the add bookmark page.
2) Changed the logic to make it select the category for you if you add from
within a category.
----------------------------------------------------------------
Change Details::
I didn't delete lines of code from this change. I commented the old lines and
added mine. All my changes are within the catSelect function within Trean.php.
Changed:
$sel = ($cat === $selected) ? ' selected="selected"' : '';
--to--
$sel = "";
if ($cat['name'] == $selected) {
$sel = "selected";
}
and
Removed:
$sel = ('-1' === $selected) ? ' selected="selected"' : '';
$options = '<option value="-1">' . _("My Bookmarks") . "</option>\n"
------------------------------------------------------------------------
Attached is Trean.php. Is should replace the file in horde/trean/lib.
I hope you find this change useful.
--
Chris Albertson
alb@chrisalbertson.com
Never be afraid to try something new.
Remember that amateurs built the ark. Professionals built the Titanic.
4783147098
Quoting Nate Mollring <nmollring@cennecs.org>:
> Quoting Chris Albertson <alb@chrisalbertson.com>:
>
> > Attached please find "browse.php." This replaces the browse.php that lives
> in
> >
> > the root of trean.
> > I changed the following line:
> > $show_new_bookmark = !$showBookmarks;
> > --to--
> > $show_new_bookmark = $showBookmarks;
> >
> > The code for the ability to "not" show the add bookmark menu item was all
> > there, it just had the wrong boolean set.
> > I believe this change will also jive with future releases of trean where
> I'd
> >
> > suspect that additional category/sub-category groupings could be added.
> (ie.
> >
> > another "My_Bookmarks" level item with sub-categories)
> >
> > If you have any questions about this change, please feel free to let me
> know.
>
>
> That works when I'm in the browse screen, I like it. But if you click add in
> the top menu, My Bookmarks is an option still.
> thanks for the modification.
> Nate
> --
> Trean mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: trean-unsubscribe@lists.horde.org
-------------------------------------------------
This email was sent from www.chrisalbertson.com
using IMP mailing program, part of the Horde suite
of information management tools.
http://horde.org/
---------------------- multipart/mixed attachment
PD9waHANCg0KcmVxdWlyZV9vbmNlIFRSRUFOX0JBU0UgLiAnL2xpYi9jb25zdGFudHMucGhwJzsN
Cg0KLyoqDQogKiBUcmVhbiBCYXNlIENsYXNzLg0KICoNCiAqICRIb3JkZTogdHJlYW4vbGliL1Ry
ZWFuLnBocCx2IDEuNCAyMDAyLzA5LzAzIDAxOjUzOjExIGNodWNrIEV4cCAkDQogKg0KICogQGF1
dGhvciBNaWtlIENvY2hyYW5lIDxtaWtlQGdyYWZ0b25oYWxsLmNvLm56Pg0KICogQHZlcnNpb24g
JFJldmlzaW9uOiAxLjQgJA0KICogQHBhY2thZ2UgdHJlYW4NCiAqLw0KY2xhc3MgVHJlYW4gew0K
DQogICAgLyoqDQogICAgICogTGlzdCBhIGNhdGVnb3JpZXMNCiAgICAgKg0KICAgICAqIEByZXR1
cm4gYXJyYXkgQSBsaXN0IG9mIGNhdGVnb3JpZXMuDQogICAgICovDQogICAgZnVuY3Rpb24gbGlz
dENhdGVnb3JpZXMoJHBhcmVudCA9ICctMScpDQogICAgew0KICAgICAgICByZXR1cm4gJF9TRVNT
SU9OWyd0cmVhbiddLT5fYm9va21hcmtzLT5leHBvcnQoQ0FURUdPUllfRk9STUFUX1RSRUUsICRw
YXJlbnQpOw0KICAgIH0NCg0KICAgIC8qKg0KICAgICAqIFRoaXMgZ2VuZXJhdGVzIHRoZSBib2R5
IG9mIGEgJmx0O3NlbGVjdCZndDsgZm9ybSBpbnB1dCB0byBzZWxlY3QgYQ0KICAgICAqIGNhdGVn
b3J5LiBUaGUgJmx0O3NlbGVjdCZndDsgYW5kICZsdDsvc2VsZWN0Jmd0OyB0YWdzIGFyZSBOT1Qg
aW5jbHVkZWQNCiAgICAgKiBpbiB0aGUgb3V0cHV0IG9mIHRoaXMgZnVuY3Rpb24uDQogICAgICoN
CiAgICAgKiBAcGFyYW0gb3B0aW9uYWwgc3RyaW5nICRzZWxlY3RlZCAgVGhlIGNhdGVnb3J5IH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AgICAgICAgICAk
Y2F0W10gPSAkY2hpbGQ7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAg
ICB9DQogICAgICAgIA0KICAgICAgICByZXR1cm4gJGNhdDsNCiAgICB9DQoNCiAgICBmdW5jdGlv
biBsaXN0QWxsQm9va21hcmtzKCRuYW1lID0gJy0xJykgDQogICAgew0KICAgICAgICByZXR1cm4g
JF9TRVNTSU9OWyd0cmVhbiddLT5saXN0QWxsQm9va21hcmtzKCRuYW1lKTsNCiAgICB9DQoNCiAg
ICBmdW5jdGlvbiBmaWx0ZXJBbGxCb29rbWFya3MoJGZpbHRlciwgJG5hbWUgPSAnLTEnKQ0KICAg
IHsNCiAgICAgICAgcmV0dXJuICRfU0VTU0lPTlsndHJlYW4nXS0+ZmlsdGVyQWxsQm9va21hcmtz
KCRmaWx0ZXIsICRuYW1lKTsNCiAgICB9DQogICAgDQogICAgZnVuY3Rpb24gbmV3Q2F0ZWdvcnko
JG5hbWUpDQogICAgew0KICAgICAgICByZXR1cm4gJF9TRVNTSU9OWyd0cmVhbiddLT5uZXdDYXRl
Z29yeSgkbmFtZSk7DQogICAgfQ0KDQogICAgZnVuY3Rpb24gYWRkQ2F0ZWdvcnkoJGNhdCwgJHBh
cmVudCA9ICctMScpDQogICAgew0KICAgICAgICByZXR1cm4gJF9TRVNTSU9OWyd0cmVhbiddLT5h
ZGRDYXRlZ29yeSgkY2F0LCAkcGFyZW50KTsNCiAgICB9DQoNCn0NCg==
---------------------- multipart/mixed attachment--