Permalink
Browse files

Separating the Hybrid Core into its own directory and using svn:exter…

…nals to pull it into the theme.

git-svn-id: http://svn.locallylost.com/themes/hybrid/trunk@328 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information...
greenshady
greenshady committed Aug 27, 2010
1 parent 121de27 commit def89e5cf25fc5903dd5301a75e4a31b90943417
Showing with 0 additions and 8,680 deletions.
  1. +0 −81 library/admin/admin.php
  2. +0 −256 library/admin/meta-box.php
  3. +0 −386 library/admin/settings-page.php
  4. +0 −282 library/classes/hybrid.php
  5. +0 −174 library/classes/widget-archives.php
  6. +0 −184 library/classes/widget-authors.php
  7. +0 −300 library/classes/widget-bookmarks.php
  8. +0 −98 library/classes/widget-calendar.php
  9. +0 −285 library/classes/widget-categories.php
  10. +0 −192 library/classes/widget-nav-menu.php
  11. +0 −251 library/classes/widget-pages.php
  12. +0 −140 library/classes/widget-search.php
  13. +0 −284 library/classes/widget-tags.php
  14. +0 −1 library/css/18px.css
  15. +0 −1 library/css/20px.css
  16. +0 −1 library/css/21px.css
  17. +0 −1 library/css/22px.css
  18. +0 −1 library/css/24px.css
  19. +0 −1 library/css/25px.css
  20. +0 −63 library/css/2c-l-fixed.css
  21. +0 −61 library/css/2c-r-fixed.css
  22. +0 −85 library/css/3c-c-fixed.css
  23. +0 −63 library/css/3c-l-fixed.css
  24. +0 −63 library/css/3c-r-fixed.css
  25. +0 −57 library/css/admin.css
  26. +0 −61 library/css/drop-downs.css
  27. +0 −1 library/css/holy-grail-fluid.css
  28. +0 −1 library/css/plugins.css
  29. +0 −1 library/css/print.css
  30. +0 −71 library/css/readme.css
  31. +0 −1 library/css/reset.css
  32. +0 −609 library/css/screen.css
  33. +0 −20 library/css/ui-tabs.css
  34. +0 −335 library/extensions/breadcrumb-trail.php
  35. +0 −91 library/extensions/custom-field-series.php
  36. +0 −158 library/extensions/entry-views.php
  37. +0 −400 library/extensions/get-the-image.php
  38. +0 −267 library/extensions/get-the-object.php
  39. +0 −100 library/extensions/loop-pagination.php
  40. +0 −174 library/functions/comments.php
  41. +0 −393 library/functions/context.php
  42. +0 −207 library/functions/core.php
  43. +0 −117 library/functions/defaults.php
  44. +0 −248 library/functions/hooks-actions.php
  45. +0 −391 library/functions/hooks-filters.php
  46. +0 −222 library/functions/media.php
  47. +0 −46 library/functions/menus.php
  48. +0 −405 library/functions/shortcodes.php
  49. +0 −230 library/functions/template.php
  50. +0 −218 library/functions/widgets.php
  51. BIN library/images/pingback.png
  52. BIN library/images/trackback.png
  53. +0 −77 library/js/drop-downs.js
  54. +0 −525 library/legacy/deprecated.php
View
@@ -1,81 +0,0 @@
-<?php
-/**
- * The theme administration functions are initialized and set up mainly from this file. It is used to
- * launch the theme settings page and allow child themes and plugins to access theme-specific
- * features. See meta-box.php for the post meta box functions.
- *
- * @package HybridCore
- * @subpackage Admin
- */
-
-/* Initialize the theme admin functionality. */
-add_action( 'init', 'hybrid_admin_init' );
-
-/**
- * Initializes the theme administration functions. Makes sure we have a theme settings
- * page and a meta box on the edit post/page screen.
- *
- * @since 0.7
- */
-function hybrid_admin_init() {
- $prefix = hybrid_get_prefix();
-
- if ( current_theme_supports( 'hybrid-core-theme-settings' ) ) {
-
- /* Initialize the theme settings page. */
- add_action( 'admin_menu', 'hybrid_settings_page_init' );
-
- /* Save settings page meta boxes. */
- add_action( "{$prefix}_update_settings_page", 'hybrid_save_theme_settings' );
- }
-
- /* Add a new meta box to the post editor. */
- if ( current_theme_supports( 'hybrid-core-post-meta-box' ) )
- add_action( 'admin_menu', 'hybrid_create_post_meta_box' );
-
- /* Load the admin stylesheet for the widgets screen. */
- add_action( 'load-widgets.php', 'hybrid_settings_page_enqueue_style' );
-}
-
-/**
- * Function for getting an array of available custom templates with a specific header. Ideally,
- * this function would be used to grab custom singular post (any post type) templates.
- *
- * @since 0.7
- * @param array $args Arguments to check the templates against.
- * @return array $post_templates The array of templates.
- */
-function hybrid_get_post_templates( $args = array() ) {
-
- $args = wp_parse_args( $args, array( 'label' => array( 'Post Template' ) ) );
-
- $themes = get_themes();
- $theme = get_current_theme();
- $templates = $themes[$theme]['Template Files'];
- $post_templates = array();
-
- if ( is_array( $templates ) ) {
- $base = array( trailingslashit( get_template_directory() ), trailingslashit( get_stylesheet_directory() ) );
-
- foreach ( $templates as $template ) {
- $basename = str_replace( $base, '', $template );
-
- $template_data = implode( '', file( $template ) );
-
- $name = '';
- foreach ( $args['label'] as $label ) {
- if ( preg_match( "|{$label}:(.*)$|mi", $template_data, $name ) ) {
- $name = _cleanup_header_comment( $name[1] );
- break;
- }
- }
-
- if ( !empty( $name ) )
- $post_templates[trim( $name )] = $basename;
- }
- }
-
- return $post_templates;
-}
-
-?>
View
@@ -1,256 +0,0 @@
-<?php
-/**
- * Creates the theme post meta box functionality, which can be extended, changed, or
- * removed through child themes or plugins. The goal is to make it easier for the average end
- * user to update post metadata without having to understand how custom fields work.
- *
- * @package HybridCore
- * @subpackage Admin
- */
-
-/**
- * Creates a meta box on the post (page, other post types) editing screen for allowing
- * the easy input of commonly-used post metadata. The function uses the get_post_types()
- * function for grabbing a list of available post types and adding a new meta box for
- * each post type.
- *
- * @since 0.7
- * @uses get_post_types() Gets an array of post type objects.
- * @uses add_meta_box() Adds a meta box to the post editing screen.
- */
-function hybrid_create_post_meta_box() {
-
- /* Get theme information. */
- $prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
- $theme_data = get_theme_data( TEMPLATEPATH . '/style.css' );
-
- /* Gets available post types. */
- $post_types = get_post_types( array( 'public' => true, 'exclude_from_search' => false ), 'objects' );
-
- /* For each available post type, create a meta box on its edit page if it supports '$prefix-post-settings'. */
- foreach ( $post_types as $type ) {
- if ( post_type_supports( $type->name, "{$prefix}-post-settings" ) ) {
-
- /* Add the meta box. */
- add_meta_box( "{$prefix}-{$type->name}-meta-box", sprintf( __( '%1$s Settings', $domain ), $type->labels->singular_name ), 'hybrid_post_meta_box', $type->name, 'normal', 'high' );
-
- /* Saves the post meta box data. */
- add_action( 'save_post', 'hybrid_save_post_meta_box', 10, 2 );
- }
- }
-}
-
-/**
- * Creates the settings for the post meta box depending on some things in how the theme is
- * set up.
- *
- * @since 0.7
- * @param string $type The post_type of the current post in the post editor.
- */
-function hybrid_post_meta_box_args( $type = '' ) {
-
- /* Get theme information. */
- $prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
-
- /* If no post type is given, default to 'post'. */
- if ( empty( $type ) )
- $type = 'post';
-
- /* If the disable SEO plugin setting is not selected, allow the input of custom meta. */
- if ( current_theme_supports( 'hybrid-core-seo' ) ) {
- $meta['title'] = array( 'name' => 'Title', 'title' => __( 'Title:', $domain ), 'type' => 'text' );
- $meta['description'] = array( 'name' => 'Description', 'title' => __( 'Description:', $domain ), 'type' => 'textarea' );
- $meta['keywords'] = array( 'name' => 'Keywords', 'title' => __( 'Keywords:', $domain ), 'type' => 'text' );
- }
-
- /* Integrates with the custom field series extension. */
- if ( current_theme_supports( 'custom-field-series' ) )
- $meta['series'] = array( 'name' => 'Series', 'title' => __( 'Series:', $domain ), 'type' => 'text' );
-
- /* Input box for a custom thumbnail. */
- if ( current_theme_supports( 'get-the-image' ) )
- $meta['thumbnail'] = array( 'name' => 'Thumbnail', 'title' => __( 'Thumbnail:', $domain ), 'type' => 'text' );
-
- /* Input box for a custom stylesheet. */
- if ( current_theme_supports( 'post-stylesheets' ) )
- $meta['stylesheet'] = array( 'name' => 'Stylesheet', 'title' => __( 'Stylesheet:', $domain ), 'type' => 'text' );
-
- /* If there are any custom post templates, allow the user to select one. */
- if ( 'page' != $type && 'attachment' != $type ) {
- $post_type_object = get_post_type_object( $type );
-
- if ( $post_type_object->labels->singular_name || $post_type_object->name ) {
- $templates = hybrid_get_post_templates( array( 'label' => array( "{$post_type_object->labels->singular_name} Template", "{$post_type_object->name} Template" ) ) );
-
- if ( 0 != count( $templates ) )
- $meta['template'] = array( 'name' => "_wp_{$type}_template", 'title' => __( 'Template:', $domain ), 'type' => 'select', 'options' => $templates, 'use_key_and_value' => true );
- }
- }
-
- /* Add post layouts option if current theme supports them. */
- if ( current_theme_supports( 'post-layouts' ) )
- $meta['post_layout'] = array( 'name' => 'Layout', 'title' => __( 'Layout:', $domain ), 'type' => 'select', 'options' => array( '1c', '2c-l', '2c-r', '3c-l', '3c-r', '3c-c' ) );
-
- /* $prefix_$type_meta_boxes filter is deprecated. Use $prefix_$type_meta_box_args instead. */
- $meta = apply_filters( "{$prefix}_{$type}_meta_boxes", $meta );
-
- return apply_filters( "{$prefix}_{$type}_meta_box_args", $meta );
-}
-
-/**
- * Displays the post meta box on the edit post page. The function gets the various metadata elements
- * from the hybrid_post_meta_box_args() function. It then loops through each item in the array and
- * displays a form element based on the type of setting it should be.
- *
- * @since 0.7
- * @parameter object $object Post object that holds all the post information.
- * @parameter array $box The particular meta box being shown and its information.
- */
-function hybrid_post_meta_box( $object, $box ) {
-
- $prefix = hybrid_get_prefix();
-
- $meta_box_options = hybrid_post_meta_box_args( $object->post_type ); ?>
-
- <input type="hidden" name="<?php echo "{$prefix}_{$object->post_type}_meta_box_nonce"; ?>" value="<?php echo wp_create_nonce( basename( __FILE__ ) ); ?>" />
-
- <table class="form-table">
-
- <?php foreach ( $meta_box_options as $option ) {
- if ( function_exists( "hybrid_post_meta_box_{$option['type']}" ) )
- call_user_func( "hybrid_post_meta_box_{$option['type']}", $option, get_post_meta( $object->ID, $option['name'], true ) );
- } ?>
-
- </table><!-- .form-table --><?php
-}
-
-/**
- * Outputs a text input box with the given arguments for use with the post meta box.
- *
- * @since 0.7
- * @param array $args
- * @param string|bool $value Custom field value.
- */
-function hybrid_post_meta_box_text( $args = array(), $value = false ) {
- $name = preg_replace( "/[^A-Za-z_-]/", '-', $args['name'] ); ?>
- <tr>
- <th style="width:10%;"><label for="<?php echo $name; ?>"><?php echo $args['title']; ?></label></th>
- <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_html( $value ); ?>" size="30" tabindex="30" style="width: 97%;" /></td>
- </tr>
- <?php
-}
-
-/**
- * Outputs a select box with the given arguments for use with the post meta box.
- *
- * @since 0.7
- * @param array $args
- * @param string|bool $value Custom field value.
- */
-function hybrid_post_meta_box_select( $args = array(), $value = false ) {
- $name = preg_replace( "/[^A-Za-z_-]/", '-', $args['name'] ); ?>
- <tr>
- <th style="width:10%;"><label for="<?php echo $name; ?>"><?php echo $args['title']; ?></label></th>
- <td>
- <select name="<?php echo $name; ?>" id="<?php echo $name; ?>">
- <option value=""></option>
- <?php foreach ( $args['options'] as $option => $val ) : ?>
- <option <?php if ( htmlentities( $value, ENT_QUOTES ) == $val ) echo ' selected="selected"'; ?> value="<?php echo $val; ?>"><?php if ( !empty( $args['use_key_and_value'] ) ) echo $option; else echo $val; ?></option>
- <?php endforeach; ?>
- </select>
- </td>
- </tr>
- <?php
-}
-
-/**
- * Outputs a textarea with the given arguments for use with the post meta box.
- *
- * @since 0.7
- * @param array $args
- * @param string|bool $value Custom field value.
- */
-function hybrid_post_meta_box_textarea( $args = array(), $value = false ) {
- $name = preg_replace( "/[^A-Za-z_-]/", '-', $args['name'] ); ?>
- <tr>
- <th style="width:10%;"><label for="<?php echo $name; ?>"><?php echo $args['title']; ?></label></th>
- <td><textarea name="<?php echo $name; ?>" id="<?php echo $name; ?>" cols="60" rows="4" tabindex="30" style="width: 97%;"><?php echo esc_html( $value ); ?></textarea></td>
- </tr>
- <?php
-}
-
-/**
- * Outputs radio inputs with the given arguments for use with the post meta box.
- *
- * @since 0.8
- * @param array $args
- * @param string|bool $value Custom field value.
- */
-function hybrid_post_meta_box_radio( $args = array(), $value = false ) {
- $name = preg_replace( "/[^A-Za-z_-]/", '-', $args['name'] ); ?>
- <tr>
- <th style="width:10%;"><label for="<?php echo $name; ?>"><?php echo $args['title']; ?></label></th>
- <td>
- <?php foreach ( $args['options'] as $option => $val ) { ?>
- <input <?php if ( htmlentities( $value, ENT_QUOTES ) == $val ) echo ' checked="checked"'; ?>type="radio" name="<?php echo $name; ?>" value="<?php echo $val; ?>" /> <?php echo $val; ?>
- <?php } ?>
- </td>
- </tr>
- <?php
-}
-
-/**
- * The function for saving the theme's post meta box settings. It loops through each of the meta
- * box arguments for that particular post type and adds, updates, or deletes the metadata.
- *
- * @since 0.7
- * @param int $post_id
- */
-function hybrid_save_post_meta_box( $post_id, $post ) {
-
- $prefix = hybrid_get_prefix();
-
- /* Verify the nonce before preceding. */
- if ( !post_type_supports( $post->post_type, "{$prefix}-post-settings" ) || !isset( $_POST["{$prefix}_{$post->post_type}_meta_box_nonce"] ) || !wp_verify_nonce( $_POST["{$prefix}_{$post->post_type}_meta_box_nonce"], basename( __FILE__ ) ) )
- return $post_id;
-
- /* Get the post type object. */
- $post_type = get_post_type_object( $post->post_type );
-
- /* Make sure the post type supports the post settings meta box. */
- if ( !post_type_supports( $post_type->name, "{$prefix}-post-settings" ) )
- return $post_id;
-
- /* Check if the current user has permission to edit the post. */
- if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
- return $post_id;
-
- /* Get the post meta box arguments. */
- $metadata = hybrid_post_meta_box_args( $_POST['post_type'] );
-
- /* Loop through all of post meta box arguments. */
- foreach ( $metadata as $meta ) {
-
- /* Get the meta value of the custom field key. */
- $meta_value = get_post_meta( $post_id, $meta['name'], true );
-
- /* Get the meta value the user input. */
- $new_meta_value = stripslashes( $_POST[ preg_replace( "/[^A-Za-z_-]/", '-', $meta['name'] ) ] );
-
- /* If a new meta value was added and there was no previous value, add it. */
- if ( $new_meta_value && '' == $meta_value )
- add_post_meta( $post_id, $meta['name'], $new_meta_value, true );
-
- /* If the new meta value does not match the old value, update it. */
- elseif ( $new_meta_value && $new_meta_value != $meta_value )
- update_post_meta( $post_id, $meta['name'], $new_meta_value );
-
- /* If there is no new meta value but an old value exists, delete it. */
- elseif ( '' == $new_meta_value && $meta_value )
- delete_post_meta( $post_id, $meta['name'], $meta_value );
- }
-}
-
-?>
Oops, something went wrong.

0 comments on commit def89e5

Please sign in to comment.