aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php9
-rw-r--r--include/identity.php21
2 files changed, 30 insertions, 0 deletions
diff --git a/include/conversation.php b/include/conversation.php
index af41e8fa7..880639bf4 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1052,6 +1052,13 @@ function status_editor($a,$x,$popup=false) {
}
+ if(array_key_exists('channel_select',$x) && $x['channel_select']) {
+ require_once('include/identity.php');
+ $id_select = identity_selector();
+ }
+ else
+ $id_select = '';
+
$webpage = ((x($x,'webpage')) ? $x['webpage'] : '');
@@ -1098,6 +1105,8 @@ function status_editor($a,$x,$popup=false) {
'$webpage' => $webpage,
'$placeholdpagetitle' => ((x($x,'ptlabel')) ? $x['ptlabel'] : t('Page link title')),
'$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''),
+ '$id_select' => $id_select,
+ '$id_seltext' => t('Post as'),
'$upload' => t('Upload photo'),
'$shortupload' => t('upload photo'),
'$attach' => t('Attach file'),
diff --git a/include/identity.php b/include/identity.php
index d15f3861e..e773bb314 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1257,3 +1257,24 @@ function get_channel_by_nick($nick) {
return(($r) ? $r[0] : false);
}
+
+
+function identity_selector() {
+ if(local_user()) {
+ $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel.channel_account_id = %d and not ( channel_pageflags & %d ) order by channel_name ",
+ intval(get_account_id()),
+ intval(PAGE_REMOVED)
+ );
+ if(count($r) > 1) {
+ $selected_channel = null;
+ $account = get_app()->get_account();
+ $o = replace_macros(get_markup_template('channel_id_select.tpl'),array(
+ '$channels' => $r,
+ '$selected' => local_user()
+ ));
+ return $o;
+ }
+ }
+
+ return '';
+} \ No newline at end of file