| | |
| | | $jsdata = array(); |
| | | |
| | | $line_templ = html::tag('li', array( |
| | | 'id' => 'rcmli%s', 'class' => 'addressbook %s'), |
| | | 'id' => 'rcmli%s', 'class' => '%s'), |
| | | html::a(array('href' => '%s', |
| | | 'rel' => '%s', |
| | | 'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s')); |
| | |
| | | foreach ($sources as $j => $source) { |
| | | $id = strval($source['id'] ? $source['id'] : $j); |
| | | $js_id = JQ($id); |
| | | |
| | | // set class name(s) |
| | | $class_name = 'addressbook'; |
| | | if ($current === $id) |
| | | $class_name .= ' selected'; |
| | | if ($source['readonly']) |
| | | $class_name .= ' readonly'; |
| | | if ($source['class_name']) |
| | | $class_name .= ' ' . $source['class_name']; |
| | | |
| | | $out .= sprintf($line_templ, |
| | | html_identifier($id), |
| | | ($current === $id ? 'selected' : ''), |
| | | $class_name, |
| | | Q(rcmail_url(null, array('_source' => $id))), |
| | | $source['id'], |
| | | $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id))); |
| | |
| | | |
| | | function rcmail_contact_photo($attrib) |
| | | { |
| | | global $CONTACTS, $CONTACT_COLTYPES, $RCMAIL, $CONFIG; |
| | | global $SOURCE_ID, $CONTACTS, $CONTACT_COLTYPES, $RCMAIL, $CONFIG; |
| | | |
| | | if (!$CONTACT_COLTYPES['photo']) |
| | | return ''; |
| | |
| | | if (strpos($record['photo'], 'http:') === 0) |
| | | $photo_img = $record['photo']; |
| | | else if ($record['photo']) |
| | | $photo_img = $RCMAIL->url(array('_action' => 'photo', '_cid' => $record['ID'], '_source' => $_REQUEST['_source'])); |
| | | $photo_img = $RCMAIL->url(array('_action' => 'photo', '_cid' => $record['ID'], '_source' => $SOURCE_ID)); |
| | | else |
| | | $ff_value = '-del-'; // will disable delete-photo action |
| | | |
| | |
| | | // containing contact ID and source name in form: <ID>-<SOURCE> |
| | | |
| | | $cid = get_input_value('_cid', RCUBE_INPUT_GPC); |
| | | $source = get_input_value('_source', RCUBE_INPUT_GPC); |
| | | $source = (string) get_input_value('_source', RCUBE_INPUT_GPC); |
| | | |
| | | if (!preg_match('/^[a-zA-Z0-9\+\/=_-]+(,[a-zA-Z0-9\+\/=_-]+)*$/', $cid)) { |
| | | return array(); |
| | |
| | | if (!$got_source) { |
| | | list ($c, $s) = explode('-', $id, 2); |
| | | if (strlen($s)) { |
| | | $result[$s][] = $c; |
| | | } |
| | | else if (strlen($source)) { |
| | | $result[$source][] = $c; |
| | | $result[(string)$s][] = $c; |
| | | } |
| | | } |
| | | else { |