Plugin Directory

Changeset 135351


Ignore:
Timestamp:
07/15/2009 11:34:46 AM (17 years ago)
Author:
kahi
Message:

0.7

Location:
kahis-notes/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kahis-notes/trunk/knotes.php

    r103219 r135351  
    33Plugin Name: Kahi's Notes
    44Plugin URI: http://kahi.cz/wordpress/wp-notes-plugin/
    5 Description: A place for your notes inside WordPress.
     5Description: A place for your notes inside WordPress administration.
    66Author: Peter Kahoun
    7 Version: 0.6
     7Version: 0.7
    88Author URI: http://kahi.cz
    9 */
    10 
    11 /*
    12 
    13 @todo
    14 - !! Page title not working
    15 -
    16 
    179*/
    1810
     
    3729    // Descr: in db are these settings prefixed with abbr_
    3830    static $settings = array (
    39 
    40         'content' => '',
    41 
     31        'content' => 'Your mind comes here...',
    4232    );
    43 
    44 
    45 
    4633
    4734
     
    5643
    5744        // load translation
    58 //      load_plugin_textdomain(self::$abbr, 'wp-content/plugins/' . self::$dir_name . '/languages/');
     45        // @todo: generate .pot (very low priority)
     46        // load_plugin_textdomain(self::$abbr, 'wp-content/plugins/' . self::$dir_name . '/languages/');
    5947
    6048        // prepare settings
     
    6553        add_action('admin_menu', array (self::$abbr, 'admin_menu'));
    6654        add_action('admin_head', array (self::$abbr, 'admin_head'));
    67 
    68     }
     55        add_action('wp_dashboard_setup', array (self::$abbr, 'wp_dashboard_setup'));
     56
     57    }
     58
    6959
    7060
     
    8171
    8272
    83     // Hook: Action: admin_menu
     73    // Hook: Special: admin_menu
    8474    // Descr: adds own item into menu in administration
    8575    public static function admin_menu () {
     
    9787
    9888
     89    // Hook: Special: wp_add_dashboard_widget
     90    // Descr: links the function with widget's content
     91    public static function wp_dashboard_setup() {
     92        wp_add_dashboard_widget('knotes', 'Notes', array (self::$abbr, 'dashboard_widget'));   
     93    }
     94
     95
    9996    // Hook: Action: admin_head
    10097    // Descr: apply my CSS
    10198    public static function admin_head () {
    10299
    103         ?>
     100?>
    104101
    105102<!-- by plugin: <?php echo self::$full_name; ?> -->
    106103<style type="text/css">
    107     #<?php echo self::$abbr; ?> textarea {width:60em; min-height:10em;}
     104    #<?php echo self::$abbr; ?> textarea {width:60em; min-height:14em;}
     105    #dashboard-widgets #<?php echo self::$abbr; ?> textarea {width:100%; /* note: max-height:60em not working*/}
    108106</style>
    109107<script type="text/javascript">
     
    113111</script>
    114112
    115         <?php
    116 
    117     }
    118 
    119 
    120     // WP settings page ---------------------------------------------------------
     113<?php
     114    }
     115
     116
     117
     118
     119    // ====================  WP settings pages  ====================
     120
    121121
    122122    // Descr: own settings-page
     
    124124    public static function TheSettingsPage () {
    125125
    126 
    127     ?>
     126?>
    128127
    129128    <div class="wrap" id="<?php echo self::$abbr; ?>">
    130 
    131129
    132130        <h2><?php echo self::$short_name; ?></h2>
     
    134132        <form method="post" action="options.php">
    135133       
    136 
    137134            <div>
    138135            <label>
     
    154151    </div><!-- /wrap -->
    155152
    156     <?php
     153<?php
     154    }
     155   
     156   
     157    // Descr: Dashboard wiget
     158    // @note: at the time, this is exact copy of options-page (minus label)
     159    // @todo: fix max-height?
     160    public static function dashboard_widget() {
     161
     162?>
     163
     164        <form method="post" action="options.php">
     165
     166            <div>
     167                <textarea name="<?php echo self::$abbr . '_content'; ?>" rows="3"><?php echo htmlSpecialChars(self::$settings['content']) ?></textarea>
     168            </div>
     169
     170            <p class="submit">
     171                <?php wp_nonce_field('update-options') ?>
     172                <input type="hidden" name="action" value="update" />
     173                <input type="hidden" name="page_options" value="<?php echo self::$abbr . '_content'; ?>" />
     174                <input type="submit" name="<?php echo self::$abbr ?>_submit_update" value="<?php _e('Save Changes') ?>" class="button" />
     175            </p>
     176
     177        </form>
     178
     179<?php
    157180    }
    158181
     
    181204
    182205
     206
    183207// ====================  Initialize the plugin  ====================
    184208knotes::Init();
  • kahis-notes/trunk/readme.txt

    r103221 r135351  
    11=== Kahi's WP Notes ===
    2 Contributors: kahi
     2Contributors:
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=kahi%40kahi%2ecz&item_name=Kahi&no_shipping=1&cn=Your%20note%2e%2e%2e&tax=0&currency_code=EUR&lc=CZ&bn=PP%2dDonationsBF&charset=UTF%2d8
    44Tags: note, notes, admin, administration
    55Requires at least: 2.7
    6 Tested up to: 2.7.1
     6Tested up to: 2.8.1
    77Stable tag: trunk
    88
    9 For me, it's place to leave notes about future articles, possible topics, ToDos connected with that particular WP site.
     9For me, it's the place to keep notes about future articles, possible topics, plans, ToDos connected with that particular WP site.
     10
    1011
    1112== Description ==
     
    2021
    2122**PHP 5** on your server is necessary to run this plugin.
     23
     24
     25== Screenshots ==
     26
     27Imagine a large text-field... or [see a screenshot](http://kahi.cz/wordpress/wp-content/images/kahis-notes-plugin/notes-screen.png)
     28
     29
     30== Changelog ==
     31
     32= 0.7 =
     33
     34* New: Dashboard widget!
Note: See TracChangeset for help on using the changeset viewer.