Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

Commit a1e42cc

Browse files
first commit
0 parents  commit a1e42cc

40 files changed

+848
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_size = 4
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Include your project-specific ignores in this file
2+
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
3+
node_modules
4+
npm-debug.log
5+
vendor
6+
7+
.DS_Store
8+
Thumbs.db

404.php

Whitespace-only changes.

LICENSE.md

Whitespace-only changes.

README.md

Whitespace-only changes.

bootstrap/compatibility.php

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Searches for `Tonik & Gin` plugin
6+
|--------------------------------------------------------------------------
7+
|
8+
| This section checks if `Tonik & Gin` plugin is present. It is
9+
| required to correct functioning. When plugin is missing
10+
| display error messages on the front and admin.
11+
|
12+
*/
13+
14+
// Include detect plugin.
15+
if ( ! function_exists('is_plugin_active')) {
16+
include_once ABSPATH . 'wp-admin/includes/plugin.php';
17+
}
18+
19+
if ( ! (
20+
is_plugin_active('tonik-gin/tonik-gin.php')
21+
|| class_exists('Tonik\Gin\Foundation\Theme')
22+
))
23+
{
24+
/**
25+
* Checks if we on the admin, login or register page.
26+
*
27+
* @return boolean
28+
*/
29+
function tonikgin_is_admin_login_or_register_page()
30+
{
31+
global $pagenow;
32+
33+
return is_admin() || in_array($pagenow, ['wp-login.php', 'wp-register.php']);
34+
}
35+
36+
// Die and display alert information, if we are
37+
// not on the admin, login or register page.
38+
if ( ! tonikgin_is_admin_login_or_register_page()) {
39+
wp_die(__("Unfortunately, this theme requires <strong>Tonik&Gin</strong> plugin. Please, make sure it's installed and activated.", '{{ theme.textdomain }}'));
40+
}
41+
42+
/**
43+
* Outputs error message markup about missing plugin.
44+
*
45+
* @return void
46+
*/
47+
function tonikgin_not_found_notice()
48+
{
49+
?>
50+
<div class="error notice">
51+
<p>
52+
<?php _e('We could not find <strong>Tonik&Gin plugin</strong>. Install and activate', '{{ theme.textdomain }}'); ?>
53+
</p>
54+
</div>
55+
<?php
56+
}
57+
58+
// Hook to the admin notices and display error message.
59+
add_action('admin_notices', 'tonikgin_not_found_notice');
60+
61+
return;
62+
}

bootstrap/theme.php

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/*
4+
|-----------------------------------------------------------
5+
| Create the Theme
6+
|-----------------------------------------------------------
7+
|
8+
| Create a new Theme instance which behaves as singleton.
9+
| This allows for easily bind and resolve various
10+
| parts across all theme components.
11+
|
12+
*/
13+
14+
$theme = Tonik\Gin\Foundation\Theme::getInstance();
15+
16+
17+
/*
18+
|-----------------------------------------------------------
19+
| Bind Theme Config
20+
|-----------------------------------------------------------
21+
|
22+
| We neet to bind all configs like theme's paths, directories
23+
| and files to autoload. We look for child theme config
24+
| file before binding values inside theme registry.
25+
|
26+
*/
27+
28+
$config = require __DIR__ . '/../config/theme.php';
29+
30+
if ($childConfig = locate_template('config/theme.php', false, false)) {
31+
$theme->bind('config', array_merge($config, require $childConfig));
32+
}
33+
34+
$theme->bind('config', $config);
35+
36+
37+
/*
38+
|-----------------------------------------------------------
39+
| Return the Theme
40+
|-----------------------------------------------------------
41+
|
42+
| Here we returns the theme instance. Later, this instance
43+
| is used for autoload all theme's core component.
44+
|
45+
*/
46+
47+
return $theme;

composer.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "tonik/theme",
3+
"description": "WordPress starter theme.",
4+
"keywords": ["tonik", "gin", "wordpress", "theme"],
5+
"license": "GPL-2.0+",
6+
"type": "wordpress-theme",
7+
"require": {
8+
"php": ">=5.4",
9+
"tonik/gin": "@dev"
10+
},
11+
"require-dev": {
12+
"symfony/console": "~2.3|~3.0"
13+
},
14+
"repositories": [
15+
{
16+
"type": "vcs",
17+
"url": "/Users/jedrzejchalubek/Code/tonik/gin"
18+
}
19+
],
20+
"minimum-stability": "dev"
21+
}

0 commit comments

Comments
 (0)