From 4b112f79cf6156afa83ec7a738ed7c004c105443 Mon Sep 17 00:00:00 2001 From: Ryan Hellyer Date: Sat, 29 Oct 2011 18:08:02 +1300 Subject: [PATCH] Moving from built in designs to child themes --- comments.php | 18 +- designer/css.php | 2 +- designer/designs.php | 3 +- designer/index.php | 5 +- designer/modules/designs.php | 2 + designer/modules/temp.html | 3341 ---------------------------------- designer/sanitization.php | 3 +- functions.php | 42 +- import-export.php | 186 -- testepatch.diff | 0 10 files changed, 56 insertions(+), 3546 deletions(-) delete mode 100644 designer/modules/temp.html delete mode 100755 import-export.php delete mode 100644 testepatch.diff diff --git a/comments.php b/comments.php index b88a6aa..61a9e67 100755 --- a/comments.php +++ b/comments.php @@ -5,12 +5,14 @@ * @since WP Paintbrush 0.9 * * Comments template + * + * Much of the code used in this file was lifted directly from the Coraline theme by Automattic */ ?>
-

+

-

' . get_the_title() . '' ); ?>

+

' . get_the_title() . '' ); ?>

1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> @@ -39,8 +41,8 @@ 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> @@ -51,11 +53,11 @@ */ if ( ! comments_open() ) : ?> -

+

*/ ?> - \ No newline at end of file + diff --git a/designer/css.php b/designer/css.php index be49eb1..43b1cec 100755 --- a/designer/css.php +++ b/designer/css.php @@ -138,7 +138,7 @@ function wppb_convert_published_urls( $css ) { $css = wppb_convert_css_on_load( $css ); return $css; } -add_filter( 'pixopoint_css_filter', 'wppb_convert_published_urls', $css ); +add_filter( 'pixopoint_css_filter', 'wppb_convert_published_urls' ); /* Create CSS from editor submit data * @since 0.1 diff --git a/designer/designs.php b/designer/designs.php index 4ae315e..e9144c9 100755 --- a/designer/designs.php +++ b/designer/designs.php @@ -133,7 +133,6 @@ function wppb_grab_design( $design ) { if ( !isset( $split[1] ) ) $split[1] = ''; $split = explode( WPPB_NAME_SPLIT_END, $split[1] ); // Splitting data - //$split[0] . '
' . $split[1]; // Echo'ing data $name = $split[0]; if ( !isset( $split[1] ) ) @@ -153,7 +152,7 @@ function wppb_publish_options( $wppb_design_settings, $css ) { // Get options ready for publishing $input = wppb_get_options_for_storing( $wppb_design_settings, $css ); - + // Update database with sanitized data update_option( WPPB_SETTINGS, wppb_settings_options_validate( $input ) ); diff --git a/designer/index.php b/designer/index.php index 864a0df..44c8057 100755 --- a/designer/index.php +++ b/designer/index.php @@ -23,7 +23,7 @@ */ define( 'WPPB_DIR', get_template_directory() . '/designer/' ); // Designer framework directory define( 'WPPB_URL', get_template_directory_uri() . '/designer/' ); // Designer framework folder URL -define( 'WPPB_CSS_GENERATOR', 'http://pressabl.com/wp-content/plugins/pressabl-css-generator/index.php?wppb_css_generator=process' ); // Designer framework folder URL +define( 'WPPB_CSS_GENERATOR', 'http://wppaintbrush.com/wp-content/plugins/wppaintbrush-css-generator/index.php?wppb_css_generator=process' ); // Designer framework folder URL /** * Include required files @@ -47,8 +47,9 @@ if ( 'on' == get_option( 'wppb_designer_pane' ) && current_user_can( 'manage_options' ) ) { add_action( 'wp_footer', 'wppb_updatecolours' ); add_action( 'wp_head', 'wppb_inline_scripts' ); - add_action( 'wp_footer', 'wppb_open_editor' ); } +elseif ( current_user_can( 'manage_options' ) ) + add_action( 'wp_footer', 'wppb_open_editor' ); /* Load AJAX content * @since 0.1 diff --git a/designer/modules/designs.php b/designer/modules/designs.php index 8e0a552..594cdd9 100755 --- a/designer/modules/designs.php +++ b/designer/modules/designs.php @@ -27,6 +27,7 @@ function wppb_designs_editor_tab() { ?>
+

@@ -42,6 +43,7 @@ function wppb_designs_editor_tab() { ?>


+ */ ?>

diff --git a/designer/modules/temp.html b/designer/modules/temp.html deleted file mode 100644 index d561afe..0000000 --- a/designer/modules/temp.html +++ /dev/null @@ -1,3341 +0,0 @@ - - - - - Unit Test site | This is the tagline for the Unit Test site, yay! - - - - - - - - - - - - - - - - - - -
- - - -
-
-

Unit Test site

- -
This is the tagline for the Unit Test site, yay!
- -
-
- - - -
-
-
- - -
-
- -
-

Layout Test

- -

This is a sticky post!!! Make sure it sticks!

-

This should then split into other pages with layout, images, HTML tags, and other things.

- - - -
- -
-

Readability Test

- -

All children, except one, grow up. They soon know that they will grow up, and the way Wendy knew was this. One day when she was two years old she was playing in a garden, and she plucked another flower and ran with it to her mother. I suppose she must have looked rather delightful, for Mrs. Darling put her hand to her heart and cried, “Oh, why can’t you remain like this for ever!” This was all that passed between them on the subject, but henceforth Wendy knew that she must grow up. You always know after you are two. Two is the beginning of the end.

-

Continue reading

- - - -
- -
-

Images Test

- -

Image Alignment Tests: Un-Captioned Images

-

Center-align, no caption

-

Center-aligned image with no caption, and text before and after. ALorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed odio nibh, tincidunt adipiscing, pretium nec, tincidunt id, enim. Fusce scelerisque nunc vitae nisl. Quisque quis urna in velit dictum pellentesque. Vivamus a quam. Curabitur eu tortor id turpis tristique adipiscing. Morbi blandit. Maecenas vel est. Nunc aliquam, orci at accumsan commodo, libero nibh euismod augue, a ullamcorper velit dui et purus. Aenean volutpat, ipsum ac imperdiet fermentum, dui dui suscipit arcu, vitae dictum purus diam ac ligula.

-

Left-align, no caption

-

Left-aligned image with no caption, and text before and after. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed odio nibh, tincidunt adipiscing, pretium nec, tincidunt id, enim. Fusce scelerisque nunc vitae nisl. Quisque quis urna in velit dictum pellentesque. Vivamus a quam. Curabitur eu tortor id turpis tristique adipiscing. Morbi blandit. Maecenas vel est. Nunc aliquam, orci at accumsan commodo, libero nibh euismod augue, a ullamcorper velit dui et purus. Aenean volutpat, ipsum ac imperdiet fermentum, dui dui suscipit arcu, vitae dictum purus diam ac ligula.

-

Right-align, no caption

-

Right-aligned image with no caption, and text before and after. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed odio nibh, tincidunt adipiscing, pretium nec, tincidunt id, enim. Fusce scelerisque nunc vitae nisl. Quisque quis urna in velit dictum pellentesque. Vivamus a quam. Curabitur eu tortor id turpis tristique adipiscing. Morbi blandit. Maecenas vel est. Nunc aliquam, orci at accumsan commodo, libero nibh euismod augue, a ullamcorper velit dui et purus. Aenean volutpat, ipsum ac imperdiet fermentum, dui dui suscipit arcu, vitae dictum purus diam ac ligula.

-

No alignment, no caption

-

None-aligned image with no caption, and text before and after. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed odio nibh, tincidunt adipiscing, pretium nec, tincidunt id, enim. Fusce scelerisque nunc vitae nisl. Quisque quis urna in velit dictum pellentesque. Vivamus a quam. Curabitur eu tortor id turpis tristique adipiscing. Morbi blandit. Maecenas vel est. Nunc aliquam, orci at accumsan commodo, libero nibh euismod augue, a ullamcorper velit dui et purus. Aenean volutpat, ipsum ac imperdiet fermentum, dui dui suscipit arcu, vitae dictum purus diam ac ligula.

- - - -
- -
-

Post Format Test: Gallery

- -

FOUR
- - - -

-

-

BLANK
- - - -

-

-

TWO
- - - -

-

- - - -
- -
-

Post Format Test: Aside

- -

“I never tried to prove nothing, just wanted to give a good show. My life has always been my music, it’s always come first, but the music ain’t worth nothing if you can’t lay it on the public. The main thing is to live for that audience, ’cause what you’re there for is to please the people.”

- - - -
- - -
-
-
-
-
- - -
- -
-
- Loading -
-

One moment please. The WP Paintbrush editor is loading.

-
-
-
- - - -
- - - -
-
-
-

Choose design

-

You can select a default design to start from. We will be adding more designs to this area over time.

-
-
-
- -
- -
- -
-


-
-
-

Layout

-

You can modify your layout by dragging content boxes around.

-
Open layout editor
-
-

- Drag content across and arrange it on your template -

-
-
-
    -
  • Menu
  • Header
  • Header image
- - -
-
-

Content blocks

-
-
    -
-
-

Sidebar blocks

-
- -
-
-
-
-
-
-
-
-
- -
-
-

Overall

- -

- -

- -

-
-
-

Background

- -

- -

-
-
-

Full width background

-

Background displayed across the full width of the site - leave blank to use the standard page background.

-

- -

- -

-
-

Border

Border top

- -

- -

- -

-

Border right

- -

- -

- -

-

Border bottom

- -

- -

- -

-

Border left

- -

- -

- -

-

Margins

- -

- -

-
-
-
-

Heading

-

- -

- -

-

-
-

Text

-

- -

- -

-

- -

-

- -

-

- -

-
-
-

Text shadow

- -

- -

- -

- -

-
-
-
-
-
-

Description

-

- -

- -

-

-
-

Text

-

- -

- -

-

- -

-

- -

-

- -

-
-
-

Text shadow

- -

- -

- -

- -

-
-
-
-
-
-

Logo

-

- -

- -

- -

- -

- -

-
-
-
-
-

Search box

-

- -

- -

- -

- -

-

Background

- -

- -

-
-
-

Search text

- -

- -

- -

-

- -

-

- -

-

- -

-

Text shadow

- - -

- -

- -

- -

-

Dimensions

- -

- -

- -

- -

-

Background

- -

- -

-
-
-

Search submit

-

- -

- -

- -

-

- -

-

- -

-

- -

-

Text shadow

- - -

- -

- -

- -

-

Dimensions

- -

- -

- -

- -

-

Background

- -

- -

-
-
-
-
- -
-
- -
-
-
-

Header image

- -

- -

- -

- -

-
-

Border

Border top

- -

- -

- -

-

Border right

- -

- -

- -

-

Border bottom

- -

- -

- -

-

Border left

- -

- -

- -

-

Margins

- -

- -

-
-
-
-
- -
-
-

Publishing

-
-
- -
- -
-
- -
- -
000
-


-
-

CSS

- -
-

"Process" updates the site in front of you.

-

"Save" stores your design for later editing without updating your live site.

-

"Publish" updates the live site to match the new design.

-

"Export" updates the live site and exports the design as a zip file.

-
-
-

Add custom CSS

-

Any CSS added here will be appended to the CSS generated by WP Paintbrush

-
- -
-
-
- -
-

-
-
-
- - -
Colour picker
- - -
-
- -
No image
epic_boobs-change-a-lightbulb1-150x150.jpg
stored/epic_boobs-change-a-lightbulb1-150x150.jpg
633664081664569332-Boobs5.jpg
stored/633664081664569332-Boobs5.jpg
epic-boobs-nom-nom-nom-246x300.jpg
stored/epic-boobs-nom-nom-nom-246x300.jpg
epic-boobs-nom-nom-nom1-150x150.jpg
stored/epic-boobs-nom-nom-nom1-150x150.jpg
big-boobs_280_609549a-215x300.jpg
stored/big-boobs_280_609549a-215x300.jpg
gazette-menu2-background.png
stored/gazette-menu2-background.png
epic-boobs-epic-boobs-wall-demotivational-poster-12585859642.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-12585859642.jpg
epic-boobs-nom-nom-nom1.jpg
stored/epic-boobs-nom-nom-nom1.jpg
epic_boobs-change-a-lightbulb.jpg
stored/epic_boobs-change-a-lightbulb.jpg
gazette-menu.png
stored/gazette-menu.png
boobs4-150x150.png
stored/boobs4-150x150.png
epic_boobs-change-a-lightbulb-150x150.jpg
stored/epic_boobs-change-a-lightbulb-150x150.jpg
epic-boobs-epic-boobs-wall-demotivational-poster-12585859642-240x300.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-12585859642-240x300.jpg
backboobs4.jpg
stored/backboobs4.jpg
boobs.png
stored/boobs.png
epic-boobs-epic-boobs-wall-demotivational-poster-12585859641.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-12585859641.jpg
epic-boobs-are-you-gay.png
stored/epic-boobs-are-you-gay.png
633664081664569332-Boobs3-150x150.jpg
stored/633664081664569332-Boobs3-150x150.jpg
gazette-menu1.png
stored/gazette-menu1.png
epic-boobs-epic-boobs-wall-demotivational-poster-1258585964.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-1258585964.jpg
big-boobs_280_609549a.jpg
stored/big-boobs_280_609549a.jpg
633664081664569332-Boobs1.jpg
stored/633664081664569332-Boobs1.jpg
gazette-menu2-item.png
stored/gazette-menu2-item.png
epic-boobs-are-you-gay1.png
stored/epic-boobs-are-you-gay1.png
epic_boobs-change-a-lightbulb-300x225.jpg
stored/epic_boobs-change-a-lightbulb-300x225.jpg
633664081664569332-Boobs4.jpg
stored/633664081664569332-Boobs4.jpg
boobs1.png
stored/boobs1.png
epic-boobs-nom-nom-nom.jpg
stored/epic-boobs-nom-nom-nom.jpg
backboobs6.jpg
stored/backboobs6.jpg
boobs2.png
stored/boobs2.png
6102008100053AM_1429187231_fdbab74b92.jpg
stored/6102008100053AM_1429187231_fdbab74b92.jpg
epic-boobs-are-you-gay1-300x235.png
stored/epic-boobs-are-you-gay1-300x235.png
backboobs1-300x254.jpg
stored/backboobs1-300x254.jpg
gazette-logo1.png
stored/gazette-logo1.png
633664081664569332-Boobs4-300x240.jpg
stored/633664081664569332-Boobs4-300x240.jpg
backboobs.jpg
stored/backboobs.jpg
epic-boobs-epic-boobs-wall-demotivational-poster-12585859642-150x150.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-12585859642-150x150.jpg
633664081664569332-Boobs5-300x240.jpg
stored/633664081664569332-Boobs5-300x240.jpg
gazette_content.png
stored/gazette_content.png
big-boobs_280_609549a1-150x150.jpg
stored/big-boobs_280_609549a1-150x150.jpg
633664081664569332-Boobs-300x240.jpg
stored/633664081664569332-Boobs-300x240.jpg
boobs3-150x150.png
stored/boobs3-150x150.png
header.png
stored/header.png
backboobs5.jpg
stored/backboobs5.jpg
epic_boobs-change-a-lightbulb2-150x150.jpg
stored/epic_boobs-change-a-lightbulb2-150x150.jpg
menu-item-enterprize.png
stored/menu-item-enterprize.png
searchbox-text-2011.png
stored/searchbox-text-2011.png
lantern-2011.jpg
stored/lantern-2011.jpg
epic-boobs-epic-boobs-wall-demotivational-poster-12585859641-240x300.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-12585859641-240x300.jpg
epic-boobs-are-you-gay-150x150.png
stored/epic-boobs-are-you-gay-150x150.png
BoobNinja-150x150.png
stored/BoobNinja-150x150.png
boobs4-300x272.png
stored/boobs4-300x272.png
epic-boobs-are-you-gay2-300x235.png
stored/epic-boobs-are-you-gay2-300x235.png
backboobs3-150x150.jpg
stored/backboobs3-150x150.jpg
backboobs5-150x150.jpg
stored/backboobs5-150x150.jpg
menu_hover-2011.png
stored/menu_hover-2011.png
backboobs1-150x150.jpg
stored/backboobs1-150x150.jpg
boobs3-300x272.png
stored/boobs3-300x272.png
633664081664569332-Boobs3-300x240.jpg
stored/633664081664569332-Boobs3-300x240.jpg
jailbait-sometimes-its-worth-it-150x150.jpg
stored/jailbait-sometimes-its-worth-it-150x150.jpg
epic-boobs-epic-boobs-wall-demotivational-poster-1258585964-150x150.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-1258585964-150x150.jpg
jailbait-sometimes-its-worth-it-225x300.jpg
stored/jailbait-sometimes-its-worth-it-225x300.jpg
boobs2-150x150.png
stored/boobs2-150x150.png
BoobNinja1-300x240.png
stored/BoobNinja1-300x240.png
footer-2011.png
stored/footer-2011.png
boobs-300x272.png
stored/boobs-300x272.png
gazette-menu2-hoveritem.png
stored/gazette-menu2-hoveritem.png
gazette-logo.png
stored/gazette-logo.png
BoobNinja1-150x150.png
stored/BoobNinja1-150x150.png
pn9cg9nkco.jpg
stored/pn9cg9nkco.jpg
backboobs7.jpg
stored/backboobs7.jpg
633664081664569332-Boobs5-150x150.jpg
stored/633664081664569332-Boobs5-150x150.jpg
coraline-header.jpg
stored/coraline-header.jpg
header-2011.png
stored/header-2011.png
searchbox-submit-2011.png
stored/searchbox-submit-2011.png
633664081664569332-Boobs2.jpg
stored/633664081664569332-Boobs2.jpg
epic_boobs-change-a-lightbulb2-300x225.jpg
stored/epic_boobs-change-a-lightbulb2-300x225.jpg
BoobNinja-300x240.png
stored/BoobNinja-300x240.png
logo-enterprize.png
stored/logo-enterprize.png
backboobs1.jpg
stored/backboobs1.jpg
boobs1-300x272.png
stored/boobs1-300x272.png
epic-boobs-are-you-gay-300x235.png
stored/epic-boobs-are-you-gay-300x235.png
backboobs6-300x254.jpg
stored/backboobs6-300x254.jpg
BoobNinja.png
stored/BoobNinja.png
boobs4.png
stored/boobs4.png
epic-boobs-are-you-gay2-150x150.png
stored/epic-boobs-are-you-gay2-150x150.png
backboobs7-300x254.jpg
stored/backboobs7-300x254.jpg
epic-boobs-epic-boobs-wall-demotivational-poster-12585859641-150x150.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-12585859641-150x150.jpg
633664081664569332-Boobs1-300x240.jpg
stored/633664081664569332-Boobs1-300x240.jpg
backboobs4-150x150.jpg
stored/backboobs4-150x150.jpg
backboobs4-300x254.jpg
stored/backboobs4-300x254.jpg
coraline-footer.png
stored/coraline-footer.png
backboobs3-300x254.jpg
stored/backboobs3-300x254.jpg
backboobs5-300x254.jpg
stored/backboobs5-300x254.jpg
content-enterprize.png
stored/content-enterprize.png
gazette_header.png
stored/gazette_header.png
epic-boobs-are-you-gay2.png
stored/epic-boobs-are-you-gay2.png
epic-boobs-are-you-gay1-150x150.png
stored/epic-boobs-are-you-gay1-150x150.png
BoobNinja1.png
stored/BoobNinja1.png
backboobs-150x150.jpg
stored/backboobs-150x150.jpg
boobs-150x150.png
stored/boobs-150x150.png
coraline-header.png
stored/coraline-header.png
633664081664569332-Boobs2-300x240.jpg
stored/633664081664569332-Boobs2-300x240.jpg
big-boobs_280_609549a1-215x300.jpg
stored/big-boobs_280_609549a1-215x300.jpg
boobs1-150x150.png
stored/boobs1-150x150.png
backboobs2-150x150.jpg
stored/backboobs2-150x150.jpg
menu-enterprize.png
stored/menu-enterprize.png
633664081664569332-Boobs-150x150.jpg
stored/633664081664569332-Boobs-150x150.jpg
6102008100053AM_1429187231_fdbab74b92-150x150.jpg
stored/6102008100053AM_1429187231_fdbab74b92-150x150.jpg
epic_boobs-change-a-lightbulb1-300x225.jpg
stored/epic_boobs-change-a-lightbulb1-300x225.jpg
backboobs6-150x150.jpg
stored/backboobs6-150x150.jpg
633664081664569332-Boobs.jpg
stored/633664081664569332-Boobs.jpg
6102008100053AM_1429187231_fdbab74b92-300x240.jpg
stored/6102008100053AM_1429187231_fdbab74b92-300x240.jpg
boobs3.png
stored/boobs3.png
633664081664569332-Boobs2-150x150.jpg
stored/633664081664569332-Boobs2-150x150.jpg
backboobs-300x254.jpg
stored/backboobs-300x254.jpg
jailbait-sometimes-its-worth-it.jpg
stored/jailbait-sometimes-its-worth-it.jpg
backboobs2.jpg
stored/backboobs2.jpg
epic_boobs-change-a-lightbulb2.jpg
stored/epic_boobs-change-a-lightbulb2.jpg
epic-boobs-epic-boobs-wall-demotivational-poster-1258585964-240x300.jpg
stored/epic-boobs-epic-boobs-wall-demotivational-poster-1258585964-240x300.jpg
backboobs7-150x150.jpg
stored/backboobs7-150x150.jpg
footer.png
stored/footer.png
633664081664569332-Boobs4-150x150.jpg
stored/633664081664569332-Boobs4-150x150.jpg
backboobs2-300x254.jpg
stored/backboobs2-300x254.jpg
footer-enterprize.png
stored/footer-enterprize.png
633664081664569332-Boobs1-150x150.jpg
stored/633664081664569332-Boobs1-150x150.jpg
backboobs3.jpg
stored/backboobs3.jpg
epic-boobs-nom-nom-nom1-246x300.jpg
stored/epic-boobs-nom-nom-nom1-246x300.jpg

Design images

header.png
coraline/header.png
coraline-header.jpg
coraline/coraline-header.jpg
coraline-footer.png
coraline/coraline-footer.png
coraline-header.png
coraline/coraline-header.png
footer.png
coraline/footer.png
-
-

Image uploads

-
- -
- - -
-

Sorry, the server is having difficulties connecting to the CSS generator. Please try again.

-
- -
-

We need to reload the page to show the changes you just selected. One moment please ...

-
- -
-
- - - - - - - - - - - - - - \ No newline at end of file diff --git a/designer/sanitization.php b/designer/sanitization.php index 2f5e842..5116349 100755 --- a/designer/sanitization.php +++ b/designer/sanitization.php @@ -95,7 +95,8 @@ function wppb_sanitize_inputs( $input='' ) { $input[$opt] = ''; $image_location_initial = explode( '/', $input[$opt] ); $image_location_final[0] = sanitize_file_name( $image_location_initial[0] ); - $image_location_final[1] = sanitize_file_name( $image_location_initial[1] ); + if ( isset( $image_location_initial[1] ) ) + $image_location_final[1] = sanitize_file_name( $image_location_initial[1] ); $wppb_design_settings[$opt] = implode( '/', $image_location_final ); if ( '/' == $wppb_design_settings[$opt] ) $wppb_design_settings[$opt] = ''; diff --git a/functions.php b/functions.php index 65bdb03..8e8d13c 100755 --- a/functions.php +++ b/functions.php @@ -21,14 +21,23 @@ define( 'PIXOPOINT_SETTINGS_COPYRIGHT', 'Theme by WPPaintbrush.com' ); // Copyright constant define( 'WPPB_ADMIN_URL', get_template_directory_uri() . '/admin' ); // Admin directory URL define( 'WPPB_TEMPLATES_LABEL', 'Themes' ); // Decides what label to give the templates page (for theme selection page - in development as an addon plugin) -define( 'WPPB_SETTINGS', 'wppb_settings' ); // Label for option used to store template code in database -define( 'WPPB_DESIGNER_SETTINGS', 'wppb_designer_settings' ); // Label for option used to store designer settings in database define( 'WPPB_STORAGE_FOLDER', 'wppb_storage' ); define( 'WPPB_STORAGE_IMAGES_FOLDER', wppb_storage_folder( 'images', 'url' ) ); define( 'WPPB_BLOCK_SPLITTER', "/* PixoPoint Template option */\n" ); // Strings used to descriminate between differents bits in exported/imported files define( 'WPPB_NAME_SPLIT_START', '[----' ); // Strings used to descriminate between differents bits in exported/imported files define( 'WPPB_NAME_SPLIT_END', "----]\n" ); // Strings used to descriminate between differents bits in exported/imported files +/* Set Theme specific Constants + * Defined later due to child themes needing to override these constants (allows child themes to store data separately from core theme) + * @since 1.0.6 + */ +function wppb_theme_constants() { + define( 'WPPB_SETTINGS', 'wppb_settings' ); // Label for option used to store template code in database + define( 'WPPB_DESIGNER_SETTINGS', 'wppb_designer_settings' ); // Label for option used to store designer settings in database +} +if ( !defined( 'WPPB_SETTINGS' ) ) + add_action( 'init', 'wppb_theme_constants', 1 ); + /** * Set widget suffixes * Currently uses numbers, but could easily incorporate text instead @@ -53,7 +62,6 @@ function wppb_settings_thumbs_array() { */ function get_wppb_option( $option='' ) { - // Grab options from database $options = get_option( WPPB_SETTINGS ); // Choose which bit to return @@ -89,7 +97,6 @@ function get_wppb_option( $option='' ) { require( get_template_directory() . '/admin_pages.php' ); // Admin specific functions - need loaded for front end of theme roller too require( get_template_directory() . '/designer/index.php' ); // Loading designer interface require( get_template_directory() . '/templating/index.php' ); // Loading PixoPoint emplating framework -require( get_template_directory() . '/import-export.php' ); // Loading Import/Export script require( get_template_directory() . '/images.php' ); // Loading image uploader functions /** @@ -105,7 +112,10 @@ function get_wppb_option( $option='' ) { * Dynamically create CSS file * @since 0.3 */ +function bla() { pixopoint_fallback_css( WPPB_SETTINGS, 'css' ); +} +add_action( 'init', 'bla'); /** * Sanitize and validate input @@ -256,6 +266,28 @@ function wppb_callback_string_in_templates( $v1, $v2 ) { return $v1 . "\n\n\n\n\n" . $v2; } +/** + * Utilized within child themes for changing to a new design + * @since 1.0.6 + */ +function wppb_child_theme_setup() { + global $pagenow; + + $css = get_wppb_option( 'css' ); // Used for checking if data stored + if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" && !isset( $css ) ) { + + // Grab design + $wppb_design = wppb_grab_design( WPPB_CHILD_THEME ); // Grab design + + // Change the design to the one specified (alters front-end editor settings) + wppb_change_design( $wppb_design ); + + // Publish theme + wppb_publish_options( $wppb_design, $wppb_design['css'] ); + + } +} + /** * Load CSS * @since 0.1 @@ -267,7 +299,7 @@ function wppb_settings_css() { return; // Load CSS (uses PixoPoint templating framework function as addon plugins for the framework will allow for variations in how the CSS loaded, eg: inline CSS, static cached files etc.) - pixopoint_css( 'wppb_settings' ); + pixopoint_css( WPPB_SETTINGS ); } add_action( 'wp_print_styles', 'wppb_settings_css' ); diff --git a/import-export.php b/import-export.php deleted file mode 100755 index 85a6a0c..0000000 --- a/import-export.php +++ /dev/null @@ -1,186 +0,0 @@ - -
- ' . get_current_theme() . __( ' Import/exporter', 'pixopoint_theme_editor' ) . ''; - - // "Options Saved" message as displayed at top of page on clicking "Save" - if ( isset( $_GET['updated'] ) ) - echo '

' . __( 'Options saved' ) . '

'; - ?> -
- - - -

-

- -

-

- - - -

-

- -

-

 

- -

-

-

- -

- - -
-
- - LINK';die(); - - // Copying images folder - $from = wppb_storage_folder( 'tmp' ) . $rand . '/' . $folder_contents[0] . '/images/'; - $to = wppb_storage_folder( 'images' ) . '/'; - wppb_copy_images( $from, $to ); - - // Grabbing contents of data file - $data = file_get_contents( wppb_storage_folder( 'tmp' ) . $rand . '/' . $folder_contents[0] . '/data.tpl' ); // Shoving file contents into string - // If no data.tpl file detected (or file is empty), then bail out to error message page - if ( '' == $data ) { - wp_redirect( home_url() . '/wp-admin/themes.php?page=import_template&error=no_data_file' ); - exit; - } - - // Delete temporary folder (where zip contents were stashed) - wppb_delete_directory( wppb_storage_folder( 'tmp' ) . $rand ); - - // Processing data ready for database - $data = explode( WPPB_BLOCK_SPLITTER, $data ); // Splitting data - $counter = 0; - $options = array(); - while ( $counter <= 100 ) { - $split = explode( WPPB_NAME_SPLIT_START, $data[$counter+1] ); // Splitting data - $split = explode( WPPB_NAME_SPLIT_END, $split[1] ); // Splitting data - //$split[0] . '
' . $split[1]; // Echo'ing data - $name = $split[0]; - $options[$name] = $split[1]; - $counter++; - } - - // Shoving data into database after validating it - update_option( WPPB_SETTINGS, wppb_settings_options_validate( $options ) ); - pixopoint_validate_css( get_wppb_option( 'css' ), 'style' ); - - // Since it was a success - redirect back to page (with success message) - wp_redirect( home_url() . '/wp-admin/themes.php?page=import_template&updated=yay' ); - exit; -} - -/** - * wppb_error_no_data_file() - * @description Displays an error message when no data.tpl file is detected in an imported theme - * @since 0.8.1 - */ -function wppb_error_no_data_file() { - echo ' -
-

- Sorry, but there appears to be no data.tpl file in that theme. -

-

- Note: You can only upload themes which have been previously exported from WP Paintbrush. Themes from other sites will not work. -

-
'; -} -if ( isset( $_GET['error'] ) ) { - if ( 'no_data_file' == $_GET['error'] ) - add_action( 'admin_notices', 'wppb_error_no_data_file' ); -} - -/** - * wppb_update_theme_imported() - * @description Displays an update message when a theme is imported - * @since 0.8.1 - */ -function wppb_update_theme_imported() { - echo ' -
-

- Yay! Your theme has been successfully imported :) -

-
'; -} -if ( isset( $_GET['updated'] ) ) { - if ( 'yay' == $_GET['updated'] ) - add_action( 'admin_notices', 'wppb_update_theme_imported' ); -} - diff --git a/testepatch.diff b/testepatch.diff deleted file mode 100644 index e69de29..0000000