phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] PHP-GW as backend to public site?


From: Patrick Walsh (mr_e)
Subject: Re: [Phpgroupware-developers] PHP-GW as backend to public site?
Date: Mon, 14 Oct 2002 16:12:24 -0700
User-agent: Microsoft-Entourage/10.1.0.2006

On 10/14/02 10:10 AM, "Stephane Couture" <address@hidden> wrote:

> Le ven 04/10/2002 à 21:42, Patrick Walsh (mr_e) a écrit :
>>> 1.  Forum uses nextmatches class, which refer to few things like
>>> PHPGW_TEMPLATE_DIR and theme colors.  It doesn't seem that we have
>>> access to theses things in the SiteMgr...
>> 
>>     I haven't looked at the NextMatches class recently, so I'm not sure what
>> needs to happen to make it work with SiteMgr.  If, however, you can make
>> calls to NextMatches that return data and not html (as one would hope is the
>> case) then it's just a matter of making a UI class to wrap it for doing
>> nextmatches in SiteMgr.
> 
> This means that we have to re-write ui part of the forum (I created a
> class class.uiforum_sitemgr.inc.php, which means getting rid of a lot of
> phpgw functionnality...   Is that right?

    I don't know why you should have to get rid of any phpgw functionality.
However, I'm not familiar with the forums app, how it is structured or how
it works.  
  
> I'm still at prototyping phase.  What I did, up to now, is to generate
> the forum index (the list of category), into the content of the page.
> In class.bo.inc.php of sitemgr, I get this function:
> 
> function get_content()
> {   
> return $this->forumui->index();
> // return $this->page->content;
> }
> 
> So basically, I have the forum (which would be a general module) in one
> page (in all pages now, but anyway...).

    I can't imagine why you'd want to do this, but if it suits your purpose,
then go for it.
 
> The problem is that the forum contains some link to itself.  Let's say I
> click on one forum, I would like the sitemgr to remain on the same page,
> but display my specific forum.  The url would then be something like
> this:
> 
> http://localhost/~steph/phpgroupware/sitemgr/sitemgr-site/index.php?page_name=
> Forumdediscussion&menuaction=forum.uiforum_sitemgr.forum&cat_id=1
> 
> Is there anything that would deal with this?

    No.  MenuAction isn't evaluated in SiteMgr.
 
> Actually, I would think of creating a new class class
> class.Page_BO.inc.php, with a more intelligent function Content that
> will call the appropriate function in the forum (or more generally, the
> module associated with this page...)

    This is the plan for the upcoming hooks/modules feature.  The returned
content will be a compilation of the modules and html for a given page.
  
> I need to put my forum in the sitemgr, and I want to do it the right
> way, that's it.  So, I can code anything that would facilitate me doing
> this, and when you are ready to work again, I can pass you the code, or
> something like this...  I would appreciate if you send me the interface,
> and bo class, anyway, what you did so it can gives me ideas about your
> architecture...

   OK, I don't have an interface worked up just yet, but you can get started
anyway.  The interface will be pretty straight forward.  You will need to
create a file with a single class in it.  Later I will let you know what to
name the class and the file and how to get them listed as a module (by
registering the hook).  The class will need to have a couple of functions.
One of them will be moduleName(), another will be propertiesList(), and
finally and most importantly there will be moduleOutput($properties).

    Nevermind the first two for now.  The moduleOutput function will take an
array of properties and values of those properties.  In the case of the
forums app the properties might be what forum to display, whether or not to
show the index, show a particular message, how many to show, nested... Etc.
For now, just make sure you know what the property names and possible values
are.  This information will be retrieved by SiteMgr via the propertiesList()
function. 

    The moduleOutput function will return an array.  The array that is
returned will depend on the output type.  I would prefer to return a class
object, but for now just write your class and have it return an array.  The
array must have a 'displayType' element that takes one of the following
values.  The rest of the array elements will be dictated by this one value.

displayType == 'basic'
    content //standard html
DisplayType == 'block' // standard html in a box
    title
    content
displayType == 'article'
    title
    subtitle
    status
    submitted-by
    submitted-date

And there may be more in the future.

    That's all that is needed to create a module...

..Patrick (mr_e)


> ps.: Our Thanksgiving (in Canada) is today.  When is yours?
    
    Ours is the last Thursday of November -- the 28th this year. 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]