Changeset 586927
- Timestamp:
- 08/17/2012 06:16:01 PM (13 years ago)
- Location:
- kickpress/trunk
- Files:
-
- 5 edited
-
elements/class-datetime.php (modified) (2 diffs)
-
elements/class-time.php (modified) (3 diffs)
-
kickpress-form-elements.php (modified) (4 diffs)
-
kickpress.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kickpress/trunk/elements/class-datetime.php
r583190 r586927 1 1 <?php 2 2 3 require_once dirname( __FILE__ ) . '/class-time.php'; 4 3 5 class kickpress_datetime extends kickpress_form_elements { 6 public function __construct( $args = array() ) { 7 parent::__construct( $args ); 8 9 wp_enqueue_style( 'jquery-ui-datepicker', plugins_url( 'kickpress/includes/css/ui.datepicker.css' ) ); 10 wp_enqueue_script( 'jquery-ui-datepicker' ); 11 } 12 4 13 public function element($params) { 5 14 // kickpress_auto_version('/css/ui.datepicker.css' 6 wp_enqueue_style( 'jquery-ui-datepicker', plugins_url( 'kickpress/includes/css/ui.datepicker.css' ) ); 7 wp_enqueue_script( 'jquery-ui-datepicker' ); 8 15 9 16 $date_params = array(); 17 10 18 if ( in_array( $params['caption'], array( 'Birthdate', 'Birthday' ) ) ) 11 19 $date_params['yearRange'] = '-99:+00'; 12 20 13 $hour_options = array(); 14 $minute_options = array(); 21 $time = strtotime( $params['value'] ); 15 22 16 for ( $i = 0; $i < 24; $i++ ) { 17 $hour = sprintf( '%02d', $i ); 18 $hour_options[$hour] = sprintf( '%02d %s', 19 (($i + 11) % 12 + 1), 20 $i < 12 ? 'AM' : 'PM' 21 ); 23 $hour_name = 'hour_' . $params['name']; 24 $minute_name = 'minute_' . $params['name']; 25 26 if ( 0 == $time ) { 27 $date = ''; 28 29 $hour_value = '00'; 30 $minute_value = '00'; 31 } else { 32 $date = date( 'm/d/Y', $time ); 33 34 $hour_value = date( 'H', $time ); 35 $minute_value = date( 'i', $time ); 22 36 } 23 37 24 for ( $i = 0; $i < 60; $i += 15 ) { 25 $minute = sprintf( '%02d', $i ); 26 $minute_options[$minute] = $minute; 27 } 38 $attr = $params['properties']; 39 $attr['style'] = $this->style; 28 40 29 $time = strtotime( $params['value'] ); 30 31 if ( 0 == $time ) { 32 $date = ''; 33 $hour = '00'; 34 $minute = '00'; 35 } else { 36 $date = date( 'm/d/Y', $time ); 37 $hour = date( 'H', $time ); 38 $minute = date( 'i', $time ); 39 } 40 41 $hour = $this->simple_select( 'hour_' . $params['name'], $hour, $hour_options, $params['properties'], $this->style ); 42 $minute = $this->simple_select( 'minute_' . $params['name'], $minute, $minute_options, $params['properties'], $this->style ); 41 $hour = self::_html_select( $hour_name, $hour_value, kickpress_time::$hours, $attr ); 42 $minute = self::_html_select( $minute_name, $minute_value, kickpress_time::$minutes, $attr ); 43 43 44 44 $html = sprintf(' … … 72 72 return $html; 73 73 } 74 75 /* public function input( $params ) { 76 $date_params = array(); 77 78 if ( in_array( $params['caption'], array( 'Birthdate', 'Birthday' ) ) ) 79 $date_params['yearRange'] = '-99:+00'; 80 81 '<input type="text" id="%1$s" name="%2$s" value="%3$s" class="datepicker%5$s"%6$s /> 82 %9$s 83 %10$s 84 <br class="grid-break" /> 85 <div>Format: (MM/DD/YYYY)</div>' 86 87 $time = new kickpress_time()->input( $params ); 88 } */ 74 89 } 75 90 -
kickpress/trunk/elements/class-time.php
r583190 r586927 16 16 '15' => '15', '30' => '30', '45' => '45' ); 17 17 18 public function element( $params ) {18 /* public function element( $params ) { 19 19 if ( ! isset( $params['value'] ) && ! strstr( $params['value'], ':') ) 20 20 $params['value'] = isset( $_POST['selected_time'] ) … … 22 22 23 23 $time = explode( ':', $params['value'] ); 24 25 //$properties = array("style"=>"width:70px");26 $hour = $this->simple_select( 'hour_' . $params['name'], $time[0],27 self::$hours, $params['properties'], $this->style );28 24 29 //$properties = array("style"=>"width:50px"); 30 $minute = $this->simple_select( 'minute_' . $params['name'], $time[1], 31 self::$minutes, $params['properties'], $this->style ); 25 $hour_name = 'hour_' . $params['name']; 26 $minute_name = 'minute_' . $params['name']; 27 28 $time = strtotime( $params['value'] ); 29 30 if ( 0 == $time ) { 31 $date = ''; 32 33 $hour_value = '00'; 34 $minute_value = '00'; 35 } else { 36 $date = date( 'm/d/Y', $time ); 37 38 $hour_value = date( 'H', $time ); 39 $minute_value = date( 'i', $time ); 40 } 41 42 $attr = $params['properties']; 43 $attr['style'] = $this->style; 44 45 $hour = self::_html_select( $hour_name, $time[0], self::$hours, $attr ); 46 $minute = self::_html_select( $minute_name, $time[1], self::$minutes, $attr ); 32 47 33 48 $html = sprintf(' … … 49 64 50 65 return $html; 66 } */ 67 68 public function input( $params ) { 69 $hour_name = 'hour_' . $params['name']; 70 $minute_name = 'minute_' . $params['name']; 71 72 $time = strtotime( $params['value'] ); 73 74 if ( 0 == $time ) { 75 $hour_value = '00'; 76 $minute_value = '00'; 77 } else { 78 $hour_value = date( 'H', $time ); 79 $minute_value = date( 'i', $time ); 80 } 81 82 $attr = $params['properties']; 83 $attr['style'] = $this->style; 84 85 $hour = self::_html_select( $hour_name, 86 $hour_value, self::$hours, $attr ); 87 88 $minute = self::_html_select( $minute_name, 89 $minute_value, self::$minutes, $attr ); 90 91 return $hour . $minute; 51 92 } 52 93 } -
kickpress/trunk/kickpress-form-elements.php
r584904 r586927 95 95 96 96 public function simple_select( $name, $value, $options = array(), $properties, $style = '', $first = '' ) { 97 if ( ! is_array( $properties ) ) $properties = array();98 99 $properties['id'] = $name;100 $properties['name'] = $name;101 $properties['style'] = $style;102 103 97 if ( ! empty( $first ) ) { 104 $options[] = self::_html_tag( 'option', $first, array( 98 $options = array( '' => $first ) + $option; 99 /* $options[] = self::_html_tag( 'option', $first, array( 105 100 'value' => null 106 ) ); 107 } 108 109 foreach ( (array) $options as $set_value => $option ) {101 ) ); */ 102 } 103 104 /* foreach ( (array) $options as $set_value => $option ) { 110 105 $options[] = self::_html_tag( 'option', $option, array( 111 106 'value' => $set_value, … … 114 109 } 115 110 116 $options = implode( PHP_EOL, (array) $options ); 117 118 return self::_html_tag( 'select', $options, $properties ); 111 $options = implode( PHP_EOL, (array) $options ); */ 112 113 if ( ! is_array( $properties ) ) $properties = array(); 114 115 $properties['id'] = $name; 116 $properties['style'] = $style; 117 118 return self::_html_select( 'select', $value, $options, $properties ); 119 119 } 120 120 … … 135 135 $attr['class'] = $class; 136 136 137 return self::_html_select( $name, $ options, $value, $attr );137 return self::_html_select( $name, $value, $options, $attr ); 138 138 } 139 139 … … 182 182 } 183 183 184 protected static function _html_select( $name, $options = array(), $value = null, $attr = array() ) { 185 foreach ( (array) $options as $opt_value => $opt_label ) { 184 /** 185 * Convenience method for generating select boxes 186 */ 187 protected static function _html_select( $name, $value = null, $opts = array(), $attr = array() ) { 188 foreach ( (array) $opts as $opt_value => $opt_label ) { 186 189 $opt_tags[] = self::_html_tag( 'option', $opt_label, array( 187 190 'value' => $opt_value, -
kickpress/trunk/kickpress.php
r571417 r586927 4 4 Plugin URI: http://kickpress.org/ 5 5 Description: Allows for apps, themes, and APIs to be built using WordPress as a php framework 6 Version: 0.1. 76 Version: 0.1.8 7 7 Author: David S. Tufts 8 8 Author URI: http://kickpress.org -
kickpress/trunk/readme.txt
r543578 r586927 3 3 Donate link: http://kickpress.org/ 4 4 Tags: api, shortcodes, widgets, custom post types, php framework 5 Requires at least: 3. 3.26 Tested up to: 3. 3.27 Stable tag: 0.1. 75 Requires at least: 3.2 6 Tested up to: 3.4.1 7 Stable tag: 0.1.8 8 8 9 9 KickPress turns your WordPress install into an API … … 11 11 == Description == 12 12 13 This version is a beta pre-release, do not expect it to work yet.13 This version is a beta pre-release, all functions and variables are subject to change without notice. Please report any issues to help make this a better product. 14 14 15 This plugin addresses many features that WordPress does not have out-of-the-box but that are interrelated in some way 16 and should be included in one plugin as these features need to play well together. Here is a list of some 17 features: 15 This plugin addresses many features that WordPress does not have out-of-the-box but that are interrelated in some way and should be included in one plugin as these features need to play well together. Here is a list of some features: 18 16 19 1. Allows admins to create custom post types 20 2. Turns your WordPress install into an public API 21 3. comes with advanced filtering and searches 22 4. Allows for view switching: e.g. For Events, "Day View", "Week View", "Month View", "List View" 17 **For Administrators** 23 18 24 A few notes about the sections above: 19 1. Allows for point-and-click post type management 20 2. Adds user roles and capabilities control 21 3. Adds content publication workflow 25 22 26 * "Contributors" is a comma separated list of wp.org/wp-plugins.org usernames 27 * "Tags" is a comma separated list of tags that apply to the plugin 28 * "Requires at least" is the lowest version that the plugin will work on 29 * "Tested up to" is the highest version that you've *successfully used to test the plugin*. Note that it might work on 30 higher versions... this is just the highest one you've verified. 31 * Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for 32 stable. 23 **For Designers** 33 24 34 Note that the `readme.txt` of the stable tag is the one that is considered the defining one for the plugin, so 35 if the `/trunk/readme.txt` file says that the stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that'll be used 36 for displaying information about the plugin. In this situation, the only thing considered from the trunk `readme.txt` 37 is the stable tag pointer. Thus, if you develop in trunk, you can update the trunk `readme.txt` to reflect changes in 38 your in-development version, without having that information incorrectly disclosed about the current stable version 39 that lacks those changes -- as long as the trunk's `readme.txt` points to the correct stable tag. 25 1. Has an expanded multi-view template architecture, e.g. For Events, "Day View", "Week View", "Month View", "List View" 26 2. Adds robust navigation, pagination, and taxonomy widgets 27 3. Adds advanced filtering and sorting 40 28 41 If no stable tag is provided, it is assumed that trunk is stable, but you should specify "trunk" if that's where 42 you put the stable version, in order to eliminate any doubt. 29 **For Developers** 30 31 1. Uses session-based data storage 32 2. Has object relationships (a la group-members, user-favorites, etc) 33 3. Turns your WordPress install into an public API 34 35 * Uses a pseudo-ReSTful API to WordPress 36 * OpenID-style authentication 37 * Object-oriented resource controllers (post type modules) 38 * Post meta-types: people, items, locations, events 43 39 44 40 == Installation == 45 41 46 This section describes how to install the plugin and get it working.47 48 e.g.49 50 42 1. Upload the `kickpress` folder to the `/wp-content/plugins/` directory 51 43 2. Activate the plugin through the 'Plugins' menu in WordPress 52 3. Place `<?php do_action('plugin_name_hook'); ?>` in your templates53 54 == Frequently Asked Questions ==55 56 = A question that someone might have =57 58 An answer to that question.59 44 60 45 == Screenshots == 61 46 62 1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from 63 the directory of the stable readme.txt, so in this case, `/tags/4.3/screenshot-1.png` (or jpg, jpeg, gif) 64 2. This is the second screen shot 47 1. Adding new Post Types through the WordPress admin interface. 65 48 66 49 == Changelog == 67 50 51 = 0.1.8 = 52 * Added entensible form elements 53 * Added activating/deactivating of modules 54 * Added admin interface for managin custom taxonomies 55 * Expanded capabilities of URL filtering 56 = 0.1.7 = 57 * Added front end image uploads for post thumbnails 58 * Fixed some bugs 59 = 0.1.6 = 60 * Fixed issue with permissions 61 * Added the wysiwyg editor as a form element with calls the internal WordPress wp_editor 62 = 0.1.5 = 63 * Added JSON API responses for remote api calls 64 * Added Roles and Capabilities 65 * Added Workfklows 66 * General code cleanup 67 = 0.1.4 = 68 * Fixed issues with Adding new custom post types and a fatal error 69 * General code cleanup 70 = 0.1.3 = 71 * Cleaned up API authentication 72 * General code cleanup 73 = 0.1.2 = 74 * Added API authentication for remote access through the KickPress API by means of a token, signature, and timestamp 75 * General code cleanup 76 * Switched directory name back from 'components' to 'modules' for the directory that holds files that extend the API 77 = 0.1.1 = 78 * Fixed issue with errors when no custom post types exist 79 * Fixed issue with permalinks not working with newly registered post types 80 * Added rule to only allow users with permissions to edit options to create custom post types 68 81 = 0.1 = 69 82 * First upload to WordPress Plugin SVN. 70 71 == Upgrade Notice ==72 73 = 0.1 =74 This is the first version of this plugin.75 76 == Arbitrary section ==77 78 This plugin addresses many features that WordPress does not have out-of-the-box but that are interrelated in some way79 and should be included in one plugin as these features need to play well together. Here is a complete list of these80 features:81 82 == A brief Markdown Example ==83 84 Ordered list:85 86 1. Some feature87 2. Another feature88 3. Something else about the plugin89 90 Unordered list:91 92 * something93 * something else94 * third thing95 96 Here's a link to [WordPress](http://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax].97 Titles are optional, naturally.98 99 [markdown syntax]: http://daringfireball.net/projects/markdown/syntax100 "Markdown is what the parser uses to process much of the readme file"101 102 Markdown uses email style notation for blockquotes and I've been told:103 > Asterisks for *emphasis*. Double it up for **strong**.104 105 `<?php code(); // goes in backticks ?>`
Note: See TracChangeset
for help on using the changeset viewer.