"Fossies" - the Fresh Open Source Software Archive

Member "phpgroupware-" (23 Jun 2003, 51343 Bytes) of package /linux/www/old/phpgroupware-

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    2 <HTML
    3 ><HEAD
    4 ><TITLE
    5 >Sitemgr user manual
    6   </TITLE
    7 ><META
    9 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
   10 "></HEAD
   11 ><BODY
   14 TEXT="#000000"
   15 LINK="#0000FF"
   16 VLINK="#840084"
   17 ALINK="#0000FF"
   18 ><DIV
   20 ><DIV
   22 ><H1
   24 ><A
   25 NAME="AEN2">Sitemgr user manual</H1
   26 ><HR
   27 WIDTH="75%"
   29 COLOR="#000000"
   30 SIZE="1"></DIV
   31 ><DIV
   32 CLASS="TOC"
   33 ><DL
   34 ><DT
   35 ><B
   36 >Table of Contents</B
   37 ></DT
   38 ><DT
   39 ><A
   40 HREF="#AEN8"
   41 >Introduction</A
   42 ></DT
   43 ><DT
   44 ><A
   45 HREF="#AEN102"
   46 >User manual</A
   47 ></DT
   48 ><DT
   49 ><A
   50 HREF="#AEN254"
   51 >Administrator manual<A
   53 ></A
   54 ></A
   55 ></DT
   56 ><DT
   57 ><A
   58 HREF="#AEN341"
   59 >Template designer manual<A
   61 ></A
   62 ></A
   63 ></DT
   64 ><DT
   65 ><A
   66 HREF="#AEN358"
   67 >Module developper manual<A
   69 ></A
   70 ></A
   71 ></DT
   72 ></DL
   73 ></DIV
   74 ><DIV
   75 CLASS="SECT1"
   76 ><H2
   77 CLASS="SECT1"
   78 ><A
   79 NAME="AEN8">Introduction</H2
   80 ><P
   81 >This introductory section describes some concepts, you will need to understand if you want to get the most out of sitemgr. If you are just interested in a quick installation introduction go to section <A
   83 >Installation</A
   84 >
   85   </P
   86 ><DIV
   87 CLASS="SECT2"
   88 ><HR><H3
   89 CLASS="SECT2"
   90 ><A
   91 NAME="AEN12">Template</H3
   92 ><P
   93 >Sitemgr builds web sites from templates. Those are stored in the directory sitemgr/sitemg-site/templates. Each of them has a directory of its own. The file main.tpl defines the template of the whole site, there can be other files that define code for separate areas of the page or for specific modules. Templates contain four kinds of variables. These are explained here since the types 2,3,4 and 5 can be used both in the template as in the page content a module generates.
   94    </P
   95 ><P
   96 ></P
   97 ><OL
   98 TYPE="1"
   99 ><LI
  100 ><P
  101 >{contentarea: areaname} These define where administrator and contributor provided content go. The names and the number of contentareas a template defines are almost arbitrary.
  102     </P
  103 ></LI
  104 ><LI
  105 ><P
  106 >{modulename(?arguments)}These let you hardcode a call to a module into a template. Arguments are in the HTTP GET query string syntax (?key1=value1&#38;key2=value2). At the moment, if you use this type of variables, you have to urlencode the query string yourself. Future versions of sitemgr might provide a simpler notation. For example,{lang_block] creates the select box for multilingual sites.
  107     </P
  108 ></LI
  109 ><LI
  110 ><P
  111 >{?(phpgw|sitemgr:)link} This lets you create links either to other pages of your website, or to phpgroupware applications:
  112     </P
  113 ><P
  114 ></P
  115 ><OL
  116 TYPE="a"
  117 ><LI
  118 ><P
  119 >Links to sitemgr either start with '?sitemgr:' or only with '?'. You can either link to a page with {?page_name=downloads] and [?page_id=4}, to a category's index (?category_id=5), to the site index (?index), to the site's table of contents (?toc). Just [?] or {?sitemgr:} links to the administrator defined home page.
  120      </P
  121 ></LI
  122 ><LI
  123 ><P
  124 >Links to phpgw start with '?phpgw:' . You have to name the application followed by a comma, and optionnally arguments the application can interpret. For example {?phpgw:/addressbook,order=n_given&#38;sort=ASC}.
  125      </P
  126 ></LI
  127 ></OL
  128 ></LI
  129 ><LI
  130 ><P
  131 >{variable} Finally there are some simple variables you can use to retrieve metainformation about the page or about the user's context:
  132     </P
  133 ><P
  134 ></P
  135 ><OL
  136 TYPE="a"
  137 ><LI
  138 ><P
  139 >{title} the page title
  140      </P
  141 ></LI
  142 ><LI
  143 ><P
  144 >{subtitle} the page subtitle
  145      </P
  146 ></LI
  147 ><LI
  148 ><P
  149 >{sitename}the sitename the administrator has chosen for the site
  150      </P
  151 ></LI
  152 ><LI
  153 ><P
  154 >{sitedescription} the sitedescription 
  155      </P
  156 ></LI
  157 ><LI
  158 ><P
  159 >{user}the user's account name
  160      </P
  161 ></LI
  162 ></OL
  163 ></LI
  164 ><LI
  165 ><P
  166 >{lang_translatable_string} This lets you make the template internationalized. The translatable string is sent through phpgroupware's lang function. Thus you can add it to the lang files in the setup directory and install it through the setup programm.
  167     </P
  168 ></LI
  169 ></OL
  170 ></DIV
  171 ><DIV
  172 CLASS="SECT2"
  173 ><HR><H3
  174 CLASS="SECT2"
  175 ><A
  176 NAME="AEN42">Module</H3
  177 ><P
  178 >The main function of a sitemgr module is to generate dynamic web site content. To make the development of new modules, and the use of modules easy and convenient, sitemgr defines an &#8220;abstract&#8221; class module which each module should extend. This parent of all modules, provides one essential service: It hooks the module into the content managment interface and permits the editing of the module's arguments that determine what content will be generated. Thus in order to create a new module, all you have to do, is to extend the abstract super module, define the modules arguments, and write a get_content function that returns the content that should be displayed on the website. More on this in the chapter about<A
  180 >Module developpment</A
  181 >.
  182    </P
  183 ></DIV
  184 ><DIV
  185 CLASS="SECT2"
  186 ><HR><H3
  187 CLASS="SECT2"
  188 ><A
  189 NAME="AEN46">Argument/Content</H3
  190 ><P
  191 >A module can be seen as a transformation of input arguments into generated content. It is important to understand that the input arguments can be of completely different kinds. On the one hand there can be arguments that are as close as possible to the generated content. For example the html module's only argument is named &#8220;htmlcontent&#8221; and in normal circumstances it is not transformed at all but handed over as is to the page generation engine. On the other hand arguments can play any conceivable role in the generation of content that is driven by data coming from other phpgroupware applications. They can be used to select between different categories of content, they can choose a certain format of presentation, they can function as search terms, etc.
  192    </P
  193 ></DIV
  194 ><DIV
  195 CLASS="SECT2"
  196 ><HR><H3
  197 CLASS="SECT2"
  198 ><A
  199 NAME="AEN49">Properties</H3
  200 ><P
  201 >A module can define properties. Properties are accessible to the modules get_content function in the same way as arguments, but they differ from them in two ways:
  202    </P
  203 ><P
  204 ></P
  205 ><UL
  206 ><LI
  207 ><P
  208 >Properties are edited by the site administrator. Their intended role is to put certain constrains on the workings of the module, so that a site administrator can enforce certain rules. For example the standard html module defines a property called striphtml. If this boolean property is set the module replaces all html in the generated content with entities.
  209     </P
  210 ></LI
  211 ><LI
  212 ><P
  213 >Properties are not defined with respect to a certain generated content block, but are defined either on a site-wide level or on the level of specific categories. Additionally you can differenciate on each scope properties for each content area. When a content block is generated, properties are searched for in a cascading way, i.e. when the block is specific to a specific page and contentarea and the module's properties are not defined for the combination of the contentarea and the page's category, then properties defined for higher scopes are looked for in a certain order. More on this in the chapter about<A
  215 >Administration</A
  216 >.
  217     </P
  218 ></LI
  219 ></UL
  220 ></DIV
  221 ><DIV
  222 CLASS="SECT2"
  223 ><HR><H3
  224 CLASS="SECT2"
  225 ><A
  226 NAME="AEN58">Blocks, content areas and scope</H3
  227 ><P
  228 >There are three ways a module can generate content that will be displayed on a web page:
  229    </P
  230 ><P
  231 ></P
  232 ><OL
  233 TYPE="1"
  234 ><LI
  235 ><P
  236 >A template can contain hardcoded calls to modules that will generate content visible on each page. Thus you could put dynamic content that is visible across the whole site on a place of its own directly into the template. But beware that restrictions defined by the administrator also apply to these hardcoded module calls.
  237     </P
  238 ></LI
  239 ><LI
  240 ><P
  241 >A template defines several content areas. This is one important differenced between the modularized sitemgr and previous versions where there were was only one place where contributor edited content went (page_content) and two places for administrator configured blocks (right_blocks, left_blocks). Now templates can define any practical number of content areas with arbitrary names. And there is no more much difference between central and peripheric areas. All can show administrator and contributor provided block content.With one exeption: The name &#8220;center&#8221; is special in that special pages that get generated by special URLs like &#8220;?toc&#8221; and &#8220;?index&#8221; or &#8220;?category_id=number&#8221; always put there page content (which is internally generated by nothing else than a module) into this content area. If your template does not have a content area called &#8220;center&#8221; these special URLs won't work.
  242 Content areas can display module output, as edited by the page's contributors. We refer to each output of a module as a block. Here is another important difference to how sitemgr used to work: Until now there was a sharp distinction between page content which replaces the template variable page_content, and side blocks which got defined in a special file called blockconfig and replaced the template varialbes right_blocks and left_blocks. Now from the perspective of the page generation engine there is no more any difference between content areas, all display blocks of content generated by modules.
  243 The blocks one content area displays can be defined on different levels of scope: There are site wide blocks that are visible across the whole site, category wide blocks, that are visible on pages that belong to the category or any of its children, and finally are page blocks that define what distinguishes the page from other pages, and normally will be that what you'd call the page's main content.
  244     </P
  245 ></LI
  246 ><LI
  247 ><P
  248 >The block content generated by a module can contain template variables of the same type as those that can be hardcoded. This is mostly useful for modules like the html module, where the contributor specified argument is nearly identical to the generated content. Thus a contributor can embed module calls inside the content of a certain block. This is done only once without any recursion, i.e. if a embedded module call returns itself a template variable it is not parsed and processed again.
  249     </P
  250 ></LI
  251 ></OL
  252 ></DIV
  253 ><DIV
  254 CLASS="SECT2"
  255 ><HR><H3
  256 CLASS="SECT2"
  257 ><A
  258 NAME="AEN68">Versioning</H3
  259 ><P
  260 >Sitemgr handles block content in versions. This means that you can have different versions of one block at the same time, but only one of them is visible on the website. This allows for working on several changes to the website and viewing them in a draft mode, before commiting them all at once to the production site. Sitemgr distinguishes five states for versions:
  261    </P
  262 ><P
  263 ></P
  264 ><DIV
  266 ><DL
  267 ><DT
  268 >draft:</DT
  269 ><DD
  270 ><P
  271 >A draft version will not appear at the website at all. Draft versions are here for content you are not yet sure about.
  272     </P
  273 ></DD
  274 ><DT
  275 >prepublished:</DT
  276 ><DD
  277 ><P
  278 >A prepublished version will appear on the website if you view it in draft mode. A prepublished version is registered for publication, and it will change to published state, once you commit it.
  279     </P
  280 ></DD
  281 ><DT
  282 >published:</DT
  283 ><DD
  284 ><P
  285 >A published version is visible on your website both in production mode and draft mode.
  286     </P
  287 ></DD
  288 ><DT
  289 >preunpublished:</DT
  290 ><DD
  291 ><P
  292 >You put a version into preunpublished mode, if you want to remove it or replace it, but want to do this only by commiting other changes in the same time.
  293     </P
  294 ></DD
  295 ><DT
  296 >archived:</DT
  297 ><DD
  298 ><P
  299 >Archived versions will no longer appear anywhere but a special archive interface that allows you to reactivate archived content.
  300     </P
  301 ></DD
  302 ></DL
  303 ></DIV
  304 ><P
  305 >There are no versions of categories or pages, but they do can be in any of these five states. This means you can create a new category or a new page, but it will not appear on the website until you commit it.
  306    </P
  307 ><P
  308 >Only one version of a content block can be in published, prepublished or preunpublished state at a time. There is one exeption: a prepublished and preunpublished version can exist together. When you commit the change, the prepublished version will become published and the preunpublished version will get archived.
  309    </P
  310 ></DIV
  311 ><DIV
  312 CLASS="SECT2"
  313 ><HR><H3
  314 CLASS="SECT2"
  315 ><A
  316 NAME="AEN94">Transformer</H3
  317 ><P
  318 >The architecture for sitemgr modules provides for the distinction between some form of raw content a module produces and the way it should get displayed on the web site, with the future possibility to plug other display types into the same framework. The idea is that the raw content of a module gets passed through different transformers, possibly even several transformers in a sequence at the time of content generation. Additionally this provides for a use of modules outside of sitemgr, for example remote retrieval of information with something like XML-RPC. 
  319    </P
  320 ><P
  321 >At the moment, a module does not need to use transformers on its own, it can directly generate html content, but if it does, sitemgr provides for an easy way to chain different transformers together. Thus a module can be constructed in different layers of functionality. For example a module's get_content function could return data in XML, and it defines a XSLT transformation to reorganize this data, and a second transformer for creating a user interface for display.
  322    </P
  323 ><P
  324 >Transformers are also used on the level of the site template, insofar as each contentarea can have an associated transformer, which wraps the different content blocks into a common display format. This does the same thing as the file sideblock.tpl in former versions of sitemgr.
  325    </P
  326 ></DIV
  327 ><DIV
  328 CLASS="SECT2"
  329 ><HR><H3
  330 CLASS="SECT2"
  331 ><A
  332 NAME="AEN99">Translations</H3
  333 ><P
  334 >Sitemgr in its new modularized architecture continues to be fully multilingual. It is very simple to have a new module use this feature. All that is needed is to use a special flag in the definition of the module's arguments. All arguments that have this flag will be stored in a language specific database table, and can be translated in the translation manager, very similar to the way category and page definitions could already be translated to several languages.
  335    </P
  336 ></DIV
  337 ></DIV
  338 ><DIV
  339 CLASS="SECT1"
  340 ><HR><H2
  341 CLASS="SECT1"
  342 ><A
  343 NAME="AEN102">User manual</H2
  344 ><DIV
  345 CLASS="SECT2"
  346 ><H3
  347 CLASS="SECT2"
  348 ><A
  349 NAME="AEN104">Manage categories and pages</H3
  350 ><DIV
  351 CLASS="SECT3"
  352 ><H4
  353 CLASS="SECT3"
  354 ><A
  355 NAME="AEN106">Create a new category</H4
  356 ><P
  357 >to be completed
  358     </P
  359 ></DIV
  360 ><DIV
  361 CLASS="SECT3"
  362 ><HR><H4
  363 CLASS="SECT3"
  364 ><A
  365 NAME="AEN109">Edit a category</H4
  366 ><P
  367 >to be completed
  368     </P
  369 ></DIV
  370 ><DIV
  371 CLASS="SECT3"
  372 ><HR><H4
  373 CLASS="SECT3"
  374 ><A
  375 NAME="AEN112">Delete a category</H4
  376 ><P
  377 >to be completed
  378     </P
  379 ></DIV
  380 ><DIV
  381 CLASS="SECT3"
  382 ><HR><H4
  383 CLASS="SECT3"
  384 ><A
  385 NAME="AEN115">Create a new page</H4
  386 ><P
  387 >to be completed
  388     </P
  389 ></DIV
  390 ><DIV
  391 CLASS="SECT3"
  392 ><HR><H4
  393 CLASS="SECT3"
  394 ><A
  395 NAME="AEN118">Edit a page</H4
  396 ><P
  397 >to be completed
  398     </P
  399 ></DIV
  400 ><DIV
  401 CLASS="SECT3"
  402 ><HR><H4
  403 CLASS="SECT3"
  404 ><A
  405 NAME="AEN121">Editing page content</H4
  406 ><P
  407 >There are two interfaces for creating and editing content blocks. The first one is called &#8220;content manager&#8221; and works inside the phpgw interface, the second works in interaction with the generated web site and we call it &#8220;editing mode&#8221;.
  408     </P
  409 ><DIV
  410 CLASS="SECT4"
  411 ><HR><H5
  412 CLASS="SECT4"
  413 ><A
  414 NAME="AEN124">The content manager</H5
  415 ><P
  416 >The interface for creating content blocks is the same on each level of scope, besides that when editing blocks on a lower level you can see all the blocks that have been defined on a higher level, and will be displayed on the website together with the blocks you are editing. I will refer to this interface as the content manager.
  417      </P
  418 ><P
  419 >In each content manager, there is a section for each content area, where you can add blocks selected from a menu of all available modules. Once you have added a new block, it appears amidst all other blocks of the content area. Those defined on higher level scopes are only displayed, those pertaining to the scope (site-wide, category or page) you are managing are editable. 
  420      </P
  421 ></DIV
  422 ><DIV
  423 CLASS="SECT4"
  424 ><HR><H5
  425 CLASS="SECT4"
  426 ><A
  427 NAME="AEN128">Editing mode</H5
  428 ><P
  429 >In order to use editing mode, you must add a site-wide administration block to your website (viewable only by registered users). This block has a dropdown menu where you can switch between production mode (viewing the website in its public state), draft mode (viewing the website in the prepublished state, i.e. how it will look after you commit any pending changes) and edit mode. In edit mode, you will see the same content as in draft mode, but in front of each content block you will see a link &#8220;Edit block&#8221;. Activating this link will pop up a new window for editing it.
  430      </P
  431 ></DIV
  432 ><DIV
  433 CLASS="SECT4"
  434 ><HR><H5
  435 CLASS="SECT4"
  436 ><A
  437 NAME="AEN131">Editing a block</H5
  438 ><P
  439 >In both the content manager and the editing window that opens in editing mode, the interface for editing the block is the same. There are three standard interface elements you can edit for each block:
  440      </P
  441 ><P
  442 ></P
  443 ><DIV
  445 ><DL
  446 ><DT
  447 >Title</DT
  448 ><DD
  449 ><P
  450 >Each module defines a default title for blocks it generates. The block title is not necessarily displayed in each content area. It depends on the block transformer defined for the content area by the site template you use. Here you can override the default title with a customized title that will only be used by the block you are editing
  451       </P
  452 ></DD
  453 ><DT
  454 >Seenby</DT
  455 ><DD
  456 ><P
  457 >You can control the visibility of each block for the different user roles defined by sitemgr: site administrators, phpgroupware users (which include site administrators) and the anonymous user. Evidently you can also make the block visible for everyone which is the default. 
  458       </P
  459 ></DD
  460 ><DT
  461 >Sortorder</DT
  462 ><DD
  463 ><P
  464 >Here you can change the order in which the blocks are displayed by defining a different integer for each block.
  465       </P
  466 ></DD
  467 ></DL
  468 ></DIV
  469 ><P
  470 >When you first create a content block, sitemgr automatically creates a version for it. For each version, you have to edit the module specific arguments, each of which is preceded by an explanatory label. The input elements for arguments can be of different types: checkboxes, selectboxes, textareas, textfields. In the case of text input, you can use the same template variables as are used in the site template. But be aware that this only works if the module puts the same variable into its output, which need not necessarily be the case.
  471      </P
  472 ><P
  473 >Even if not all blocks may make sense for each content area, the content manager does not impose on itselft any constraints on which modules you use for which area (Administrators can restrict the available modules for categories and content areas). For example you can use modules that are optimized for side block areas in the central area and you could use a simple html content block on side areas. The following modules are shiped with sitemgr:
  474      </P
  475 ><P
  476 ></P
  477 ><DIV
  479 ><DL
  480 ><DT
  481 >administration</DT
  482 ><DD
  483 ><P
  484 >simply creates a link to sitemgr's administration interface. Thus you probably would not want to make it visible for anonymous user's but only for phpgw users or adminstrators.
  485       </P
  486 ></DD
  487 ><DT
  488 >amazon</DT
  489 ><DD
  490 ><P
  491 >shows ads for books on the Amazon website. There is a comment in the modules source file about how it works.
  492       </P
  493 ></DD
  494 ><DT
  495 >appdir</DT
  496 ><DD
  497 ><P
  498 >a demonstration of how sitemgr's architecture can be used to realize a simple application for creating a directory of information. It should be adaptable to other needs. At the moment, you need PHP's XSLT extension to use this module.
  499       </P
  500 ></DD
  501 ><DT
  502 >bookmarks</DT
  503 ><DD
  504 ><P
  505 >lets you show content from phpgw's bookmarks application
  506       </P
  507 ></DD
  508 ><DT
  509 >calendar</DT
  510 ><DD
  511 ><P
  512 >produces a calendar where each days links to phpgroupware's calendar application
  513       </P
  514 ></DD
  515 ><DT
  516 >currentsection</DT
  517 ><DD
  518 ><P
  519 >produces an index of the pages in the current section.
  520       </P
  521 ></DD
  522 ><DT
  523 >download</DT
  524 ><DD
  525 ><P
  526 >you can use this module for creating links to files you store with phpgw's filemanager
  527       </P
  528 ></DD
  529 ><DT
  530 >filecontents</DT
  531 ><DD
  532 ><P
  533 >this module lets you include the content of a file on your webserver into your website
  534       </P
  535 ></DD
  536 ><DT
  537 >forum</DT
  538 ><DD
  539 ><P
  540 >another demonstration of what sitemg's modules are intended for: This module displays the discussions of phpgroupware's forum application on the web site. It does not permit to post, since to implement this, in my humble opinion, the forum application has to be redesigned slightly.
  541       </P
  542 ></DD
  543 ><DT
  544 >galerie</DT
  545 ><DD
  546 ><P
  547 >creates a picture galery. You have to name both the filesytem path and the URL to a directory, where images that have a common filename, and are numbered beginning with one, are stored. Once the directory has been found, you can edit a subtext for each image.
  548       </P
  549 ></DD
  550 ><DT
  551 >google</DT
  552 ><DD
  553 ><P
  554 >displays a form for querying the google website.
  555       </P
  556 ></DD
  557 ><DT
  558 >hello</DT
  559 ><DD
  560 ><P
  561 >a simple &#8220;Hello world&#8221; module used below in this manual.
  562       </P
  563 ></DD
  564 ><DT
  565 >html</DT
  566 ><DD
  567 ><P
  568 >probably the most important module, since it plays the role, formerly the simple page content area had, ie. you add html content to the page.
  569       </P
  570 ></DD
  571 ><DT
  572 >index_block</DT
  573 ><DD
  574 ><P
  575 >a index of the whole site, formatted for peripheric areas of your web site.
  576       </P
  577 ></DD
  578 ><DT
  579 >index</DT
  580 ><DD
  581 ><P
  582 >is automatically used with the index GET parameter. You probably would not have to use this block otherwise.
  583       </P
  584 ></DD
  585 ><DT
  586 >lang_block</DT
  587 ><DD
  588 ><P
  589 >displays a select box for changing the user's site language.
  590       </P
  591 ></DD
  592 ><DT
  593 >login</DT
  594 ><DD
  595 ><P
  596 >displays a login block
  597       </P
  598 ></DD
  599 ><DT
  600 >news</DT
  601 ><DD
  602 ><P
  603 >publishes news you edit with phpgroupware's news_admin application. You can choose a category to display.
  604       </P
  605 ></DD
  606 ><DT
  607 >redirect</DT
  608 ><DD
  609 ><P
  610 >makes the page redirect to another URL. This is useful, if you want an entry in your menus that links to a page outside your sitemgr site. If you use this module you shouldn't put any other blocks on the same page.
  611       </P
  612 ></DD
  613 ><DT
  614 >sitetree</DT
  615 ><DD
  616 ><P
  617 >displays a tree like menu to the website.
  618       </P
  619 ></DD
  620 ><DT
  621 >toc_block</DT
  622 ><DD
  623 ><P
  624 >the site's table of contents, formatted for peripheric areas of your web site.
  625       </P
  626 ></DD
  627 ><DT
  628 >toc</DT
  629 ><DD
  630 ><P
  631 >is automatically used with the toc GET parameter. You probably would not have to use this block otherwise.
  632       </P
  633 ></DD
  634 ><DT
  635 >xml</DT
  636 ><DD
  637 ><P
  638 >is only a demonstration of how a module could serve XML content stored on your webserver. It does not do anything useful besides creating a browser from one file to the other. Files have to be named like images in the galerie module. You need PHP's xslt extension to use this module. 
  639       </P
  640 ></DD
  641 ></DL
  642 ></DIV
  643 ></DIV
  644 ><DIV
  645 CLASS="SECT4"
  646 ><HR><H5
  647 CLASS="SECT4"
  648 ><A
  649 NAME="AEN242">Handling versions</H5
  650 ><P
  651 >For each content block you can create a new version simply by clicking on the &#8220;Create new version link&#8221;. Once you have several versions of a block, you can change their status at any time. If you want to immediately publish a block, you choose &#8220;published&#8221;. If you want to register a version for being published at the next commit, you choose &#8220;prepublished&#8221;. A version that is &#8220;preunpublished&#8221; is visible on the website, but will be archived at the next commit. Thus if you want to replace some content at the next commit, you have to put the published version into &#8220;preunpublished&#8221; and create a new version that you put into &#8220;prepublished&#8221; state. Archived versions will be no longer visible in the content managment interface, but will not be deleted from your database. They can be reactivated in the &#8220;Manage archived content&#8221; interface.
  652      </P
  653 ></DIV
  654 ></DIV
  655 ></DIV
  656 ><DIV
  657 CLASS="SECT2"
  658 ><HR><H3
  659 CLASS="SECT2"
  660 ><A
  661 NAME="AEN245">Manage translations</H3
  662 ><P
  663 >to be completed
  664    </P
  665 ></DIV
  666 ><DIV
  667 CLASS="SECT2"
  668 ><HR><H3
  669 CLASS="SECT2"
  670 ><A
  671 NAME="AEN248">Commit changes</H3
  672 ><P
  673 >In this interface you see a list of all categories, pages and blocks that are in prepublished or preunpublished state. You can return to any of them for further editing or changing their status, and you can choose between them for commiting. Prepublished content will go public, preunpublished content will go to the archive.
  674    </P
  675 ></DIV
  676 ><DIV
  677 CLASS="SECT2"
  678 ><HR><H3
  679 CLASS="SECT2"
  680 ><A
  681 NAME="AEN251">Manage archived content</H3
  682 ><P
  683 >to be completed
  684    </P
  685 ></DIV
  686 ></DIV
  687 ><DIV
  688 CLASS="SECT1"
  689 ><HR><H2
  690 CLASS="SECT1"
  691 ><A
  692 NAME="AEN254">Administrator manual<A
  694 ></A
  695 ></H2
  696 ><DIV
  697 CLASS="SECT2"
  698 ><H3
  699 CLASS="SECT2"
  700 ><A
  701 NAME="AEN257">Installation<A
  703 ></A
  704 ></H3
  705 ><P
  706 ></P
  707 ><OL
  708 TYPE="1"
  709 ><LI
  710 ><P
  711 >Once you have the sitemgr directory inside your phpgroupware install you can setup it like any other phpgroupware application with the setup program (http://yourmachine/phpgw-path/setup/). You should also install the sitemgr-link application, which is is inside sitemgr and has to be moved up in the directory hierarchy.
  712     </P
  713 ><TABLE
  714 BORDER="0"
  715 BGCOLOR="#E0E0E0"
  716 WIDTH="90%"
  717 ><TR
  718 ><TD
  719 ><PRE
  721 >cd sitemgr
  722 mv sitemgr-link ..
  723     </PRE
  724 ></TD
  725 ></TR
  726 ></TABLE
  727 ><P
  728 >and then install sitemgr-link with setup
  729     </P
  730 ></LI
  731 ><LI
  732 ><P
  733 >Log in to phpGroupWare as an admin and create an anonymous phpgw user and assign it a password. The only app (I assume) that they should have access to is sitemgr-link. sitemgr-link is a dummy application that redirects phpGW users to the generated site.
  734     </P
  735 ></LI
  736 ><LI
  737 ><P
  738 >Users who you wish to see sitemgr (aka contributors) must be given acces to sitemgr, users who you want to be able to link to the sitemgr site from phpGW must be given rights to sitemgr-link. The easiest way to do this is to go to User groups and give groups permissions to use the applications. 
  739     </P
  740 ></LI
  741 ><LI
  742 ><P
  743 >The sitemgr-site is the directory that serves the dynamic web site. It is located inside sitemgr and works without moving it somewhere else. But it can be located anywhere. For example, you could put it in /var/www/html. You could make the root location of your web server point to it, if you wish (ie, http://yourmachine/ refers to /var/www/html/sitemgr-site if you moved the directory, or to /path/to/phpgroupware/sitemgr/sitemgr-site if you did not). Make a mental note of the directory where you put it and the url that it is accessed by.
  744     </P
  745 ></LI
  746 ><LI
  747 ><P
  748 >In the sitemgr-site directory is a file called config.inc.php. You only have to edit it if you moved the directory. Change the value of the line
  749     </P
  750 ><TABLE
  751 BORDER="0"
  752 BGCOLOR="#E0E0E0"
  753 WIDTH="90%"
  754 ><TR
  755 ><TD
  756 ><PRE
  758 >'phpgw_path'           =&#62; '../../',
  759     </PRE
  760 ></TD
  761 ></TR
  762 ></TABLE
  763 ><P
  764 >so that the value of $sitemgr_info['phpgw_path'] is '/path/to/phpgroupware/'
  765     </P
  766 ></LI
  767 ><LI
  768 ><P
  769 >You can handle different websites with sitemgr. The first thing to do is to define your new website. Sitemgr defines a default website upon installation, but you will probably have to redefine it. Log in as a phpgw administrator and go into phpgroupware's admin application and choose &#8220;Define websites&#8221; in the sitemgr section. You should see the default website listed, and can choose to edit it. A website is defined by the following values:
  770     </P
  771 ><P
  772 ></P
  773 ><DIV
  775 ><DL
  776 ><DT
  777 >Site_name</DT
  778 ><DD
  779 ><P
  780 >This is not used on the website, but only helps identify a website inside the administration interface.
  781      </P
  782 ></DD
  783 ><DT
  784 >Filesystem_path_to_sitemgr-site_directory</DT
  785 ><DD
  786 ><P
  787 >If you did not move the sitemgr-site directory above you can leave this unchanged.
  788      </P
  789 ></DD
  790 ><DT
  791 >URL_to_sitemgr-site</DT
  792 ><DD
  793 ><P
  794 >You can also leave this unchanged if you want to access your public website with a url that looks like http:/your.phpgw.url/sitemgr/sitemgr-site. If you want a different URL, you either have to move the sitemgr-site directory or to use an alias or a virtual server in your webserver's configuration.
  795      </P
  796 ></DD
  797 ><DT
  798 >Anonymous_user's_username</DT
  799 ><DD
  800 ><P
  801 >the account name you created above.
  802      </P
  803 ></DD
  804 ><DT
  805 >Anonymous_user's_password</DT
  806 ><DD
  807 ><P
  808 >and the corresponding password
  809      </P
  810 ></DD
  811 ><DT
  812 >Site_administrators</DT
  813 ><DD
  814 ><P
  815 >Here you choose the users and/or groups that should have administrator rights for the website. They do not have to be adminstrators in phpgw's sense.
  816      </P
  817 ></DD
  818 ></DL
  819 ></DIV
  820 ></LI
  821 ><LI
  822 ><P
  823 >You can know log in as on one of the user's you gave administrator rights for the website.. Go to the sitemgr application and select "Configure SiteMgr". Here you can set different values that affect how your site will be presented.
  824     </P
  825 ><P
  826 ></P
  827 ><DIV
  829 ><DL
  830 ><DT
  831 >Site_name</DT
  832 ><DD
  833 ><P
  834 >is used mainly for metadata
  835      </P
  836 ></DD
  837 ><DT
  838 >Site_description</DT
  839 ><DD
  840 ><P
  841 >is used mainly for metadata
  842      </P
  843 ></DD
  844 ><DT
  845 >Default_home_page</DT
  846 ><DD
  847 ><P
  848 >here you can select the page that will show up first one your website. Evidently there won't be any choice until you create some pages.
  849      </P
  850 ></DD
  851 ><DT
  852 >Template_select</DT
  853 ><DD
  854 ><P
  855 >lets you choose between the different site designs that come with sitemgr or any you will create yourself.
  856      </P
  857 ></DD
  858 ><DT
  859 >Site_languages</DT
  860 ><DD
  861 ><P
  862 >If you want a multilingual site, you have to set them here. This will let you use the translation interface for translating your content and you can put a selectbox on your website where it's visitors can choose between different languages.
  863      </P
  864 ></DD
  865 ></DL
  866 ></DIV
  867 ></LI
  868 ><LI
  869 ><P
  870 >After installation sitemgr does not immediately know about all available modules. The setup routine only installs the modules html,index and toc that every site will need. In order to register all availabe modules select &#8220;Manage site-wide module properties&#8221; from the administrative menu, and then follow the &#8220;Register new modules&#8221; link.
  871     </P
  872 ></LI
  873 ><LI
  874 ><P
  875 >That's it. Go to the Outline manager (&#8220;Manage categories and pages), add a category or three and check who can view and edit them, then add a page or three to each category, create some content for each page. You can also have content that is visible everwhere on your website (&#8220;Manage site-wide content&#8221;) or on all pages that belong to a category (&#8220;Manage categories and pages&#8221; =&#62; &#8220;Manage category wide content&#8221;). Take care to put all categories and pages and blocks you create into published state, otherwise they will not be visible on the website.
  876     </P
  877 ></LI
  878 ><LI
  879 ><P
  880 >Go view your recently created site by clicking on the sitemgr-link application. Voilą!
  881     </P
  882 ></LI
  883 ></OL
  884 ></DIV
  885 ><DIV
  886 CLASS="SECT2"
  887 ><HR><H3
  888 CLASS="SECT2"
  889 ><A
  890 NAME="AEN331">Maintenance</H3
  891 ><P
  892 >As a site administrator, you have three privileges/responsibilies:
  893    </P
  894 ><P
  895 ></P
  896 ><OL
  897 TYPE="1"
  898 ><LI
  899 ><P
  900 >Define site wide content blocks. These are edited in the same interface as category and page specific blocks.
  901     </P
  902 ></LI
  903 ><LI
  904 ><P
  905 >Choose permitted modules: If you choose &#8220;Manage site-wide module properties&#8221; from sitemgr's main menu, you will see several rows which all contain four elements: a select box, a button labelled &#8220;Select allowed modules', another select box and a button labelled &#8220;Configure module properties&#8221;. The first select box and its adjacent button in each row permits to choose lists of permitted modules. The first row defines a master list for the whole site which is used when no more specific lists are found for content areas or categories. The following rows each pertain to the different content areas of your site template. Here you can choose to allow some modules for one content areas, and other modules for another one.
  906 In the category manager, there is a button &#8220;Manage Modules&#8221; associated with each category. There you can use the same interface to define lists specific to one category (and all its subcategories, unless overriden). Again you have the choice between one list that pertains to all content areas, and specific lists for each category.
  907 When sitemgr has to find a specific value of permitted lists in a given context (a given contentarea in a given category) the following algorithm is used: First it aks for a value defined for the pair contentarea/category. If none is defined, it climbs up the category hierarchy until the site wide value, each time looking for a value defined for the pair contentarea/category. If none can be found, it returns to the given category the search started from, and now asks for values defined for the given category but independent from the contentarea. If there is still none defined, it repeats the same traversal up the category hierarchy. This means that by simply defining one global master list of permitted modules, you can configure the whole site, if you do not need more fine grained control.
  908 The lists of permitted lists are never merged, if you define one list for a given context, this list is used in this context.
  909     </P
  910 ></LI
  911 ><LI
  912 ><P
  913 >Define module properties: The lookup algorithm for module properties is exactly the same as for the lists of permitted modules. For each module you can set properties for the whole site, for content areas, for categories, or for combinations of content areas and categories. You access the property editor from the same page where you choose the list of permitted modules. You just use the second select box in each row. By selecting one module and clicking the &#8220;Configure module properties&#8221; button, you will open a interface for editing the module's properties which ressembles the interface for editing module arguments in the content manager. Be aware that only some modules define properties.
  914     </P
  915 ></LI
  916 ></OL
  917 ></DIV
  918 ></DIV
  919 ><DIV
  920 CLASS="SECT1"
  921 ><HR><H2
  922 CLASS="SECT1"
  923 ><A
  924 NAME="AEN341">Template designer manual<A
  926 ></A
  927 ></H2
  928 ><P
  929 >One main idea behind sitemgr's modularized architecture is that all dynamic content on the website is produced by a module. This permits for a very structural way of defining functionality and for an easy way of extending functionality. With respect to former versions of sitemgr, this means that the templates have to be slightly modified:
  930   </P
  931 ><P
  932 ></P
  933 ><UL
  934 ><LI
  935 ><P
  936 >The whole page template is now stored in a file main.tpl in the template's directory.
  937    </P
  938 ></LI
  939 ><LI
  940 ><P
  941 >The variables page_content, left_blocks,right_blocks have to be replaced by content areas: {contentarea:center}, {contentarea:left}, {contentarea:right}. Only the contentarea center has a special semantics, since it is the hardcoded value for the display of table of contents and side index. All other contentareas can have arbitrary names, and you can have any practical number of them.
  942    </P
  943 ></LI
  944 ><LI
  945 ><P
  946 >A contentarea serves to display the content blocks, the site administrator and contributors define. Each contentarea can have its own way of wrapping html code around each content block. This at the moment defined in a class that implements the transformer interface, i.e. defines a function apply_transform($title,$content).This class' name is areaname_bt (for blocktransformer) and it is stored in file areaname_bt.inc.php inside the template directory. The function apply_transform just has to wrap the desired html around the content. It is free to ignore the title, for example the block title does not necessarily make sense in a page's central content area. A block transformer could apply other transformations to the content, but this would probably have counter-intuitive effects on your page's contributors<A
  947 NAME="AEN352"
  948 HREF="#FTN.AEN352"
  949 >[1]</A
  950 >.
  951    </P
  952 ></LI
  953 ><LI
  954 ><P
  955 >Other than that a template directory can contain template files that are specific to a certain module. For example the news module uses a file newsblock.tpl which is a standard API template. It is up to a module's developpers what kind of templates he wants to use. We propose to use a namespace for these module specific template files. For example a template used by module 'news' would go into a subdirectory 'modules/news' in each template directory. If the module does not find a template it needs in the site template's directory, it should look for a default template file, for example in &#8220;default/modules/news'.
  956    </P
  957 ></LI
  958 ><LI
  959 ><P
  960 >You can hardcode module calls into the template if your site should have the same dynamic content on one specific place.
  961    </P
  962 ></LI
  963 ></UL
  964 ></DIV
  965 ><DIV
  966 CLASS="SECT1"
  967 ><HR><H2
  968 CLASS="SECT1"
  969 ><A
  970 NAME="AEN358">Module developper manual<A
  972 ></A
  973 ></H2
  974 ><P
  975 >Sitemgr's parent module class, defines all the important functionality a module needs in its lifetime. Thus creating a new module can be as easy as creating a class that extends the standard module, defines the module's arguments if there are any, and has a function get_content that produces the module's content. Let's start with &#8220;Hello World&#8221;.
  976   </P
  977 ><TABLE
  978 BORDER="0"
  979 BGCOLOR="#E0E0E0"
  980 WIDTH="100%"
  981 ><TR
  982 ><TD
  983 ><PRE
  985 >&#60;?php
  986 class module_hello extends Module 
  987 {      
  988     function module_hello()  
  989     {               
  990         $this-&#62;arguments = array(
  991             'name' =&#62; array(
  992                 'type' =&#62; 'textfield', 
  993                 'label' =&#62; 'The person to say hello to'
  994             )
  995         );
  996         $this-&#62;title = "Hello world";
  997         $this-&#62;description = "This is a simple sample module";   
  998     }
  999     function get_content($arguments,$properties)    
 1000     {
 1001         return lang('Hello') . ' ' . $arguments['name'];
 1002     }
 1003 }
 1004   </PRE
 1005 ></TD
 1006 ></TR
 1007 ></TABLE
 1008 ><P
 1009 >Once your module is registered<A
 1010 NAME="AEN364"
 1011 HREF="#FTN.AEN364"
 1012 >[2]</A
 1013 > and added to the list of permitted modules for some context, users can create blocks from this module: They will see in the content manager a textfield where they edit the argument name, and once the block is activated, it will generate the hello phrase on the website. Easy, isn't it?
 1014   </P
 1015 ><P
 1016 >Now let's examine more in detail how the standard module is constructed. This will help you understand in what way you can extend it to create more powerful modules. It defines the following functions:
 1017   </P
 1018 ><P
 1019 ></P
 1020 ><DIV
 1022 ><DL
 1023 ><DT
 1024 >add_transformer($transformer)</DT
 1025 ><DD
 1026 ><P
 1027 >This function adds a transformer class to the module's transformer chain, so that when a block is generated from this module, its content will be passed through $transformer. This function is automatically called for block transformers, but you can use it on your own, if you want to separate in your module raw content from different forms of output. There is only one function a transformer class has to provide:
 1028    </P
 1029 ><P
 1030 ></P
 1031 ><DIV
 1033 ><DL
 1034 ><DT
 1035 >apply_transform($title,$content)</DT
 1036 ><DD
 1037 ><P
 1038 >A transformer that is not a block transformer should normally ignore the title argument, and construct its return value from the content argument.
 1039     </P
 1040 ></DD
 1041 ></DL
 1042 ></DIV
 1043 ></DD
 1044 ><DT
 1045 >set_block(&#38;$block,$produce=False)</DT
 1046 ><DD
 1047 ><P
 1048 >This function is called by the content manager (with $produce=False) and by the page generation (with $produce=True) for each content block, so that the module knows everything about the block it has to edit or generate (above all its context and its arguments). If your module overrides this function, it should always call the parent class' set_block function first with parent::set_block($block,$produce). If you want to configure your module with respect to the block, you can do this here. This is also the place where your module should add the transformers it needs for generating output. For example:
 1049    </P
 1050 ></DD
 1051 ></DL
 1052 ></DIV
 1053 ><TABLE
 1054 BORDER="0"
 1055 BGCOLOR="#E0E0E0"
 1056 WIDTH="100%"
 1057 ><TR
 1058 ><TD
 1059 ><PRE
 1061 >function set_block(&#38;$block,$produce=False)
 1062 { 
 1063     parent::set_block($block,$produce)
 1064     if ($produce)
 1065     {
 1066         $this-&#62;add_transformer(new my_transform());
 1067     }
 1068 }
 1069   </PRE
 1070 ></TD
 1071 ></TR
 1072 ></TABLE
 1073 ><P
 1074 ></P
 1075 ><DIV
 1077 ><DL
 1078 ><DT
 1079 >get_properties()</DT
 1080 ><DD
 1081 ><P
 1082 >This function looks up the value of the module's properties for the context of a block. There should not be much reason to override this function.
 1083    </P
 1084 ></DD
 1085 ><DT
 1086 >get_user_interface()</DT
 1087 ><DD
 1088 ><P
 1089 >This function is responsible for creating the interface you use in the content manager when you edit a module's arguments. If you want this interface to show more than your module's arguments, youcan override this function. It must return an array of interface elements where each element is an array with two values associated to the keys label and form. You can even dynamically construct arguments, sitemgr's sample gallery module shows how to do this.
 1090    </P
 1091 ></DD
 1092 ><DT
 1093 >get_admin_interface($defaults)</DT
 1094 ><DD
 1095 ><P
 1096 >This function creates the interface for editing module properties, it works in a similar way to get_user_interface.
 1097    </P
 1098 ></DD
 1099 ><DT
 1100 >get_translation_interface($fromblock,$toblock)</DT
 1101 ><DD
 1102 ><P
 1103 >This function creates the interface for the translation manager. If your module makes use of sitemgr multilingual feature, and you have overriden get_user_interface, you'll probably have to override this function too.
 1104    </P
 1105 ></DD
 1106 ><DT
 1107 >build_input_element(($input,$default,$elementname)</DT
 1108 ><DD
 1109 ><P
 1110 >This is a helper function for above functions. If you override one of above functions you can use build_input_element in the same way as the parent module does.
 1111    </P
 1112 ></DD
 1113 ><DT
 1114 >validate(&#38;$data)</DT
 1115 ><DD
 1116 ><P
 1117 >This function is called when a module's arguments are edited. The parent class simply returns true. When you override this function, you can alter the arguments, a reference to which is passed to the function, but you can also return false, and set the module's validation_error variable. In this case, the arguments will not be saved and the validation error is displayed to the user. For example we could add the following lines to our hello module:
 1118    </P
 1119 ><TABLE
 1120 BORDER="0"
 1121 BGCOLOR="#E0E0E0"
 1122 WIDTH="90%"
 1123 ><TR
 1124 ><TD
 1125 ><PRE
 1127 >function validate(&#38;$data) 
 1128 { 
 1129     if (preg_match("/[[:upper:]]/",$data['name']))
 1130     {
 1131         $data['name'] = strtolower($data['name']);
 1132         $this-&#62;validation_error = "Name has been translated to lower case";
 1133     }
 1134     return true;
 1135 }
 1136    </PRE
 1137 ></TD
 1138 ></TR
 1139 ></TABLE
 1140 ><P
 1141 >This would make sure that the module argument name would always be lowercase.
 1142    </P
 1143 ></DD
 1144 ><DT
 1145 >get_content(&#38;$arguments,$properties)</DT
 1146 ><DD
 1147 ><P
 1148 >This is the function every module needs. It produces the module's content. It is passed two arrays, one with the arguments for the block the module is generating, and the other with the properties that apply for the block's context. At the moment there is no constraint on what type of date the get_content function returns. It can be html, xml, an array, etc. But if it does not return html, you have to provide a transformer capable to produce html from the data get_content produces. The arguments are passed as a reference, because the get_content function can change them, and they can get stored automatically as session variable. This is because the parent module provides one other service: Your module can rely on an automatic handling of HTTP GET, POST and COOKIE variables, and of session variables. All you'd have to do is to define the arrays $this-&#62;get, $this-&#62;post, $this-&#62;cookie and $this-&#62;session. All members of these variables will be fetched from the GET, POST or COOKIE parameters, or from session variables and stored for you in the $arguments array. The entries of $this-&#62;session additionnaly will be stored after get_content returns to get_output. This can be very useful if you want your module to remain in a stable state while the user interacts with other modules on the same page.
 1149    </P
 1150 ><P
 1151 >The variables you define in these arrays can be identical to those in $this-&#62;arguments. In this case, if they are defined in the HTTP session context, they will override the values the page contributor has defined for the page. But they can be different variables that do not need an initial value provided by the page contributor. Whereas $this-&#62;get,$this-&#62;cookie and $this-&#62;session are simple arrays enumerating the variable names, $this-&#62;post is special because it can contain the element definition in the same way as $this-&#62;arguments, which can be used to programatically construct the form elements.
 1152   </P
 1153 ><P
 1154 >Your module does not need to use this service, it could directly read HTTP variables. The advantage of using it is that it provides a namespace for each module, so that if different modules that use the same variable names are used on the same page, no problems occur. If you use this service you can construct URLS automatically with the modules link function (see below), and if you construct the user interface, you have to provide the correct form element names for this service to work. The build_post_element function can help you do this. For example lets extend our hello module, so that the site user can choose his own name. Since we can no longer rely on the validation that is automatically done on contributor provided input. we call validate from the get_content function.
 1155   </P
 1156 ><TABLE
 1157 BORDER="0"
 1158 BGCOLOR="#E0E0E0"
 1159 WIDTH="90%"
 1160 ><TR
 1161 ><TD
 1162 ><PRE
 1164 >&#60;?php
 1165 class module_hello extends Module  {
 1166     function module_hello()
 1167     {
 1168         $this-&#62;arguments = array(
 1169             'name' =&#62; array(
 1170                 'type' =&#62; 'textfield',
 1171                  'label' =&#62; 'The person to say hello to'
 1172             )
 1173         );
 1174        $this-&#62;post = array('name' =&#62; array('type' =&#62; 'textfield'));
 1175        $this-&#62;session = array('name');
 1176        $this-&#62;title = "Hello world";
 1177        $this-&#62;description = "This is a simple sample module";
 1178     }
 1179     function get_content(&#38;$arguments,$properties)
 1180     {
 1181        $this-&#62;validate($arguments);
 1182        return lang('Hello') . ' ' . $arguments['name'] . '&#60;br&#62;&#60;form action="' .
 1183            $_SERVER['REQUEST_URI'] . '" method="post"&#62;' .
 1184                $this-&#62;build_post_element('name',lang('Enter a name') .
 1185            '&#60;/form&#62;';
 1186     }
 1187     function validate(&#38;$data)
 1188     {
 1189        if (preg_match("/[[:upper:]]/",$data['name']))
 1190        {
 1191            $data['name'] = strtolower($data['name']);
 1192            $this-&#62;validation_error = "Name has been translated to lower case";                }
 1193        return true;
 1194    }
 1195 }
 1196    </PRE
 1197 ></TD
 1198 ></TR
 1199 ></TABLE
 1200 ></DD
 1201 ><DT
 1202 >build_post_element($key,$default=False)</DT
 1203 ><DD
 1204 ><P
 1205 >You can use this function from your module's get_content function to construct form elements. This works with the argument definition you put into $this-&#62;post. If you do not provide a default the current blocks value for the argument will be filled in.
 1206    </P
 1207 ></DD
 1208 ><DT
 1209 >link($modulevars)</DT
 1210 ><DD
 1211 ><P
 1212 >helps you construct URLS with GET parameters that use the service described above. modulevars is an array of variable values keyed on variable names.
 1213    </P
 1214 ></DD
 1215 ><DT
 1216 >find_template_dir()</DT
 1217 ><DD
 1218 ><P
 1219 >if a module uses a different template (of whatever kind) for different site themes, this function can help finding the template directory inside the theme's directory, if it follows the namespace described above, or if it cannot be found name the default directory.
 1220    </P
 1221 ></DD
 1222 ><DT
 1223 >get_output($type='html')</DT
 1224 ><DD
 1225 ><P
 1226 >This is the function that is actually called by the page generation engine, since it not only calls the module's get_content function, but makes sure that all transformers that have been added to the modules transformer_chain get called. For type argument is not really used at the moment, but future versions of sitemgr could be extended so that modules could produce output in different formats by specifying different transformers for each output type. Your module should not need to override get_output.
 1227    </P
 1228 ></DD
 1229 ></DL
 1230 ></DIV
 1231 ><P
 1232 >To summarize, there are the following requirements for a sitemgr module:
 1233   </P
 1234 ><P
 1235 ></P
 1236 ><OL
 1237 TYPE="1"
 1238 ><LI
 1239 ><P
 1240 >It is written as a class called module_name and extends the class Module. It must be put into a file called class.module_name.inc.php and put into the inc directory of any phpgroupware application.
 1241    </P
 1242 ></LI
 1243 ><LI
 1244 ><P
 1245 >Its constructor should define the following member variables:
 1246    </P
 1247 ><P
 1248 ></P
 1249 ><OL
 1250 TYPE="a"
 1251 ><LI
 1252 ><P
 1253 >arguments: the module's arguments a contributor can edit in order to create content blocks from the module. Each argument needs to define a label and the type of input element used to edit it in the content manager. Parameters for these input elements (like size for textfields, cols and rows for textareas can be defined). Translatable arguments can be specially flagged with a i18n entry in the arguments definition array.
 1254     </P
 1255 ></LI
 1256 ><LI
 1257 ><P
 1258 >properties: the module's properties the site administrator can edit in order to constrain or configure the functionnality of the module
 1259     </P
 1260 ></LI
 1261 ><LI
 1262 ><P
 1263 >title: The module's default title that can be overriden for each content block.
 1264     </P
 1265 ></LI
 1266 ><LI
 1267 ><P
 1268 >description: A short descriptive text, that is displayed in the content manager and module manager (for example when you put the mouse over an entry in the module select lists).
 1269     </P
 1270 ></LI
 1271 ></OL
 1272 ></LI
 1273 ><LI
 1274 ><P
 1275 >It needs a get_content function that has access to arguments and properties and produces the block content.
 1276    </P
 1277 ></LI
 1278 ><LI
 1279 ><P
 1280 >If the content returned by get_content is something different from HTML, the module has to define transformer classes, and should add them to the module's transformer chain. This can be done in the constructor, but the best place for it is the set_block function
 1281    </P
 1282 ></LI
 1283 ><LI
 1284 ><P
 1285 >The parent module class provides a user interface for editing module arguments. If a module needs a customized interface or wants to construct arguments dynamically, it can override the get_user_interface function.
 1286    </P
 1287 ></LI
 1288 ></OL
 1289 ><P
 1290 >These are the building blocks which should allow for some flexibility in constructing modules that make phpgroupware managed data visible on a sitemgr web site.
 1291   </P
 1292 ></DIV
 1293 ></DIV
 1294 ><H3
 1296 >Notes</H3
 1297 ><TABLE
 1298 BORDER="0"
 1300 WIDTH="100%"
 1301 ><TR
 1302 ><TD
 1303 ALIGN="LEFT"
 1304 VALIGN="TOP"
 1305 WIDTH="5%"
 1306 ><A
 1307 NAME="FTN.AEN352"
 1308 HREF="#AEN352"
 1309 >[1]</A
 1310 ></TD
 1311 ><TD
 1312 ALIGN="LEFT"
 1313 VALIGN="TOP"
 1314 WIDTH="95%"
 1315 ><P
 1316 >For compatibility with how sitemgr used to work, the file sideblock.tpl which uses the two variables block_title and block_content is still recognized as a template for a transformation of the two contentareas left and right. The transformer is automatically created by the template class. Thus you could use one file sideblock.tpl instead of the two files right_bt.inc.php and left_bt.inc.php.</P
 1317 ></TD
 1318 ></TR
 1319 ><TR
 1320 ><TD
 1321 ALIGN="LEFT"
 1322 VALIGN="TOP"
 1323 WIDTH="5%"
 1324 ><A
 1325 NAME="FTN.AEN364"
 1326 HREF="#AEN364"
 1327 >[2]</A
 1328 ></TD
 1329 ><TD
 1330 ALIGN="LEFT"
 1331 VALIGN="TOP"
 1332 WIDTH="95%"
 1333 ><P
 1334 >Modules must be stored in the directory /path/to/phpgroupware/sitemgr/modules and be named class.module_modulename.inc.php in order that sitemgr can find them.</P
 1335 ></TD
 1336 ></TR
 1337 ></TABLE
 1338 ></BODY
 1339 ></HTML
 1340 >