Admin com_weblinks proof of concept for best practices

13 views
Skip to first unread message

Andrew Eddie

unread,
Jan 26, 2009, 1:18:08 AM1/26/09
to joomla-...@googlegroups.com
This is where the rubber meets the road :)

I've totally revamped the com_weblinks admin component (in the Joomla
SVN trunk) in line with new MVC classes and technologies that are
available, and also some new lines of thinking.

The highlights are:

* List view model derives from JModelList
* List model constructor sets the state from the request
* Edit view model derives from JModelItem
* Edit form is running off the new JForm class
* Controllers have been split up
* Trash management is integrated into the list view
* Use of JHtml helpers has been improved
* Save then new feature added
* Namespacing of the language strings

The last one is among the most significant changes. We are going to
move away from our home-grown ini parser and use the built-in parser.
This requires that all keys contain only A-Z0-9_ (ie, no spaces or
other characters). There are a couple of reserved words like yes, no,
true, false, etc so what I've done is namespace all of the keys.

Keys only relating to com_weblinks are prefixed with Weblink_Something

Keys relating to system words are namespaced with something beginning
with "J" with some sort of context. For example, common words used in
a Toolbar are prefixed with JToolbar_ (eg JToolbar_Save,
JToolbar_Empty_trash), and so on. The admin en-GB.ini and
en-GB.com_weblinks.ini have a couple of other examples. The idea is
that any "J" key will have a fairly reliable meaning attached to it so
that 3PD's don't have to duplicate many common words. For example,
JCommon_Yes will mean "Yes", JCommon_Number_Column is always the
column heading for the number column in list views (usually replaced
with just "#"). Anyway, you should get the idea.

Initial comment on the redesign of com_weblinks is welcome.

Note that validation is broken because of the upgrade to Mootools 1.2
but it's all working enough for you to get the idea.

Regards,
Andrew Eddie

orware

unread,
Jan 26, 2009, 6:08:00 PM1/26/09
to Joomla! CMS Development
I just checked out the latest version of the development trunk from
subversion (last week it wasn't working, now it is, but that's to be
expected :-) and I'm going to study this component with pleasure :-).

Before the Christmas holidays I was actually doing a bit of analysis
on the jxtended components to see what kind of interesting things I
could learn (ended up writing down quite a bit).

Thanks for the heads up!

-Omar

elin

unread,
Feb 8, 2009, 7:35:23 AM2/8/09
to Joomla! CMS Development
Could we consider adding meta data, also following the pattern in
com_content?

In content there are three text fields:
metakey
metadesc
metadata

Metakey and metadesc are pretty straightforward. (and an added
benefit is that related items could possible be extended to include
weblinks)
Meta data would probably have some different parameters; author
wouldn't really make sense but robots would for example.

I'd think that you would also want to add this to the weblinks
category layout which would also mean adding the three fields to the
categories table.

The weblinks layout already has a parameters area. I'd argue for
adding that to the category layout, on the right, in that big
currently blank area. I'd argue that image and image position belong
in a parameters area anyway. In fact, I think there is an argument for
making the layout more like the article layout, with the editarea in
one column and all of the parameters in a second column.

Elin

Andrew Eddie

unread,
Feb 8, 2009, 2:18:57 PM2/8/09
to joomla-...@googlegroups.com
Patch, anyone?

Regards,
Andrew Eddie



2009/2/8 elin <elin....@gmail.com>:

infograf768

unread,
Feb 13, 2009, 11:34:48 AM2/13/09
to Joomla! CMS Development
Sigh...
All inis to be retranslated...

On Feb 8, 8:18 pm, Andrew Eddie <mambob...@gmail.com> wrote:
> Patch, anyone?
>
> Regards,
> Andrew Eddie
>
> 2009/2/8 elin <elin.war...@gmail.com>:

ot2sen

unread,
Feb 13, 2009, 11:49:54 AM2/13/09
to Joomla! CMS Development
Hi Andrew,

"* Namespacing of the language strings
The last one is among the most significant changes."

This suggested namespacing and trunkating of spaces does look
interesting.
But like JM says, all inis need a rewamp..
And that extends from en-GB getting new strings to a need of
completely new translation packs from all TT´s.
Could mean a drop in international support of 1.6 when approx. 50 TTs
need to edit all reference strings.

Please tell me you have a script for them to handle this easily ;p

Ole
> > > Elin- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -

Andrew Eddie

unread,
Feb 21, 2009, 5:22:21 PM2/21/09
to joomla-...@googlegroups.com
The problem is that the strings were never handled wisely in the first
place. As extensions get more complicated the potential for
collisions and out-of-context usage increases. Yes, I accept the fact
that it's a pain in the butt, but not changing now is far worse.
Logical and consistent language files will actually assist the
translation process. Well namespaced string following a couple of key
rules **could** help with parsers to auto-generate the base ini files
as well. There are a lot of potential benefits.

Regards,
Andrew Eddie



2009/2/14 ot2sen <ot2...@gmail.com>:

coolbung

unread,
Feb 22, 2009, 12:11:09 PM2/22/09
to Joomla! CMS Development
I'm doing a patch for the meta data in category manager.
How do I put the database changes in the patch?

- Ashwin

Andrew Eddie

unread,
Feb 23, 2009, 2:27:22 AM2/23/09
to joomla-...@googlegroups.com
There would be a change to the main sql install file. There is also a
1.5 to 1.6 changes file that should also be updated. That's all you
have to do.

Regards,
Andrew Eddie



2009/2/23 coolbung <cool...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages