provide headings for blocks and layouts

This commit is contained in:
Mario Vavti 2015-04-22 10:31:36 +02:00
parent e807231e91
commit b4dff3a9ff
7 changed files with 51 additions and 10 deletions

View File

@ -95,6 +95,7 @@ function blocks_content(&$a) {
'mimetype' => $mimetype, 'mimetype' => $mimetype,
'ptlabel' => t('Block Name'), 'ptlabel' => t('Block Name'),
'profile_uid' => intval($owner), 'profile_uid' => intval($owner),
'expanded' => true,
); );
if($_REQUEST['title']) if($_REQUEST['title'])
@ -106,7 +107,7 @@ function blocks_content(&$a) {
$o .= status_editor($a,$x); $editor = 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 where uid = %d and service = 'BUILDBLOCK' order by sid asc",
intval($owner) intval($owner)
@ -126,7 +127,10 @@ function blocks_content(&$a) {
$o .= replace_macros(get_markup_template('blocklist.tpl'), array( $o .= replace_macros(get_markup_template('blocklist.tpl'), array(
'$baseurl' => $url, '$baseurl' => $url,
'$title' => t('Blocks'),
'$create' => t('Create'),
'$edit' => t('Edit'), '$edit' => t('Edit'),
'$editor' => $editor,
'$pages' => $pages, '$pages' => $pages,
'$channel' => $which, '$channel' => $which,
'$view' => t('View'), '$view' => t('View'),

View File

@ -114,7 +114,7 @@ function editlayout_content(&$a) {
'$ispublic' => '&nbsp;', // t('Visible to <strong>everybody</strong>'), '$ispublic' => '&nbsp;', // t('Visible to <strong>everybody</strong>'),
'$geotag' => $geotag, '$geotag' => $geotag,
'$nickname' => $channel['channel_address'], '$nickname' => $channel['channel_address'],
'$confirmdelete' => t('Delete layout?') '$confirmdelete' => t('Delete layout?')
)); ));
@ -170,7 +170,6 @@ function editlayout_content(&$a) {
'$acl' => '', '$acl' => '',
'$bang' => '', '$bang' => '',
'$profile_uid' => (intval($owner)), '$profile_uid' => (intval($owner)),
'$preview' => t('Preview'),
'$jotplugins' => $jotplugins, '$jotplugins' => $jotplugins,
'$sourceapp' => t($a->sourcename), '$sourceapp' => t($a->sourcename),
'$defexpire' => '', '$defexpire' => '',

View File

@ -112,7 +112,7 @@ function layouts_content(&$a) {
'id' => 'layout-help-tab', 'id' => 'layout-help-tab',
)); ));
$o .= replace_macros(get_markup_template('common_tabs.tpl'),array('$tabs' => $tabs)); //$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
@ -123,13 +123,15 @@ 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'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), //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,
'nopreview' => 1, 'nopreview' => 1,
'ptlabel' => t('Layout Name'), 'ptlabel' => t('Layout Name'),
'profile_uid' => intval($owner), 'profile_uid' => intval($owner),
'expanded' => true
); );
if($_REQUEST['title']) if($_REQUEST['title'])
@ -140,7 +142,7 @@ function layouts_content(&$a) {
$x['pagetitle'] = $_REQUEST['pagetitle']; $x['pagetitle'] = $_REQUEST['pagetitle'];
$o .= 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 from item_id left join item on item.id = item_id.iid
where item_id.uid = %d and service = 'PDL' order by sid asc", where item_id.uid = %d and service = 'PDL' order by sid asc",
@ -164,14 +166,16 @@ function layouts_content(&$a) {
$url = z_root() . '/editlayout/' . $which; $url = z_root() . '/editlayout/' . $which;
$o .= replace_macros(get_markup_template('layoutlist.tpl'), array( $o .= replace_macros(get_markup_template('layoutlist.tpl'), array(
'$title' => t('Layouts'),
'$create' => t('Create'),
'$help' => array('text' => t('Help'), 'url' => 'help/Comanche', 'title' => t('Comanche page description language help')),
'$editor' => $editor,
'$baseurl' => $url, '$baseurl' => $url,
'$edit' => t('Edit'), '$edit' => t('Edit'),
'$share' => t('Share'), '$share' => t('Share'),
'$pages' => $pages, '$pages' => $pages,
'$channel' => $which, '$channel' => $which,
'$view' => t('View'), '$view' => t('View'),
'$preview' => '1',
)); ));
return $o; return $o;

3
view/css/mod_blocks.css Normal file
View File

@ -0,0 +1,3 @@
#block-editor {
display: none;
}

3
view/css/mod_layouts.css Normal file
View File

@ -0,0 +1,3 @@
#layout-editor {
display: none;
}

View File

@ -1,3 +1,17 @@
<div class="section-title-wrapper">
{{if $editor}}
<div class="pull-right">
<button id="webpage-create-btn" class="btn btn-xs btn-success" onclick="openClose('block-editor');"><i class="icon-edit"></i>&nbsp;{{$create}}</button>
</div>
{{/if}}
<h2>{{$title}}</h2>
<div class="clear"></div>
</div>
{{if $editor}}
<div id="block-editor" class="section-content-tools-wrapper">
{{$editor}}
</div>
{{/if}}
{{if $pages}} {{if $pages}}
<div id="pagelist-content-wrapper" class="generic-content-wrapper"> <div id="pagelist-content-wrapper" class="generic-content-wrapper">

View File

@ -1,5 +1,20 @@
{{if $pages}} <div class="section-title-wrapper">
{{if $editor}}
<div class="pull-right">
<button id="webpage-create-btn" class="btn btn-xs btn-success" onclick="openClose('layout-editor');"><i class="icon-edit"></i>&nbsp;{{$create}}</button>
<a href="{{$help.url}}" target="_blank" class="btn btn-xs btn-warning" title="{{$help.title}}"><i class="icon-info"></i>&nbsp;{{$help.text}}</a>
</div>
{{/if}}
<h2>{{$title}}</h2>
<div class="clear"></div>
</div>
{{if $editor}}
<div id="layout-editor" class="section-content-tools-wrapper">
{{$editor}}
</div>
{{/if}}
{{if $pages}}
<div id="pagelist-content-wrapper" class="generic-content-wrapper"> <div id="pagelist-content-wrapper" class="generic-content-wrapper">
{{foreach $pages as $key => $items}} {{foreach $pages as $key => $items}}
{{foreach $items as $item}} {{foreach $items as $item}}
@ -15,5 +30,4 @@
</div> </div>
<div class="clear"></div> <div class="clear"></div>
{{/if}} {{/if}}