[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-docteam] help class.
From: |
Josh Miller |
Subject: |
[Phpgroupware-docteam] help class. |
Date: |
Mon, 26 Nov 2001 01:18:10 -0600 |
Okay I have been thinking over an over what the right way to do this is.
then I started a list of what/ how I think the inline help should be run.
also put some thoughts into the manual but here is kinda what I came up
with, please let me know what ya'll think:
class help
{
$showhelp = TRUE;
// helparray in the form
data['shortname']=array('fulldesc','is_url')
// Short name = What will be displayed in ALT tag of link.
// = also the name the help message will be called
under.
// $fulldesc = either a text help message, or a hyperlink to a
full page help file.
// is_url = Well is it, I don't want to parse it to make sure so
tell me.
$helparray= array();
function help($helpdata=0,$app)
{
if // check preferences if help should be showed.
{
$this->showhelp = TRUE;
}
if ($helpdata)
{
$helparray=$helpdata;
}
else
{
grab from DB. for current application.
}
}
function link($shortname)
{
$helpdata= $this->helparray[$shortname];
if (($this->showhelp)&& ($helpdata))
{
if ($helpdata['is_url'])
{
echo '<a alt=\''.$shortname.'\' href=\''.
$GLOBALS['phpgw']->link($helpdata['fulldesc']). '\' target=_help>[?]</a>';
}
else
{
// print a hyperlink as above to blank window
containing the data in $helpdata['fulldesc'];
// The page would need to be fed the data and
display it, with some nice borders, and maybe send the current application
as .'-HELP' in the title. This whole page may run inside or ouotside of the
API... hmmm...
}
}
}
}
Not much to the class, but it doesn't do much.
This would allow for setting a local variable to the class, and simplify
calling it, if it was needed frequently.
The other thing to add would be to get applications to register a into a
help table in the DB durring setup but I bet this could easilly fit in with
what exists in .13 now.
Not sure how to do language. For the single like helps. we could do a lang
call on the text. REquireing every help line to have a entry in .lang. but
for the pages, we would need a way of maybe have the files in a specific
place 'module/help/en/whatever.php' and have the user only pass the
whatever.php part. then we could have it add the '/en/', '/fr/' etc... and
if its a link with an http:// front then we could take out the phpgw->link()
call and just have a normal link. So if someone wanted to refer to a active
developed web site... dunno just thinking features.
So far as the manual pages, I was wondering if we should try the three layer
approach with some xml-rpc interface. This would allow us to keep up with
the trend of seperating things, and allow us to serv help pages to things
like Jengo's client. this may be over kill, but if a client were built that
could use templates that were packaged with the modules, then serving the
help files may be of benifit (sounds like a nice future eh?). Also wondered
if segmenting some parts of the webbased manual, to allow screenshots under
multiple themes, where necessary.
I was also trying to think how to keep from duplicateing data, with the
manual maybe change the manual to always read the file data from the DB...
Okay, enough thinking for me tonight, let me know what yall think, and what
I have left out. And tell me if you think the manual stuf is overkill.
- Josh
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
- [Phpgroupware-docteam] help class.,
Josh Miller <=