| | |
| | | $RCMAIL->session->remove('contact_undo'); |
| | | } |
| | | |
| | | // register UI objects |
| | | $OUTPUT->add_handlers(array( |
| | | 'directorylist' => 'rcmail_directory_list', |
| | | // 'groupslist' => 'rcmail_contact_groups', |
| | | 'addresslist' => 'rcmail_contacts_list', |
| | | 'addresslisttitle' => 'rcmail_contacts_list_title', |
| | | 'addressframe' => 'rcmail_contact_frame', |
| | | 'recordscountdisplay' => 'rcmail_rowcount_display', |
| | | 'searchform' => array($OUTPUT, 'search_form') |
| | | )); |
| | | |
| | | // register action aliases |
| | | $RCMAIL->register_action_map(array( |
| | | 'add' => 'edit.inc', |
| | | 'group-create' => 'groups.inc', |
| | | 'group-rename' => 'groups.inc', |
| | | 'group-delete' => 'groups.inc', |
| | | 'group-addmembers' => 'groups.inc', |
| | | 'group-delmembers' => 'groups.inc', |
| | | 'search-create' => 'search.inc', |
| | | 'search-delete' => 'search.inc', |
| | | )); |
| | | |
| | | |
| | | |
| | | // instantiate a contacts object according to the given source |
| | | function rcmail_contact_source($source=null, $init_env=false, $writable=false) |
| | | { |
| | |
| | | return $CONTACTS; |
| | | |
| | | $OUTPUT->set_env('readonly', $CONTACTS->readonly); |
| | | $OUTPUT->set_env('source', $source); |
| | | $OUTPUT->set_env('source', (string) $source); |
| | | |
| | | // reduce/extend $CONTACT_COLTYPES with specification from the current $CONTACT object |
| | | if (is_array($CONTACTS->coltypes)) { |
| | |
| | | ), '»'); |
| | | } |
| | | else |
| | | $val = ' '; |
| | | $val = ''; |
| | | break; |
| | | |
| | | default: |
| | |
| | | unset($attrib['name']); |
| | | |
| | | $OUTPUT->add_gui_object('addresslist_title', $attrib['id']); |
| | | $OUTPUT->add_label('contacts'); |
| | | $OUTPUT->add_label('contacts','uponelevel'); |
| | | |
| | | return html::tag($attrib['tag'], $attrib, $RCMAIL->gettext($attrib['label']), html::$common_attrib); |
| | | } |
| | |
| | | foreach ($coltypes as $col => $prop) { |
| | | if ($prop['subtypes']) { |
| | | $subtype_names = array_map('rcmail_get_type_label', $prop['subtypes']); |
| | | $select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype')); |
| | | $select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype', 'title' => $prop['label'] . ' ' . $RCMAIL->gettext('type'))); |
| | | $select_subtype->add($subtype_names, $prop['subtypes']); |
| | | $coltypes[$col]['subtypes_select'] = $select_subtype->show(); |
| | | } |
| | |
| | | // prepare subtype selector in edit mode |
| | | if ($edit_mode && is_array($colprop['subtypes'])) { |
| | | $subtype_names = array_map('rcmail_get_type_label', $colprop['subtypes']); |
| | | $select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype')); |
| | | $select_subtype = new html_select(array('name' => '_subtype_'.$col.'[]', 'class' => 'contactselectsubtype', 'title' => $colprop['label'] . ' ' . $RCMAIL->gettext('type'))); |
| | | $select_subtype->add($subtype_names, $colprop['subtypes']); |
| | | } |
| | | else |
| | |
| | | foreach ($values as $i => $val) { |
| | | if ($subtypes[$i]) |
| | | $subtype = $subtypes[$i]; |
| | | |
| | | $colprop['id'] = 'ff_' . $col . intval($coltypes[$field]['count']); |
| | | |
| | | // render composite field |
| | | if ($colprop['type'] == 'composite') { |
| | |
| | | // display row with label |
| | | if ($label) { |
| | | $rows .= html::div('row', |
| | | html::div('contactfieldlabel label', $select_subtype ? $select_subtype->show($subtype) : rcube::Q($label)) . |
| | | html::div('contactfieldlabel label', $select_subtype ? $select_subtype->show($subtype) : html::label($colprop['id'], rcube::Q($label))) . |
| | | html::div('contactfieldcontent '.$colprop['type'], $val)); |
| | | } |
| | | else // row without label |
| | |
| | | else |
| | | $ff_value = '-del-'; // will disable delete-photo action |
| | | |
| | | $img = html::img(array('src' => $photo_img, 'border' => 1, 'alt' => '')); |
| | | $img = html::img(array('src' => $photo_img, 'border' => 1, 'alt' => $RCMAIL->gettext('contactphoto'))); |
| | | $content = html::div($attrib, $img); |
| | | |
| | | if ($CONTACT_COLTYPES['photo'] && ($RCMAIL->action == 'edit' || $RCMAIL->action == 'add')) { |
| | |
| | | |
| | | return $filter !== null ? $result[$filter] : $result; |
| | | } |
| | | |
| | | |
| | | // register UI objects |
| | | $OUTPUT->add_handlers(array( |
| | | 'directorylist' => 'rcmail_directory_list', |
| | | // 'groupslist' => 'rcmail_contact_groups', |
| | | 'addresslist' => 'rcmail_contacts_list', |
| | | 'addresslisttitle' => 'rcmail_contacts_list_title', |
| | | 'addressframe' => 'rcmail_contact_frame', |
| | | 'recordscountdisplay' => 'rcmail_rowcount_display', |
| | | 'searchform' => array($OUTPUT, 'search_form') |
| | | )); |
| | | |
| | | // register action aliases |
| | | $RCMAIL->register_action_map(array( |
| | | 'add' => 'edit.inc', |
| | | 'group-create' => 'groups.inc', |
| | | 'group-rename' => 'groups.inc', |
| | | 'group-delete' => 'groups.inc', |
| | | 'group-addmembers' => 'groups.inc', |
| | | 'group-delmembers' => 'groups.inc', |
| | | 'search-create' => 'search.inc', |
| | | 'search-delete' => 'search.inc', |
| | | )); |