[kdewebdev-site] Proposed PHP infrastructure

Chris Hornbaker chrishornbaker at earthlink.net
Thu Mar 4 04:34:31 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, all.

I've been working on, what I call, a content processor. It basically takes
all the work out of Accessibility, Usability, PHP, navigation, and
translation. Pages created with it are consistant, easy to use, and valid
(you have to actually /try/ to make it invalid).

So that I don't go into too many details, I'll just explain how it'll be used
from a content creators point-of-view.

First, the physical layout of the sites will be just as Eric said in a previous
email, plus two:
www/
devel/

www/ contains scripts for automation and common pages. Common pages
consist of help, access key description, personalized styling and language
selection, etc..

devel/ contains all the not-to-be-seen-by-the-user files. The layout of this
dir is exactly the same as the top-level, minus www/ and devel/ -- it's
duplicated.

Within devel/ you place XML files, which contains essentially what can be
contained in an XHTML <div>, plus a key element. The new element is
<i18n>. This is used to wrap text that is to be translated. A cron job when
run every <set of time> and will 1) replace the top and bottom of the file
with PHP includes, 2) replace, for example,
<p><i18n>string</i18n></p>
with:
<p><?php i18n("string"); ?></p>

The cron job will then place the files in the "live" area (eg. the dirs Eric
mentioned) in their correct location, after which another cron job will
come through the "live" area and use xgettext to create .pot for
translation via KBabel.

Once a .pot file is translated, the translator emails it to someone and they
place it in a dir within www/  Another cron job will come trough that dir
and convert the .pot files to PHP includes.

(Note: Only three steps of human interference: content creation,
translation, and placing translated files in a dir.)

(See the attached accesskeys.xml file for an example XML file and
accesskeys.phps for an example generated PHP file.)

Navigation is made up of simple PHP. See attached example menu.inc file
- -- it can't get any simplier. :-) Here's an example entry:
$section->appendURI(i18nVar("Who is Chris Hornbaker?"),"aboutme", "W", true);

The first arg is the text that the user will see. The second is what will go into
href="". The third is the character to be highlighted (//FIXME: for other langs).
The last arg specifies if it's a dir or file.

Lastly, on the developer's end, is CSS. Pages generated with the code are 100%
customizible. At no point is XHTML used to style the page.

That's really all there is on the developer's end. Some quirks that need worked
out, but overall it's functional and does a great job, and, with this team, it
shouldn't take much time to resolve them with a good solution.

To see a funtioning example, see my site http://jilks.no-ip.org/  (note: I don't work
on my site much, so parts aren't existing).

Thoughts?
- -- 
Christopher Hornbaker           
Jabber ID: Jilks at jabber.org     Email: chrishornbaker at earthlink.net
Join the Free State Project!    http://www.freestateproject.org
   "Liberty in Our Lifetime"
Was I helpful? Let me know! http://svcs.affero.net/rm.php?r=Jilks
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFARrHnZeGU2azox1wRAmssAJwPVPKsMZALRkNXSppwZns/Sz4/2ACgg0pC
RcxhJOGNmbBNND4PvMa/Lo4=
=+9Yb
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accesskeys.phps
Type: application/x-php
Size: 1567 bytes
Desc: not available
Url : http://mail.kdewebdev.org/pipermail/kdewebdev-site/attachments/20040304/972cb6f0/accesskeys.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accesskeys.xml
Type: text/xml
Size: 1496 bytes
Desc: not available
Url : http://mail.kdewebdev.org/pipermail/kdewebdev-site/attachments/20040304/972cb6f0/accesskeys.xml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu.inc
Type: application/x-php
Size: 958 bytes
Desc: not available
Url : http://mail.kdewebdev.org/pipermail/kdewebdev-site/attachments/20040304/972cb6f0/menu.bin


More information about the kdewebdev-site mailing list