diff options
author | friendica <info@friendica.com> | 2015-04-29 21:49:43 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-04-29 21:49:43 -0700 |
commit | c4221f32738dac51f691d5be1bebd2b50318521e (patch) | |
tree | e353242b42ca2942d7fe6d29888568c8bfe821ee /mod | |
parent | 6679734135fb04f4a7beccb81663bf1e9574f062 (diff) | |
parent | 2376d2140ab6eeb8a44d7582a52978520844e229 (diff) | |
download | volse-hubzilla-c4221f32738dac51f691d5be1bebd2b50318521e.tar.gz volse-hubzilla-c4221f32738dac51f691d5be1bebd2b50318521e.tar.bz2 volse-hubzilla-c4221f32738dac51f691d5be1bebd2b50318521e.zip |
Merge branch 'master' into tres
Conflicts:
include/notifier.php
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blocks.php | 8 | ||||
-rw-r--r-- | mod/branchtopic.php | 42 | ||||
-rw-r--r-- | mod/editlayout.php | 30 | ||||
-rw-r--r-- | mod/editwebpage.php | 2 | ||||
-rw-r--r-- | mod/impel.php | 2 | ||||
-rw-r--r-- | mod/layouts.php | 49 | ||||
-rw-r--r-- | mod/manage.php | 8 | ||||
-rw-r--r-- | mod/webpages.php | 4 |
8 files changed, 91 insertions, 54 deletions
diff --git a/mod/blocks.php b/mod/blocks.php index f609164e0..56da9caf7 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -95,6 +95,7 @@ function blocks_content(&$a) { 'ptlabel' => t('Block Name'), 'profile_uid' => intval($owner), 'expanded' => true, + 'novoting' => true ); if($_REQUEST['title']) @@ -106,7 +107,7 @@ function blocks_content(&$a) { $editor = status_editor($a,$x); - $r = q("select * from item_id left join item on item_id.iid = item.id + $r = q("select iid, sid, mid, title, body, mimetype, created, edited 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) ); @@ -118,6 +119,7 @@ function blocks_content(&$a) { foreach($r as $rr) { $element_arr = array( 'type' => 'block', + 'title' => $rr['title'], 'body' => $rr['body'], 'created' => $rr['created'], 'edited' => $rr['edited'], @@ -127,7 +129,8 @@ function blocks_content(&$a) { ); $pages[$rr['iid']][] = array( 'url' => $rr['iid'], - 'title' => $rr['sid'], + 'name' => $rr['sid'], + 'title' => $rr['title'], 'created' => $rr['created'], 'edited' => $rr['edited'], 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' @@ -142,6 +145,7 @@ function blocks_content(&$a) { '$baseurl' => $url, '$title' => t('Blocks'), '$name' => t('Block Name'), + '$blocktitle' => t('Block Title'), '$created' => t('Created'), '$edited' => t('Edited'), '$create' => t('Create'), diff --git a/mod/branchtopic.php b/mod/branchtopic.php new file mode 100644 index 000000000..609cb19ec --- /dev/null +++ b/mod/branchtopic.php @@ -0,0 +1,42 @@ +<?php + +function branchtopic_init(&$a) { + + if(! local_channel()) + return; + + $item_id = 0; + + if(argc() > 1) + $item_id = intval(argv(1)); + + if(! $item_id) + return; + + $channel = $a->get_channel(); + + if(! $channel) + return; + + + $r = q("select * from item where id = %d and uid = %d and owner_xchan = '%s' and id != parent limit 1", + intval($item_id), + intval(local_channel()), + dbesc($channel['channel_hash']) + ); + + if(! $r) + return; + + $p = q("select * from item where id = %d and uid = %d limit 1", + intval($r[0]['parent']), + intval(local_channel()) + ); + + $x = q("update item set parent = id, route = '', item_flags = (item_flags | %d) where id = %d", + intval(ITEM_THREAD_TOP), + intval($item_id) + ); + + return; +} diff --git a/mod/editlayout.php b/mod/editlayout.php index 11bcc10eb..a3879a381 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -23,7 +23,6 @@ function editlayout_init(&$a) { function editlayout_content(&$a) { - if(! $a->profile) { notice( t('Requested profile is not available.') . EOL ); $a->error = 404; @@ -69,7 +68,6 @@ function editlayout_content(&$a) { $o = ''; - // Figure out which post we're editing $post_id = ((argc() > 2) ? intval(argv(2)) : 0); @@ -105,7 +103,9 @@ function editlayout_content(&$a) { $plaintext = true; $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( - '$title' => t('Edit Layout') + '$title' => t('Edit Layout'), + '$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false), + '$id' => $itm[0]['id'] )); $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( @@ -161,8 +161,9 @@ function editlayout_content(&$a) { '$public' => t('Public post'), '$jotnets' => $jotnets, '$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), - '$placeholdertitle' => t('Title (optional)'), + '$placeholdertitle' => t('Layout Description (Optional)'), '$pagetitle' => $layout_title, + '$placeholdpagetitle' => t('Layout Name'), '$category' => '', '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), @@ -176,27 +177,6 @@ function editlayout_content(&$a) { '$feature_expire' => false, '$expires' => t('Set expiration date'), )); - - - if(($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) - $o .= '<br /><br /><a class="layout-delete-link" href="item/drop/' . $itm[0]['id'] . '" >' . t('Delete Layout') . '</a><br />'; - - - $x = array( - 'type' => 'layout', - 'title' => $itm[0]['title'], - 'body' => $itm[0]['body'], - 'term' => $itm[0]['term'], - 'created' => $itm[0]['created'], - 'edited' => $itm[0]['edited'], - 'mimetype' => $itm[0]['mimetype'], - 'pagetitle' => $page_title, - 'mid' => $itm[0]['mid'] - ); - - $o .= EOL . EOL . t('Share') . EOL . '<textarea onclick="this.select();" class="shareable_element_text" >[element]' . base64url_encode(json_encode($x)) . '[/element]</textarea>' . EOL . EOL; - - return $o; diff --git a/mod/editwebpage.php b/mod/editwebpage.php index fb0d87d4a..3b0b543a6 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -188,7 +188,7 @@ function editwebpage_content(&$a) { '$video' => t('Insert Vorbis [.ogg] video'), '$audio' => t('Insert Vorbis [.ogg] audio'), '$setloc' => t('Set your location'), - '$noloc' => t('Clear browser location'), + '$noloc' => ((get_pconfig($uid, 'system', 'use_browser_location')) ? t('Clear browser location') : ''), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$ptyp' => $itm[0]['type'], diff --git a/mod/impel.php b/mod/impel.php index 4fb9e3ac0..930158589 100644 --- a/mod/impel.php +++ b/mod/impel.php @@ -118,4 +118,4 @@ function impel_init(&$a) { json_return_and_die(true); -}
\ No newline at end of file +} diff --git a/mod/layouts.php b/mod/layouts.php index b2be39802..b42debe18 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -88,6 +88,9 @@ function layouts_content(&$a) { return; } + //This feature is not exposed in redbasic ui since it is not clear why one would want to + //download a json encoded pdl file - we dont have a possibility to import it. + //Use the buildin share/install feature instead. if((argc() > 3) && (argv(2) === 'share') && (argv(3))) { $r = q("select sid, service, mimetype, title, body from item_id left join item on item.id = item_id.iid @@ -103,18 +106,6 @@ function layouts_content(&$a) { } } - $tabs = array( - array( - 'label' => t('Layout Help'), - 'url' => 'help/Comanche', - 'sel' => '', - 'title' => t('Help with this feature'), - 'id' => 'layout-help-tab', - )); - - //$o .= replace_macros(get_markup_template('common_tabs.tpl'),array('$tabs' => $tabs)); - - // 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. @@ -123,15 +114,15 @@ function layouts_content(&$a) { 'webpage' => ITEM_TYPE_PDL, 'is_owner' => true, 'nickname' => $a->profile['channel_address'], - //do we need that at this place? - //'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => '', 'showacl' => false, 'visitor' => false, 'nopreview' => 1, 'ptlabel' => t('Layout Name'), 'profile_uid' => intval($owner), - 'expanded' => true + 'expanded' => true, + 'placeholdertitle' => t('Layout Description (Optional)'), + 'novoting' => true ); if($_REQUEST['title']) @@ -141,11 +132,10 @@ function layouts_content(&$a) { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; - $editor = status_editor($a,$x); - $r = q("select iid, sid, mid from item_id left join item on item.id = item_id.iid - where item_id.uid = %d and service = 'PDL' order by sid asc", + $r = q("select iid, sid, mid, title, body, mimetype, created, edited from item_id left join item on item_id.iid = item.id + where item_id.uid = %d and service = 'PDL' order by item.created desc", intval($owner) ); @@ -154,10 +144,24 @@ function layouts_content(&$a) { if($r) { $pages = array(); foreach($r as $rr) { + $element_arr = array( + 'type' => 'layout', + 'title' => $rr['title'], + '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'], - 'mid' => $rr['mid'] + 'title' => $rr['sid'], + 'descr' => $rr['title'], + 'mid' => $rr['mid'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' ); } } @@ -171,8 +175,13 @@ function layouts_content(&$a) { '$help' => array('text' => t('Help'), 'url' => 'help/Comanche', 'title' => t('Comanche page description language help')), '$editor' => $editor, '$baseurl' => $url, + '$name' => t('Layout Name'), + '$descr' => t('Layout Description'), + '$created' => t('Created'), + '$edited' => t('Edited'), '$edit' => t('Edit'), '$share' => t('Share'), + '$download' => t('Download PDL file'), '$pages' => $pages, '$channel' => $which, '$view' => t('View'), diff --git a/mod/manage.php b/mod/manage.php index aa356abad..bb6c010f6 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -148,14 +148,16 @@ function manage_content(&$a) { intval(local_channel()), intval(PERMS_A_DELEGATE) ); - if(! $delegates) - $delegates = null; if($delegates) { for($x = 0; $x < count($delegates); $x ++) { - $delegates[$x]['link'] = 'magic?f=&dest=' . urlencode($delegates[$x]['xchan_url']) . '&delegate=' . urlencode($delegates[$x]['xchan_addr']); + $delegates[$x]['link'] = 'magic?f=&dest=' . urlencode($delegates[$x]['xchan_url']) + . '&delegate=' . urlencode($delegates[$x]['xchan_addr']); } } + else { + $delegates = null; + } diff --git a/mod/webpages.php b/mod/webpages.php index 7dead3371..e04cbdc11 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -113,7 +113,8 @@ function webpages_content(&$a) { 'profile_uid' => intval($owner), 'mimetype' => $mimetype, 'layout' => $layout, - 'expanded' => true + 'expanded' => true, + 'novoting' => true ); if($_REQUEST['title']) @@ -149,7 +150,6 @@ function webpages_content(&$a) { 'type' => 'webpage', 'title' => $rr['title'], 'body' => $rr['body'], - 'term' => $rr['term'], 'created' => $rr['created'], 'edited' => $rr['edited'], 'mimetype' => $rr['mimetype'], |