move share webpage element from editwebpage to webpages and make it shareable with rpost
This commit is contained in:
parent
32f79374b0
commit
86ac9c0d6b
@ -221,21 +221,6 @@ logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos
|
||||
if(($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash))
|
||||
$o .= '<br /><br /><a class="page-delete-link" href="item/drop/' . $itm[0]['id'] . '" >' . t('Delete Webpage') . '</a><br />';
|
||||
|
||||
|
||||
$x = array(
|
||||
'type' => 'webpage',
|
||||
'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;
|
||||
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ function webpages_content(&$a) {
|
||||
if($_REQUEST['pagetitle'])
|
||||
$x['pagetitle'] = $_REQUEST['pagetitle'];
|
||||
|
||||
$editor .= status_editor($a,$x);
|
||||
$editor = status_editor($a,$x);
|
||||
|
||||
// Get a list of webpages. We can't display all them because endless scroll makes that unusable,
|
||||
// so just list titles and an edit link.
|
||||
@ -141,12 +141,24 @@ function webpages_content(&$a) {
|
||||
$pages = array();
|
||||
foreach($r as $rr) {
|
||||
unobscure($rr);
|
||||
$element_arr = array(
|
||||
'type' => 'webpage',
|
||||
'title' => $rr['title'],
|
||||
'body' => $rr['body'],
|
||||
'term' => $rr['term'],
|
||||
'created' => $rr['created'],
|
||||
'edited' => $rr['edited'],
|
||||
'mimetype' => $rr['mimetype'],
|
||||
'pagetitle' => $rr['sid'],
|
||||
'mid' => $rr['mid']
|
||||
);
|
||||
$pages[$rr['iid']][] = array(
|
||||
'url' => $rr['iid'],
|
||||
'pagetitle' => $rr['sid'],
|
||||
'title' => $rr['title'],
|
||||
'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),
|
||||
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited'])
|
||||
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']),
|
||||
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]'
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -158,8 +170,9 @@ function webpages_content(&$a) {
|
||||
$o .= replace_macros(get_markup_template('webpagelist.tpl'), array(
|
||||
'$listtitle' => t('Webpages'),
|
||||
'$baseurl' => $url,
|
||||
'$create' => t('Create'),
|
||||
'$create' => t('Create'),
|
||||
'$edit' => t('Edit'),
|
||||
'$share' => t('Share'),
|
||||
'$delete' => t('Delete'),
|
||||
'$pages' => $pages,
|
||||
'$channel' => $which,
|
||||
|
@ -15,14 +15,14 @@
|
||||
padding: 7px 3px 7px 10px;
|
||||
}
|
||||
|
||||
#webpage-list-table th:nth-child(5),
|
||||
#webpage-list-table td:nth-child(5){
|
||||
#webpage-list-table th:nth-child(6),
|
||||
#webpage-list-table td:nth-child(6){
|
||||
padding: 7px 3px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#webpage-list-table th:nth-child(6),
|
||||
#webpage-list-table td:nth-child(6){
|
||||
#webpage-list-table th:nth-child(7),
|
||||
#webpage-list-table td:nth-child(7){
|
||||
padding: 7px 10px 7px 7px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
<th width="95%">{{$title_txt}}</th>
|
||||
<th width="1%"></th>
|
||||
<th width="1%"></th>
|
||||
<th width="1%"></th>
|
||||
<th width="1%" class="hidden-xs">{{$created_txt}}</th>
|
||||
<th width="1%" class="hidden-xs">{{$edited_txt}}</th>
|
||||
</tr>
|
||||
@ -40,6 +41,9 @@
|
||||
{{if $edit}}<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil"></i></a>{{/if}}
|
||||
</td>
|
||||
<td class="webpage-list-tool">
|
||||
{{if $item.bb_element}}<a href="rpost?body={{$item.bb_element}}" title="{{$share}}"><i class="icon-share"></i></a>{{/if}}
|
||||
</td>
|
||||
<td class="webpage-list-tool">
|
||||
{{if $edit}}<a href="#" title="{{$delete}}" onclick="dropItem('item/drop/{{$item.url}}', '#webpage-list-item-{{$item.url}}'); return false;"><i class="icon-trash drop-icons"></i></a>{{/if}}
|
||||
</td>
|
||||
<td class="hidden-xs">
|
||||
|
Reference in New Issue
Block a user