From 61d9b34929adc831eb780fd3410660eb98c114a9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 19 Sep 2017 23:30:52 -0700 Subject: use mimetype text description rather than technical name in dropdown choices, found bug in mimetype selection option code --- Zotlabs/Widget/Wiki_pages.php | 3 ++- include/text.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Zotlabs/Widget/Wiki_pages.php b/Zotlabs/Widget/Wiki_pages.php index f98081da0..b4928ede5 100644 --- a/Zotlabs/Widget/Wiki_pages.php +++ b/Zotlabs/Widget/Wiki_pages.php @@ -53,7 +53,8 @@ class Wiki_pages { '$addnew' => t('Add new page'), '$typelock' => $typelock, '$lockedtype' => $w['mimeType'], - '$mimetype' => mimetype_select(0,$w['mimeType'], [ 'text/markdown','text/bbcode', 'text/plain' ]), + '$mimetype' => mimetype_select(0,$w['mimeType'], + [ 'text/markdown' => t('Markdown'), 'text/bbcode' => t('BBcode'), 'text/plain' => t('Text') ]), '$pageName' => array('pageName', t('Page name')), '$refresh' => $arr['refresh'] )); diff --git a/include/text.php b/include/text.php index c4d441e85..49cc2d6c5 100644 --- a/include/text.php +++ b/include/text.php @@ -1789,21 +1789,21 @@ function layout_select($channel_id, $current = '') { function mimetype_select($channel_id, $current = 'text/bbcode', $choices = null, $element = 'mimetype') { $x = (($choices) ? $choices : [ - 'text/bbcode', - 'text/html', - 'text/markdown', - 'text/plain', - 'application/x-pdl' + 'text/bbcode' => t('BBcode'), + 'text/html' => t('HTML'), + 'text/markdown' => t('Markdown'), + 'text/plain' => t('Text'), + 'application/x-pdl' => t('Comanche Layout') ]); if((App::$is_sys) || (channel_codeallowed($channel_id) && $channel_id == local_channel())){ - $x[] = 'application/x-php'; + $x['application/x-php'] = t('PHP'); } - foreach($x as $y) { + foreach($x as $y => $z) { $selected = (($y == $current) ? ' selected="selected" ' : ''); - $options .= ''; + $options .= ''; } $o = replace_macros(get_markup_template('field_select_raw.tpl'), array( -- cgit v1.2.3