Merge https://github.com/redmatrix/redmatrix into pending_merge
This commit is contained in:
commit
e01873b4cf
@ -155,7 +155,7 @@ function comanche_block($s) {
|
|||||||
dbesc($name)
|
dbesc($name)
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
$o .= (($var['wrap'] == 'none') ? '' : '<div class="bblock">');
|
$o .= (($var['wrap'] == 'none') ? '' : '<div class="bblock widget">');
|
||||||
if($r[0]['title'])
|
if($r[0]['title'])
|
||||||
$o .= '<h3>' . $r[0]['title'] . '</h3>';
|
$o .= '<h3>' . $r[0]['title'] . '</h3>';
|
||||||
|
|
||||||
|
@ -1200,6 +1200,7 @@ function status_editor($a, $x, $popup = false) {
|
|||||||
'$shortnoloc' => t('clear location'),
|
'$shortnoloc' => t('clear location'),
|
||||||
'$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
|
'$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
|
||||||
'$placeholdertitle' => t('Title (optional)'),
|
'$placeholdertitle' => t('Title (optional)'),
|
||||||
|
'$hidetitle' => ((x($x, 'hidetitle')) ? $x['hidetitle'] : false),
|
||||||
'$catsenabled' => ((feature_enabled($x['profile_uid'], 'categories') && (! $webpage)) ? 'categories' : ''),
|
'$catsenabled' => ((feature_enabled($x['profile_uid'], 'categories') && (! $webpage)) ? 'categories' : ''),
|
||||||
'$category' => "",
|
'$category' => "",
|
||||||
'$placeholdercategory' => t('Categories (optional, comma-separated list)'),
|
'$placeholdercategory' => t('Categories (optional, comma-separated list)'),
|
||||||
|
@ -106,7 +106,7 @@ function blocks_content(&$a) {
|
|||||||
|
|
||||||
$editor = status_editor($a,$x);
|
$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",
|
where item_id.uid = %d and service = 'BUILDBLOCK' order by item.created desc",
|
||||||
intval($owner)
|
intval($owner)
|
||||||
);
|
);
|
||||||
@ -118,6 +118,7 @@ function blocks_content(&$a) {
|
|||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$element_arr = array(
|
$element_arr = array(
|
||||||
'type' => 'block',
|
'type' => 'block',
|
||||||
|
'title' => $rr['title'],
|
||||||
'body' => $rr['body'],
|
'body' => $rr['body'],
|
||||||
'created' => $rr['created'],
|
'created' => $rr['created'],
|
||||||
'edited' => $rr['edited'],
|
'edited' => $rr['edited'],
|
||||||
@ -127,7 +128,8 @@ function blocks_content(&$a) {
|
|||||||
);
|
);
|
||||||
$pages[$rr['iid']][] = array(
|
$pages[$rr['iid']][] = array(
|
||||||
'url' => $rr['iid'],
|
'url' => $rr['iid'],
|
||||||
'title' => $rr['sid'],
|
'name' => $rr['sid'],
|
||||||
|
'title' => $rr['title'],
|
||||||
'created' => $rr['created'],
|
'created' => $rr['created'],
|
||||||
'edited' => $rr['edited'],
|
'edited' => $rr['edited'],
|
||||||
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]'
|
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]'
|
||||||
@ -142,6 +144,7 @@ function blocks_content(&$a) {
|
|||||||
'$baseurl' => $url,
|
'$baseurl' => $url,
|
||||||
'$title' => t('Blocks'),
|
'$title' => t('Blocks'),
|
||||||
'$name' => t('Block Name'),
|
'$name' => t('Block Name'),
|
||||||
|
'$blocktitle' => t('Block Title'),
|
||||||
'$created' => t('Created'),
|
'$created' => t('Created'),
|
||||||
'$edited' => t('Edited'),
|
'$edited' => t('Edited'),
|
||||||
'$create' => t('Create'),
|
'$create' => t('Create'),
|
||||||
|
@ -23,7 +23,6 @@ function editlayout_init(&$a) {
|
|||||||
|
|
||||||
function editlayout_content(&$a) {
|
function editlayout_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
if(! $a->profile) {
|
if(! $a->profile) {
|
||||||
notice( t('Requested profile is not available.') . EOL );
|
notice( t('Requested profile is not available.') . EOL );
|
||||||
$a->error = 404;
|
$a->error = 404;
|
||||||
@ -69,7 +68,6 @@ function editlayout_content(&$a) {
|
|||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
||||||
// Figure out which post we're editing
|
// Figure out which post we're editing
|
||||||
$post_id = ((argc() > 2) ? intval(argv(2)) : 0);
|
$post_id = ((argc() > 2) ? intval(argv(2)) : 0);
|
||||||
|
|
||||||
@ -105,7 +103,9 @@ function editlayout_content(&$a) {
|
|||||||
$plaintext = true;
|
$plaintext = true;
|
||||||
|
|
||||||
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
|
$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(
|
$a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array(
|
||||||
@ -177,27 +177,6 @@ function editlayout_content(&$a) {
|
|||||||
'$expires' => t('Set expiration date'),
|
'$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;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,9 @@ function layouts_content(&$a) {
|
|||||||
return;
|
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))) {
|
if((argc() > 3) && (argv(2) === 'share') && (argv(3))) {
|
||||||
$r = q("select sid, service, mimetype, title, body from item_id
|
$r = q("select sid, service, mimetype, title, body from item_id
|
||||||
left join item on item.id = item_id.iid
|
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
|
// 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.
|
// Nickname is set to the observers xchan, and profile_uid to the owners.
|
||||||
// This lets you post pages at other people's channels.
|
// This lets you post pages at other people's channels.
|
||||||
@ -123,8 +114,6 @@ function layouts_content(&$a) {
|
|||||||
'webpage' => ITEM_PDL,
|
'webpage' => ITEM_PDL,
|
||||||
'is_owner' => true,
|
'is_owner' => true,
|
||||||
'nickname' => $a->profile['channel_address'],
|
'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' => '',
|
'bang' => '',
|
||||||
'showacl' => false,
|
'showacl' => false,
|
||||||
'visitor' => false,
|
'visitor' => false,
|
||||||
@ -141,11 +130,10 @@ function layouts_content(&$a) {
|
|||||||
if($_REQUEST['pagetitle'])
|
if($_REQUEST['pagetitle'])
|
||||||
$x['pagetitle'] = $_REQUEST['pagetitle'];
|
$x['pagetitle'] = $_REQUEST['pagetitle'];
|
||||||
|
|
||||||
|
|
||||||
$editor = status_editor($a,$x);
|
$editor = status_editor($a,$x);
|
||||||
|
|
||||||
$r = q("select iid, sid, mid from item_id left join item on item.id = item_id.iid
|
$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 sid asc",
|
where item_id.uid = %d and service = 'PDL' order by item.created desc",
|
||||||
intval($owner)
|
intval($owner)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -154,10 +142,23 @@ function layouts_content(&$a) {
|
|||||||
if($r) {
|
if($r) {
|
||||||
$pages = array();
|
$pages = array();
|
||||||
foreach($r as $rr) {
|
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(
|
$pages[$rr['iid']][] = array(
|
||||||
'url' => $rr['iid'],
|
'url' => $rr['iid'],
|
||||||
'title' => $rr['sid'],
|
'title' => $rr['sid'],
|
||||||
'mid' => $rr['mid']
|
'mid' => $rr['mid'],
|
||||||
|
'created' => $rr['created'],
|
||||||
|
'edited' => $rr['edited'],
|
||||||
|
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,8 +172,12 @@ function layouts_content(&$a) {
|
|||||||
'$help' => array('text' => t('Help'), 'url' => 'help/Comanche', 'title' => t('Comanche page description language help')),
|
'$help' => array('text' => t('Help'), 'url' => 'help/Comanche', 'title' => t('Comanche page description language help')),
|
||||||
'$editor' => $editor,
|
'$editor' => $editor,
|
||||||
'$baseurl' => $url,
|
'$baseurl' => $url,
|
||||||
|
'$name' => t('Layout Name'),
|
||||||
|
'$created' => t('Created'),
|
||||||
|
'$edited' => t('Edited'),
|
||||||
'$edit' => t('Edit'),
|
'$edit' => t('Edit'),
|
||||||
'$share' => t('Share'),
|
'$share' => t('Share'),
|
||||||
|
'$download' => t('Download PDL file'),
|
||||||
'$pages' => $pages,
|
'$pages' => $pages,
|
||||||
'$channel' => $which,
|
'$channel' => $which,
|
||||||
'$view' => t('View'),
|
'$view' => t('View'),
|
||||||
|
@ -149,7 +149,6 @@ function webpages_content(&$a) {
|
|||||||
'type' => 'webpage',
|
'type' => 'webpage',
|
||||||
'title' => $rr['title'],
|
'title' => $rr['title'],
|
||||||
'body' => $rr['body'],
|
'body' => $rr['body'],
|
||||||
'term' => $rr['term'],
|
|
||||||
'created' => $rr['created'],
|
'created' => $rr['created'],
|
||||||
'edited' => $rr['edited'],
|
'edited' => $rr['edited'],
|
||||||
'mimetype' => $rr['mimetype'],
|
'mimetype' => $rr['mimetype'],
|
||||||
|
@ -15,14 +15,18 @@
|
|||||||
padding: 7px 3px 7px 10px;
|
padding: 7px 3px 7px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#block-list-table th:nth-child(5),
|
#block-list-table th:nth-child(2){
|
||||||
#block-list-table td:nth-child(5){
|
|
||||||
padding: 7px 3px;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#block-list-table th:nth-child(6),
|
#block-list-table th:nth-child(6),
|
||||||
#block-list-table td:nth-child(6){
|
#block-list-table td:nth-child(6){
|
||||||
|
padding: 7px 3px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
#block-list-table th:nth-child(7),
|
||||||
|
#block-list-table td:nth-child(7){
|
||||||
padding: 7px 10px 7px 7px;
|
padding: 7px 10px 7px 7px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,32 @@
|
|||||||
#layout-editor {
|
#layout-editor {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#layout-list-table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#layout-list-table th:nth-child(1){
|
||||||
|
padding: 7px 3px 7px 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
#layout-list-table td:nth-child(1){
|
||||||
|
padding: 7px 3px 7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#layout-list-table th:nth-child(5),
|
||||||
|
#layout-list-table td:nth-child(5){
|
||||||
|
padding: 7px 3px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
#layout-list-table th:nth-child(6),
|
||||||
|
#layout-list-table td:nth-child(6){
|
||||||
|
padding: 7px 10px 7px 7px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.webpage-list-tool {
|
||||||
|
padding: 7px 10px;
|
||||||
|
}
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
padding: 7px 3px 7px 10px;
|
padding: 7px 3px 7px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#webpage-list-table th:nth-child(2){
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
#webpage-list-table th:nth-child(7),
|
#webpage-list-table th:nth-child(7),
|
||||||
#webpage-list-table td:nth-child(7){
|
#webpage-list-table td:nth-child(7){
|
||||||
padding: 7px 3px;
|
padding: 7px 3px;
|
||||||
|
@ -1938,6 +1938,7 @@ nav .dropdown-menu {
|
|||||||
|
|
||||||
[id^="webpage-list-item-"]:hover td,
|
[id^="webpage-list-item-"]:hover td,
|
||||||
[id^="block-list-item-"]:hover td,
|
[id^="block-list-item-"]:hover td,
|
||||||
|
[id^="layout-list-item-"]:hover td,
|
||||||
[id^="menu-list-item-"]:hover td,
|
[id^="menu-list-item-"]:hover td,
|
||||||
[id^="mitem-list-item-"]:hover td {
|
[id^="mitem-list-item-"]:hover td {
|
||||||
background-color: $item_colour;
|
background-color: $item_colour;
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
<div id="pagelist-content-wrapper" class="section-content-wrapper-np">
|
<div id="pagelist-content-wrapper" class="section-content-wrapper-np">
|
||||||
<table id="block-list-table">
|
<table id="block-list-table">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="97%">{{$name}}</th>
|
<th width="1%">{{$name}}</th>
|
||||||
|
<th width="94%">{{$blocktitle}}</th>
|
||||||
<th width="1%"></th>
|
<th width="1%"></th>
|
||||||
<th width="1%"></th>
|
<th width="1%"></th>
|
||||||
<th width="1%"></th>
|
<th width="1%"></th>
|
||||||
@ -28,11 +29,14 @@
|
|||||||
<tr id="block-list-item-{{$item.url}}">
|
<tr id="block-list-item-{{$item.url}}">
|
||||||
<td>
|
<td>
|
||||||
{{if $view}}
|
{{if $view}}
|
||||||
<a href="block/{{$channel}}/{{$item.title}}" title="{{$view}}">{{$item.title}}</a>
|
<a href="block/{{$channel}}/{{$item.title}}" title="{{$view}}">{{$item.name}}</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{$item.title}}
|
{{$item.name}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
{{$item.title}}
|
||||||
|
</td>
|
||||||
<td class="webpage-list-tool">
|
<td class="webpage-list-tool">
|
||||||
{{if $edit}}
|
{{if $edit}}
|
||||||
<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil"></i></a>
|
<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil"></i></a>
|
||||||
|
@ -15,19 +15,51 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $pages}}
|
{{if $pages}}
|
||||||
<div id="pagelist-content-wrapper" class="generic-content-wrapper">
|
<div id="pagelist-content-wrapper" class="section-content-wrapper-np">
|
||||||
|
<table id="layout-list-table">
|
||||||
|
<tr>
|
||||||
|
<th width="97%">{{$name}}</th>
|
||||||
|
<th width="1%"></th>
|
||||||
|
<th width="1%"></th>
|
||||||
|
<th width="1%"></th>
|
||||||
|
<th width="1%" class="hidden-xs">{{$created}}</th>
|
||||||
|
<th width="1%" class="hidden-xs">{{$edited}}</th>
|
||||||
|
</tr>
|
||||||
{{foreach $pages as $key => $items}}
|
{{foreach $pages as $key => $items}}
|
||||||
{{foreach $items as $item}}
|
{{foreach $items as $item}}
|
||||||
<div class="page-list-item">
|
<tr id="layout-list-item-{{$item.url}}">
|
||||||
{{if $edit}}<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil design-icons design-edit-icon btn btn-default"></i></a> {{/if}}
|
<td>
|
||||||
{{if $view}}<a href="page/{{$channel}}/{{$item.title}}" title="{{$view}}"><i class="icon-external-link design-icons design-view-icon btn btn-default"></i></a> {{/if}}
|
{{if $view}}
|
||||||
{{if $share}}<a href="layouts/{{$channel}}/share/{{$item.mid}}" title="{{$share}}"><i class="icon-share design-icons btn btn-default"></i></a> {{/if}}
|
<a href="page/{{$channel}}/{{$item.title}}" title="{{$view}}">{{$item.title}}</a>
|
||||||
{{*if $preview}}<a href="page/{{$channel}}/{{$item.title}}?iframe=true&width=80%&height=80%" title="{{$preview}}" class="webpage-preview" ><i class="icon-eye-open design-icons design-preview-icon"></i></a> {{/if*}}
|
{{else}}
|
||||||
{{$item.title}}
|
{{$item.title}}
|
||||||
</div>
|
{{/if}}
|
||||||
{{/foreach}}
|
</td>
|
||||||
|
<td class="webpage-list-tool">
|
||||||
|
{{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?attachment={{$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}}', '#layout-list-item-{{$item.url}}'); return false;"><i class="icon-trash drop-icons"></i></a>
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
|
<td class="hidden-xs">
|
||||||
|
{{$item.created}}
|
||||||
|
</td>
|
||||||
|
<td class="hidden-xs">
|
||||||
|
{{$item.edited}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</div>
|
{{/foreach}}
|
||||||
|
</table>
|
||||||
<div class="clear"></div>
|
</div>
|
||||||
|
<div class="clear"></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Reference in New Issue
Block a user