Skip to content
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...
1 parent 121de27 commit def89e5cf25fc5903dd5301a75e4a31b90943417 greenshady committed Aug 27, 2010
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
81 library/admin/admin.php
@@ -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
256 library/admin/meta-box.php
@@ -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 );
- }
-}
-
-?>
View
386 library/admin/settings-page.php
@@ -1,386 +0,0 @@
-<?php
-/**
- * Handles the display and functionality of the theme settings page. This provides the needed hooks and
- * meta box calls for developers to create any number of theme settings needed.
- *
- * Provides the ability for developers to add custom meta boxes to the theme settings page by using the
- * add_meta_box() function. Developers should hook their meta box registration function to 'admin_menu'
- * and register the meta box for 'appearance_page-theme-settings'. If data needs to be saved, devs can
- * use the '$prefix_update_settings_page' action hook to save their data.
- *
- * @package HybridCore
- * @subpackage Admin
- */
-
-/**
- * Initializes all the theme settings page functions. This function is used to create the theme
- * settings page, then use that as a launchpad for specific actions that need to be tied to the
- * settings page.
- *
- * Users or developers can set a custom capability (default is 'edit_themes') for access to the
- * settings page using the "$prefix_settings_capability" filter hook.
- *
- * @since 0.7
- * @global string $hybrid The global theme object.
- */
-function hybrid_settings_page_init() {
- global $hybrid;
-
- /* Get theme information. */
- $theme_data = get_theme_data( TEMPLATEPATH . '/style.css' );
- $prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
-
- /* Create the theme settings page. */
- $hybrid->settings_page = add_theme_page( sprintf( __( '%1$s Theme Settings', $domain ), $theme_data['Name'] ), sprintf( __( '%1$s Settings', $domain ), $theme_data['Name'] ), apply_filters( "{$prefix}_settings_capability", 'edit_theme_options' ), 'theme-settings', 'hybrid_settings_page' );
-
- /* Register the default theme settings meta boxes. */
- add_action( "load-{$hybrid->settings_page}", 'hybrid_create_settings_meta_boxes' );
-
- /* Make sure the settings are saved. */
- add_action( "load-{$hybrid->settings_page}", 'hybrid_load_settings_page' );
-
- /* Load the JavaScript and stylehsheets needed for the theme settings. */
- add_action( "load-{$hybrid->settings_page}", 'hybrid_settings_page_enqueue_script' );
- add_action( "load-{$hybrid->settings_page}", 'hybrid_settings_page_enqueue_style' );
- add_action( "admin_head-{$hybrid->settings_page}", 'hybrid_settings_page_load_scripts' );
-}
-
-/**
- * This function creates all of the default theme settings and adds them to a single array. By saving
- * them in one array, the function only creates one setting in the {$wpdb->prefix}_options table.
- *
- * @since 0.4
- * @return array All options for theme settings.
- */
-function hybrid_theme_settings() {
- $domain = hybrid_get_textdomain();
-
- /* Add the default data to the theme settings array. */
- $settings = array(
- 'feed_url' => false,
- 'feeds_redirect' => false,
- 'print_style' => false,
- 'superfish_js' => true,
- 'seo_plugin' => false,
- 'use_menus' => true,
- 'footer_insert' => '<p class="copyright">' . __( 'Copyright &#169; [the-year] [site-link].', $domain ) . '</p>' . "\n\n" . '<p class="credit">' . __( 'Powered by [wp-link] and [theme-link].', $domain ) . '</p>',
- );
-
- /* If there is a child theme active, add the [child-link] shortcode to the $footer_insert. */
- if ( STYLESHEETPATH !== TEMPLATEPATH )
- $settings['footer_insert'] = '<p class="copyright">' . __( 'Copyright &#169; [the-year] [site-link].', $domain ) . '</p>' . "\n\n" . '<p class="credit">' . __( 'Powered by [wp-link], [theme-link], and [child-link].', $domain ) . '</p>';
-
- return apply_filters( hybrid_get_prefix() . '_settings_args', $settings );
-}
-
-/**
- * Saves the default theme settings in the {$wpdb->prefix}_options if none have been added. The
- * settings are given a unique name depending on the theme directory. They are always saved as
- * {$prefix}_theme_settings in the database. It also fires the {$prefix}_update_settings_page
- * hook for saving custom settings.
- *
- * @since 0.7
- */
-function hybrid_load_settings_page() {
- $prefix = hybrid_get_prefix();
-
- /* Get theme settings from the database. */
- $settings = get_option( "{$prefix}_theme_settings" );
-
- /* If no settings are available, add the default settings to the database. */
- if ( empty( $settings ) ) {
- $settings = hybrid_theme_settings();
- add_option( "{$prefix}_theme_settings", $settings, '', 'yes' );
-
- /* Redirect the page so that the settings are reflected on the settings page. */
- wp_redirect( admin_url( 'themes.php?page=theme-settings' ) );
- exit;
- }
-
- /* If the form has been submitted, check the referer and execute available actions. */
- elseif ( isset( $_POST["{$prefix}-settings-submit"] ) && 'Y' == $_POST["{$prefix}-settings-submit"] ) {
-
- /* Make sure the form is valid. */
- check_admin_referer( "{$prefix}-settings-page" );
-
- /* Available hook for saving settings. */
- do_action( "{$prefix}_update_settings_page" );
-
- /* Redirect the page so that the new settings are reflected on the settings page. */
- wp_redirect( admin_url( 'themes.php?page=theme-settings&updated=true' ) );
- exit;
- }
-}
-
-/**
- * Updates the default theme settings if the settings page has been updated. It validates the values
- * added through the default theme settings page meta boxes. Only settings returned by the
- * hybrid_theme_settings() function will be saved. Child themes and plugins should save their settings
- * separately.
- *
- * @since 0.7
- */
-function hybrid_save_theme_settings() {
- $prefix = hybrid_get_prefix();
-
- /* Get the current theme settings. */
- $settings = get_option( "{$prefix}_theme_settings" );
-
- /* Loop through each of the default settings and match them with the posted settings. */
- foreach ( hybrid_theme_settings() as $key => $value )
- $settings[$key] = ( isset( $_POST[$key] ) ? $_POST[$key] : '' );
-
- /* Make sure users without the 'unfiltered_html' capability can't add HTML to the footer insert. */
- if ( $settings['footer_insert'] && !current_user_can( 'unfiltered_html' ) )
- $settings['footer_insert'] = stripslashes( wp_filter_post_kses( $settings['footer_insert'] ) );
-
- /* Escape the entered feed URL. */
- if ( $settings['feed_url'] )
- $settings['feed_url'] = esc_url( $settings['feed_url'] );
-
- /* Update the theme settings. */
- $updated = update_option( "{$prefix}_theme_settings", $settings );
-}
-
-/**
- * Creates the default meta boxes for the theme settings page. Child theme and plugin developers
- * should use add_meta_box() to create additional meta boxes.
- *
- * @since 0.7
- * @global string $hybrid The global theme object.
- */
-function hybrid_create_settings_meta_boxes() {
- global $hybrid;
-
- /* Get theme information. */
- $prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
- $theme_data = get_theme_data( TEMPLATEPATH . '/style.css' );
-
- /* Adds the About box for the parent theme. */
- add_meta_box( "{$prefix}-about-theme-meta-box", sprintf( __( 'About %1$s', $domain ), $theme_data['Title'] ), 'hybrid_about_theme_meta_box', $hybrid->settings_page, 'normal', 'high' );
-
- /* If the user is using a child theme, add an About box for it. */
- if ( TEMPLATEPATH != STYLESHEETPATH ) {
- $child_data = get_theme_data( STYLESHEETPATH . '/style.css' );
- add_meta_box( "{$prefix}-about-child-meta-box", sprintf( __( 'About %1$s', $domain ), $child_data['Title'] ), 'hybrid_about_theme_meta_box', $hybrid->settings_page, 'normal', 'high' );
- }
-
- /* Creates a meta box for the general theme settings. */
- if ( current_theme_supports( 'hybrid-core-meta-box-general' ) )
- add_meta_box( "{$prefix}-general-settings-meta-box", __( 'General settings', $domain ), 'hybrid_general_settings_meta_box', $hybrid->settings_page, 'normal', 'high' );
-
- /* Creates a meta box for the footer settings. */
- if ( current_theme_supports( 'hybrid-core-meta-box-footer' ) )
- add_meta_box( "{$prefix}-footer-settings-meta-box", __( 'Footer settings', $domain ), 'hybrid_footer_settings_meta_box', $hybrid->settings_page, 'normal', 'high' );
-}
-
-/**
- * Creates an information meta box with no settings about the theme. The meta box will display
- * information about both the parent theme and child theme. If a child theme is active, this function
- * will be called a second time.
- *
- * @since 0.7
- * @param $object Variable passed through the do_meta_boxes() call.
- * @param array $box Specific information about the meta box being loaded.
- */
-function hybrid_about_theme_meta_box( $object, $box ) {
-
- /* Get theme information. */
- $prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
-
- /* Grab theme information based on the meta box being shown (parent or child theme). */
- if ( "{$prefix}-about-theme-meta-box" == $box['id'] )
- $theme_data = get_theme_data( TEMPLATEPATH . '/style.css' );
-
- elseif ( "{$prefix}-about-child-meta-box" == $box['id'] )
- $theme_data = get_theme_data( STYLESHEETPATH . '/style.css' ); ?>
-
- <table class="form-table">
- <tr>
- <th><?php _e( 'Theme:', $domain ); ?></th>
- <td><a href="<?php echo $theme_data['URI']; ?>" title="<?php echo $theme_data['Title']; ?>"><?php echo $theme_data['Title']; ?> <?php echo $theme_data['Version']; ?></a></td>
- </tr>
- <tr>
- <th><?php _e( 'Author:', $domain ); ?></th>
- <td><?php echo $theme_data['Author']; ?></td>
- </tr>
- <tr>
- <th><?php _e( 'Description:', $domain ); ?></th>
- <td><?php echo $theme_data['Description']; ?></td>
- </tr>
- </table><!-- .form-table --><?php
-}
-
-/**
- * Adds a general settings suite suitable for the average theme, which includes a print stylesheet,
- * drop-downs JavaScript option, and the ability to change the feed URL.
- *
- * @since 0.7
- */
-function hybrid_general_settings_meta_box() {
- $domain = hybrid_get_textdomain(); ?>
-
- <table class="form-table">
-
- <tr>
- <th><label for="print_style"><?php _e( 'Stylesheets:', $domain ); ?></label></th>
- <td>
- <input id="print_style" name="print_style" type="checkbox" <?php if ( hybrid_get_setting( 'print_style' ) ) echo 'checked="checked"'; ?> value="true" />
- <label for="print_style"><?php _e( 'Select this to have the theme automatically include a print stylesheet.', $domain ); ?></label>
- </td>
- </tr>
- <tr>
- <th><label for="superfish_js"><?php _e( 'JavaScript:', $domain ); ?></label></th>
- <td>
- <input id="superfish_js" name="superfish_js" type="checkbox" <?php if ( hybrid_get_setting( 'superfish_js' ) ) echo 'checked="checked"'; ?> value="true" />
- <label for="superfish_js"><?php _e( 'Include the drop-down menu JavaScript.', $domain ); ?></label>
- </td>
- </tr>
- <?php if ( 'hybrid' == get_template() ) { // Only show if 'hybrid' is the template ?>
- <tr>
- <th><label for="use_menus"><?php _e( 'Menus:', $domain ); ?></label></th>
- <td>
- <input id="use_menus" name="use_menus" type="checkbox" <?php if ( hybrid_get_setting( 'use_menus' ) ) echo 'checked="checked"'; ?> value="true" />
- <label for="use_menus"><?php _e( 'Use the WordPress 3.0+ menu system? Child themes built prior to <em>Hybrid</em> 0.8 may need to be updated to use this.', $domain ); ?></label>
- </td>
- </tr>
- <?php } ?>
- <tr>
- <th><label for="feed_url"><?php _e( 'Feeds:', $domain ); ?></label></th>
- <td>
- <input id="feed_url" name="feed_url" type="text" value="<?php echo hybrid_get_setting( 'feed_url' ); ?>" size="30" /><br />
- <?php _e( 'If you have an alternate feed address, such as one from <a href="http://feedburner.com" title="Feedburner">Feedburner</a>, you can enter it here to have the theme redirect your feed links.', $domain ); ?><br /><br />
- <input id="feeds_redirect" name="feeds_redirect" type="checkbox" <?php if ( hybrid_get_setting( 'feeds_redirect' ) ) echo 'checked="checked"'; ?> value="true" />
- <label for="feeds_redirect"><?php _e( 'Direct category, tag, search, and author feeds to your alternate feed address?', $domain ); ?></label>
- </td>
- </tr>
- <tr>
- <th><label for="seo_plugin"><acronym title="<?php _e( 'Search Engine Optimization', $domain ); ?>"><?php _e( 'SEO:', $domain ); ?></acronym></label></th>
- <td>
- <input id="seo_plugin" name="seo_plugin" type="checkbox" <?php if ( hybrid_get_setting( 'seo_plugin' ) ) echo 'checked="checked"'; ?> value="true" />
- <label for="seo_plugin"><?php _e( 'Are you using an <acronym title="Search Engine Optimization">SEO</acronym> plugin? Select this to disable the theme\'s meta and indexing features.', $domain ); ?></label>
- </td>
- </tr>
-
- </table><!-- .form-table --><?php
-}
-
-/**
- * Creates a settings box that allows users to customize their footer. A basic textarea is given that
- * allows HTML and shortcodes to be input.
- *
- * @since 0.7
- */
-function hybrid_footer_settings_meta_box() {
- $domain = hybrid_get_textdomain(); ?>
-
- <table class="form-table">
- <tr>
- <th><label for="footer_insert"><?php _e( 'Footer Insert:', $domain ); ?></label></th>
- <td>
- <?php _e( 'You can add custom <acronym title="Hypertext Markup Language">HTML</acronym> and/or shortcodes, which will be automatically inserted into your theme.', $domain ); ?><br />
- <textarea id="footer_insert" name="footer_insert" cols="60" rows="5" style="width: 98%;"><?php echo wp_htmledit_pre( stripslashes( hybrid_get_setting( 'footer_insert' ) ) ); ?></textarea>
- <?php if ( current_theme_supports( 'hybrid-core-shortcodes' ) ) { ?>
- <br />
- <?php _e( 'Shortcodes:', $domain ); ?> <code>[the-year]</code>, <code>[site-link]</code>, <code>[wp-link]</code>, <code>[theme-link]</code>, <code>[child-link]</code>, <code>[loginout-link]</code>, <code>[query-counter]</code>.
- <?php } ?>
- </td>
- </tr>
- </table><!-- .form-table --><?php
-}
-
-/**
- * Displays the theme settings page and calls do_meta_boxes() to allow additional settings
- * meta boxes to be added to the page.
- *
- * @since 0.7
- * @global string $hybrid The global theme object.
- */
-function hybrid_settings_page() {
- global $hybrid;
-
- /* Get the theme information. */
- $prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
- $theme_data = get_theme_data( TEMPLATEPATH . '/style.css' ); ?>
-
- <div class="wrap">
-
- <?php screen_icon(); ?>
-
- <h2><?php printf( __( '%1$s Theme Settings', $domain ), $theme_data['Name'] ); ?></h2>
-
- <?php if ( isset( $_GET['updated'] ) && 'true' == esc_attr( $_GET['updated'] ) ) echo '<p class="updated fade below-h2" style="padding: 5px 10px;"><strong>' . __( 'Settings saved.', $domain ) . '</strong></p>'; ?>
-
- <div id="poststuff">
-
- <form method="post" action="<?php admin_url( 'themes.php?page=theme-settings' ); ?>">
-
- <?php wp_nonce_field( "{$prefix}-settings-page" ); ?>
- <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
- <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
-
- <div class="metabox-holder">
- <div class="post-box-container column-1 normal"><?php do_meta_boxes( $hybrid->settings_page, 'normal', $theme_data ); ?></div>
- <div class="post-box-container column-2 advanced"><?php do_meta_boxes( $hybrid->settings_page, 'advanced', $theme_data ); ?></div>
- <div class="post-box-container column-3 side"><?php do_meta_boxes( $hybrid->settings_page, 'side', $theme_data ); ?></div>
- </div>
-
- <p class="submit" style="clear: both;">
- <input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Update Settings', $domain ); ?>" />
- <input type="hidden" name="<?php echo "{$prefix}-settings-submit"; ?>" value="Y" />
- <!-- deprecated --><input type="hidden" name="<?php echo "hybrid_submit_hidden"; ?>" value="Y" />
- </p><!-- .submit -->
-
- <?php do_action( "{$prefix}_child_settings" ); // Hook for child settings (deprecated). ?>
-
- </form>
-
- </div><!-- #poststuff -->
-
- </div><!-- .wrap --><?php
-}
-
-/**
- * Loads the JavaScript files required for managing the meta boxes on the theme settings
- * page, which allows users to arrange the boxes to their liking.
- *
- * @since 0.7
- */
-function hybrid_settings_page_enqueue_script() {
- wp_enqueue_script( 'common' );
- wp_enqueue_script( 'wp-lists' );
- wp_enqueue_script( 'postbox' );
-}
-
-/**
- * Loads the admin.css stylesheet for the theme settings page.
- *
- * @since 0.7
- */
-function hybrid_settings_page_enqueue_style() {
- wp_enqueue_style( hybrid_get_prefix() . '-admin', HYBRID_CSS . '/admin.css', false, 0.7, 'screen' );
-}
-
-/**
- * Loads the JavaScript required for toggling the meta boxes on the theme settings page.
- *
- * @since 0.7
- * @global string $hybrid The global theme object.
- */
-function hybrid_settings_page_load_scripts() {
- global $hybrid; ?>
- <script type="text/javascript">
- //<![CDATA[
- jQuery(document).ready( function($) {
- $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
- postboxes.add_postbox_toggles( '<?php echo $hybrid->settings_page; ?>' );
- });
- //]]>
- </script><?php
-}
-
-?>
View
282 library/classes/hybrid.php
@@ -1,282 +0,0 @@
-<?php
-/**
- * The Hybrid class launches the framework. It's the organizational structure behind the
- * entire theme. This class should be initialized before anything else in the theme is called.
- *
- * @package HybridCore
- * @subpackage Classes
- */
-
-class Hybrid {
-
- /**
- * Theme prefix (mostly used for hooks).
- *
- * @since 0.7
- * @var string
- */
- var $prefix;
-
- /**
- * Constructor method for the Hybrid class. Just calls the init() method.
- *
- * @since 0.9
- */
- function Hybrid() {
- $this->init();
- }
-
- /**
- * Initializes the theme framework, loads the required files, and calls the
- * functions needed to run the theme.
- *
- * @since 0.7
- */
- function init() {
-
- /* Define theme constants. */
- $this->constants();
-
- /* Load theme functions. */
- $this->functions();
-
- /* Load legacy files and functions. */
- $this->legacy();
-
- /* Load admin files. */
- $this->admin();
-
- /* Theme prefix for creating things such as filter hooks (i.e., "$prefix_hook_name"). */
- $this->prefix = hybrid_get_prefix();
-
- /* Initialize the theme's default actions. */
- $this->actions();
-
- /* Initialize the theme's default filters. */
- $this->filters();
-
- /* Load theme extensions later since we need to check if they're supported. */
- add_action( 'after_setup_theme', array( &$this, 'extensions' ), 12 );
-
- /* Load theme textdomain. */
- $domain = hybrid_get_textdomain();
- $locale = get_locale();
- load_theme_textdomain( $domain );
-
- /* Load locale-specific functions file. */
- $locale_functions = locate_template( array( "languages/{$locale}.php", "{$locale}.php" ) );
- if ( !empty( $locale_functions ) && is_readable( $locale_functions ) )
- require_once( $locale_functions );
-
- /* Theme init hook. */
- do_action( "{$this->prefix}_init" );
- }
-
- /**
- * Defines the constant paths for use within the core framework, parent theme, and
- * child theme. Constants prefixed with 'HYBRID_' are for use only within the core
- * framework and don't reference other areas of the theme.
- *
- * @since 0.7
- */
- function constants() {
- /* Sets the path to the parent theme directory. */
- define( 'THEME_DIR', get_template_directory() );
-
- /* Sets the path to the parent theme directory URI. */
- define( 'THEME_URI', get_template_directory_uri() );
-
- /* Sets the path to the child theme directory. */
- define( 'CHILD_THEME_DIR', get_stylesheet_directory() );
-
- /* Sets the path to the child theme directory URI. */
- define( 'CHILD_THEME_URI', get_stylesheet_directory_uri() );
-
- /* Sets the path to the core framework directory. */
- define( 'HYBRID_DIR', THEME_DIR . '/library' );
-
- /* Sets the path to the core framework directory URI. */
- define( 'HYBRID_URI', THEME_URI . '/library' );
-
- /* Sets the path to the core framework admin directory. */
- define( 'HYBRID_ADMIN', HYBRID_DIR . '/admin' );
-
- /* Sets the path to the core framework classes directory. */
- define( 'HYBRID_CLASSES', HYBRID_DIR . '/classes' );
-
- /* Sets the path to the core framework extensions directory. */
- define( 'HYBRID_EXTENSIONS', HYBRID_DIR . '/extensions' );
-
- /* Sets the path to the core framework functions directory. */
- define( 'HYBRID_FUNCTIONS', HYBRID_DIR . '/functions' );
-
- /* Sets the path to the core framework legacy directory. */
- define( 'HYBRID_LEGACY', HYBRID_DIR . '/legacy' );
-
- /* Sets the path to the core framework images directory URI. */
- define( 'HYBRID_IMAGES', HYBRID_URI . '/images' );
-
- /* Sets the path to the core framework CSS directory URI. */
- define( 'HYBRID_CSS', HYBRID_URI . '/css' );
-
- /* Sets the path to the core framework JavaScript directory URI. */
- define( 'HYBRID_JS', HYBRID_URI . '/js' );
- }
-
- /**
- * Loads the core theme functions.
- *
- * @since 0.7
- */
- function functions() {
- require_once( HYBRID_FUNCTIONS . '/core.php' );
- require_once( HYBRID_FUNCTIONS . '/hooks-actions.php' );
- require_once( HYBRID_FUNCTIONS . '/hooks-filters.php' );
- require_once( HYBRID_FUNCTIONS . '/comments.php' );
- require_once( HYBRID_FUNCTIONS . '/context.php' );
- require_once( HYBRID_FUNCTIONS . '/media.php' );
- require_once( HYBRID_FUNCTIONS . '/shortcodes.php' );
- require_once( HYBRID_FUNCTIONS . '/template.php' );
- require_once( HYBRID_FUNCTIONS . '/widgets.php' );
-
- /* Load the Hybrid theme functions if it's the parent theme. */
- if ( 'hybrid' == get_template() )
- require_once( HYBRID_FUNCTIONS . '/defaults.php' );
-
- /* Menus compatibility. */
- if ( hybrid_get_setting( 'use_menus' ) || 'hybrid' !== get_template() )
- require_once( HYBRID_FUNCTIONS . '/menus.php' );
- }
-
- /**
- * Load extensions (external projects). Themes must use add_theme_support( $extension ) to
- * use a specific extension within the theme. This should be declared on 'after_setup_theme' no
- * later than the default priority of 10.
- *
- * @since 0.7
- */
- function extensions() {
-
- /* Load the Breadcrumb Trail extension if supported. */
- if ( current_theme_supports( 'breadcrumb-trail' ) )
- require_once( HYBRID_EXTENSIONS . '/breadcrumb-trail.php' );
-
- /* Load the Custom Field Series extension if supported. */
- if ( current_theme_supports( 'custom-field-series' ) )
- require_once( HYBRID_EXTENSIONS . '/custom-field-series.php' );
-
- /* Load the Get the Image extension if supported. */
- if ( current_theme_supports( 'get-the-image' ) )
- require_once( HYBRID_EXTENSIONS . '/get-the-image.php' );
-
- /* Load the Get the Object extension if supported. */
- if ( current_theme_supports( 'get-the-object' ) )
- require_once( HYBRID_EXTENSIONS . '/get-the-object.php' );
-
- /* Load the Pagination extension if supported. */
- if ( current_theme_supports( 'loop-pagination' ) )
- require_once( HYBRID_EXTENSIONS . '/loop-pagination.php' );
-
- /* Load the Entry Views extension if supported. */
- if ( current_theme_supports( 'entry-views' ) )
- require_once( HYBRID_EXTENSIONS . '/entry-views.php' );
- }
-
- /**
- * Load legacy functions for backwards compatibility.
- *
- * @since 0.7
- */
- function legacy() {
- require_once( HYBRID_LEGACY . '/deprecated.php' );
- }
-
- /**
- * Load admin files.
- *
- * @since 0.7
- */
- function admin() {
- if ( is_admin() ) {
- require_once( HYBRID_ADMIN . '/admin.php' );
- require_once( HYBRID_ADMIN . '/meta-box.php' );
- require_once( HYBRID_ADMIN . '/settings-page.php' );
- }
- }
-
- /**
- * Adds the default theme actions.
- *
- * @since 0.7
- */
- function actions() {
-
- /* Remove WP and plugin functions. */
- remove_action( 'wp_head', 'wp_generator' );
- add_action( 'wp_print_styles', 'hybrid_disable_styles' );
-
- /* Head actions. */
- $actions[] = 'hybrid_meta_content_type';
- $actions[] = 'wp_generator';
- $actions[] = 'hybrid_meta_template';
- if ( current_theme_supports( 'hybrid-core-seo' ) ) {
- $actions[] = 'hybrid_meta_robots';
- $actions[] = 'hybrid_meta_author';
- $actions[] = 'hybrid_meta_copyright';
- $actions[] = 'hybrid_meta_revised';
- $actions[] = 'hybrid_meta_description';
- $actions[] = 'hybrid_meta_keywords';
- }
- $actions[] = 'hybrid_head_pingback';
- $actions[] = 'hybrid_favicon';
-
- foreach ( $actions as $action )
- add_action( "{$this->prefix}_head", $action );
-
- /* WP print scripts and styles. */
- add_action( 'template_redirect', 'hybrid_enqueue_style' );
- add_action( 'template_redirect', 'hybrid_enqueue_script' );
- }
-
- /**
- * Adds the default theme filters.
- *
- * @since 0.7
- */
- function filters() {
- /* Filter the textdomain mofile to allow child themes to load the parent theme translation. */
- add_filter( 'load_textdomain_mofile', 'hybrid_load_textdomain', 10, 2 );
-
- /* Add same filters to user description as term descriptions. */
- add_filter( 'get_the_author_description', 'wptexturize' );
- add_filter( 'get_the_author_description', 'convert_chars' );
- add_filter( 'get_the_author_description', 'wpautop' );
- add_filter( 'get_the_author_description', 'shortcode_unautop' );
-
- /* Make text widgets, term descriptions, and user descriptions shortcode aware. */
- add_filter( 'widget_text', 'do_shortcode' );
- add_filter( 'term_description', 'do_shortcode' );
- add_filter( 'get_the_author_description', 'do_shortcode' );
-
- /* Stylesheet filters. */
- add_filter( 'stylesheet_uri', 'hybrid_post_stylesheets', 10, 2 );
-
- /* Template filters. */
- add_filter( 'date_template', 'hybrid_date_template' );
- add_filter( 'author_template', 'hybrid_user_template' );
- add_filter( 'tag_template', 'hybrid_taxonomy_template' );
- add_filter( 'category_template', 'hybrid_taxonomy_template' );
- add_filter( 'single_template', 'hybrid_singular_template' );
- add_filter( 'page_template', 'hybrid_singular_template' );
- add_filter( 'attachment_template', 'hybrid_singular_template' );
-
- /* Feed links. */
- add_filter( 'feed_link', 'hybrid_feed_link', 1, 2 );
- add_filter( 'category_feed_link', 'hybrid_other_feed_link' );
- add_filter( 'author_feed_link', 'hybrid_other_feed_link' );
- add_filter( 'tag_feed_link', 'hybrid_other_feed_link' );
- add_filter( 'search_feed_link', 'hybrid_other_feed_link' );
- }
-}
-
-?>
View
174 library/classes/widget-archives.php
@@ -1,174 +0,0 @@
-<?php
-/**
- * Archives Widget Class
- *
- * The Archives widget replaces the default WordPress Archives widget. This version gives total
- * control over the output to the user by allowing the input of all the arguments typically seen
- * in the wp_get_archives() function.
- *
- * @since 0.6
- * @link http://codex.wordpress.org/Template_Tags/wp_get_archives
- * @link http://themehybrid.com/themes/hybrid/widgets
- *
- * @package Hybrid
- * @subpackage Classes
- */
-
-class Hybrid_Widget_Archives extends WP_Widget {
-
- var $prefix;
- var $textdomain;
-
- /**
- * Set up the widget's unique name, ID, class, description, and other options.
- * @since 0.6
- */
- function Hybrid_Widget_Archives() {
- $this->prefix = hybrid_get_prefix();
- $this->textdomain = hybrid_get_textdomain();
-
- $widget_ops = array( 'classname' => 'archives', 'description' => __( 'An advanced widget that gives you total control over the output of your archives.', $this->textdomain ) );
- $control_ops = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-archives" );
- $this->WP_Widget( "{$this->prefix}-archives", __( 'Archives', $this->textdomain ), $widget_ops, $control_ops );
- }
-
- /**
- * Outputs the widget based on the arguments input through the widget controls.
- * @since 0.6
- */
- function widget( $args, $instance ) {
- extract( $args );
-
- $args = array();
-
- $args['type'] = $instance['type'];
- $args['format'] = $instance['format'];
- $args['before'] = $instance['before'];
- $args['after'] = $instance['after'];
- $args['show_post_count'] = isset( $instance['show_post_count'] ) ? $instance['show_post_count'] : false;
- $args['limit'] = !empty( $instance['limit'] ) ? intval( $instance['limit'] ) : '';
- $args['echo'] = false;
-
- echo $before_widget;
-
- if ( $instance['title'] )
- echo $before_title . apply_filters( 'widget_title', $instance['title'] ) . $after_title;
-
- $archives = str_replace( array( "\r", "\n", "\t" ), '', wp_get_archives( $args ) );
-
- if ( 'option' == $args['format'] ) {
-
- if ( 'yearly' == $args['type'] )
- $option_title = __( 'Select Year', $this->textdomain );
- elseif ( 'monthly' == $args['type'] )
- $option_title = __( 'Select Month', $this->textdomain );
- elseif ( 'weekly' == $args['type'] )
- $option_title = __( 'Select Week', $this->textdomain );
- elseif ( 'daily' == $args['type'] )
- $option_title = __( 'Select Day', $this->textdomain );
- elseif ( 'postbypost' == $args['type'] || 'alpha' == $args['type'] )
- $option_title = __( 'Select Post', $this->textdomain );
-
- echo '<select name="archive-dropdown" onchange=\'document.location.href=this.options[this.selectedIndex].value;\'>';
- echo '<option value="">' . esc_attr( $option_title ) . '</option>';
- echo $archives;
- echo '</select>';
- }
- elseif ( 'html' == $args['format'] ) {
- echo '<ul class="xoxo archives">' . $archives . '</ul><!-- .xoxo .archives -->';
- }
- else {
- echo $archives;
- }
-
- echo $after_widget;
- }
-
- /**
- * Updates the widget control options for the particular instance of the widget.
- * @since 0.6
- */
- function update( $new_instance, $old_instance ) {
- $instance = $old_instance;
-
- $instance = $new_instance;
-
- $instance['title'] = strip_tags( $new_instance['title'] );
- $instance['before'] = strip_tags( $new_instance['before'] );
- $instance['after'] = strip_tags( $new_instance['after'] );
- $instance['limit'] = strip_tags( $new_instance['limit'] );
- $instance['show_post_count'] = ( isset( $new_instance['show_post_count'] ) ? 1 : 0 );
-
- return $instance;
- }
-
- /**
- * Displays the widget control options in the Widgets admin screen.
- * @since 0.6
- */
- function form( $instance ) {
-
- //Defaults
- $defaults = array(
- 'title' => __( 'Archives', $this->textdomain ),
- 'limit' => 10,
- 'type' => 'monthly',
- 'format' => 'html',
- 'before' => '',
- 'after' => '',
- 'show_post_count' => false
- );
- $instance = wp_parse_args( (array) $instance, $defaults );
-
- $type = array( 'alpha' => __( 'Alphabetical', $this->textdomain ), 'daily' => __( 'Daily', $this->textdomain ), 'monthly' => __( 'Monthly', $this->textdomain ),'postbypost' => __( 'Post By Post', $this->textdomain ), 'weekly' => __( 'Weekly', $this->textdomain ), 'yearly' => __( 'Yearly', $this->textdomain ) );
- $format = array( 'custom' => __( 'Custom', $this->textdomain ), 'html' => __( 'HTML', $this->textdomain ), 'option' => __( 'Option', $this->textdomain ) );
-
- ?>
-
- <div class="hybrid-widget-controls columns-2">
- <p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
- <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><code>limit</code></label>
- <input type="text" class="smallfat code" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" value="<?php echo $instance['limit']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'type' ); ?>"><code>type</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>">
- <?php foreach ( $type as $option_value => $option_label ) { ?>
- <option value="<?php echo $option_value; ?>" <?php selected( $instance['type'], $option_value ); ?>><?php echo $option_label; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'format' ); ?>"><code>format</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'format' ); ?>" name="<?php echo $this->get_field_name( 'format' ); ?>">
- <?php foreach ( $format as $option_value => $option_label ) { ?>
- <option value="<?php echo $option_value; ?>" <?php selected( $instance['format'], $option_value ); ?>><?php echo $option_label; ?></option>
- <?php } ?>
- </select>
- </p>
- </div>
-
- <div class="hybrid-widget-controls columns-2 column-last">
- <p>
- <label for="<?php echo $this->get_field_id( 'before' ); ?>"><code>before</code></label>
- <input type="text" class="widefat code" id="<?php echo $this->get_field_id( 'before' ); ?>" name="<?php echo $this->get_field_name( 'before' ); ?>" value="<?php echo $instance['before']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'after' ); ?>"><code>after</code></label>
- <input type="text" class="widefat code" id="<?php echo $this->get_field_id( 'after' ); ?>" name="<?php echo $this->get_field_name( 'after' ); ?>" value="<?php echo $instance['after']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_post_count' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_post_count'], true ); ?> id="<?php echo $this->get_field_id( 'show_post_count' ); ?>" name="<?php echo $this->get_field_name( 'show_post_count' ); ?>" /> <?php _e( 'Show post count?', $this->textdomain ); ?> <code>show_post_count</code></label>
- </p>
- </div>
- <div style="clear:both;">&nbsp;</div>
- <?php
- }
-}
-
-?>
View
184 library/classes/widget-authors.php
@@ -1,184 +0,0 @@
-<?php
-/**
- * Authors Widget Class
- *
- * The authors widget was created to give users the ability to list the authors of their blog because
- * there was no equivalent WordPress widget that offered the functionality. This widget allows full
- * control over its output by giving access to the parameters of wp_list_authors().
- *
- * @since 0.6
- * @link http://codex.wordpress.org/Template_Tags/wp_list_authors
- * @link http://themehybrid.com/themes/hybrid/widgets
- *
- * @package Hybrid
- * @subpackage Classes
- */
-
-class Hybrid_Widget_Authors extends WP_Widget {
-
- var $prefix;
- var $textdomain;
-
- /**
- * Set up the widget's unique name, ID, class, description, and other options.
- * @since 0.6
- */
- function Hybrid_Widget_Authors() {
- $this->prefix = hybrid_get_prefix();
- $this->textdomain = hybrid_get_textdomain();
-
- $widget_ops = array( 'classname' => 'authors', 'description' => __( 'An advanced widget that gives you total control over the output of your author lists.',$this->textdomain ) );
- $control_ops = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-authors" );
- $this->WP_Widget( "{$this->prefix}-authors", __( 'Authors', $this->textdomain ), $widget_ops, $control_ops );
-
- add_action( 'delete_user', array( &$this, 'delete_transient' ) );
- add_action( 'user_register', array( &$this, 'delete_transient' ) );
- add_action( 'profile_update', array( &$this, 'delete_transient' ) );
- add_action( 'save_post', array( &$this, 'delete_transient' ) );
- add_action( 'deleted_post', array( &$this, 'delete_transient' ) );
- }
-
- /**
- * Outputs the widget based on the arguments input through the widget controls.
- * @since 0.6
- */
- function widget( $args, $instance ) {
-
- /* If a transient has been saved with the widget information, use it. */
- $transient = get_transient( "{$this->prefix}_widget_{$args['widget_id']}" );
- if ( $transient ) {
- echo $transient;
- return;
- }
-
- extract( $args, EXTR_SKIP );
-
- $args = array();
-
- $args['style'] = $instance['style'];
- $args['feed'] = $instance['feed'];
- $args['feed_image'] = $instance['feed_image'];
- $args['optioncount'] = isset( $instance['optioncount'] ) ? $instance['optioncount'] : false;
- $args['exclude_admin'] = isset( $instance['exclude_admin'] ) ? $instance['exclude_admin'] : false;
- $args['show_fullname'] = isset( $instance['show_fullname'] ) ? $instance['show_fullname'] : false;
- $args['hide_empty'] = isset( $instance['hide_empty'] ) ? $instance['hide_empty'] : false;
- $args['html'] = isset( $instance['html'] ) ? $instance['html'] : false;
- $args['echo'] = false;
-
- $authors_widget = $before_widget;
-
- if ( $instance['title'] )
- $authors_widget .= $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;
-
- $authors = str_replace( array( "\r", "\n", "\t" ), '', wp_list_authors( $args ) );
-
- if ( 'list' == $args['style'] && $args['html'] )
- $authors = '<ul class="xoxo authors">' . $authors . '</ul><!-- .xoxo .authors -->';
-
- $authors_widget .= $authors;
-
- $authors_widget .= $after_widget;
-
- set_transient( "{$this->prefix}_widget_{$widget_id}", $authors_widget, hybrid_get_transient_expiration() );
- echo $authors_widget;
- }
-
- /**
- * Updates the widget control options for the particular instance of the widget.
- * @since 0.6
- */
- function update( $new_instance, $old_instance ) {
- $instance = $old_instance;
-
- $instance = $new_instance;
-
- $instance['title'] = strip_tags( $new_instance['title'] );
- $instance['feed'] = strip_tags( $new_instance['feed'] );
- $instance['feed_image'] = strip_tags( $new_instance['feed_image'] );
-
- $instance['html'] = ( isset( $new_instance['html'] ) ? 1 : 0 );
- $instance['optioncount'] = ( isset( $new_instance['optioncount'] ) ? 1 : 0 );
- $instance['exclude_admin'] = ( isset( $new_instance['exclude_admin'] ) ? 1 : 0 );
- $instance['show_fullname'] = ( isset( $new_instance['show_fullname'] ) ? 1 : 0 );
- $instance['hide_empty'] = ( isset( $new_instance['hide_empty'] ) ? 1 : 0 );
-
- $this->delete_transient();
-
- return $instance;
- }
-
- function delete_transient() {
- delete_transient( "{$this->prefix}_widget_{$this->id}" );
- }
-
- /**
- * Displays the widget control options in the Widgets admin screen.
- * @since 0.6
- */
- function form( $instance ) {
-
- //Defaults
- $defaults = array(
- 'title' => __( 'Authors', $this->textdomain ),
- 'optioncount' => false,
- 'exclude_admin' => false,
- 'show_fullname' => true,
- 'hide_empty' => true,
- 'style' => 'list',
- 'html' => true,
- 'feed' => '',
- 'feed_image' => ''
- );
- $instance = wp_parse_args( (array) $instance, $defaults ); ?>
-
- <div class="hybrid-widget-controls columns-2">
- <p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
- <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'feed' ); ?>"><code>feed</code></label>
- <input type="text" class="widefat code" id="<?php echo $this->get_field_id( 'feed' ); ?>" name="<?php echo $this->get_field_name( 'feed' ); ?>" value="<?php echo $instance['feed']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'feed_image' ); ?>"><code>feed_image</code></label>
- <input type="text" class="widefat code" id="<?php echo $this->get_field_id( 'feed_image' ); ?>" name="<?php echo $this->get_field_name( 'feed_image' ); ?>" value="<?php echo $instance['feed_image']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'style' ); ?>"><code>style</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'style' ); ?>" name="<?php echo $this->get_field_name( 'style' ); ?>">
- <?php foreach ( array( 'list' => __( 'List', $this->textdomain), 'none' => __( 'None', $this->textdomain ) ) as $option_value => $option_label ) { ?>
- <option value="<?php echo $option_value; ?>" <?php selected( $instance['style'], $option_value ); ?>><?php echo $option_label; ?></option>
- <?php } ?>
- </select>
- </p>
- </div>
-
- <div class="hybrid-widget-controls columns-2 column-last">
- <p>
- <label for="<?php echo $this->get_field_id( 'html' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['html'], true ); ?> id="<?php echo $this->get_field_id( 'html' ); ?>" name="<?php echo $this->get_field_name( 'html' ); ?>" /> <?php _e( '<acronym title="Hypertext Markup Language">HTML</acronym>?', $this->textdomain ); ?> <code>html</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'optioncount' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['optioncount'], true ); ?> id="<?php echo $this->get_field_id( 'optioncount' ); ?>" name="<?php echo $this->get_field_name( 'optioncount' ); ?>" /> <?php _e( 'Show post count?', $this->textdomain ); ?> <code>optioncount</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'exclude_admin' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['exclude_admin'], true ); ?> id="<?php echo $this->get_field_id( 'exclude_admin' ); ?>" name="<?php echo $this->get_field_name( 'exclude_admin' ); ?>" /> <?php _e( 'Exclude admin?', $this->textdomain ); ?> <code>exclude_admin</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_fullname' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_fullname'], true ); ?> id="<?php echo $this->get_field_id( 'show_fullname' ); ?>" name="<?php echo $this->get_field_name( 'show_fullname' ); ?>" /> <?php _e( 'Show full name?', $this->textdomain ); ?> <code>show_fullname</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hide_empty'], true ); ?> id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" /> <?php _e( 'Hide empty?', $this->textdomain ); ?> <code>hide_empty</code></label>
- </p>
- </div>
- <div style="clear:both;">&nbsp;</div>
- <?php
- }
-}
-
-?>
View
300 library/classes/widget-bookmarks.php
@@ -1,300 +0,0 @@
-<?php
-/**
- * Bookmarks Widget Class
- *
- * The Bookmarks widget replaces the default WordPress Links widget. This version gives total
- * control over the output to the user by allowing the input of all the arguments typically seen
- * in the wp_list_bookmarks() function.
- *
- * @since 0.6
- * @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks
- * @link http://themehybrid.com/themes/hybrid/widgets
- *
- * @package Hybrid
- * @subpackage Classes
- */
-
-class Hybrid_Widget_Bookmarks extends WP_Widget {
-
- var $prefix;
- var $textdomain;
-
- /**
- * Set up the widget's unique name, ID, class, description, and other options.
- * @since 0.6
- */
- function Hybrid_Widget_Bookmarks() {
- $this->prefix = hybrid_get_prefix();
- $this->textdomain = hybrid_get_textdomain();
-
- $widget_ops = array( 'classname' => 'bookmarks', 'description' => __( 'An advanced widget that gives you total control over the output of your bookmarks (links).', $this->textdomain ) );
- $control_ops = array( 'width' => 800, 'height' => 350, 'id_base' => "{$this->prefix}-bookmarks" );
- $this->WP_Widget( "{$this->prefix}-bookmarks", __( 'Bookmarks', $this->textdomain ), $widget_ops, $control_ops );
- }
-
- /**
- * Outputs the widget based on the arguments input through the widget controls.
- * @since 0.6
- */
- function widget( $args, $instance ) {
- extract( $args );
-
- $args = array();
-
- $args['title_li'] = apply_filters( 'widget_title', $instance['title_li'], $instance, $this->id_base );
- $args['category'] = ( isset( $instance['category'] ) ? join( ', ', $instance['category'] ) : '' );
- $args['exclude_category'] = ( isset( $instance['exclude_category'] ) ? join( ', ', $instance['exclude_category'] ) : '' );
- $args['category_order'] = $instance['category_order'];
- $args['category_orderby'] = $instance['category_orderby'];
- $args['include'] = ( isset( $instance['include'] ) ? join( ', ', $instance['include'] ) : '' );
- $args['exclude'] = ( isset( $instance['exclude'] ) ? join( ', ', $instance['exclude'] ) : '' );
- $args['order'] = $instance['order'];
- $args['orderby'] = $instance['orderby'];
- $args['limit'] = ( ( $instance['limit'] ) ? intval( $instance['limit'] ) : -1 );
- $args['between'] = $instance['between'];
- $args['link_before'] = $instance['link_before'];
- $args['link_after'] = $instance['link_after'];
- $args['search'] = $instance['search'];
- $args['categorize'] = isset( $instance['categorize'] ) ? $instance['categorize'] : false;
- $args['show_description'] = isset( $instance['show_description'] ) ? $instance['show_description'] : false;
- $args['hide_invisible'] = isset( $instance['hide_invisible'] ) ? $instance['hide_invisible'] : false;
- $args['show_rating'] = isset( $instance['show_rating'] ) ? $instance['show_rating'] : false;
- $args['show_updated'] = isset( $instance['show_updated'] ) ? $instance['show_updated'] : false;
- $args['show_images'] = isset( $instance['show_images'] ) ? $instance['show_images'] : false;
- $args['show_name'] = isset( $instance['show_name'] ) ? $instance['show_name'] : false;
- $args['show_private'] = isset( $instance['show_private'] ) ? $instance['show_private'] : false;
-
- if ( $args['categorize'] )
- $before_widget = preg_replace( '/id="[^"]*"/','id="%id"', $before_widget );
- if ( $instance['class'] )
- $before_widget = str_replace( 'class="', 'class="' . esc_attr( $instance['class'] ) . ' ', $before_widget );
-
- $args['title_before'] = $before_title;
- $args['title_after'] = $after_title;
- $args['category_before'] = $before_widget;
- $args['category_after'] = $after_widget;
- $args['category_name'] = false;
- $args['echo'] = false;
-
- echo str_replace( array( "\r", "\n", "\t" ), '', wp_list_bookmarks( $args ) );
- }
-
- /**
- * Updates the widget control options for the particular instance of the widget.
- * @since 0.6
- */
- function update( $new_instance, $old_instance ) {
- $instance = $old_instance;
-
- /* Set the instance to the new instance. */
- $instance = $new_instance;
-
- $instance['title_li'] = strip_tags( $new_instance['title_li'] );
- $instance['limit'] = strip_tags( $new_instance['limit'] );
- $instance['class'] = strip_tags( $new_instance['class'] );
- $instance['search'] = strip_tags( $new_instance['search'] );
- $instance['category_order'] = $new_instance['category_order'];
- $instance['category_orderby'] = $new_instance['category_orderby'];
- $instance['orderby'] = $new_instance['orderby'];
- $instance['order'] = $new_instance['order'];
- $instance['between'] = $new_instance['between'];
- $instance['link_before'] = $new_instance['link_before'];
- $instance['link_after'] = $new_instance['link_after'];
-
- $instance['categorize'] = ( isset( $new_instance['categorize'] ) ? 1 : 0 );
- $instance['hide_invisible'] = ( isset( $new_instance['hide_invisible'] ) ? 1 : 0 );
- $instance['show_private'] = ( isset( $new_instance['show_private'] ) ? 1 : 0 );
- $instance['show_rating'] = ( isset( $new_instance['show_rating'] ) ? 1 : 0 );
- $instance['show_updated'] = ( isset( $new_instance['show_updated'] ) ? 1 : 0 );
- $instance['show_images'] = ( isset( $new_instance['show_images'] ) ? 1 : 0 );
- $instance['show_name'] = ( isset( $new_instance['show_name'] ) ? 1 : 0 );
- $instance['show_description'] = ( isset( $new_instance['show_description'] ) ? 1 : 0 );
-
- return $instance;
- }
-
- /**
- * Displays the widget control options in the Widgets admin screen.
- * @since 0.6
- */
- function form( $instance ) {
-
- //Defaults
- $defaults = array(
- 'title_li' => __( 'Bookmarks', $this->textdomain ),
- 'categorize' => true,
- 'category_order' => 'ASC',
- 'category_orderby' => 'name',
- 'category' => array(),
- 'exclude_category' => array(),
- 'limit' => '',
- 'order' => 'ASC',
- 'orderby' => 'name',
- 'include' => array(),
- 'exclude' => array(),
- 'search' => '',
- 'hide_invisible' => true,
- 'show_description' => false,
- 'show_images' => false,
- 'show_rating' => false,
- 'show_updated' => false,
- 'show_private' => false,
- 'show_name' => false,
- 'class' => 'linkcat',
- 'link_before' => '<span>',
- 'link_after' => '</span>',
- 'between' => '<br />',
- );
- $instance = wp_parse_args( (array) $instance, $defaults );
-
- $terms = get_terms( 'link_category' );
- $bookmarks = get_bookmarks( array( 'hide_invisible' => false ) );
- $category_order = array( 'ASC' => __( 'Ascending', $this->textdomain ), 'DESC' => __( 'Descending', $this->textdomain ) );
- $category_orderby = array( 'count' => __( 'Count', $this->textdomain ), 'ID' => __( 'ID', $this->textdomain ), 'name' => __( 'Name', $this->textdomain ), 'slug' => __( 'Slug', $this->textdomain ) );
- $order = array( 'ASC' => __( 'Ascending', $this->textdomain ), 'DESC' => __( 'Descending', $this->textdomain ) );
- $orderby = array( 'id' => __( 'ID', $this->textdomain ), 'description' => __( 'Description', $this->textdomain ), 'length' => __( 'Length', $this->textdomain ), 'name' => __( 'Name', $this->textdomain ), 'notes' => __( 'Notes', $this->textdomain ), 'owner' => __( 'Owner', $this->textdomain ), 'rand' => __( 'Random', $this->textdomain ), 'rating' => __( 'Rating', $this->textdomain ), 'rel' => __( 'Rel', $this->textdomain ), 'rss' => __( 'RSS', $this->textdomain ), 'target' => __( 'Target', $this->textdomain ), 'updated' => __( 'Updated', $this->textdomain ), 'url' => __( 'URL', $this->textdomain ) );
-
- ?>
-
- <div class="hybrid-widget-controls columns-3">
- <p>
- <label for="<?php echo $this->get_field_id( 'title_li' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
- <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title_li' ); ?>" name="<?php echo $this->get_field_name( 'title_li' ); ?>" value="<?php echo $instance['title_li']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'category_order' ); ?>"><code>category_order</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'category_order' ); ?>" name="<?php echo $this->get_field_name( 'category_order' ); ?>">
- <?php foreach ( $category_order as $option_value => $option_label ) { ?>
- <option value="<?php echo $option_value; ?>" <?php selected( $instance['category_order'], $option_value ); ?>><?php echo $option_label; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'category_orderby' ); ?>"><code>category_orderby</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'category_orderby' ); ?>" name="<?php echo $this->get_field_name( 'category_orderby' ); ?>">
- <?php foreach ( $category_orderby as $option_value => $option_label ) { ?>
- <option value="<?php echo $option_value; ?>" <?php selected( $instance['category_orderby'], $option_value ); ?>><?php echo $option_label; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'category' ); ?>"><code>category</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'category' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>[]" size="4" multiple="multiple">
- <?php foreach ( $terms as $term ) { ?>
- <option value="<?php echo $term->term_id; ?>" <?php echo ( in_array( $term->term_id, (array) $instance['category'] ) ? 'selected="selected"' : '' ); ?>><?php echo $term->name; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'exclude_category' ); ?>"><code>exclude_category</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'exclude_category' ); ?>" name="<?php echo $this->get_field_name( 'exclude_category' ); ?>[]" size="4" multiple="multiple">
- <?php foreach ( $terms as $term ) { ?>
- <option value="<?php echo $term->term_id; ?>" <?php echo ( in_array( $term->term_id, (array) $instance['exclude_category'] ) ? 'selected="selected"' : '' ); ?>><?php echo $term->name; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'class' ); ?>"><code>class</code></label>
- <input type="text" class="smallfat code" id="<?php echo $this->get_field_id( 'class' ); ?>" name="<?php echo $this->get_field_name( 'class' ); ?>" value="<?php echo $instance['class']; ?>" />
- </p>
-
- </div>
-
- <div class="hybrid-widget-controls columns-3">
-
- <p>
- <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><code>limit</code></label>
- <input type="text" class="smallfat code" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" value="<?php echo $instance['limit']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'order' ); ?>"><code>order</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'order' ); ?>" name="<?php echo $this->get_field_name( 'order' ); ?>">
- <?php foreach ( $order as $option_value => $option_label ) { ?>
- <option value="<?php echo $option_value; ?>" <?php selected( $instance['order'], $option_value ); ?>><?php echo $option_label; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><code>orderby</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>">
- <?php foreach ( $orderby as $option_value => $option_label ) { ?>
- <option value="<?php echo $option_value; ?>" <?php selected( $instance['orderby'], $option_value ); ?>><?php echo $option_label; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'include' ); ?>"><code>include</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'include' ); ?>" name="<?php echo $this->get_field_name( 'include' ); ?>[]" size="4" multiple="multiple">
- <?php foreach ( $bookmarks as $bookmark ) { ?>
- <option value="<?php echo $bookmark->link_id; ?>" <?php echo ( in_array( $bookmark->link_id, (array) $instance['include'] ) ? 'selected="selected"' : '' ); ?>><?php echo $bookmark->link_name; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'exclude' ); ?>"><code>exclude</code></label>
- <select class="widefat" id="<?php echo $this->get_field_id( 'exclude' ); ?>" name="<?php echo $this->get_field_name( 'exclude' ); ?>[]" size="4" multiple="multiple">
- <?php foreach ( $bookmarks as $bookmark ) { ?>
- <option value="<?php echo $bookmark->link_id; ?>" <?php echo ( in_array( $bookmark->link_id, (array) $instance['exclude'] ) ? 'selected="selected"' : '' ); ?>><?php echo $bookmark->link_name; ?></option>
- <?php } ?>
- </select>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'search' ); ?>"><code>search</code></label>
- <input type="text" class="widefat code" id="<?php echo $this->get_field_id( 'search' ); ?>" name="<?php echo $this->get_field_name( 'search' ); ?>" value="<?php echo $instance['search']; ?>" />
- </p>
-
- </div>
-
- <div class="hybrid-widget-controls columns-3 column-last">
- <p>
- <label for="<?php echo $this->get_field_id( 'between' ); ?>"><code>between</code></label>
- <input type="text" class="smallfat code" id="<?php echo $this->get_field_id( 'between' ); ?>" name="<?php echo $this->get_field_name( 'between' ); ?>" value="<?php echo $instance['between']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'link_before' ); ?>"><code>link_before</code></label>
- <input type="text" class="smallfat code" id="<?php echo $this->get_field_id( 'link_before' ); ?>" name="<?php echo $this->get_field_name( 'link_before' ); ?>" value="<?php echo $instance['link_before']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'link_after' ); ?>"><code>link_after</code></label>
- <input type="text" class="smallfat code" id="<?php echo $this->get_field_id( 'link_after' ); ?>" name="<?php echo $this->get_field_name( 'link_after' ); ?>" value="<?php echo $instance['link_after']; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'categorize' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['categorize'], true ); ?> id="<?php echo $this->get_field_id( 'categorize' ); ?>" name="<?php echo $this->get_field_name( 'categorize' ); ?>" /> <?php _e( 'Categorize?', $this->textdomain ); ?> <code>categorize</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_description' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_description'], true ); ?> id="<?php echo $this->get_field_id( 'show_description' ); ?>" name="<?php echo $this->get_field_name( 'show_description' ); ?>" /> <?php _e( 'Show description?', $this->textdomain ); ?> <code>show_description</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'hide_invisible' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hide_invisible'], true ); ?> id="<?php echo $this->get_field_id( 'hide_invisible' ); ?>" name="<?php echo $this->get_field_name( 'hide_invisible' ); ?>" /> <?php _e( 'Hide invisible?', $this->textdomain ); ?> <code>hide_invisible</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_rating' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_rating'], true ); ?> id="<?php echo $this->get_field_id( 'show_rating' ); ?>" name="<?php echo $this->get_field_name( 'show_rating' ); ?>" /> <?php _e( 'Show rating?', $this->textdomain ); ?> <code>show_rating</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_updated' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_updated'], true ); ?> id="<?php echo $this->get_field_id( 'show_updated' ); ?>" name="<?php echo $this->get_field_name( 'show_updated' ); ?>" /> <?php _e( 'Show updated?', $this->textdomain ); ?> <code>show_updated</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_images' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_images'], true ); ?> id="<?php echo $this->get_field_id( 'show_images' ); ?>" name="<?php echo $this->get_field_name( 'show_images' ); ?>" /> <?php _e( 'Show images?', $this->textdomain ); ?> <code>show_images</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_name' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_name'], true ); ?> id="<?php echo $this->get_field_id( 'show_name' ); ?>" name="<?php echo $this->get_field_name( 'show_name' ); ?>" /> <?php _e( 'Show name?', $this->textdomain ); ?> <code>show_name</code></label>
- </p>
- <p>
- <label for="<?php echo $this->get_field_id( 'show_private' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_private'], true ); ?> id="<?php echo $this->get_field_id( 'show_private' ); ?>" name="<?php echo $this->get_field_name( 'show_private' ); ?>" /> <?php _e( 'Show private?', $this->textdomain ); ?> <code>show_private</code></label>
- </p>
-
- </div>
- <div style="clear:both;">&nbsp;</div>
- <?php
- }
-}
-
-?>
View
98 library/classes/widget-calendar.php
@@ -1,98 +0,0 @@
-<?php
-/**
- * Calendar Widget Class
- *
- * The calendar widget was created to give users the ability to show a post calendar for their blog
- * using all the available options given in the get_calendar() function. It replaces the default WordPress
- * calendar widget.
- *
- * @since 0.6
- * @link http://codex.wordpress.org/Function_Reference/get_calendar
- * @link http://themehybrid.com/themes/hybrid/widgets
- *
- * @package Hybrid
- * @subpackage Classes
- */
-
-class Hybrid_Widget_Calendar extends WP_Widget {
-
- var $prefix;
- var $textdomain;
-
- /**
- * Set up the widget's unique name, ID, class, description, and other options.
- * @since 0.6
- */
- function Hybrid_Widget_Calendar() {
- $this->prefix = hybrid_get_prefix();
- $this->textdomain = hybrid_get_textdomain();
-
- $widget_ops = array( 'classname' => 'calendar', 'description' => __( 'An advanced widget that gives you total control over the output of your calendar.', $this->textdomain ) );
- $control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => "{$this->prefix}-calendar" );
- $this->WP_Widget( "{$this->prefix}-calendar", __( 'Calendar', $this->textdomain ), $widget_ops, $control_ops );
- }
-
- /**
- * Outputs the widget based on the arguments input through the widget controls.
- * @since 0.6
- */
- function widget( $args, $instance ) {
- extract( $args );
-
- $initial = isset( $instance['initial'] ) ? $instance['initial'] : false;
-
- echo $before_widget;
-
- if ( $instance['title'] )
- echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;
-
- echo '<div class="calendar-wrap">';
- get_calendar( $initial );
- echo '</div><!-- .calendar-wrap -->';
-
- echo $after_widget;
- }
-
- /**
- * Updates the widget control options for the particular instance of the widget.
- * @since 0.6
- */
- function update( $new_instance, $old_instance ) {
- $instance = $old_instance;
-
- $instance = $new_instance;
-
- $instance['title'] = strip_tags( $new_instance['title'] );
- $instance['initial'] = ( isset( $new_instance['initial'] ) ? 1 : 0 );
-
- return $instance;
- }
-
- /**
- * Displays the widget control options in the Widgets admin screen.
- * @since 0.6
- */
- function form( $instance ) {