aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Card_edit.php2
-rw-r--r--Zotlabs/Module/Cards.php2
-rw-r--r--Zotlabs/Module/Item.php21
-rw-r--r--include/conversation.php11
-rwxr-xr-xinclude/items.php2
-rwxr-xr-xview/tpl/jot.tpl2
6 files changed, 31 insertions, 9 deletions
diff --git a/Zotlabs/Module/Card_edit.php b/Zotlabs/Module/Card_edit.php
index b5b44c567..6927c0b6f 100644
--- a/Zotlabs/Module/Card_edit.php
+++ b/Zotlabs/Module/Card_edit.php
@@ -123,7 +123,7 @@ class Card_edit extends \Zotlabs\Web\Controller {
$editor = status_editor($a, $x);
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
- '$title' => t('Edit Block'),
+ '$title' => t('Edit Card'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$editor' => $editor
diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php
index 9114e3b89..22c5d673c 100644
--- a/Zotlabs/Module/Cards.php
+++ b/Zotlabs/Module/Cards.php
@@ -92,6 +92,8 @@ class Cards extends \Zotlabs\Web\Controller {
$x = [
'webpage' => ITEM_TYPE_CARD,
'is_owner' => true,
+ 'content_label' => t('Add Card'),
+ 'button' => t('Create'),
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 797b46f93..a86106b6a 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -734,10 +734,8 @@ class Item extends \Zotlabs\Web\Controller {
if($parent_item)
$parent_mid = $parent_item['mid'];
-
- if($webpage == ITEM_TYPE_CARD && $pagetitle) {
- $plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . $pagetitle;
- }
+
+
// Fallback so that we alway have a thr_parent
@@ -748,6 +746,21 @@ class Item extends \Zotlabs\Web\Controller {
$item_thread_top = ((! $parent) ? 1 : 0);
+
+ // fix permalinks for cards
+
+ if($webpage == ITEM_TYPE_CARD) {
+ $plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : substr($mid,0,16));
+ }
+ if(($parent_item) && ($parent_item['item_type'] == ITEM_TYPE_CARD)) {
+ $r = q("select v from iconfig where iconfig.cat = 'system' and iconfig.k = 'CARD' and iconfig.iid = %d limit 1",
+ intval($parent_item['id'])
+ );
+ if($r) {
+ $plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . $r[0]['v'];
+ }
+ }
+
if ((! $plink) && ($item_thread_top)) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
}
diff --git a/include/conversation.php b/include/conversation.php
index 78d90a6fc..ec445ba4c 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -703,6 +703,9 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$is_new = true;
+ $conv_link = (($item['item_type'] == ITEM_TYPE_CARD) ? $item['plink'] : z_root() . '/display/' . gen_link_id($item['mid']));
+
+
$tmp_item = array(
'template' => $tpl,
'toplevel' => 'toplevel_item',
@@ -757,7 +760,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'like' => '',
'dislike' => '',
'comment' => '',
- 'conv' => (($preview) ? '' : array('href'=> z_root() . '/display/' . gen_link_id($item['mid']), 'title'=> t('View in context'))),
+ 'conv' => (($preview) ? '' : array('href'=> $conv_link, 'title'=> t('View in context'))),
'previewing' => $previewing,
'wait' => t('Please wait'),
'thread_level' => 1,
@@ -1337,10 +1340,14 @@ function status_editor($a, $x, $popup = false) {
call_hooks('jot_networks', $jotnets);
}
+ $sharebutton = (x($x,'button') ? $x['button'] : t('Share'));
+ $placeholdtext = (x($x,'content_label') ? $x['content_label'] : $sharebutton);
+
$o .= replace_macros($tpl, array(
'$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string),
'$action' => z_root() . '/item',
- '$share' => (x($x,'button') ? $x['button'] : t('Share')),
+ '$share' => $sharebutton,
+ '$placeholdtext' => $placeholdtext,
'$webpage' => $webpage,
'$placeholdpagetitle' => ((x($x,'ptlabel')) ? $x['ptlabel'] : t('Page link name')),
'$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''),
diff --git a/include/items.php b/include/items.php
index 070c4571a..8489ec162 100755
--- a/include/items.php
+++ b/include/items.php
@@ -177,7 +177,7 @@ function item_normal() {
}
function item_normal_search() {
- return " and item.item_hidden = 0 and item.item_type in (0,3) and item.item_deleted = 0
+ return " and item.item_hidden = 0 and item.item_type in (0,3,6) and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
}
diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl
index 39ba9e59b..ce17f2f24 100755
--- a/view/tpl/jot.tpl
+++ b/view/tpl/jot.tpl
@@ -41,7 +41,7 @@
</div>
{{/if}}
<div id="jot-text-wrap">
- <textarea class="profile-jot-text" id="profile-jot-text" name="body" tabindex="2" placeholder="{{$share}}" >{{$content}}</textarea>
+ <textarea class="profile-jot-text" id="profile-jot-text" name="body" tabindex="2" placeholder="{{$placeholdtext}}" >{{$content}}</textarea>
</div>
{{if $attachment}}
<div id="jot-attachment-wrap">