Skip to content

Commit

Permalink
Ads 32x32 icon, fixes plural label suggestion
Browse files Browse the repository at this point in the history
Icon:
  - Icons added to the Settings and Magic Fields admin page
  - The wand-hat icon is Yusuke Kamiyamane's work from the Fugue Icons pack. It is CC-BY-3.0, so we can use it, but Yusuke has to be credited
  - images/wand-hat-32-orig.png is the original icon made by Yusuke
  - images/wand-hat-orig.xcf is the GIMP source, it was converted from Yusuke's PSD
  - images/wand-hat.svg is made by Gábor Udvari in Inkscape
  - images/wand-hat-32.png is exported from the SVG

Custom post type label suggestions:
  - Plural and singular support was added

Readme.markdown:
  - Fixed bad grammar
  - Yusuke Kamiyamane credited
  • Loading branch information
gabor-udvari committed Feb 20, 2012
1 parent 73e8185 commit a869b62
Show file tree
Hide file tree
Showing 12 changed files with 705 additions and 72 deletions.
2 changes: 2 additions & 0 deletions admin/mf_dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function main() {
$custom_taxonomies = $this->get_custom_taxonomies();

print '<div class="wrap">';
// print screen icon
print get_screen_icon('magic-fields');
print '<h2>'.__( 'Magic Fields',$mf_domain).'</h2>';
print '<h3>'.__( 'Post Types', $mf_domain ).'<a href="admin.php?page=mf_dispatcher&mf_section=mf_posttype&mf_action=add_post_type" class="add-new-h2 button">'.__( 'Add new Post Type', $mf_domain ).'</a></h3>';

Expand Down
116 changes: 58 additions & 58 deletions admin/mf_posttype.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,22 @@ public function fields_form() {
'value' => 0,
'description' => __( 'Whether the post type is hierarchical. Allows Parent to be specified', $mf_domain )
),
'has_archive' => array(
'id' => 'posttype-has-archive',
'type' => 'checkbox',
'label' => __( 'Has archive', $mf_domain ),
'name' => 'mf_posttype[option][has_archive]',
'value' => 0,
'description' => __( 'Enables post type archives. Will use string as archive slug. Will generate the proper rewrite rules if rewrite is enabled.', $mf_domain )
),
'has_archive_slug' => array(
'id' => 'posttype-has-archive-slug',
'type' => 'text',
'label' => __( 'Archive slug', $mf_domain ),
'name' => 'mf_posttype[option][has_archive_slug]',
'value' => '',
'description' => __( 'Archive slug. The archive for the post type can be viewed at this slug. Has archives must be checked for this to work.', $mf_domain )
),
'has_archive' => array(
'id' => 'posttype-has-archive',
'type' => 'checkbox',
'label' => __( 'Has archive', $mf_domain ),
'name' => 'mf_posttype[option][has_archive]',
'value' => 0,
'description' => __( 'Enables post type archives. Will use string as archive slug. Will generate the proper rewrite rules if rewrite is enabled.', $mf_domain )
),
'has_archive_slug' => array(
'id' => 'posttype-has-archive-slug',
'type' => 'text',
'label' => __( 'Archive slug', $mf_domain ),
'name' => 'mf_posttype[option][has_archive_slug]',
'value' => '',
'description' => __( 'Archive slug. The archive for the post type can be viewed at this slug. Has archives must be checked for this to work.', $mf_domain )
),
'rewrite' => array(
'id' => 'posttype-rewrite',
'type' => 'checkbox',
Expand Down Expand Up @@ -224,7 +224,7 @@ public function fields_form() {
'name' => 'mf_posttype[label][name]',
'value' => __('Posts',$mf_domain),
'description' => __( 'General name for the post type, usually plural.', $mf_domain ),
'rel' => '%s'
'rel' => '$p' // plural, the sign is rather $ than %, because it's more like a variable rather than a sprintf type
),
'singular_name' => array(
'id' => 'posttype-label-singular-name',
Expand All @@ -233,7 +233,7 @@ public function fields_form() {
'name' => 'mf_posttype[label][singular_name]',
'value' => __('Post',$mf_domain),
'description' => __( 'Name for one object of this post type. Defaults to value of name.', $mf_domain ),
'rel' => '%s' //@todo inflection
'rel' => '$s' // singular
),
'add_new' => array(
'id' => 'posttype-label-add-new',
Expand All @@ -242,25 +242,25 @@ public function fields_form() {
'name' => 'mf_posttype[label][add_new]',
'value' => __('Add New',$mf_domain),
'description' => __( 'General name for the post type, usually plural.', $mf_domain ),
'rel' => 'Add %s'
),
'all_items' => array(
'id' => 'posttype-label-all-items',
'type' => 'text',
'label' => __( 'All', $mf_domain ),
'name' => 'mf_posttype[label][all_items]',
'value' => __('All',$mf_domain),
'description' => __( 'The all items text used in the menu. Default is the Name label.', $mf_domain ),
'rel' => 'All %s'
),
'rel' => 'Add $s'
),
'all_items' => array(
'id' => 'posttype-label-all-items',
'type' => 'text',
'label' => __( 'All', $mf_domain ),
'name' => 'mf_posttype[label][all_items]',
'value' => __('All',$mf_domain),
'description' => __( 'The all items text used in the menu. Default is the Name label.', $mf_domain ),
'rel' => 'All $p'
),
'add_new_item' => array(
'id' => 'posttype-label-add-new-item',
'type' => 'text',
'label' => __( 'Add new item', $mf_domain ),
'name' => 'mf_posttype[label][add_new_item]',
'value' => __('Add New Post',$mf_domain),
'description' => __( 'The add new item text.', $mf_domain ),
'rel' => 'Add New %s'
'rel' => 'Add New $s'
),
'edit_item' => array(
'id' => 'posttype-label-edit-item',
Expand All @@ -269,7 +269,7 @@ public function fields_form() {
'name' => 'mf_posttype[label][edit_item]',
'value' => __('Edit Post',$mf_domain),
'description' => __( 'General name for the post type, usually plural.', $mf_domain ),
'rel' => 'Edit %s'
'rel' => 'Edit $s'
),
'new_item' => array(
'id' => 'posttype-label-new-item',
Expand All @@ -278,7 +278,7 @@ public function fields_form() {
'name' => 'mf_posttype[label][new_item]',
'value' => __('New Post',$mf_domain),
'description' => __( 'The new item text.', $mf_domain ),
'rel' => 'New %s'
'rel' => 'New $s'
),
'view_item' => array(
'id' => 'posttype-label-view-item',
Expand All @@ -287,7 +287,7 @@ public function fields_form() {
'name' => 'mf_posttype[label][view_item]',
'value' => __('View Post',$mf_domain),
'description' => __( 'The view item text.', $mf_domain ),
'rel' => 'View %s'
'rel' => 'View $s'
),
'search_items' => array(
'id' => 'posttype-label-search-items',
Expand All @@ -296,43 +296,43 @@ public function fields_form() {
'name' => 'mf_posttype[label][search_items]',
'value' => __('Search Posts',$mf_domain),
'description' => __( 'The search items text.', $mf_domain ),
'rel' => 'No %s found'
),
'not_found' => array(
'id' => 'posttype-label-not-found',
'type' => 'text',
'label' => __( 'Not found', $mf_domain ),
'name' => 'mf_posttype[label][not_found]',
'value' => __('No %s found',$mf_domain),
'description' => __( 'The not found text. Default is No posts found/No pages found', $mf_domain ),
'rel' => 'No %s found'
),
'rel' => 'No $s found'
),
'not_found' => array(
'id' => 'posttype-label-not-found',
'type' => 'text',
'label' => __( 'Not found', $mf_domain ),
'name' => 'mf_posttype[label][not_found]',
'value' => __('No %s found',$mf_domain),
'description' => __( 'The not found text. Default is No posts found/No pages found', $mf_domain ),
'rel' => 'No $p found'
),
'not_found_in_trash' => array(
'id' => 'posttype-label-not-found-in-trash',
'type' => 'text',
'label' => __( 'Not found in trash', $mf_domain ),
'name' => 'mf_posttype[label][not_found_in_trash]',
'value' => __('No posts found in Trash',$mf_domain),
'description' => __( 'the not found in trash text.', $mf_domain ),
'rel' => 'No %s found in Trash'
),
'parent_item_colon' => array(
'id' => 'posttype-label-parent-item-colon',
'type' => 'text',
'label' => __( 'Parent item colon', $mf_domain ),
'name' => 'mf_posttype[label][parent_item_colon]',
'value' => __('Parent Item:',$mf_domain),
'description' => __( 'The same as parent_item, but with colon:', $mf_domain ),
'rel' => __('Parent',$mf_domain) . ' %s:'
),
'rel' => 'No $p found in Trash'
),
'parent_item_colon' => array(
'id' => 'posttype-label-parent-item-colon',
'type' => 'text',
'label' => __( 'Parent item colon', $mf_domain ),
'name' => 'mf_posttype[label][parent_item_colon]',
'value' => __('Parent Item:',$mf_domain),
'description' => __( 'The same as parent_item, but with colon:', $mf_domain ),
'rel' => __('Parent',$mf_domain) . ' $s:'
),
'menu_name' => array(
'id' => 'posttype-label-menu_name',
'type' => 'text',
'label' => __( 'Menu name', $mf_domain ),
'name' => 'mf_posttype[label][menu_name]',
'value' => __('Post',$mf_domain),
'description' => __( 'The name of menu.', $mf_domain ),
'rel' => '%s'
'description' => __( 'The name of menu, usually plural.', $mf_domain ),
'rel' => '$p'
)
)
);
Expand Down Expand Up @@ -421,7 +421,7 @@ function form_post_type($data){
</div>
<?php endif; ?>
<?php endforeach; ?>
<! / core -->
<!-- / core -->

<!-- supports -->
<div class="form-field mf_label_checkbox mf_form">
Expand Down
5 changes: 4 additions & 1 deletion admin/mf_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function main() {

global $mf_domain;
print '<div class="wrap">';
//@todo: the title needs a hat icon

// the title needs a hat icon
echo get_screen_icon('magic-fields');

print '<h2>'.__('Magic Fields Settings', $mf_domain ).'</h2>';
$options = self::fields_form();
self::form_options($options);
Expand Down
8 changes: 8 additions & 0 deletions css/mf_admin.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* Screen icon
* embed icons with echo get_screen_icon('magic-fields');
* URL is relative to this CSS file
*/
#icon-magic-fields {
background: url(../images/wand-hat-32.png) 0 0 no-repeat;
}

/* Messages boxes
* Thanks to: http://www.mattvarone.com/web-design/message-box-with-css/
* */
Expand Down
Binary file added images/wand-hat-32-orig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wand-hat-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wand-hat-orig.xcf
Binary file not shown.
Loading

0 comments on commit a869b62

Please sign in to comment.