From 9bc76b425948e7a6118e7749a3eb7c08c447bab3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 15:02:20 +0200 Subject: appification of the pdl editor and move advanced_theming to theme settings where it belongs --- Zotlabs/Module/Pdledit.php | 21 +++++++++++++++------ Zotlabs/Module/Settings/Display.php | 10 +--------- app/pdledit.apd | 6 ++++++ view/theme/redbasic/php/config.php | 6 ++++-- view/theme/redbasic/tpl/theme_settings.tpl | 1 + view/tpl/settings_display.tpl | 6 ------ 6 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 app/pdledit.apd diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index 9b86b599b..d0bde7715 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -1,15 +1,20 @@ PDL Editor App (Not Installed):
'; + $o .= t('Provides the ability to edit system page layouts'); + return $o; } if(argc() > 2 && argv(2) === 'reset') { diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index d35c54a90..0c63a3056 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -31,7 +31,6 @@ class Display { $network_list_mode = ((x($_POST,'network_list_mode')) ? intval($_POST['network_list_mode']) : 0); $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); - $advanced_theming = ((x($_POST,'advanced_theming')) ? intval($_POST['advanced_theming']) : 0); $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); if($channel_divmore_height < 50) @@ -63,7 +62,6 @@ class Display { set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update); set_pconfig(local_channel(),'system','channel_menu', $channel_menu); set_pconfig(local_channel(),'system','start_menu', $start_menu); - set_pconfig(local_channel(),'system','advanced_theming', $advanced_theming); $newschema = ''; if($theme){ @@ -181,8 +179,6 @@ class Display { $title_tosource = get_pconfig(local_channel(),'system','title_tosource'); $title_tosource = (($title_tosource===false)? '0': $title_tosource); // default if not set: 0 - $advanced_theming = get_pconfig(local_channel(),'system','advanced_theming', 0); - $theme_config = ""; if(($themeconfigfile = $this->get_theme_config_file($theme)) != null){ require_once($themeconfigfile); @@ -218,16 +214,12 @@ class Display { '$channel_menu' => [ 'channel_menu', t('Provide channel menu in navigation bar'), get_pconfig(local_channel(),'system','channel_menu',get_config('system','channel_menu',0)), t('Default: channel menu located in app menu'),$yes_no ], '$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no), '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no), - '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, - '$expert' => $advanced_theming, '$channel_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_channel(),'system','channel_list_mode'), t('(comments displayed separately)'), $yes_no), '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on grid page'), get_pconfig(local_channel(),'system','network_list_mode'), t('(comments displayed separately)'), $yes_no), '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), '$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), - '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no], - '$advanced_theming' => ['advanced_theming', t('Advanced Theme and Layout Settings'), $advanced_theming, t('Allows fine tuning of themes and page layouts'), $yes_no] - + '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no] )); call_hooks('display_settings',$o); diff --git a/app/pdledit.apd b/app/pdledit.apd new file mode 100644 index 000000000..ae62d4ff3 --- /dev/null +++ b/app/pdledit.apd @@ -0,0 +1,6 @@ +version: 1 +url: $baseurl/pdledit +requires: local_channel +name: PDL Editor +photo: icon:object-group +categories: Appearance diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index ae926d07b..d9d46c8f4 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -54,6 +54,7 @@ class RedbasicConfig { $arr['converse_width']=get_pconfig(local_channel(),"redbasic","converse_width"); $arr['top_photo']=get_pconfig(local_channel(),"redbasic","top_photo"); $arr['reply_photo']=get_pconfig(local_channel(),"redbasic","reply_photo"); + $arr['advanced_theming'] = get_pconfig(local_channel(), 'redbasic', 'advanced_theming'); return $this->form($arr); } @@ -80,15 +81,15 @@ class RedbasicConfig { set_pconfig(local_channel(), 'redbasic', 'converse_width', $_POST['redbasic_converse_width']); set_pconfig(local_channel(), 'redbasic', 'top_photo', $_POST['redbasic_top_photo']); set_pconfig(local_channel(), 'redbasic', 'reply_photo', $_POST['redbasic_reply_photo']); + set_pconfig(local_channel(), 'redbasic', 'advanced_theming', $_POST['redbasic_advanced_theming']); } } function form($arr) { - if(get_pconfig(local_channel(), 'system', 'advanced_theming')) + if(get_pconfig(local_channel(), 'redbasic', 'advanced_theming')) $expert = 1; - $o .= replace_macros(get_markup_template('theme_settings.tpl'), array( '$submit' => t('Submit'), '$baseurl' => z_root(), @@ -112,6 +113,7 @@ class RedbasicConfig { '$converse_width' => array('redbasic_converse_width',t('Set maximum width of content region in pixel'),$arr['converse_width'], t('Leave empty for default width')), '$top_photo' => array('redbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo']), '$reply_photo' => array('redbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']), + '$advanced_theming' => ['redbasic_advanced_theming', t('Show more custom theme settings'), $arr['advanced_theming'], '', [t('No'), t('Yes')]] )); return $o; diff --git a/view/theme/redbasic/tpl/theme_settings.tpl b/view/theme/redbasic/tpl/theme_settings.tpl index 7c552b49e..cc403f0a7 100644 --- a/view/theme/redbasic/tpl/theme_settings.tpl +++ b/view/theme/redbasic/tpl/theme_settings.tpl @@ -1,6 +1,7 @@ {{include file="field_checkbox.tpl" field=$narrow_navbar}} {{include file="field_input.tpl" field=$converse_width}} {{include file="field_input.tpl" field=$font_size}} +{{include file="field_checkbox.tpl" field=$advanced_theming}} {{if $expert}} {{include file="field_colorinput.tpl" field=$nav_bg}} {{include file="field_colorinput.tpl" field=$nav_icon_colour}} diff --git a/view/tpl/settings_display.tpl b/view/tpl/settings_display.tpl index ee0e137b5..f96e7f84c 100755 --- a/view/tpl/settings_display.tpl +++ b/view/tpl/settings_display.tpl @@ -69,12 +69,6 @@ {{include file="field_checkbox.tpl" field=$preload_images}} {{include file="field_checkbox.tpl" field=$manual_update}} {{include file="field_checkbox.tpl" field=$start_menu}} - {{include file="field_checkbox.tpl" field=$advanced_theming}} - {{if $expert}} -
- {{$layout_editor}} -
- {{/if}}
-- cgit v1.2.3