[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/etemplate/inc/ -> class.link_widget.inc.php (sommaire)

(pas de description)

Poids: 443 lignes (16 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

link_widget:: (3 méthodes):
  link_widget()
  pre_process()
  post_process()


Classe: link_widget  - X-Ref

eTemplate Extension: several widgets as user-interface for the link-class

All widgets use the link-registry, to "know" which apps use popups (and what size).
If run in a popup and the app uses no popups, a target will be set, to open a new full decorated window.

The class contains the following widgets:
- link: Show a link to one linked entry specified by an array with keys app, id and optional title and help-message
- link-to: Widget to create links to an other entries of link-aware apps
If an id was set, this widgets creats the links without further interaction with the calling code.
If the entry does not yet exist, the widget returns an array with the new links in the id. After the
entry was successful create, bolink::link($app,$new_id,$arr) has to be called to create the links!
- link-list: Widget to shows the links to an entry in a table with an unlink icon for each link
- link-string: comma-separated list of link-titles with a link to its view method, value is like get_links()
or array with keys to_app and to_id (widget calls then get_links itself)
- link-add:    Add a new entry of the select app, which is already linked to a given entry

<code>
$content[$name] = array(
'to_app'       => // I  string appname of the entry to link to
'to_id'        => // IO int id of the entry to link to, for new entries 0, returns the array with new links
// the following params apply only for the link-to widget!
'no_files'     => // I  boolean suppress attach-files, default no
'search_label' => // I  string label to use instead of search
'link_label'   => // I  string label for the link button, default 'Link'
// optional only for the link-add widget
'extra'        => // I  array with extra parameters, eg. array('cat_id' => 15)
);
</code>

This widget is independent of the UI as it only uses etemplate-widgets and has therefor no render-function.

link_widget($ui)   X-Ref
Constructor of the extension

param: string $ui '' for html

pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)   X-Ref
pre-processing of the extension

This function is called before the extension gets rendered

param: string $name form-name of the control
param: mixed &$value value / existing content, can be modified
param: array &$cell array with the widget, can be modified for ui-independent widgets
param: array &$readonlys names of widgets as key, to be made readonly
param: mixed &$extension_data data the extension can store persisten between pre- and post-process
param: object &$tmpl reference to the template we belong too
return: boolean true if extra label is allowed, false otherwise

post_process($name,&$value,&$extension_data,&$loop,&$tmpl,$value_in)   X-Ref
postprocessing method, called after the submission of the form

It has to copy the allowed/valid data from $value_in to $value, otherwise the widget
will return no data (if it has a preprocessing method). The framework insures that
the post-processing of all contained widget has been done before.

Only used by select-dow so far

param: string $name form-name of the widget
param: mixed &$value the extension returns here it's input, if there's any
param: mixed &$extension_data persistent storage between calls or pre- and post-process
param: boolean &$loop can be set to true to request a re-submision of the form/dialog
param: object &$tmpl the eTemplate the widget belongs too
param: mixed &value_in the posted values (already striped of magic-quotes)
return: boolean true if $value has valid content, on false no content will be returned!



Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7