source: subversion/trunk/roundcubemail/program/steps/addressbook/func.inc @ 4424

Last change on this file since 4424 was 4424, checked in by thomasb, 2 years ago

Merge branch devel-addressbook (r4193:4382) back into trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 24.2 KB
Line 
1<?php
2
3/*
4 +-----------------------------------------------------------------------+
5 | program/steps/addressbook/func.inc                                    |
6 |                                                                       |
7 | This file is part of the Roundcube Webmail client                     |
8 | Copyright (C) 2005-2007, The Roundcube Dev Team                       |
9 | Licensed under the GNU GPL                                            |
10 |                                                                       |
11 | PURPOSE:                                                              |
12 |   Provide addressbook functionality and GUI objects                   |
13 |                                                                       |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16 +-----------------------------------------------------------------------+
17
18 $Id$
19
20*/
21
22// add list of address sources to client env
23$js_list = $RCMAIL->get_address_sources();
24
25// select source
26$source = get_input_value('_source', RCUBE_INPUT_GPC);
27
28// if source is not set use first directory
29if (empty($source))
30    $source = $js_list[key($js_list)]['id'];
31
32// instantiate a contacts object according to the given source
33$CONTACTS = $RCMAIL->get_address_book($source);
34
35$CONTACTS->set_pagesize($CONFIG['pagesize']);
36
37// set list properties and session vars
38if (!empty($_GET['_page']))
39    $CONTACTS->set_page(($_SESSION['page'] = intval($_GET['_page'])));
40else
41    $CONTACTS->set_page(isset($_SESSION['page']) ?$_SESSION['page'] : 1);
42 
43if (!empty($_REQUEST['_gid']))
44    $CONTACTS->set_group(get_input_value('_gid', RCUBE_INPUT_GPC));
45
46// set message set for search result
47if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']]))
48    $CONTACTS->set_search_set($_SESSION['search'][$_REQUEST['_search']]);
49
50// set data source env
51$OUTPUT->set_env('source', $source ? $source : '0');
52$OUTPUT->set_env('readonly', $CONTACTS->readonly, false);
53if (!$OUTPUT->ajax_call) {
54    $OUTPUT->set_env('address_sources', $js_list);
55    $OUTPUT->set_pagetitle(rcube_label('addressbook'));
56}
57
58
59// general definition of contact coltypes
60$CONTACT_COLTYPES = array(
61  'name'         => array('type' => 'text', 'size' => 40, 'limit' => 1, 'label' => rcube_label('name')),
62  'firstname'    => array('type' => 'text', 'size' => 19, 'limit' => 1, 'label' => rcube_label('firstname')),
63  'surname'      => array('type' => 'text', 'size' => 19, 'limit' => 1, 'label' => rcube_label('surname')),
64  'middlename'   => array('type' => 'text', 'size' => 19, 'limit' => 1, 'label' => rcube_label('middlename')),
65  'prefix'       => array('type' => 'text', 'size' => 8,  'limit' => 1, 'label' => rcube_label('nameprefix')),
66  'suffix'       => array('type' => 'text', 'size' => 8,  'limit' => 1, 'label' => rcube_label('namesuffix')),
67  'nickname'     => array('type' => 'text', 'size' => 40, 'limit' => 1, 'label' => rcube_label('nickname')),
68  'jobtitle'     => array('type' => 'text', 'size' => 40, 'limit' => 1, 'label' => rcube_label('jobtitle')),
69  'organization' => array('type' => 'text', 'size' => 19, 'limit' => 1, 'label' => rcube_label('organization')),
70  'department'   => array('type' => 'text', 'size' => 19, 'limit' => 1, 'label' => rcube_label('department')),
71  'gender'       => array('type' => 'select', 'limit' => 1, 'label' => rcube_label('gender'), 'options' => array('male' => rcube_label('male'), 'female' => rcube_label('female'))),
72  'maidenname'   => array('type' => 'text', 'size' => 40, 'limit' => 1, 'label' => rcube_label('maidenname')),
73  'email'        => array('type' => 'text', 'size' => 40, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other')),
74  'phone'        => array('type' => 'text', 'size' => 40, 'label' => rcube_label('phone'), 'subtypes' => array('home','home2','work','work2','mobile','main','homefax','workfax','car','pager','video','assistant','other')),
75  'address'      => array('type' => 'composite', 'label' => rcube_label('address'), 'subtypes' => array('home','work','other'), 'childs' => array(
76    'street'     => array('type' => 'text', 'size' => 40, 'label' => rcube_label('street')),
77    'locality'   => array('type' => 'text', 'size' => 28, 'label' => rcube_label('locality')),
78    'zipcode'    => array('type' => 'text', 'size' => 8, 'label' => rcube_label('zipcode')),
79    'region'     => array('type' => 'text', 'size' => 12, 'label' => rcube_label('region')),
80    'country'    => array('type' => 'text', 'size' => 40, 'label' => rcube_label('country')),
81  )),
82  'birthday'     => array('type' => 'date', 'size' => 12, 'label' => rcube_label('birthday'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col'),
83  'anniversary'  => array('type' => 'date', 'size' => 12, 'label' => rcube_label('anniversary'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col'),
84  'website'      => array('type' => 'text', 'size' => 40, 'label' => rcube_label('website'), 'subtypes' => array('homepage','work','blog','other')),
85  'im'           => array('type' => 'text', 'size' => 40, 'label' => rcube_label('instantmessenger'), 'subtypes' => array('aim','icq','msn','yahoo','jabber','skype','other')),
86  'notes'        => array('type' => 'textarea', 'size' => 40, 'rows' => 15, 'label' => rcube_label('notes'), 'limit' => 1),
87  'photo'        => array('type' => 'image', 'limit' => 1),
88  'assistant'    => array('type' => 'text', 'size' => 40, 'limit' => 1, 'label' => rcube_label('assistant')),
89  'manager'      => array('type' => 'text', 'size' => 40, 'limit' => 1, 'label' => rcube_label('manager')),
90  'spouse'       => array('type' => 'text', 'size' => 40, 'limit' => 1, 'label' => rcube_label('spouse')),
91  // TODO: define fields for vcards like GEO, KEY
92);
93
94// reduce/extend $CONTACT_COLTYPES with specification from the current $CONTACT object
95if (is_array($CONTACTS->coltypes)) {
96    // remove cols not listed by the backend class
97    $contact_cols = $CONTACTS->coltypes[0] ? array_flip($CONTACTS->coltypes) : $CONTACTS->coltypes;
98    $CONTACT_COLTYPES = array_intersect_key($CONTACT_COLTYPES, $contact_cols);
99    // add associative coltypes definition
100    if (!$CONTACTS->coltypes[0]) {
101        foreach ($CONTACTS->coltypes as $col => $colprop)
102            $CONTACT_COLTYPES[$col] = $CONTACT_COLTYPES[$col] ? array_merge($CONTACT_COLTYPES[$col], $colprop) : $colprop;
103    }
104}
105
106$OUTPUT->set_env('photocol', is_array($CONTACT_COLTYPES['photo']));
107
108
109function rcmail_directory_list($attrib)
110{
111    global $RCMAIL, $OUTPUT;
112
113    if (!$attrib['id'])
114        $attrib['id'] = 'rcmdirectorylist';
115
116    $out = '';
117    $local_id = '0';
118    $jsdata = array();
119    $current = get_input_value('_source', RCUBE_INPUT_GPC);
120    $line_templ = html::tag('li', array(
121        'id' => 'rcmli%s', 'class' => 'addressbook %s'),
122        html::a(array('href' => '%s',
123            'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s'));
124
125    // currently selected is the first address source in the list
126    if (!isset($current))
127        $current = strval(key((array)$OUTPUT->env['address_sources']));
128
129    foreach ((array)$OUTPUT->env['address_sources'] as $j => $source) {
130        $id = strval($source['id'] ? $source['id'] : $j);
131        $js_id = JQ($id);
132        $dom_id = preg_replace('/[^a-z0-9\-_]/i', '_', $id);
133        $out .= sprintf($line_templ, $dom_id, ($current === $id ? 'selected' : ''),
134            Q(rcmail_url(null, array('_source' => $id))),
135            $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id)));
136
137        $groupdata = array('out' => $out, 'jsdata' => $jsdata, 'source' => $id);
138        if ($source['groups'])
139            $groupdata = rcmail_contact_groups($groupdata);
140        $jsdata = $groupdata['jsdata'];
141        $out = $groupdata['out'];
142    }
143
144    $OUTPUT->set_env('contactgroups', $jsdata);
145    $OUTPUT->add_gui_object('folderlist', $attrib['id']);
146
147    return html::tag('ul', $attrib, $out, html::$common_attrib);
148}
149
150
151function rcmail_contact_groups($args)
152{
153    global $RCMAIL;
154
155    $groups = $RCMAIL->get_address_book($args['source'])->list_groups();
156
157    if (!empty($groups)) {
158        $line_templ = html::tag('li', array(
159            'id' => 'rcmliG%s%s', 'class' => 'contactgroup'),
160            html::a(array('href' => '#',
161                'onclick' => "return ".JS_OBJECT_NAME.".command('listgroup',{'source':'%s','id':'%s'},this)"), '%s'));
162
163        $jsdata = array();
164        foreach ($groups as $group) {
165            $args['out'] .= sprintf($line_templ, $args['source'], $group['ID'], $args['source'], $group['ID'], Q($group['name']));
166            $args['jsdata']['G'.$args['source'].$group['ID']] = array(
167                'source' => $args['source'], 'id' => $group['ID'],
168                'name' => $group['name'], 'type' => 'group');
169        }
170    }
171
172    return $args;
173}
174
175
176// return the message list as HTML table
177function rcmail_contacts_list($attrib)
178{
179    global $CONTACTS, $OUTPUT;
180
181    // define list of cols to be displayed
182    $a_show_cols = array('name');
183
184    // count contacts for this user
185    $result = $CONTACTS->list_records($a_show_cols);
186
187    // add id to message list table if not specified
188    if (!strlen($attrib['id']))
189        $attrib['id'] = 'rcmAddressList';
190
191    // create XHTML table
192    $out = rcube_table_output($attrib, $result->records, $a_show_cols, $CONTACTS->primary_key);
193
194    // set client env
195    $OUTPUT->add_gui_object('contactslist', $attrib['id']);
196    $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page);
197    $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size));
198    $OUTPUT->include_script('list.js');
199
200    // add some labels to client
201    $OUTPUT->add_label('deletecontactconfirm');
202
203    return $out;
204}
205
206
207function rcmail_js_contacts_list($result, $prefix='')
208{
209    global $OUTPUT;
210
211    if (empty($result) || $result->count == 0)
212        return;
213
214    // define list of cols to be displayed
215    $a_show_cols = array('name');
216 
217    while ($row = $result->next()) {
218        $a_row_cols = array();
219   
220        // format each col
221        foreach ($a_show_cols as $col)
222            $a_row_cols[$col] = Q($row[$col]);
223
224        $OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols);
225    }
226}
227
228
229// similar function as /steps/settings/identities.inc::rcmail_identity_frame()
230function rcmail_contact_frame($attrib)
231{
232    global $OUTPUT;
233
234    if (!$attrib['id'])
235        $attrib['id'] = 'rcmcontactframe';
236   
237    $attrib['name'] = $attrib['id'];
238
239    $OUTPUT->set_env('contentframe', $attrib['name']);
240    $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif');
241
242    return html::iframe($attrib);
243}
244
245
246function rcmail_rowcount_display($attrib)
247{
248    global $OUTPUT;
249
250    if (!$attrib['id'])
251        $attrib['id'] = 'rcmcountdisplay';
252
253    $OUTPUT->add_gui_object('countdisplay', $attrib['id']);
254
255    return html::span($attrib, rcmail_get_rowcount_text());
256}
257
258
259function rcmail_get_rowcount_text()
260{
261    global $CONTACTS;
262 
263    // read nr of contacts
264    $result = $CONTACTS->get_result();
265    if (!$result) {
266        $result = $CONTACTS->count();
267    }
268
269    if ($result->count == 0)
270        $out = rcube_label('nocontactsfound');
271    else
272        $out = rcube_label(array(
273            'name'  => 'contactsfromto',
274            'vars'  => array(
275            'from'  => $result->first + 1,
276            'to'    => min($result->count, $result->first + $CONTACTS->page_size),
277            'count' => $result->count)
278        ));
279
280    return $out;
281}
282
283
284function rcmail_contact_form($form, $record, $attrib = null)
285{
286    global $RCMAIL, $CONFIG;
287
288    // Allow plugins to modify contact form content
289    $plugin = $RCMAIL->plugins->exec_hook('contact_form', array(
290        'form' => $form, 'record' => $record));
291
292    $form = $plugin['form'];
293    $record = $plugin['record'];
294    $edit_mode = $RCMAIL->action != 'show';
295    $del_button = $attrib['deleteicon'] ? html::img(array('src' => $CONFIG['skin_path'] . $attrib['deleteicon'], 'alt' => rcube_label('delete'))) : rcube_label('delete');
296    unset($attrib['deleteicon']);
297    $out = '';
298   
299    // get default coltypes
300    $coltypes = $GLOBALS['CONTACT_COLTYPES'];
301    $coltype_lables = array();
302   
303    foreach ($coltypes as $col => $prop) {
304        if ($prop['subtypes']) {
305            $select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype'));
306            $select_subtype->add($prop['subtypes']);
307            $coltypes[$col]['subtypes_select'] = $select_subtype->show();
308        }
309        if ($prop['childs']) {
310            foreach ($prop['childs'] as $childcol => $cp)
311                $coltype_lables[$childcol] = array('label' => $cp['label']);
312        }
313    }
314
315    foreach ($form as $section => $fieldset) {
316        // skip empty sections
317        if (empty($fieldset['content']))
318            continue;
319
320        $select_add = new html_select(array('class' => 'addfieldmenu', 'rel' => $section));
321        $select_add->add(rcube_label('addfield'), '');
322
323        // render head section with name fields (not a regular list of rows)
324        if ($section == 'head') {
325            $content = '';
326           
327            $names_arr = array($record['prefix'], $record['firstname'], $record['middlename'], $record['surname'], $record['suffix']);
328            if ($record['name'] == join(' ', array_filter($names_arr)))
329              unset($record['name']);
330
331            // group fields
332            $field_blocks = array(
333                'names'    => array('prefix','firstname','middlename','surname','suffix'),
334                'displayname' => array('name'),
335                'nickname' => array('nickname'),
336                'jobnames' => array('organization','department','jobtitle'),
337            );
338            foreach ($field_blocks as $blockname => $colnames) {
339                $fields = '';
340                foreach ($colnames as $col) {
341                    // skip cols unknown to the backend
342                    if (!$coltypes[$col])
343                        continue;
344
345                    if ($RCMAIL->action == 'show') {
346                        if (!empty($record[$col]))
347                            $fields .= html::span('namefield ' . $col, Q($record[$col])) . " ";
348                    }
349                    else {
350                        $colprop = (array)$fieldset['content'][$col] + (array)$coltypes[$col];
351                        $colprop['id'] = 'ff_'.$col;
352                        if (empty($record[$col]) && !$colprop['visible']) {
353                            $colprop['style'] = 'display:none';
354                            $select_add->add($colprop['label'], $col);
355                        }
356                        $fields .= rcmail_get_edit_field($col, $record[$col], $colprop, $colprop['type']);
357                    }
358                }
359                $content .= html::div($blockname, $fields);
360            }
361           
362            if ($edit_mode)
363                $content .= html::p('addfield', $select_add->show(null));
364
365            $out .= html::tag('fieldset', $attrib, (!empty($fieldset['name']) ? html::tag('legend', null, Q($fieldset['name'])) : '') . $content) ."\n";
366            continue;
367        }
368
369        $content = '';
370        if (is_array($fieldset['content'])) {
371            foreach ($fieldset['content'] as $col => $colprop) {
372                // remove subtype part of col name
373                list($field, $subtype) = explode(':', $col);
374                if (!$subtype) $subtype = 'home';
375                $fullkey = $col.':'.$subtype;
376
377                // skip cols unknown to the backend
378                if (!$coltypes[$field])
379                    continue;
380
381                // merge colprop with global coltype configuration
382                $colprop += $coltypes[$field];
383                $label = isset($colprop['label']) ? $colprop['label'] : rcube_label($col);
384
385                // prepare subtype selector in edit mode
386                if ($edit_mode && is_array($colprop['subtypes'])) {
387                    $select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype'));
388                    $select_subtype->add($colprop['subtypes']);
389                }
390                else
391                    $select_subtype = null;
392
393                if (!empty($colprop['value'])) {
394                    $values = (array)$colprop['value'];
395                }
396                else {
397                    // iterate over possible subtypes and collect values with their subtype
398                    if (is_array($colprop['subtypes'])) {
399                        $values = $subtypes = array();
400                        foreach ($colprop['subtypes'] as $i => $st) {
401                            $newval = false;
402                            if ($record[$field.':'.$st]) {
403                                $subtypes[count($values)] = $st;
404                                $newval = $record[$field.':'.$st];
405                            }
406                            else if ($i == 0 && $record[$field]) {
407                                $subtypes[count($values)] = $st;
408                                $newval = $record[$field];
409                            }
410                            if ($newval !== false) {
411                                if (is_array($newval) && isset($newval[0]))
412                                    $values = array_merge($values, $newval);
413                                else
414                                    $values[] = $newval;
415                            }
416                        }
417                    }
418                    else {
419                        $values = $record[$fullkey] ? $record[$fullkey] : $record[$field];
420                        $subtypes = null;
421                    }
422                }
423
424                // hack: create empty values array to force this field to be displayed
425                if (empty($values) && $colprop['visible'])
426                    $values[] = '';
427
428                $rows = '';
429                foreach ((array)$values as $i => $val) {
430                    if ($subtypes[$i])
431                        $subtype = $subtypes[$i];
432
433                    // render composite field
434                    if ($colprop['type'] == 'composite') {
435                        $composite = array(); $j = 0;
436                        $template = $RCMAIL->config->get($col . '_template', '{'.join('} {', array_keys($colprop['childs'])).'}');
437                        foreach ($colprop['childs'] as $childcol => $cp) {
438                            $childvalue = $val[$childcol] ? $val[$childcol] : $val[$j];
439
440                            if ($edit_mode) {
441                                if ($colprop['subtypes'] || $colprop['limit'] != 1) $cp['array'] = true;
442                                $composite['{'.$childcol.'}'] = rcmail_get_edit_field($childcol, $childvalue, $cp, $cp['type']) . " ";
443                            }
444                            else {
445                                $childval = $cp['render_func'] ? call_user_func($cp['render_func'], $childvalue, $childcol) : Q($childvalue);
446                                $composite['{'.$childcol.'}'] = html::span('data ' . $childcol, $childval) . " ";
447                            }
448                            $j++;
449                        }
450
451                        $coltypes[$field] += (array)$colprop;
452                        $coltypes[$field]['count']++;
453                        $val = strtr($template, $composite);
454                    }
455                    else if ($edit_mode) {
456                        // call callback to render/format value
457                        if ($colprop['render_func'])
458                            $val = call_user_func($colprop['render_func'], $val, $col);
459
460                        $coltypes[$field] = (array)$colprop + $coltypes[$field];
461
462                        if ($colprop['subtypes'] || $colprop['limit'] != 1)
463                            $colprop['array'] = true;
464
465                        $val = rcmail_get_edit_field($col, $val, $colprop, $colprop['type']);
466                        $coltypes[$field]['count']++;
467                    }
468                    else if ($colprop['render_func'])
469                        $val = call_user_func($colprop['render_func'], $val, $col);
470                    else if (is_array($colprop['options']) && isset($colprop['options'][$val]))
471                        $val = $colprop['options'][$val];
472                    else
473                        $val = Q($val);
474
475                    // use subtype as label
476                    if ($colprop['subtypes'])
477                        $label = $subtype;
478
479                    // add delete button/link
480                    if ($edit_mode && !($colprop['visible'] && $colprop['limit'] == 1))
481                        $val .= html::a(array('href' => '#del', 'class' => 'contactfieldbutton deletebutton', 'title' => rcube_label('delete'), 'rel' => $col), $del_button);
482
483                    // display row with label
484                    if ($label) {
485                        $rows .= html::div('row',
486                            html::div('contactfieldlabel label', $select_subtype ? $select_subtype->show($subtype) : Q($label)) .
487                            html::div('contactfieldcontent '.$colprop['type'], $val));
488                    }
489                    else   // row without label
490                        $rows .= html::div('row', html::div('contactfield', $val));
491                }
492               
493                // add option to the add-field menu
494                if (!$colprop['limit'] || $coltypes[$field]['count'] < $colprop['limit']) {
495                    $select_add->add($colprop['label'], $col);
496                    $select_add->_count++;
497                }
498               
499                // wrap rows in fieldgroup container
500                $content .= html::tag('fieldset', array('class' => 'contactfieldgroup contactcontroller' . $col, 'style' => ($rows ? null : 'display:none')),
501                  ($colprop['subtypes'] ? html::tag('legend', null, Q($colprop['label'])) : ' ') .
502                  $rows);
503            }
504
505            // also render add-field selector
506            if ($edit_mode)
507                $content .= html::p('addfield', $select_add->show(null, array('style' => $select_add->_count ? null : 'display:none')));
508
509            $content = html::div(array('id' => 'contactsection' . $section), $content);
510        }
511        else {
512            $content = $fieldset['content'];
513        }
514
515        $out .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $content) ."\n";
516    }
517
518    if ($edit_mode) {
519      $RCMAIL->output->set_env('coltypes', $coltypes + $coltype_lables);
520      $RCMAIL->output->set_env('delbutton', $del_button);
521      $RCMAIL->output->add_label('delete');
522    }
523
524    return $out;
525}
526
527
528function rcmail_contact_photo($attrib)
529{
530    global $CONTACTS, $CONTACT_COLTYPES, $RCMAIL, $CONFIG;
531   
532    if ($result = $CONTACTS->get_result())
533        $record = $result->first();
534   
535    $photo_img = $attrib['placeholder'] ? $CONFIG['skin_path'] . $attrib['placeholder'] : 'program/blank.gif';
536    unset($attrib['placeholder']);
537   
538    if ($CONTACT_COLTYPES['photo']) {
539        $RCMAIL->output->set_env('photo_placeholder', $photo_img);
540       
541        if ($record['photo'])
542            $photo_img = $RCMAIL->url(array('_action' => 'photo', '_cid' => $record['ID'], '_source' => $_REQUEST['_source']));
543        $img = html::img(array('src' => $photo_img, 'border' => 1, 'alt' => ''));
544        $content = html::div($attrib, $img);
545     
546        if ($RCMAIL->action == 'edit' || $RCMAIL->action == 'add') {
547            $RCMAIL->output->add_gui_object('contactphoto', $attrib['id']);
548            $hidden = new html_hiddenfield(array('name' => '_photo', 'id' => 'ff_photo'));
549            $content .= $hidden->show();
550        }
551  }
552 
553  return $content;
554}
555
556
557function rcmail_format_date_col($val)
558{
559    global $RCMAIL;
560    return format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d'));
561}
562
563
564// register UI objects
565$OUTPUT->add_handlers(array(
566    'directorylist' => 'rcmail_directory_list',
567//  'groupslist' => 'rcmail_contact_groups',
568    'addresslist' => 'rcmail_contacts_list',
569    'addressframe' => 'rcmail_contact_frame',
570    'recordscountdisplay' => 'rcmail_rowcount_display',
571    'searchform' => array($OUTPUT, 'search_form')
572));
573
574// register action aliases
575$RCMAIL->register_action_map(array(
576    'add' => 'edit.inc',
577    'photo' => 'show.inc',
578    'upload-photo' => 'save.inc',
579    'group-create' => 'groups.inc',
580    'group-rename' => 'groups.inc',
581    'group-delete' => 'groups.inc',
582    'group-addmembers' => 'groups.inc',
583    'group-delmembers' => 'groups.inc',
584));
Note: See TracBrowser for help on using the repository browser.