diff options
author | friendica <info@friendica.com> | 2015-04-23 19:49:41 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-04-23 19:49:41 -0700 |
commit | 6679734135fb04f4a7beccb81663bf1e9574f062 (patch) | |
tree | 887488543d98b5dd297d917718bdd99844e83ba5 /mod/blocks.php | |
parent | 08b757a22cd2804bfec8ecf682b6987b8c06ca49 (diff) | |
parent | c696860cc53bc25558d83de5eda65d9b583da382 (diff) | |
download | volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.gz volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.bz2 volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.zip |
Merge branch 'master' into tres
Conflicts:
include/Contact.php
include/ItemObject.php
include/api.php
include/attach.php
include/diaspora.php
include/dir_fns.php
include/enotify.php
include/event.php
include/expire.php
include/items.php
include/notifier.php
include/notify.php
include/photos.php
include/taxonomy.php
include/text.php
include/widgets.php
include/zot.php
mod/admin.php
mod/channel.php
mod/dirsearch.php
mod/display.php
mod/editwebpage.php
mod/events.php
mod/home.php
mod/item.php
mod/manage.php
mod/mood.php
mod/network.php
mod/page.php
mod/photos.php
mod/ping.php
mod/post.php
mod/thing.php
mod/viewsrc.php
view/css/mod_events.css
Diffstat (limited to 'mod/blocks.php')
-rw-r--r-- | mod/blocks.php | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/mod/blocks.php b/mod/blocks.php index f755f92b0..f609164e0 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -33,6 +33,8 @@ function blocks_content(&$a) { $which = argv(1); + $_SESSION['return_url'] = $a->query_string; + $uid = local_channel(); $owner = 0; $channel = null; @@ -68,7 +70,6 @@ function blocks_content(&$a) { return; } - // Block design features from visitors if((! $uid) || ($uid != $owner)) { @@ -76,17 +77,12 @@ function blocks_content(&$a) { return; } + $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); - if(feature_enabled($owner,'expert')) { - $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); - if(! $mimetype) - $mimetype = 'choose'; - } - else { - $mimetype = 'text/bbcode'; + if(! $mimetype) { + $mimetype = 'choose'; } - $x = array( 'webpage' => ITEM_BUILDBLOCK, 'is_owner' => true, @@ -98,6 +94,7 @@ function blocks_content(&$a) { 'mimetype' => $mimetype, 'ptlabel' => t('Block Name'), 'profile_uid' => intval($owner), + 'expanded' => true, ); if($_REQUEST['title']) @@ -107,11 +104,10 @@ function blocks_content(&$a) { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; + $editor = status_editor($a,$x); - - $o .= status_editor($a,$x); - - $r = q("select * from item_id where uid = %d and service = 'BUILDBLOCK' order by sid asc", + $r = q("select * from item_id left join item on item_id.iid = item.id + where item_id.uid = %d and service = 'BUILDBLOCK' order by item.created desc", intval($owner) ); @@ -120,7 +116,22 @@ function blocks_content(&$a) { if($r) { $pages = array(); foreach($r as $rr) { - $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid']); + $element_arr = array( + 'type' => 'block', + 'body' => $rr['body'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'mimetype' => $rr['mimetype'], + 'pagetitle' => $rr['sid'], + 'mid' => $rr['mid'] + ); + $pages[$rr['iid']][] = array( + 'url' => $rr['iid'], + 'title' => $rr['sid'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' + ); } } @@ -129,7 +140,15 @@ function blocks_content(&$a) { $o .= replace_macros(get_markup_template('blocklist.tpl'), array( '$baseurl' => $url, + '$title' => t('Blocks'), + '$name' => t('Block Name'), + '$created' => t('Created'), + '$edited' => t('Edited'), + '$create' => t('Create'), '$edit' => t('Edit'), + '$share' => t('Share'), + '$delete' => t('Delete'), + '$editor' => $editor, '$pages' => $pages, '$channel' => $which, '$view' => t('View'), |