Browse Source

Fix activation error.

pull/25/head
Ned Zimmerman 7 years ago
parent
commit
6ddd07140c
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 46
      app/activation.php
  2. 8
      app/controllers/App.php
  3. 8
      app/controllers/FrontPage.php
  4. 2
      resources/views/front-page.blade.php
  5. 12
      resources/views/partials/footer.blade.php

46
app/activation.php

@ -3,30 +3,30 @@
namespace Aldine;
add_action('admin_init', function () {
$extra = new \ParsedownExtra();
$about = $extra->text(file_get_contents(get_stylesheet_directory() . '/docs/about.md'));
$help = $extra->text(file_get_contents(get_stylesheet_directory() . '/docs/help.md'));
$default_pages = [
'about' => [
'post_title' => __('About', 'aldine'),
'post_content' => apply_filters('pb_root_about_page_content', $about)
],
'help' => [
'post_title' => __('Help', 'aldine'),
'post_content' => apply_filters('pb_root_help_page_content', $help)
],
'catalog' => [
'post_title' => __('Catalog', 'aldine'),
'post_content' => ''
],
'home' => [
'post_title' => __('Home', 'aldine'),
'post_content' => ''
],
];
if (! get_option('pb_aldine_activated')) {
$extra = new \ParsedownExtra();
$about = $extra->text(file_get_contents(get_stylesheet_directory() . '/docs/about.md'));
$help = $extra->text(file_get_contents(get_stylesheet_directory() . '/docs/help.md'));
$default_pages = [
'about' => [
'post_title' => __('About', 'aldine'),
'post_content' => apply_filters('pb_root_about_page_content', $about)
],
'help' => [
'post_title' => __('Help', 'aldine'),
'post_content' => apply_filters('pb_root_help_page_content', $help)
],
'catalog' => [
'post_title' => __('Catalog', 'aldine'),
'post_content' => ''
],
'home' => [
'post_title' => __('Home', 'aldine'),
'post_content' => ''
],
];
// Add our pages
$pages = [];

8
app/controllers/App.php

@ -38,14 +38,14 @@ class App extends Controller
|| get_option('pb_network_twitter')
|| is_active_sidebar("network-footer-block-$index")
) {
return "network-footer__block--$index";
return $index;
} else {
return 'network-footer__block--empty';
return 'empty';
}
}
return (is_active_sidebar("network-footer-block-$index")) ?
"network-footer__block--$index" :
'network-footer__block--empty';
$index :
'empty';
}
public static function title()

8
app/controllers/FrontPage.php

@ -9,12 +9,8 @@ class FrontPage extends Controller
public function blockCount()
{
global $_wp_sidebars_widgets;
if (empty($_wp_sidebars_widgets)) {
$_wp_sidebars_widgets = get_option('sidebars_widgets', []);
}
$sidebars_widgets_count = $_wp_sidebars_widgets;
if (isset($sidebars_widgets_count['front-page-block'])) {
return count($sidebars_widgets_count['front-page-block']);
if (!empty($_wp_sidebars_widgets['front-page-block'])) {
return count($_wp_sidebars_widgets['front-page-block']);
}
return 1;
}

2
resources/views/front-page.blade.php

@ -5,7 +5,7 @@
@if(is_active_sidebar('front-page-block'))
@php(dynamic_sidebar('front-page-block'))
@else
@component('page-block')
@component('partials.page-block')
@slot('title')
{{ __('About Pressbooks', 'aldine') }}
@endslot

12
resources/views/partials/footer.blade.php

@ -4,15 +4,11 @@
@include('partials.contact-form')
@endif
<section class="network-footer">
<div class="network-footer__block {{ App::networkFooter(1) }}">
@if(App::networkFooter(1) !== 'empty')
@php(dynamic_sidebar('network-footer-block-1'))
@endif
<div class="network-footer__block network-footer__block--{{ App::networkFooter(1) }}">
@php(dynamic_sidebar('network-footer-block-1'))
</div>
<div class="network-footer__block {{ App::networkFooter(2) }}">
@if(App::networkFooter(2) !== 'empty')
@php(dynamic_sidebar('network-footer-block-2'))
@endif
<div class="network-footer__block network-footer__block--{{ App::networkFooter(2) }}">
@php(dynamic_sidebar('network-footer-block-2'))
<div class="social-media">
@if($network_facebook)
<a class="link near-black hover-silver dib h2 w2 mr3" href="{{ $network_facebook }}" title="{{ sprintf(__('%s on Facebook', 'aldine'), get_bloginfo('name', 'display')) }}">

Loading…
Cancel
Save