aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/conversation.php16
-rwxr-xr-xinclude/text.php5
-rw-r--r--mod/webpages.php7
3 files changed, 19 insertions, 9 deletions
diff --git a/include/conversation.php b/include/conversation.php
index a357e1480..c40691bba 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1013,11 +1013,17 @@ function status_editor($a,$x,$popup=false) {
if(feature_enabled(local_user(),'richtext'))
$plaintext = false;
- if(intval($x['plaintext']))
- $plaintext = true;
-
- if(intval($x['mimeselect']))
- $mimeselect = mimetype_select($x['profile_uid']);
+ $mimeselct = '';
+ if(array_key_exists('mimetype',$x) && $x['mimetype']) {
+ if($x['mimetype'] != 'text/bbcode')
+ $plaintext = true;
+ if($x['mimetype'] === 'choose') {
+ $mimeselect = mimetype_select($x['profile_uid']);
+ }
+ else
+ $mimeselect = '<input name="mimetype" value="' . $x['mimetype'] . '" />';
+ }
+
$tpl = get_markup_template('jot-header.tpl');
diff --git a/include/text.php b/include/text.php
index 606ef421c..71374f1f9 100755
--- a/include/text.php
+++ b/include/text.php
@@ -1329,14 +1329,15 @@ function mimetype_select($channel_id, $current = 'text/bbcode') {
'text/plain'
);
- $r = q("select account_flags from account left join channel on account_id = channel_account_id where
+ $r = q("select account_id, account_roles from account left join channel on account_id = channel_account_id where
channel_id = %d limit 1",
intval($channel_id)
);
if($r) {
if($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) {
- $x[] = 'application/x-php';
+ if(local_user() && get_account_id() == $r[0]['account_id'])
+ $x[] = 'application/x-php';
}
}
diff --git a/mod/webpages.php b/mod/webpages.php
index 081297eb9..559b176fc 100644
--- a/mod/webpages.php
+++ b/mod/webpages.php
@@ -41,6 +41,10 @@ function webpages_content(&$a) {
return;
}
+ $mimetype = get_config('system','page_mimetype');
+ if(! $mimetype)
+ $mimetype = 'choose';
+
// Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages
// Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels.
require_once ('include/conversation.php');
@@ -52,8 +56,7 @@ require_once ('include/conversation.php');
'bang' => (($group || $cid) ? '!' : ''),
'visitor' => 'block',
'profile_uid' => intval($owner),
- 'plaintext' => 1,
- 'mimeselect' => 1,
+ 'mimetype' => $mimetype,
);
$o .= status_editor($a,$x);