diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-19 16:31:35 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-10-19 16:31:35 -0700 |
commit | c79c1b391331ab7c8c0f01265a627ffae23d54e2 (patch) | |
tree | 66d988e77e1af2b8695a9726a76fc7d5743a69a6 /include | |
parent | 716a83d1f77e2d6f26b25ab03ffe130c11ef7feb (diff) | |
parent | b926a4c67e4d7dcba01df91dddcc047abde246bb (diff) | |
download | volse-hubzilla-c79c1b391331ab7c8c0f01265a627ffae23d54e2.tar.gz volse-hubzilla-c79c1b391331ab7c8c0f01265a627ffae23d54e2.tar.bz2 volse-hubzilla-c79c1b391331ab7c8c0f01265a627ffae23d54e2.zip |
Merge branch 'dev' into pdo
Diffstat (limited to 'include')
-rw-r--r-- | include/acl_selectors.php | 30 | ||||
-rw-r--r-- | include/conversation.php | 2 | ||||
-rw-r--r-- | include/zot.php | 2 |
3 files changed, 30 insertions, 4 deletions
diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 80d1f1216..dcf0fe9a2 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -152,13 +152,36 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti array_walk($deny_gid,'fixacl'); } + + $channel = ((local_channel()) ? \App::get_channel() : ''); + $has_acl = false; + $single_group = false; + $just_me = false; + $custom = false; + + if($allow_cid || $allow_gid || $deny_gid || $deny_cid) { + $has_acl = true; + $custom = true; + } + + if(count($allow_gid) === 1 && (! $allow_cid) && (! $deny_gid) && (! $deny_cid)) { + $single_group = true; + $custom = false; + } + + if(count($allow_cid) === 1 && $channel && $allow_cid[0] = $channel['channel_hash'] && (! $allow_gid) && (! $deny_gid) && (! $deny_cid)) { + $just_me = true; + $custom = false; + } + $r = q("SELECT id, hash, gname FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) ); if($r) { foreach($r as $rr) { - $groups .= '<option id="' . $rr['id'] . '" value="' . $rr['hash'] . '">' . $rr['gname'] . '</option>' . "\r\n"; + $selected = (($single_group && $rr['hash'] === $allow_gid[0]) ? ' selected = "selected" ' : ''); + $groups .= '<option id="' . $rr['id'] . '" value="' . $rr['hash'] . '"' . $selected . '>' . $rr['gname'] . '</option>' . "\r\n"; } } @@ -166,7 +189,10 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti $o = replace_macros($tpl, array( '$showall' => $showall_caption, '$onlyme' => t('Only me'), - '$groups' => $groups, + '$groups' => $groups, + '$public_selected' => (($has_acl) ? false : true), + '$justme_selected' => $just_me, + '$custom_selected' => $custom, '$showallOrigin' => $showall_origin, '$showallIcon' => $showall_icon, '$select_label' => t('Who can see this?'), diff --git a/include/conversation.php b/include/conversation.php index 7239e603b..bc8f8ce8b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -146,7 +146,7 @@ function localize_item(&$item){ case ACTIVITY_OBJ_NOTE: default: $post_type = t('status'); - if($obj['mid'] != $obj['parent_mid']) + if($obj['id'] != $obj['parent']) $post_type = t('comment'); break; } diff --git a/include/zot.php b/include/zot.php index 838ac44c6..6b225912d 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2583,7 +2583,7 @@ function import_directory_profile($hash, $profile, $addr, $ud_flags = UPDATE_FLA $arr = array(); $arr['xprof_hash'] = $hash; - $arr['xprof_dob'] = datetime_convert('','',$profile['birthday'],'Y-m-d'); // !!!! check this for 0000 year + $arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')); // !!!! check this for 0000 year $arr['xprof_age'] = (($profile['age']) ? intval($profile['age']) : 0); $arr['xprof_desc'] = (($profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : ''); $arr['xprof_gender'] = (($profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : ''); |