aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-06 03:10:25 -0700
committerfriendica <info@friendica.com>2013-09-06 03:10:25 -0700
commit63c60b224c70ee9d09b8eb73bd11c44ca4a259fd (patch)
treea5101fd37914d833f5083ab16b03b5b6bc530d12 /mod
parentae624e9bce6fc3bb14ab6b6f8dcb88f2a082f086 (diff)
downloadvolse-hubzilla-63c60b224c70ee9d09b8eb73bd11c44ca4a259fd.tar.gz
volse-hubzilla-63c60b224c70ee9d09b8eb73bd11c44ca4a259fd.tar.bz2
volse-hubzilla-63c60b224c70ee9d09b8eb73bd11c44ca4a259fd.zip
provide mimetype selector on edit (pages and blocks)
Diffstat (limited to 'mod')
-rw-r--r--mod/editblock.php15
-rw-r--r--mod/editwebpage.php7
-rw-r--r--mod/item.php3
3 files changed, 22 insertions, 3 deletions
diff --git a/mod/editblock.php b/mod/editblock.php
index 25ae8d8b6..256bd1607 100644
--- a/mod/editblock.php
+++ b/mod/editblock.php
@@ -65,6 +65,20 @@ function editblock_content(&$a) {
if(feature_enabled(local_user(),'richtext'))
$plaintext = false;
+ $mimeselect = '';
+
+ if($mimetype != 'text/bbcode')
+ $plaintext = true;
+
+ if(get_config('system','page_mimetype'))
+ $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />';
+ else
+ $mimeselect = mimetype_select($item[0]['uid'],$mimetype);
+
+
+
+
+
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit block')
));
@@ -110,6 +124,7 @@ function editblock_content(&$a) {
'$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
'$ptyp' => $itm[0]['type'],
+ '$mimeselect' => $mimeselect,
'$content' => undo_post_tagging($itm[0]['body']),
'$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(),
diff --git a/mod/editwebpage.php b/mod/editwebpage.php
index 6ce5a9493..66137c474 100644
--- a/mod/editwebpage.php
+++ b/mod/editwebpage.php
@@ -71,8 +71,11 @@ function editwebpage_content(&$a) {
if($mimetype != 'text/bbcode')
$plaintext = true;
- $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />';
-
+
+ if(get_config('system','page_mimetype'))
+ $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />';
+ else
+ $mimeselect = mimetype_select($item[0]['uid'],$mimetype);
$layout = get_config('system','page_layout');
if($layout)
diff --git a/mod/item.php b/mod/item.php
index dc00efd35..3069bfa4d 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -627,9 +627,10 @@ function item_post(&$a) {
if($orig_post) {
- $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `attach` = '%s', `edited` = '%s', layout_mid = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `mimetype` = '%s', `attach` = '%s', `edited` = '%s', layout_mid = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($datarray['title']),
dbesc($datarray['body']),
+ dbesc($datarray['mimetype']),
dbesc($datarray['attach']),
dbesc(datetime_convert()),
dbesc($layout_mid),