[trean] Patch for case when No categories are set

Michal michal@michal.no-ip.com
Wed Oct 9 21:38:55 2002


This message is in MIME format.

---------------------- multipart/mixed attachment
Sorry about bad attachments, here are the good ones.

Michal

Quoting Michal <michal@michal.no-ip.com>:

> Hi all,
> 
> 
> I found that new users with no trean categories set, can see link 'New
> Bookmark', because /templates/browse/bookmarks.inc is displayed.
> 
> Also 'Add' menu icon was still displayed so here is patch for browse.php and

> /templates/menu/menu.inc which solve both things.
> 
> 
> Michal
> 
> 



---------------------- multipart/mixed attachment
LS0tIGJyb3dzZS5waHAJV2VkIE9jdCAgOSAwODo1NTo1MCAyMDAyCisrKyBicm93c2UucGhwCVdl
ZCBPY3QgIDkgMTU6NTk6NDggMjAwMgpAQCAtMTQsNiArMTQsMTggQEAKIC8qIE51bWJlciBvZiBj
b2x1bW5zIHRvIGRpc3BsYXkgKi8KICRjb2xzID0gJHByZWZzLT5nZXRWYWx1ZSgnYnJvd3NlX2Nv
bHVtbnMnKTsKIAorLyogR2V0IGJvb2ttYXJrcyB0byBkaXNwbGF5ICovCiskY2F0ZWdvcnkgPSBI
b3JkZTo6Z2V0Rm9ybURhdGEoJ2NhdGVnb3J5JywgJy0xJyk7CiskYm9va21hcmtzID0gJF9TRVNT
SU9OWyd0cmVhbiddLT5saXN0Qm9va21hcmtzKCRjYXRlZ29yeSk7Ciskc2hvd0Jvb2ttYXJrcyA9
IGNvdW50KCRib29rbWFya3MpID4gMDsKKworLyogR2V0IGNhdGVnb3JpZXMgdG8gZGlzcGxheSAq
LworJGNhdGVnb3JpZXMgPSBUcmVhbjo6bGlzdENhdGVnb3JpZXMoJGNhdGVnb3J5KTsKKyRzaG93
Q2F0ZWdvcmllcyA9IGFycmF5X2tleV9leGlzdHMoJGNhdGVnb3J5LCAkY2F0ZWdvcmllcyk7CisK
Ky8qIEFyZSBhbnkgY2F0ZWdvcmllcyBzZXQgaW4gdGhlICctMScgY2F0ZWdvcnkgYXQgYWxsID8q
LworJG5vQ2F0ZWdvcmllcyA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XTsKICAgICAkc2hvd19uZXdfYm9va21hcmsgPSAhKCRzaG93Qm9va21h
cmtzIHx8ICRjYXRlZ29yeSA9PSAnLTEnKTsKICAgICByZXF1aXJlIFRSRUFOX1RFTVBMQVRFUyAu
ICcvYnJvd3NlL2NhdGVnb3JpZXMuaW5jJzsKIH0KIAogLyogRGlzcGxheSB0aGUgYm9va21hcmtz
ICovCi1pZiAoJHNob3dCb29rbWFya3MgfHwgISRzaG93Q2F0ZWdvcmllcykgeworaWYgKCAoJHNo
b3dCb29rbWFya3MgfHwgISRzaG93Q2F0ZWdvcmllcykgJiYgISRub0NhdGVnb3JpZXMpIHsKICAg
ICAkc2hvd19uZXdfY2F0ZWdvcnkgPSAhJHNob3dDYXRlZ29yaWVzOwogICAgIHJlcXVpcmUgVFJF
QU5fVEVNUExBVEVTIC4gJy9icm93c2UvYm9va21hcmtzLmluYyc7CiB9Cg==

---------------------- multipart/mixed attachment
LS0tIG1lbnUuaW5jCVRodSBPY3QgIDMgMTk6MTc6MzcgMjAwMgorKysgbWVudS5pbmMJV2VkIE9j
dCAgOSAxNTo0NTowMyAyMDAyCkBAIC00LDcgKzQsOSBAQAogCiAvKiBUcmVhbiBtZW51IGl0ZW1z
ICovCiBNZW51OjpwcmludEl0ZW0oSG9yZGU6OmFwcGxpY2F0aW9uVXJsKCdicm93c2UucGhwJyks
IF8oIkJyb3dzZSIpLCAnYnJvd3NlLmdpZicpOwotTWVudTo6cHJpbnRJdGVtKEhvcmRlOjphcHBs
aWNhdGlvblVybCgnYWRkLnBocCcpLCBfKCJBZGQiKSwgJ2FkZC5naWYnKTsKK2lmICghJG5vQ2F0
ZWdvcmllcykgeworICAgIE1lbnU6OnByaW50SXRlbShIb3JkZTo6YXBwbGljYXRpb25VcmwoJ2Fk
ZC5waHAnKSwgXygiQWRkIiksICdhZGQuZ2lmJyk7Cit9CiBNZW51OjpwcmludEl0ZW0oSG9yZGU6
OmFwcGxpY2F0aW9uVXJsKCdzZWFyY2gucGhwJyks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