Browse Source

Update namespace and textdomain.

pull/3/head
Ned Zimmerman 7 years ago
parent
commit
0a5020fe44
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 2
      app/admin.php
  2. 2
      app/controllers/About.php
  3. 10
      app/controllers/App.php
  4. 2
      app/controllers/Home.php
  5. 4
      app/filters.php
  6. 2
      app/helpers.php
  7. 14
      app/setup.php
  8. 17
      app/widgets.php
  9. 8
      app/widgets/linkbutton.php
  10. 8
      app/widgets/pagebutton.php
  11. 2
      composer.json
  12. 12
      resources/functions.php
  13. 2
      resources/style.css
  14. 2
      resources/views/404.blade.php
  15. 4
      resources/views/index.blade.php
  16. 2
      resources/views/layouts/app.blade.php
  17. 8
      resources/views/partials/comments.blade.php
  18. 2
      resources/views/partials/content-page.blade.php
  19. 2
      resources/views/partials/content-single.blade.php
  20. 2
      resources/views/partials/entry-meta.blade.php
  21. 6
      resources/views/partials/header.blade.php
  22. 4
      resources/views/partials/uio.blade.php
  23. 2
      resources/views/search.blade.php

2
app/admin.php

@ -1,6 +1,6 @@
<?php <?php
namespace App; namespace Aldine;
/** /**
* Theme customizer * Theme customizer

2
app/controllers/About.php

@ -1,6 +1,6 @@
<?php <?php
namespace App; namespace Aldine;
use Sober\Controller\Controller; use Sober\Controller\Controller;

10
app/controllers/App.php

@ -1,10 +1,10 @@
<?php <?php
namespace App; namespace Aldine;
use Sober\Controller\Controller; use Sober\Controller\Controller;
class App extends Controller class Aldine extends Controller
{ {
public function siteName() public function siteName()
{ {
@ -17,16 +17,16 @@ class App extends Controller
if ($home = get_option('page_for_posts', true)) { if ($home = get_option('page_for_posts', true)) {
return get_the_title($home); return get_the_title($home);
} }
return __('Latest Posts', 'pressbooks-aldine'); return __('Latest Posts', 'aldine');
} }
if (is_archive()) { if (is_archive()) {
return get_the_archive_title(); return get_the_archive_title();
} }
if (is_search()) { if (is_search()) {
return sprintf(__('Search Results for %s', 'pressbooks-aldine'), get_search_query()); return sprintf(__('Search Results for %s', 'aldine'), get_search_query());
} }
if (is_404()) { if (is_404()) {
return __('Not Found', 'pressbooks-aldine'); return __('Not Found', 'aldine');
} }
return get_the_title(); return get_the_title();
} }

2
app/controllers/Home.php

@ -1,6 +1,6 @@
<?php <?php
namespace App; namespace Aldine;
use Sober\Controller\Controller; use Sober\Controller\Controller;

4
app/filters.php

@ -1,6 +1,6 @@
<?php <?php
namespace App; namespace Aldine;
/** /**
* Add <body> classes * Add <body> classes
@ -30,7 +30,7 @@ add_filter('body_class', function (array $classes) {
* Add "… Continued" to the excerpt * Add "… Continued" to the excerpt
*/ */
add_filter('excerpt_more', function () { add_filter('excerpt_more', function () {
return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'pressbooks-aldine') . '</a>'; return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'aldine') . '</a>';
}); });
/** /**

2
app/helpers.php

@ -1,6 +1,6 @@
<?php <?php
namespace App; namespace Aldine;
use Roots\Sage\Container; use Roots\Sage\Container;

14
app/setup.php

@ -1,6 +1,6 @@
<?php <?php
namespace App; namespace Aldine;
use Roots\Sage\Container; use Roots\Sage\Container;
use Roots\Sage\Assets\JsonManifest; use Roots\Sage\Assets\JsonManifest;
@ -46,7 +46,7 @@ add_action('after_setup_theme', function () {
* @link https://developer.wordpress.org/reference/functions/register_nav_menus/ * @link https://developer.wordpress.org/reference/functions/register_nav_menus/
*/ */
register_nav_menus([ register_nav_menus([
'primary_navigation' => __('Primary Navigation', 'pressbooks-aldine') 'primary_navigation' => __('Primary Navigation', 'aldine')
]); ]);
/** /**
@ -85,23 +85,23 @@ add_action('widgets_init', function () {
'after_title' => '</h3>' 'after_title' => '</h3>'
]; ];
register_sidebar([ register_sidebar([
'name' => __('Home Block 1', 'pressbooks-aldine'), 'name' => __('Home Block 1', 'aldine'),
'id' => 'home-block-1' 'id' => 'home-block-1'
] + $config); ] + $config);
register_sidebar([ register_sidebar([
'name' => __('Home Block 2', 'pressbooks-aldine'), 'name' => __('Home Block 2', 'aldine'),
'id' => 'home-block-2' 'id' => 'home-block-2'
] + $config); ] + $config);
register_sidebar([ register_sidebar([
'name' => __('Home Block 3', 'pressbooks-aldine'), 'name' => __('Home Block 3', 'aldine'),
'id' => 'home-block-3' 'id' => 'home-block-3'
] + $config); ] + $config);
register_sidebar([ register_sidebar([
'name' => __('Home Block 4', 'pressbooks-aldine'), 'name' => __('Home Block 4', 'aldine'),
'id' => 'home-block-4' 'id' => 'home-block-4'
] + $config); ] + $config);
register_sidebar([ register_sidebar([
'name' => __('Home Block 5', 'pressbooks-aldine'), 'name' => __('Home Block 5', 'aldine'),
'id' => 'home-block-5' 'id' => 'home-block-5'
] + $config); ] + $config);
}); });

17
app/widgets.php

@ -1,8 +1,23 @@
<?php <?php
namespace App; namespace Aldine;
add_action('widgets_init', function () { add_action('widgets_init', function () {
foreach([
'WP_Widget_Pages',
'WP_Widget_Calendar',
'WP_Widget_Archives',
'WP_Widget_Links',
'WP_Widget_Media_Audio',
'WP_Widget_Meta',
'WP_Widget_Search',
'WP_Widget_Categories',
'WP_Widget_Recent_Posts',
'WP_Widget_Recent_Comments',
'WP_Widget_Tag_Cloud'
] as $widget) {
unregister_widget($widget);
}
register_widget('Aldine\LinkButton'); register_widget('Aldine\LinkButton');
register_widget('Aldine\PageButton'); register_widget('Aldine\PageButton');
}); });

8
app/widgets/linkbutton.php

@ -12,8 +12,8 @@ class LinkButton extends \WP_Widget
*/ */
public function __construct() public function __construct()
{ {
parent::__construct('linkbutton', __('Link Button', 'pressbooks-aldine'), [ parent::__construct('linkbutton', __('Link Button', 'aldine'), [
'description' => esc_html__('Add a styled link button.', 'pressbooks-aldine') 'description' => esc_html__('Add a styled button which links to a custom URL.', 'aldine')
]); ]);
} }
@ -45,9 +45,9 @@ class LinkButton extends \WP_Widget
{ {
$title = ! empty($instance['title']) ? $instance['title'] : ''; $title = ! empty($instance['title']) ? $instance['title'] : '';
$url = ! empty($instance['url']) ? $instance['url'] : ''; ?> $url = ! empty($instance['url']) ? $instance['url'] : ''; ?>
<p><label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'pressbooks-aldine'); ?></label> <p><label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'aldine'); ?></label>
<input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>"></p> <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>"></p>
<p><label for="<?php echo esc_attr($this->get_field_id('url')); ?>"><?php esc_attr_e('URL:', 'pressbooks-aldine'); ?></label> <p><label for="<?php echo esc_attr($this->get_field_id('url')); ?>"><?php esc_attr_e('URL:', 'aldine'); ?></label>
<input class="widefat code" id="<?php echo esc_attr($this->get_field_id('url')); ?>" name="<?php echo esc_attr($this->get_field_name('url')); ?>" type="text" value="<?php echo esc_attr($url); ?>"></p> <input class="widefat code" id="<?php echo esc_attr($this->get_field_id('url')); ?>" name="<?php echo esc_attr($this->get_field_name('url')); ?>" type="text" value="<?php echo esc_attr($url); ?>"></p>
<?php <?php
} }

8
app/widgets/pagebutton.php

@ -12,8 +12,8 @@ class PageButton extends \WP_Widget
*/ */
public function __construct() public function __construct()
{ {
parent::__construct('pagebutton', __('Page Button', 'pressbooks-aldine'), [ parent::__construct('pagebutton', __('Page Button', 'aldine'), [
'description' => esc_html__('Add a styled button which links to a page.', 'pressbooks-aldine') 'description' => esc_html__('Add a styled button which links to a page.', 'aldine')
]); ]);
} }
@ -48,9 +48,9 @@ class PageButton extends \WP_Widget
{ {
$title = ! empty($instance['title']) ? $instance['title'] : ''; $title = ! empty($instance['title']) ? $instance['title'] : '';
$url = ! empty($instance['page_id']) ? $instance['page_id'] : ''; ?> $url = ! empty($instance['page_id']) ? $instance['page_id'] : ''; ?>
<p><label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'pressbooks-aldine'); ?></label> <p><label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'aldine'); ?></label>
<input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>"></p> <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>"></p>
<p><label for="<?php echo esc_attr($this->get_field_id('page_id')); ?>"><?php esc_attr_e('Page:', 'pressbooks-aldine'); ?></label> <p><label for="<?php echo esc_attr($this->get_field_id('page_id')); ?>"><?php esc_attr_e('Page:', 'aldine'); ?></label>
<select id="<?php echo esc_attr($this->get_field_id('page_id')); ?>" name="<?php echo esc_attr($this->get_field_name('page_id')); ?>"> <select id="<?php echo esc_attr($this->get_field_id('page_id')); ?>" name="<?php echo esc_attr($this->get_field_name('page_id')); ?>">
<option value="" <?php selected($instance['page_id'], ''); ?>> -- </a> <option value="" <?php selected($instance['page_id'], ''); ?>> -- </a>
<?php $pages = get_pages(); <?php $pages = get_pages();

2
composer.json

@ -23,7 +23,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"App\\": "app/" "Aldine\\": "app/"
} }
}, },
"require": { "require": {

12
resources/functions.php

@ -14,7 +14,7 @@ use Roots\Sage\Container;
* @param string $title * @param string $title
*/ */
$sage_error = function ($message, $subtitle = '', $title = '') { $sage_error = function ($message, $subtitle = '', $title = '') {
$title = $title ?: __('Sage &rsaquo; Error', 'pressbooks-aldine'); $title = $title ?: __('Sage &rsaquo; Error', 'aldine');
$footer = '<a href="https://roots.io/sage/docs/">roots.io/sage/docs/</a>'; $footer = '<a href="https://roots.io/sage/docs/">roots.io/sage/docs/</a>';
$message = "<h1>{$title}<br><small>{$subtitle}</small></h1><p>{$message}</p><p>{$footer}</p>"; $message = "<h1>{$title}<br><small>{$subtitle}</small></h1><p>{$message}</p><p>{$footer}</p>";
wp_die($message, $title); wp_die($message, $title);
@ -24,14 +24,14 @@ $sage_error = function ($message, $subtitle = '', $title = '') {
* Ensure compatible version of PHP is used * Ensure compatible version of PHP is used
*/ */
if (version_compare('7', phpversion(), '>=')) { if (version_compare('7', phpversion(), '>=')) {
$sage_error(__('You must be using PHP 7 or greater.', 'pressbooks-aldine'), __('Invalid PHP version', 'pressbooks-aldine')); $sage_error(__('You must be using PHP 7 or greater.', 'aldine'), __('Invalid PHP version', 'aldine'));
} }
/** /**
* Ensure compatible version of WordPress is used * Ensure compatible version of WordPress is used
*/ */
if (version_compare('4.7.0', get_bloginfo('version'), '>=')) { if (version_compare('4.7.0', get_bloginfo('version'), '>=')) {
$sage_error(__('You must be using WordPress 4.7.0 or greater.', 'pressbooks-aldine'), __('Invalid WordPress version', 'pressbooks-aldine')); $sage_error(__('You must be using WordPress 4.7.0 or greater.', 'aldine'), __('Invalid WordPress version', 'aldine'));
} }
/** /**
@ -40,8 +40,8 @@ if (version_compare('4.7.0', get_bloginfo('version'), '>=')) {
if (!class_exists('Roots\\Sage\\Container')) { if (!class_exists('Roots\\Sage\\Container')) {
if (!file_exists($composer = __DIR__.'/../vendor/autoload.php')) { if (!file_exists($composer = __DIR__.'/../vendor/autoload.php')) {
$sage_error( $sage_error(
__('You must run <code>composer install</code> from the Sage directory.', 'pressbooks-aldine'), __('You must run <code>composer install</code> from the Sage directory.', 'aldine'),
__('Autoloader not found.', 'pressbooks-aldine') __('Autoloader not found.', 'aldine')
); );
} }
require_once $composer; require_once $composer;
@ -56,7 +56,7 @@ if (!class_exists('Roots\\Sage\\Container')) {
array_map(function ($file) use ($sage_error) { array_map(function ($file) use ($sage_error) {
$file = "../app/{$file}.php"; $file = "../app/{$file}.php";
if (!locate_template($file, true, true)) { if (!locate_template($file, true, true)) {
$sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'pressbooks-aldine'), $file), 'File not found'); $sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'aldine'), $file), 'File not found');
} }
}, ['helpers', 'setup', 'filters', 'admin', 'widgets', 'widgets/linkbutton', 'widgets/pagebutton']); }, ['helpers', 'setup', 'filters', 'admin', 'widgets', 'widgets/linkbutton', 'widgets/pagebutton']);

2
resources/style.css

@ -5,7 +5,7 @@ Description: Aldine is the root theme for Pressbooks networks.
Version: 1.0.0-dev Version: 1.0.0-dev
Author: Pressbooks (Book Oven Inc.) Author: Pressbooks (Book Oven Inc.)
Author URI: https://pressbooks.org Author URI: https://pressbooks.org
Text Domain: sage Text Domain: aldine
License: MIT License License: MIT License
License URI: http://opensource.org/licenses/MIT License URI: http://opensource.org/licenses/MIT

2
resources/views/404.blade.php

@ -5,7 +5,7 @@
@if (!have_posts()) @if (!have_posts())
<div class="alert alert-warning"> <div class="alert alert-warning">
{{ __('Sorry, but the page you were trying to view does not exist.', 'pressbooks-aldine') }} {{ __('Sorry, but the page you were trying to view does not exist.', 'aldine') }}
</div> </div>
{!! get_search_form(false) !!} {!! get_search_form(false) !!}
@endif @endif

4
resources/views/index.blade.php

@ -4,8 +4,8 @@
@if($block_count === 0) @if($block_count === 0)
<div class="block block-1"> <div class="block block-1">
<div class="inside"> <div class="inside">
<h3>{{ __('About Pressbooks', 'pressbooks-aldine')}}</h3> <h3>{{ __('About Pressbooks', 'aldine')}}</h3>
<p>{{ __('Pressbooks is easy-to-use book writing software that lets you create a book in all the formats you need to publish.', 'pressbooks-aldine')}}</p> <p>{{ __('Pressbooks is easy-to-use book writing software that lets you create a book in all the formats you need to publish.', 'aldine')}}</p>
</div> </div>
</div> </div>
@elseif($block_count < 5) @elseif($block_count < 5)

2
resources/views/layouts/app.blade.php

@ -10,7 +10,7 @@
<main class="main"> <main class="main">
@yield('content') @yield('content')
</main> </main>
@if (App\display_sidebar()) @if (Aldine\display_sidebar())
<aside class="sidebar"> <aside class="sidebar">
@include('partials.sidebar') @include('partials.sidebar')
</aside> </aside>

8
resources/views/partials/comments.blade.php

@ -7,7 +7,7 @@ if (post_password_required()) {
<section id="comments" class="comments"> <section id="comments" class="comments">
@if (have_comments()) @if (have_comments())
<h2> <h2>
{!! sprintf(_nx('One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'pressbooks-aldine'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>') !!} {!! sprintf(_nx('One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'aldine'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>') !!}
</h2> </h2>
<ol class="comment-list"> <ol class="comment-list">
@ -18,10 +18,10 @@ if (post_password_required()) {
<nav> <nav>
<ul class="pager"> <ul class="pager">
@if (get_previous_comments_link()) @if (get_previous_comments_link())
<li class="previous">@php(previous_comments_link(__('&larr; Older comments', 'pressbooks-aldine')))</li> <li class="previous">@php(previous_comments_link(__('&larr; Older comments', 'aldine')))</li>
@endif @endif
@if (get_next_comments_link()) @if (get_next_comments_link())
<li class="next">@php(next_comments_link(__('Newer comments &rarr;', 'pressbooks-aldine')))</li> <li class="next">@php(next_comments_link(__('Newer comments &rarr;', 'aldine')))</li>
@endif @endif
</ul> </ul>
</nav> </nav>
@ -30,7 +30,7 @@ if (post_password_required()) {
@if (!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments')) @if (!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments'))
<div class="alert alert-warning"> <div class="alert alert-warning">
{{ __('Comments are closed.', 'pressbooks-aldine') }} {{ __('Comments are closed.', 'aldine') }}
</div> </div>
@endif @endif

2
resources/views/partials/content-page.blade.php

@ -1,2 +1,2 @@
@php(the_content()) @php(the_content())
{!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'pressbooks-aldine'), 'after' => '</p></nav>']) !!} {!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'aldine'), 'after' => '</p></nav>']) !!}

2
resources/views/partials/content-single.blade.php

@ -7,7 +7,7 @@
@php(the_content()) @php(the_content())
</div> </div>
<footer> <footer>
{!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'pressbooks-aldine'), 'after' => '</p></nav>']) !!} {!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'aldine'), 'after' => '</p></nav>']) !!}
</footer> </footer>
@php(comments_template('/partials/comments.blade.php')) @php(comments_template('/partials/comments.blade.php'))
</article> </article>

2
resources/views/partials/entry-meta.blade.php

@ -1,6 +1,6 @@
<time class="updated" datetime="{{ get_post_time('c', true) }}">{{ get_the_date() }}</time> <time class="updated" datetime="{{ get_post_time('c', true) }}">{{ get_the_date() }}</time>
<p class="byline author vcard"> <p class="byline author vcard">
{{ __('By', 'pressbooks-aldine') }} <a href="{{ get_author_posts_url(get_the_author_meta('ID')) }}" rel="author" class="fn"> {{ __('By', 'aldine') }} <a href="{{ get_author_posts_url(get_the_author_meta('ID')) }}" rel="author" class="fn">
{{ get_the_author() }} {{ get_the_author() }}
</a> </a>
</p> </p>

6
resources/views/partials/header.blade.php

@ -6,11 +6,11 @@
<a class="catalog" href="{{ home_url('/catalog') }}">Catalog</a> <a class="catalog" href="{{ home_url('/catalog') }}">Catalog</a>
<a class="contact" href="#contact">Contact</a> <a class="contact" href="#contact">Contact</a>
@if(!is_user_logged_in()) @if(!is_user_logged_in())
<a class="signin" href="{{ wp_login_url() }}">{{ __('Sign in', 'pressbooks-aldine') }}</a> <a class="signin" href="{{ wp_login_url() }}">{{ __('Sign in', 'aldine') }}</a>
<span class="sep">/</span> <span class="sep">/</span>
<a class="signup" href="{{ network_home_url('/wp-signup.php') }}">{{ __('Sign up', 'pressbooks-aldine') }}</a> <a class="signup" href="{{ network_home_url('/wp-signup.php') }}">{{ __('Sign up', 'aldine') }}</a>
@else @else
<a class="signin" href="{{ wp_logout_url() }}">{{ __('Sign out', 'pressbooks-aldine') }}</a> <a class="signin" href="{{ wp_logout_url() }}">{{ __('Sign out', 'aldine') }}</a>
@endif @endif
</nav> </nav>
<div class="branding"> <div class="branding">

4
resources/views/partials/uio.blade.php

@ -2,8 +2,8 @@
<div class="flc-slidingPanel-panel flc-prefsEditor-iframe"></div> <div class="flc-slidingPanel-panel flc-prefsEditor-iframe"></div>
<div class="fl-panelBar"> <div class="fl-panelBar">
<span class="fl-prefsEditor-buttons"> <span class="fl-prefsEditor-buttons">
<button id="reset" class="flc-prefsEditor-reset fl-prefsEditor-reset"><span class="fl-icon-undo"></span>{{ __('Reset', 'pressbooks-aldine') }}</button> <button id="reset" class="flc-prefsEditor-reset fl-prefsEditor-reset"><span class="fl-icon-undo"></span>{{ __('Reset', 'aldine') }}</button>
<button id="show-hide" class="flc-slidingPanel-toggleButton fl-prefsEditor-showHide">{{ __('Show/Hide', 'pressbooks-aldine') }}</button> <button id="show-hide" class="flc-slidingPanel-toggleButton fl-prefsEditor-showHide">{{ __('Show/Hide', 'aldine') }}</button>
</span> </span>
</div> </div>
</div> </div>

2
resources/views/search.blade.php

@ -5,7 +5,7 @@
@if (!have_posts()) @if (!have_posts())
<div class="alert alert-warning"> <div class="alert alert-warning">
{{ __('Sorry, no results were found.', 'pressbooks-aldine') }} {{ __('Sorry, no results were found.', 'aldine') }}
</div> </div>
{!! get_search_form(false) !!} {!! get_search_form(false) !!}
@endif @endif

Loading…
Cancel
Save