web/wp-content/themes/thematic/library/extensions/widgets-extensions.php
author ymh <ymh.work@gmail.com>
Mon, 22 Mar 2010 16:36:28 +0100
changeset 5 ac511f1ccc8e
parent 1 0d28b7c10758
permissions -rw-r--r--
add hgignore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
0d28b7c10758 First commit
ymh
parents:
diff changeset
     1
<?php
0d28b7c10758 First commit
ymh
parents:
diff changeset
     2
0d28b7c10758 First commit
ymh
parents:
diff changeset
     3
function thematic_search_form() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
     4
				$search_form = "\n" . "\t";
0d28b7c10758 First commit
ymh
parents:
diff changeset
     5
				$search_form .= '<form id="searchform" method="get" action="' . get_bloginfo('home') .'">';
0d28b7c10758 First commit
ymh
parents:
diff changeset
     6
				$search_form .= "\n" . "\t" . "\t";
0d28b7c10758 First commit
ymh
parents:
diff changeset
     7
				$search_form .= '<div>';
0d28b7c10758 First commit
ymh
parents:
diff changeset
     8
				$search_form .= "\n" . "\t" . "\t". "\t";
0d28b7c10758 First commit
ymh
parents:
diff changeset
     9
				if (is_search()) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
    10
						$search_form .= '<input id="s" name="s" type="text" value="' . wp_specialchars(stripslashes($_GET['s']), true) .'" size="32" tabindex="1" />';
0d28b7c10758 First commit
ymh
parents:
diff changeset
    11
				} else {
0d28b7c10758 First commit
ymh
parents:
diff changeset
    12
						$value = __('To search, type and hit enter', 'thematic');
0d28b7c10758 First commit
ymh
parents:
diff changeset
    13
						$value = apply_filters('search_field_value',$value);
0d28b7c10758 First commit
ymh
parents:
diff changeset
    14
						$search_form .= '<input id="s" name="s" type="text" value="' . $value . '" onfocus="if (this.value == \'' . $value . '\') {this.value = \'\';}" onblur="if (this.value == \'\') {this.value = \'' . $value . '\';}" size="32" tabindex="1" />';
0d28b7c10758 First commit
ymh
parents:
diff changeset
    15
				}
0d28b7c10758 First commit
ymh
parents:
diff changeset
    16
				$search_form .= "\n" . "\t" . "\t". "\t";
0d28b7c10758 First commit
ymh
parents:
diff changeset
    17
0d28b7c10758 First commit
ymh
parents:
diff changeset
    18
				$search_submit = '<input id="searchsubmit" name="searchsubmit" type="submit" value="' . __('Search', 'thematic') . '" tabindex="2" />';
0d28b7c10758 First commit
ymh
parents:
diff changeset
    19
0d28b7c10758 First commit
ymh
parents:
diff changeset
    20
				$search_form .= apply_filters('thematic_search_submit', $search_submit);
0d28b7c10758 First commit
ymh
parents:
diff changeset
    21
0d28b7c10758 First commit
ymh
parents:
diff changeset
    22
				$search_form .= "\n" . "\t" . "\t";
0d28b7c10758 First commit
ymh
parents:
diff changeset
    23
				$search_form .= '</div>';
0d28b7c10758 First commit
ymh
parents:
diff changeset
    24
0d28b7c10758 First commit
ymh
parents:
diff changeset
    25
				$search_form .= "\n" . "\t";
0d28b7c10758 First commit
ymh
parents:
diff changeset
    26
				$search_form .= '</form>';
0d28b7c10758 First commit
ymh
parents:
diff changeset
    27
0d28b7c10758 First commit
ymh
parents:
diff changeset
    28
				echo apply_filters('thematic_search_form', $search_form);
0d28b7c10758 First commit
ymh
parents:
diff changeset
    29
0d28b7c10758 First commit
ymh
parents:
diff changeset
    30
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
    31
0d28b7c10758 First commit
ymh
parents:
diff changeset
    32
// Widgets plugin: intializes the plugin after the widgets above have passed snuff
0d28b7c10758 First commit
ymh
parents:
diff changeset
    33
0d28b7c10758 First commit
ymh
parents:
diff changeset
    34
function thematic_widgets_init() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
    35
0d28b7c10758 First commit
ymh
parents:
diff changeset
    36
	// Define array for the widgetized areas
0d28b7c10758 First commit
ymh
parents:
diff changeset
    37
	$thematic_widgetized_areas = array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
    38
		'Primary Aside' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
    39
			'admin_menu_order' => 100,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    40
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
    41
				'name' => 'Primary Aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    42
				'id' => 'primary-aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    43
                'description' => __('The primary widget area, most often used as a sidebar.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    44
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    45
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    46
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    47
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    48
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    49
			'action_hook'	=> 'widget_area_primary_aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    50
			'function'		=> 'thematic_primary_aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    51
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    52
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    53
		'Secondary Aside' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
    54
			'admin_menu_order' => 200,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    55
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
    56
				'name' => 'Secondary Aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    57
				'id' => 'secondary-aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    58
                'description' => __('The secondary widget area, most often used as a sidebar.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    59
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    60
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    61
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    62
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    63
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    64
			'action_hook'	=> 'widget_area_secondary_aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    65
			'function'		=> 'thematic_secondary_aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    66
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    67
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    68
		'1st Subsidiary Aside' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
    69
			'admin_menu_order' => 300,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    70
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
    71
				'name' => '1st Subsidiary Aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    72
				'id' => '1st-subsidiary-aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    73
                'description' => __('The 1st widget area in the footer.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    74
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    75
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    76
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    77
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    78
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    79
			'action_hook'	=> 'widget_area_subsidiaries',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    80
			'function'		=> 'thematic_1st_subsidiary_aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    81
			'priority'		=> 30,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    82
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    83
		'2nd Subsidiary Aside' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
    84
			'admin_menu_order' => 400,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    85
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
    86
				'name' => '2nd Subsidiary Aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    87
				'id' => '2nd-subsidiary-aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    88
                'description' => __('The 2nd widget area in the footer.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    89
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    90
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    91
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    92
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    93
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    94
			'action_hook'	=> 'widget_area_subsidiaries',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    95
			'function'		=> 'thematic_2nd_subsidiary_aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
    96
			'priority'		=> 50,
0d28b7c10758 First commit
ymh
parents:
diff changeset
    97
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
    98
		'3rd Subsidiary Aside' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
    99
			'admin_menu_order' => 500,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   100
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   101
				'name' => '3rd Subsidiary Aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   102
				'id' => '3rd-subsidiary-aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   103
                'description' => __('The 3rd widget area in the footer.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   104
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   105
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   106
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   107
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   108
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   109
			'action_hook'	=> 'widget_area_subsidiaries',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   110
			'function'		=> 'thematic_3rd_subsidiary_aside',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   111
			'priority'		=> 70,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   112
		),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   113
		'Index Top' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   114
			'admin_menu_order' => 600,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   115
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   116
				'name' => 'Index Top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   117
				'id' => 'index-top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   118
                'description' => __('The top widget area displayed on the index page.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   119
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   120
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   121
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   122
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   123
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   124
			'action_hook'	=> 'widget_area_index_top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   125
			'function'		=> 'thematic_index_top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   126
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   127
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   128
		'Index Insert' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   129
			'admin_menu_order' => 700,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   130
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   131
				'name' => 'Index Insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   132
				'id' => 'index-insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   133
                'description' => __('The widget area inserted after x posts on the index page.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   134
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   135
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   136
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   137
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   138
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   139
			'action_hook'	=> 'widget_area_index_insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   140
			'function'		=> 'thematic_index_insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   141
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   142
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   143
		'Index Bottom' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   144
			'admin_menu_order' => 800,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   145
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   146
				'name' => 'Index Bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   147
				'id' => 'index-bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   148
                'description' => __('The bottom widget area displayed on the index page.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   149
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   150
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   151
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   152
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   153
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   154
			'action_hook'	=> 'widget_area_index_bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   155
			'function'		=> 'thematic_index_bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   156
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   157
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   158
		'Single Top' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   159
			'admin_menu_order' => 900,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   160
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   161
				'name' => 'Single Top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   162
				'id' => 'single-top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   163
                'description' => __('The top widget area displayed on a single post.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   164
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   165
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   166
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   167
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   168
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   169
			'action_hook'	=> 'widget_area_single_top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   170
			'function'		=> 'thematic_single_top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   171
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   172
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   173
		'Single Insert' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   174
			'admin_menu_order' => 1000,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   175
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   176
				'name' => 'Single Insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   177
				'id' => 'single-insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   178
                'description' => __('The widget area inserted between the post and the comments on a single post.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   179
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   180
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   181
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   182
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   183
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   184
			'action_hook'	=> 'widget_area_single_insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   185
			'function'		=> 'thematic_single_insert',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   186
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   187
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   188
		'Single Bottom' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   189
			'admin_menu_order' => 1100,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   190
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   191
				'name' => 'Single Bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   192
				'id' => 'single-bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   193
                'description' => __('The bottom widget area displayed on a single post.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   194
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   195
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   196
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   197
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   198
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   199
			'action_hook'	=> 'widget_area_single_bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   200
			'function'		=> 'thematic_single_bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   201
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   202
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   203
		'Page Top' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   204
			'admin_menu_order' => 1200,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   205
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   206
				'name' => 'Page Top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   207
				'id' => 'page-top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   208
                'description' => __('The top widget area displayed on a page.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   209
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   210
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   211
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   212
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   213
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   214
			'action_hook'	=> 'widget_area_page_top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   215
			'function'		=> 'thematic_page_top',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   216
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   217
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   218
		'Page Bottom' => array(
0d28b7c10758 First commit
ymh
parents:
diff changeset
   219
			'admin_menu_order' => 1300,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   220
			'args' => array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   221
				'name' => 'Page Bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   222
				'id' => 'page-bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   223
                'description' => __('The bottom widget area displayed on a page.', 'thematic'),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   224
				'before_widget' => thematic_before_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   225
				'after_widget' => thematic_after_widget(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   226
				'before_title' => thematic_before_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   227
				'after_title' => thematic_after_title(),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   228
				),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   229
			'action_hook'	=> 'widget_area_page_bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   230
			'function'		=> 'thematic_page_bottom',
0d28b7c10758 First commit
ymh
parents:
diff changeset
   231
			'priority'		=> 10,
0d28b7c10758 First commit
ymh
parents:
diff changeset
   232
			),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   233
		);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   234
	
0d28b7c10758 First commit
ymh
parents:
diff changeset
   235
	$thematic_widgetized_areas = apply_filters('thematic_widgetized_areas', $thematic_widgetized_areas);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   236
	
0d28b7c10758 First commit
ymh
parents:
diff changeset
   237
	if ( !function_exists('register_sidebars') )
0d28b7c10758 First commit
ymh
parents:
diff changeset
   238
			return;
0d28b7c10758 First commit
ymh
parents:
diff changeset
   239
0d28b7c10758 First commit
ymh
parents:
diff changeset
   240
	foreach ($thematic_widgetized_areas as $key => $value) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   241
		register_sidebar($thematic_widgetized_areas[$key]['args']);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   242
		if (!has_action($thematic_widgetized_areas[$key]['action_hook'], $thematic_widgetized_areas[$key]['function'])) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   243
			add_action($thematic_widgetized_areas[$key]['action_hook'], $thematic_widgetized_areas[$key]['function'], $thematic_widgetized_areas[$key]['priority']);	
0d28b7c10758 First commit
ymh
parents:
diff changeset
   244
		}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   245
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   246
	  
0d28b7c10758 First commit
ymh
parents:
diff changeset
   247
    // we will check for a Thematic widgets directory and and add and activate additional widgets
0d28b7c10758 First commit
ymh
parents:
diff changeset
   248
    // Thanks to Joern Kretzschmar
0d28b7c10758 First commit
ymh
parents:
diff changeset
   249
	  $widgets_dir = @ dir(ABSPATH . '/wp-content/themes/' . get_template() . '/widgets');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   250
	  if ($widgets_dir)	{
0d28b7c10758 First commit
ymh
parents:
diff changeset
   251
		  while(($widgetFile = $widgets_dir->read()) !== false) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   252
			 if (!preg_match('|^\.+$|', $widgetFile) && preg_match('|\.php$|', $widgetFile))
0d28b7c10758 First commit
ymh
parents:
diff changeset
   253
				  include(ABSPATH . '/wp-content/themes/' . get_template() . '/widgets/' . $widgetFile);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   254
		  }
0d28b7c10758 First commit
ymh
parents:
diff changeset
   255
	  }
0d28b7c10758 First commit
ymh
parents:
diff changeset
   256
0d28b7c10758 First commit
ymh
parents:
diff changeset
   257
	  // we will check for the child themes widgets directory and add and activate additional widgets
0d28b7c10758 First commit
ymh
parents:
diff changeset
   258
    // Thanks to Joern Kretzschmar 
0d28b7c10758 First commit
ymh
parents:
diff changeset
   259
	  $widgets_dir = @ dir(ABSPATH . '/wp-content/themes/' . get_stylesheet() . '/widgets');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   260
	  if ((TEMPLATENAME != THEMENAME) && ($widgets_dir)) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   261
		  while(($widgetFile = $widgets_dir->read()) !== false) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   262
			 if (!preg_match('|^\.+$|', $widgetFile) && preg_match('|\.php$|', $widgetFile))
0d28b7c10758 First commit
ymh
parents:
diff changeset
   263
				  include(ABSPATH . '/wp-content/themes/' . get_stylesheet() . '/widgets/' . $widgetFile);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   264
		  }
0d28b7c10758 First commit
ymh
parents:
diff changeset
   265
	  }   
0d28b7c10758 First commit
ymh
parents:
diff changeset
   266
0d28b7c10758 First commit
ymh
parents:
diff changeset
   267
	// Remove WP default Widgets
0d28b7c10758 First commit
ymh
parents:
diff changeset
   268
	// WP 2.8 function using $widget_class
0d28b7c10758 First commit
ymh
parents:
diff changeset
   269
	if (function_exists('unregister_widget')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   270
		unregister_widget('WP_Widget_Meta');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   271
		unregister_widget('WP_Widget_Search');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   272
        unregister_widget('');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   273
	
0d28b7c10758 First commit
ymh
parents:
diff changeset
   274
	// pre WP 2.8 function using $id
0d28b7c10758 First commit
ymh
parents:
diff changeset
   275
	} else {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   276
		unregister_widget_control('meta');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   277
		unregister_widget_control('search');	
0d28b7c10758 First commit
ymh
parents:
diff changeset
   278
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   279
0d28b7c10758 First commit
ymh
parents:
diff changeset
   280
	// Finished intializing Widgets plugin, now let's load the thematic default widgets
0d28b7c10758 First commit
ymh
parents:
diff changeset
   281
	register_sidebar_widget(__('Search', 'thematic'), 'widget_thematic_search', null, 'search');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   282
	unregister_widget_control('search');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   283
	register_sidebar_widget(__('Meta', 'thematic'), 'widget_thematic_meta', null, 'meta');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   284
	unregister_widget_control('meta');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   285
	register_sidebar_widget(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   286
	register_widget_control(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks_control', 300, 90);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   287
0d28b7c10758 First commit
ymh
parents:
diff changeset
   288
	// Pre-set Widgets
0d28b7c10758 First commit
ymh
parents:
diff changeset
   289
	$preset_widgets = array (
0d28b7c10758 First commit
ymh
parents:
diff changeset
   290
		'primary-aside'  => array( 'search', 'pages', 'categories', 'archives' ),
0d28b7c10758 First commit
ymh
parents:
diff changeset
   291
		'secondary-aside'  => array( 'links', 'rss-links', 'meta' )
0d28b7c10758 First commit
ymh
parents:
diff changeset
   292
		);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   293
0d28b7c10758 First commit
ymh
parents:
diff changeset
   294
    if ( isset( $_GET['activated'] ) ) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   295
  		update_option( 'sidebars_widgets', apply_filters('thematic_preset_widgets',$preset_widgets ));
0d28b7c10758 First commit
ymh
parents:
diff changeset
   296
  	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   297
0d28b7c10758 First commit
ymh
parents:
diff changeset
   298
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   299
0d28b7c10758 First commit
ymh
parents:
diff changeset
   300
// Runs our code at the end to check that everything needed has loaded
0d28b7c10758 First commit
ymh
parents:
diff changeset
   301
add_action( 'widgets_init', 'thematic_widgets_init' );
0d28b7c10758 First commit
ymh
parents:
diff changeset
   302
0d28b7c10758 First commit
ymh
parents:
diff changeset
   303
// We sort our array of widgetized areas to get a nice list display under wp-admin
0d28b7c10758 First commit
ymh
parents:
diff changeset
   304
function thematic_sort_widgetized_areas($content) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   305
	asort($content);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   306
	return $content;
0d28b7c10758 First commit
ymh
parents:
diff changeset
   307
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   308
add_filter('thematic_widgetized_areas', 'thematic_sort_widgetized_areas', 100);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   309
0d28b7c10758 First commit
ymh
parents:
diff changeset
   310
// We start our functions for the widgetized areas here
0d28b7c10758 First commit
ymh
parents:
diff changeset
   311
0d28b7c10758 First commit
ymh
parents:
diff changeset
   312
// Define the Primary Aside 
0d28b7c10758 First commit
ymh
parents:
diff changeset
   313
function thematic_primary_aside() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   314
	if (is_sidebar_active('primary-aside')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   315
		echo thematic_before_widget_area('primary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   316
		dynamic_sidebar('primary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   317
		echo thematic_after_widget_area('primary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   318
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   319
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   320
0d28b7c10758 First commit
ymh
parents:
diff changeset
   321
// Define the Secondary Aside
0d28b7c10758 First commit
ymh
parents:
diff changeset
   322
function thematic_secondary_aside() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   323
	if (is_sidebar_active('secondary-aside')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   324
		echo thematic_before_widget_area('secondary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   325
		dynamic_sidebar('secondary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   326
		echo thematic_after_widget_area('secondary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   327
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   328
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   329
0d28b7c10758 First commit
ymh
parents:
diff changeset
   330
// Define the 1st Subsidiary Aside
0d28b7c10758 First commit
ymh
parents:
diff changeset
   331
function thematic_1st_subsidiary_aside() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   332
	if (is_sidebar_active('1st-subsidiary-aside')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   333
		echo thematic_before_widget_area('1st-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   334
		dynamic_sidebar('1st-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   335
		echo thematic_after_widget_area('1st-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   336
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   337
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   338
0d28b7c10758 First commit
ymh
parents:
diff changeset
   339
// Define the 2nd Subsidiary Aside
0d28b7c10758 First commit
ymh
parents:
diff changeset
   340
function thematic_2nd_subsidiary_aside() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   341
	if (is_sidebar_active('2nd-subsidiary-aside')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   342
		echo thematic_before_widget_area('2nd-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   343
		dynamic_sidebar('2nd-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   344
		echo thematic_after_widget_area('2nd-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   345
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   346
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   347
0d28b7c10758 First commit
ymh
parents:
diff changeset
   348
// Define the 3rd Subsidiary Aside
0d28b7c10758 First commit
ymh
parents:
diff changeset
   349
function thematic_3rd_subsidiary_aside() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   350
	if (is_sidebar_active('3rd-subsidiary-aside')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   351
		echo thematic_before_widget_area('3rd-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   352
		dynamic_sidebar('3rd-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   353
		echo thematic_after_widget_area('3rd-subsidiary-aside');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   354
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   355
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   356
0d28b7c10758 First commit
ymh
parents:
diff changeset
   357
// Define the Index Top
0d28b7c10758 First commit
ymh
parents:
diff changeset
   358
function thematic_index_top() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   359
	if (is_sidebar_active('index-top')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   360
		echo thematic_before_widget_area('index-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   361
		dynamic_sidebar('index-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   362
		echo thematic_after_widget_area('index-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   363
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   364
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   365
0d28b7c10758 First commit
ymh
parents:
diff changeset
   366
// Define the Index Insert
0d28b7c10758 First commit
ymh
parents:
diff changeset
   367
function thematic_index_insert() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   368
	if (is_sidebar_active('index-insert')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   369
		echo thematic_before_widget_area('index-insert');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   370
		dynamic_sidebar('index-insert');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   371
		echo thematic_after_widget_area('index-insert');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   372
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   373
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   374
0d28b7c10758 First commit
ymh
parents:
diff changeset
   375
// Define the Index Bottom
0d28b7c10758 First commit
ymh
parents:
diff changeset
   376
function thematic_index_bottom() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   377
	if (is_sidebar_active('index-bottom')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   378
		echo thematic_before_widget_area('index-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   379
		dynamic_sidebar('index-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   380
		echo thematic_after_widget_area('index-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   381
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   382
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   383
0d28b7c10758 First commit
ymh
parents:
diff changeset
   384
// Define the Single Top
0d28b7c10758 First commit
ymh
parents:
diff changeset
   385
function thematic_single_top() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   386
	if (is_sidebar_active('single-top')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   387
		echo thematic_before_widget_area('single-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   388
		dynamic_sidebar('single-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   389
		echo thematic_after_widget_area('single-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   390
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   391
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   392
0d28b7c10758 First commit
ymh
parents:
diff changeset
   393
// Define the Single Insert
0d28b7c10758 First commit
ymh
parents:
diff changeset
   394
function thematic_single_insert() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   395
	if (is_sidebar_active('single-insert')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   396
		echo thematic_before_widget_area('single-insert');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   397
		dynamic_sidebar('single-insert');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   398
		echo thematic_after_widget_area('single-insert');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   399
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   400
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   401
0d28b7c10758 First commit
ymh
parents:
diff changeset
   402
// Define the Single Bottom
0d28b7c10758 First commit
ymh
parents:
diff changeset
   403
function thematic_single_bottom() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   404
	if (is_sidebar_active('single-bottom')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   405
		echo thematic_before_widget_area('single-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   406
		dynamic_sidebar('single-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   407
		echo thematic_after_widget_area('single-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   408
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   409
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   410
0d28b7c10758 First commit
ymh
parents:
diff changeset
   411
// Define the Page Top
0d28b7c10758 First commit
ymh
parents:
diff changeset
   412
function thematic_page_top() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   413
	if (is_sidebar_active('page-top')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   414
		echo thematic_before_widget_area('page-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   415
		dynamic_sidebar('page-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   416
		echo thematic_after_widget_area('page-top');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   417
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   418
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   419
0d28b7c10758 First commit
ymh
parents:
diff changeset
   420
// Define the Page Bottom
0d28b7c10758 First commit
ymh
parents:
diff changeset
   421
function thematic_page_bottom() {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   422
	if (is_sidebar_active('page-bottom')) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   423
		echo thematic_before_widget_area('page-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   424
		dynamic_sidebar('page-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   425
		echo thematic_after_widget_area('page-bottom');
0d28b7c10758 First commit
ymh
parents:
diff changeset
   426
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   427
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   428
0d28b7c10758 First commit
ymh
parents:
diff changeset
   429
// this function returns the opening CSS markup for the widget area 
0d28b7c10758 First commit
ymh
parents:
diff changeset
   430
function thematic_before_widget_area($hook) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   431
	$content =  "\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   432
	if ($hook == 'primary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   433
		$content .= '<div id="primary" class="aside main-aside">' . "\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   434
	} elseif ($hook == 'secondary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   435
		$content .= '<div id="secondary" class="aside main-aside">' . "\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   436
	} elseif ($hook == '1st-subsidiary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   437
		$content .= '<div id="first" class="aside sub-aside">' . "\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   438
	} elseif ($hook == '2nd-subsidiary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   439
		$content .= '<div id="second" class="aside sub-aside">' . "\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   440
	} elseif ($hook == '3rd-subsidiary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   441
		$content .= '<div id="third" class="aside sub-aside">' . "\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   442
	} else {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   443
		$content .= '<div id="' . $hook . '" class="aside">' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   444
	}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   445
	$content .= "\t" . '<ul class="xoxo">' . "\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   446
	return apply_filters('thematic_before_widget_area', $content);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   447
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   448
0d28b7c10758 First commit
ymh
parents:
diff changeset
   449
// this function returns the clossing CSS markup for the widget area
0d28b7c10758 First commit
ymh
parents:
diff changeset
   450
function thematic_after_widget_area($hook) {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   451
	$content = "\n" . "\t" . '</ul>' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   452
	if ($hook == 'primary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   453
		$content .= '</div><!-- #primary .aside -->' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   454
	} elseif ($hook == 'secondary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   455
		$content .= '</div><!-- #secondary .aside -->' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   456
	} elseif ($hook == '1st-subsidiary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   457
		$content .= '</div><!-- #first .aside -->' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   458
	} elseif ($hook == '2nd-subsidiary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   459
		$content .= '</div><!-- #second .aside -->' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   460
	} elseif ($hook == '3rd-subsidiary-aside') {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   461
		$content .= '</div><!-- #third .aside -->' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   462
	} else {
0d28b7c10758 First commit
ymh
parents:
diff changeset
   463
		$content .= '</div><!-- #' . $hook . ' .aside -->' ."\n";
0d28b7c10758 First commit
ymh
parents:
diff changeset
   464
	} 
0d28b7c10758 First commit
ymh
parents:
diff changeset
   465
	return apply_filters('thematic_after_widget_area', $content);
0d28b7c10758 First commit
ymh
parents:
diff changeset
   466
}
0d28b7c10758 First commit
ymh
parents:
diff changeset
   467
0d28b7c10758 First commit
ymh
parents:
diff changeset
   468
?>