make editblock use status_editor()
This commit is contained in:
parent
b08fc746d8
commit
75128e8f68
@ -82,11 +82,7 @@ class Blocks extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype'));
|
$mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype'));
|
||||||
|
|
||||||
if(! $mimetype) {
|
|
||||||
$mimetype = 'choose';
|
|
||||||
}
|
|
||||||
|
|
||||||
$x = array(
|
$x = array(
|
||||||
'webpage' => ITEM_TYPE_BLOCK,
|
'webpage' => ITEM_TYPE_BLOCK,
|
||||||
'is_owner' => true,
|
'is_owner' => true,
|
||||||
@ -96,6 +92,8 @@ class Blocks extends \Zotlabs\Web\Controller {
|
|||||||
'showacl' => false,
|
'showacl' => false,
|
||||||
'visitor' => true,
|
'visitor' => true,
|
||||||
'mimetype' => $mimetype,
|
'mimetype' => $mimetype,
|
||||||
|
'mimeselect' => true,
|
||||||
|
'hide_location' => true,
|
||||||
'ptlabel' => t('Block Name'),
|
'ptlabel' => t('Block Name'),
|
||||||
'profile_uid' => intval($owner),
|
'profile_uid' => intval($owner),
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
|
@ -3,6 +3,7 @@ namespace Zotlabs\Module;
|
|||||||
|
|
||||||
require_once('include/identity.php');
|
require_once('include/identity.php');
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
require_once('include/conversation.php');
|
||||||
|
|
||||||
class Editblock extends \Zotlabs\Web\Controller {
|
class Editblock extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
@ -95,81 +96,38 @@ class Editblock extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$plaintext = true;
|
|
||||||
|
|
||||||
$mimeselect = '';
|
|
||||||
$mimetype = $itm[0]['mimetype'];
|
$mimetype = $itm[0]['mimetype'];
|
||||||
|
|
||||||
if($mimetype != 'text/bbcode')
|
|
||||||
$plaintext = true;
|
|
||||||
|
|
||||||
if(get_config('system','page_mimetype'))
|
|
||||||
$mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />';
|
|
||||||
else
|
|
||||||
$mimeselect = mimetype_select($itm[0]['uid'],$mimetype);
|
|
||||||
|
|
||||||
\App::$page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array(
|
|
||||||
'$baseurl' => z_root(),
|
|
||||||
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
|
|
||||||
'$pretext' => '',
|
|
||||||
'$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
|
|
||||||
'$geotag' => '',
|
|
||||||
'$nickname' => $channel['channel_address'],
|
|
||||||
'$confirmdelete' => t('Delete block?'),
|
|
||||||
'$bbco_autocomplete'=> (($mimetype == 'text/bbcode') ? 'bbcode' : 'comanche-block')
|
|
||||||
));
|
|
||||||
|
|
||||||
$tpl = get_markup_template("jot.tpl");
|
|
||||||
|
|
||||||
$jotplugins = '';
|
|
||||||
$jotnets = '';
|
|
||||||
|
|
||||||
call_hooks('jot_tool', $jotplugins);
|
|
||||||
call_hooks('jot_networks', $jotnets);
|
|
||||||
|
|
||||||
$rp = 'blocks/' . $channel['channel_address'];
|
$rp = 'blocks/' . $channel['channel_address'];
|
||||||
|
|
||||||
$editor = replace_macros($tpl,array(
|
$x = array(
|
||||||
'$return_path' => $rp,
|
'nickname' => $channel['channel_address'],
|
||||||
'$action' => 'item',
|
'bbco_autocomplete'=> (($mimetype == 'text/bbcode') ? 'bbcode' : 'comanche-block'),
|
||||||
'$webpage' => ITEM_TYPE_BLOCK,
|
'return_path' => $rp,
|
||||||
'$share' => t('Edit'),
|
'webpage' => ITEM_TYPE_BLOCK,
|
||||||
'$bold' => t('Bold'),
|
'ptlabel' => t('Block Name'),
|
||||||
'$italic' => t('Italic'),
|
'button' => t('Edit'),
|
||||||
'$underline' => t('Underline'),
|
'writefiles' => (($mimetype == 'text/bbcode') ? perm_is_allowed($owner, get_observer_hash(), 'write_storage') : false),
|
||||||
'$quote' => t('Quote'),
|
'weblink' => (($mimetype == 'text/bbcode') ? t('Insert web link') : false),
|
||||||
'$code' => t('Code'),
|
'hide_voting' => true,
|
||||||
'$writefiles' => (($mimetype == 'text/bbcode') ? perm_is_allowed($owner, get_observer_hash(), 'write_storage') : false),
|
'hide_future' => true,
|
||||||
'$attach' => t('Attach file'),
|
'hide_location' => true,
|
||||||
'$weblink' => (($mimetype == 'text/bbcode') ? t('Insert web link') : false),
|
'hide_expire' => true,
|
||||||
'$setloc' => false,
|
'showacl' => false,
|
||||||
'$noloc' => false,
|
'ptyp' => $itm[0]['type'],
|
||||||
'$permset' => t('Permission settings'),
|
'mimeselect' => true,
|
||||||
'$ptyp' => $itm[0]['type'],
|
'mimetype' => $itm[0]['mimetype'],
|
||||||
'$mimeselect' => $mimeselect,
|
'body' => undo_post_tagging($itm[0]['body']),
|
||||||
'$content' => undo_post_tagging($itm[0]['body']),
|
'post_id' => $post_id,
|
||||||
'$post_id' => $post_id,
|
'visitor' => true,
|
||||||
'$baseurl' => z_root(),
|
'title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'),
|
||||||
'$defloc' => $channel['channel_location'],
|
'placeholdertitle' => t('Title (optional)'),
|
||||||
'$visitor' => true,
|
'pagetitle' => $block_title,
|
||||||
'$public' => t('Public post'),
|
'profile_uid' => (intval($channel['channel_id'])),
|
||||||
'$jotnets' => $jotnets,
|
'bbcode' => (($mimetype == 'text/bbcode') ? true : false)
|
||||||
'$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'),
|
);
|
||||||
'$placeholdertitle' => t('Title (optional)'),
|
|
||||||
'$pagetitle' => $block_title,
|
$editor = status_editor($a, $x);
|
||||||
'$category' => '',
|
|
||||||
'$placeholdercategory' => t('Categories (optional, comma-separated list)'),
|
|
||||||
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
|
|
||||||
'$lockstate' => $lockstate,
|
|
||||||
'$acl' => '',
|
|
||||||
'$bang' => '',
|
|
||||||
'$profile_uid' => (intval($channel['channel_id'])),
|
|
||||||
'$preview' => t('Preview'),
|
|
||||||
'$jotplugins' => $jotplugins,
|
|
||||||
'$sourceapp' => $itm[0]['app'],
|
|
||||||
'$defexpire' => '',
|
|
||||||
'$bbcode' => (($mimetype == 'text/bbcode') ? true : false)
|
|
||||||
));
|
|
||||||
|
|
||||||
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
|
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
|
||||||
'$title' => t('Edit Block'),
|
'$title' => t('Edit Block'),
|
||||||
|
@ -85,6 +85,7 @@ class Editpost extends \Zotlabs\Web\Controller {
|
|||||||
'hide_voting' => true,
|
'hide_voting' => true,
|
||||||
'hide_future' => true,
|
'hide_future' => true,
|
||||||
'hide_location' => true,
|
'hide_location' => true,
|
||||||
|
'mimetype' => $itm[0]['mimetype'],
|
||||||
'ptyp' => $itm[0]['obj_type'],
|
'ptyp' => $itm[0]['obj_type'],
|
||||||
'body' => undo_post_tagging($itm[0]['body']),
|
'body' => undo_post_tagging($itm[0]['body']),
|
||||||
'post_id' => $post_id,
|
'post_id' => $post_id,
|
||||||
|
@ -1138,25 +1138,22 @@ function status_editor($a, $x, $popup = false) {
|
|||||||
if(x($x, 'hide_location'))
|
if(x($x, 'hide_location'))
|
||||||
$geotag = $setloc = $clearloc = '';
|
$geotag = $setloc = $clearloc = '';
|
||||||
|
|
||||||
$weblink = t('Insert web link');
|
$mimetype = ((x($x,'mimetype')) ? $x['mimetype'] : 'text/bbcode');
|
||||||
if(x($x, 'hide_weblink'))
|
|
||||||
$weblink = '';
|
|
||||||
|
|
||||||
$writefiles = perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage');
|
$mimeselect = ((x($x,'mimeselect')) ? $x['mimeselect'] : false);
|
||||||
|
if($mimeselect)
|
||||||
|
$mimeselect = mimetype_select($x['profile_uid'], $mimetype);
|
||||||
|
else
|
||||||
|
$mimeselect = '<input type="hidden" name="mimetype" value="' . $x['mimetype'] . '" />';
|
||||||
|
|
||||||
|
$weblink = (($mimetype === 'text/bbcode') ? t('Insert web link') : false);
|
||||||
|
if(x($x, 'hide_weblink'))
|
||||||
|
$weblink = false;
|
||||||
|
|
||||||
|
$writefiles = (($mimetype === 'text/bbcode') ? perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage') : false);
|
||||||
if(x($x, 'hide_attach'))
|
if(x($x, 'hide_attach'))
|
||||||
$writefiles = false;
|
$writefiles = false;
|
||||||
|
|
||||||
$mimeselect = '';
|
|
||||||
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 type="hidden" name="mimetype" value="' . $x['mimetype'] . '" />';
|
|
||||||
}
|
|
||||||
|
|
||||||
$layoutselect = '';
|
$layoutselect = '';
|
||||||
if(array_key_exists('layout', $x) && $x['layout']) {
|
if(array_key_exists('layout', $x) && $x['layout']) {
|
||||||
if($x['layout'] === 'choose') {
|
if($x['layout'] === 'choose') {
|
||||||
|
Reference in New Issue
Block a user