From b4dff3a9ff16811ea0310f5dbf4d7559c97835b0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 22 Apr 2015 10:31:36 +0200 Subject: provide headings for blocks and layouts --- mod/blocks.php | 6 +++++- mod/editlayout.php | 3 +-- mod/layouts.php | 14 +++++++++----- view/css/mod_blocks.css | 3 +++ view/css/mod_layouts.css | 3 +++ view/tpl/blocklist.tpl | 14 ++++++++++++++ view/tpl/layoutlist.tpl | 18 ++++++++++++++++-- 7 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 view/css/mod_blocks.css create mode 100644 view/css/mod_layouts.css diff --git a/mod/blocks.php b/mod/blocks.php index e0f32f4f1..b74b034e5 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -95,6 +95,7 @@ function blocks_content(&$a) { 'mimetype' => $mimetype, 'ptlabel' => t('Block Name'), 'profile_uid' => intval($owner), + 'expanded' => true, ); 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", intval($owner) @@ -126,7 +127,10 @@ function blocks_content(&$a) { $o .= replace_macros(get_markup_template('blocklist.tpl'), array( '$baseurl' => $url, + '$title' => t('Blocks'), + '$create' => t('Create'), '$edit' => t('Edit'), + '$editor' => $editor, '$pages' => $pages, '$channel' => $which, '$view' => t('View'), diff --git a/mod/editlayout.php b/mod/editlayout.php index f6d76f6b4..437c164c1 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -114,7 +114,7 @@ function editlayout_content(&$a) { '$ispublic' => ' ', // t('Visible to everybody'), '$geotag' => $geotag, '$nickname' => $channel['channel_address'], - '$confirmdelete' => t('Delete layout?') + '$confirmdelete' => t('Delete layout?') )); @@ -170,7 +170,6 @@ function editlayout_content(&$a) { '$acl' => '', '$bang' => '', '$profile_uid' => (intval($owner)), - '$preview' => t('Preview'), '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$defexpire' => '', diff --git a/mod/layouts.php b/mod/layouts.php index 4640c6690..04d81f91e 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -112,7 +112,7 @@ function layouts_content(&$a) { '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 @@ -123,13 +123,15 @@ function layouts_content(&$a) { 'webpage' => ITEM_PDL, 'is_owner' => true, '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' => '', 'showacl' => false, 'visitor' => false, 'nopreview' => 1, 'ptlabel' => t('Layout Name'), 'profile_uid' => intval($owner), + 'expanded' => true ); if($_REQUEST['title']) @@ -140,7 +142,7 @@ function layouts_content(&$a) { $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 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; $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, '$edit' => t('Edit'), '$share' => t('Share'), '$pages' => $pages, '$channel' => $which, '$view' => t('View'), - '$preview' => '1', - )); return $o; diff --git a/view/css/mod_blocks.css b/view/css/mod_blocks.css new file mode 100644 index 000000000..117e99068 --- /dev/null +++ b/view/css/mod_blocks.css @@ -0,0 +1,3 @@ +#block-editor { + display: none; +} diff --git a/view/css/mod_layouts.css b/view/css/mod_layouts.css new file mode 100644 index 000000000..7f65713e7 --- /dev/null +++ b/view/css/mod_layouts.css @@ -0,0 +1,3 @@ +#layout-editor { + display: none; +} diff --git a/view/tpl/blocklist.tpl b/view/tpl/blocklist.tpl index 4068375cb..a8cb29b35 100644 --- a/view/tpl/blocklist.tpl +++ b/view/tpl/blocklist.tpl @@ -1,3 +1,17 @@ +
+ {{if $editor}} +
+ +
+ {{/if}} +

{{$title}}

+
+
+{{if $editor}} +
+ {{$editor}} +
+{{/if}} {{if $pages}}
diff --git a/view/tpl/layoutlist.tpl b/view/tpl/layoutlist.tpl index 0a0085497..cd146377d 100644 --- a/view/tpl/layoutlist.tpl +++ b/view/tpl/layoutlist.tpl @@ -1,5 +1,20 @@ -{{if $pages}} +
+ {{if $editor}} +
+ +  {{$help.text}} +
+ {{/if}} +

{{$title}}

+
+
+{{if $editor}} +
+ {{$editor}} +
+{{/if}} +{{if $pages}}
{{foreach $pages as $key => $items}} {{foreach $items as $item}} @@ -15,5 +30,4 @@
- {{/if}} -- cgit v1.2.3