Changeset 794422
- Timestamp:
- 10/27/2013 02:00:36 PM (12 years ago)
- Location:
- wordpress-gps/trunk
- Files:
-
- 8 edited
-
README.markdown (modified) (4 diffs)
-
gb_gps.php (modified) (1 diff)
-
include/api.php (modified) (2 diffs)
-
include/gb_gps.php (modified) (4 diffs)
-
include/gb_gps_pointer.php (modified) (5 diffs)
-
include/gb_gps_scenario.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
scenarios.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-gps/trunk/README.markdown
r563449 r794422 27 27 $pointer_config = array( 28 28 'selector' => '#menu-posts', 29 'post_type' => 'post', 29 30 'content' => '<h3>title</h3><p>content</p>', 30 31 'position' => array( … … 41 42 (string) The DOM selector of the element on which the pointer will be attached. 42 43 Default: '' 44 45 **post_type** 46 (string) The post type slug differenciating some screens on which the pointer will be attached. For example, 'edit.php' hook could be on 'post' or 'page' post types. 47 Default: '' (every post types) 43 48 44 49 **content** … … 108 113 $pointer_config = array( 109 114 'selector' => '#menu-posts', 115 'post_type' => 'post', 110 116 'content' => '<h3>titre</h3><p>contenu</p>', 111 117 'position' => array( … … 122 128 (string) Le sélecteur DOM de l'élément sur lequel va être attaché le pointer. 123 129 Par défaut : '' 130 131 **post_type** 132 (string) Le slug du post type différenciant plusieurs écrans. Par exemple, le hook 'edit.php' peut être sur les post types 'post' ou 'page'. 133 Par défaut : '' (tous les pos types) 124 134 125 135 **content** -
wordpress-gps/trunk/gb_gps.php
r580217 r794422 4 4 Plugin URI: http://www.globalis-ms.com 5 5 Description: This plugin Provide an admin screen to WordPress users in which they will choose one scenario to play. That scenario will help them through the WordPress administration thanks to WP-Pointers API 6 Version: 1.0.1 16 Version: 1.0.13 7 7 Author: Lionel POINTET, GLOBALIS media systems 8 8 Author URI: http://www.globalis-ms.com -
wordpress-gps/trunk/include/api.php
r563449 r794422 80 80 'content' => '', 81 81 'position' => '', 82 'post_type' => '', 82 83 ); 83 84 … … 93 94 'content' => $content, 94 95 'position' => $position, 96 'post_type' => $post_type, 95 97 )); 96 98 } -
wordpress-gps/trunk/include/gb_gps.php
r564572 r794422 87 87 */ 88 88 public function play_scenario() { 89 global $pagenow ;89 global $pagenow, $typenow; 90 90 91 91 // Retrieve the current scenario … … 95 95 return; 96 96 97 if(GBGPS_Scenario::STOP == $this->scenarios[$id]->process($pagenow )) {97 if(GBGPS_Scenario::STOP == $this->scenarios[$id]->process($pagenow, $typenow)) { 98 98 $this->set_active_scenario(); 99 99 } … … 127 127 public function admin_menu() { 128 128 $this->handlePost(); 129 add_menu_page( GB_GPS_ADMIN_MENU_PAGE_TITLE, GB_GPS_ADMIN_MENU_MENU_TITLE, ' edit_posts', self::MENU_SLUG, array(&$this, 'display_admin_menu') );129 add_menu_page( GB_GPS_ADMIN_MENU_PAGE_TITLE, GB_GPS_ADMIN_MENU_MENU_TITLE, 'read', self::MENU_SLUG, array(&$this, 'display_admin_menu') ); 130 130 } 131 131 … … 149 149 public function display_admin_menu() { 150 150 // Security check 151 if(!current_user_can(' edit_posts')) {151 if(!current_user_can('read')) { 152 152 wp_die(GB_GPS_MESSAGE_CAPABILITY_ERROR); 153 153 } -
wordpress-gps/trunk/include/gb_gps_pointer.php
r566940 r794422 5 5 protected $content; 6 6 protected $position; 7 protected $post_type; 7 8 8 9 /** … … 15 16 'content' => '', 16 17 'position' => '', 18 'post_type' => '', 17 19 ); 18 20 … … 34 36 'content' => $this->content, 35 37 'position' => $this->position, 38 'post_type' => $this->post_type, 36 39 ); 37 40 } … … 40 43 * Include the needed JavaScript to show the pointer(s) 41 44 */ 42 public static function process($pointers ) {45 public static function process($pointers, $post_type) { 43 46 $nonce = wp_create_nonce('gb_gps_ajax_nonce'); 44 47 45 48 $args = array(); 46 49 foreach($pointers as $pointer) { 47 $args[] = $pointer->args(); 50 if( empty( $pointer->post_type ) || $post_type == $pointer->post_type ) 51 $args[] = $pointer->args(); 48 52 } 53 54 if( empty( $args ) ) 55 return FALSE; 49 56 50 57 ?> … … 91 98 </script> 92 99 <?php 100 101 return TRUE; 93 102 } 94 103 } -
wordpress-gps/trunk/include/gb_gps_scenario.php
r566940 r794422 29 29 * Retrieve the current page hook and decide which pointer to show 30 30 */ 31 public function process($hook ) {31 public function process($hook, $post_type = NULL) { 32 32 if(empty($this->pointers[$hook])) { 33 33 $hook = 'all'; 34 34 } 35 35 36 $displayed = FALSE; 37 36 38 if(!empty($this->pointers[$hook])) { 37 GBGPS_Pointer::process($this->pointers[$hook]);39 $displayed = GBGPS_Pointer::process($this->pointers[$hook], $post_type); 38 40 } 39 41 40 return $ this->places[$hook] == $this->nb_pointers - 1 ? self::STOP : 0;42 return $displayed && $this->places[$hook] == $this->nb_pointers - 1 ? self::STOP : 0; 41 43 } 42 44 -
wordpress-gps/trunk/readme.txt
r580217 r794422 3 3 Tags: admin, help, tutorial, scenario, pointers, backend, plugin, training 4 4 Requires at least: 3.3.0 5 Tested up to: 3. 46 Stable tag: 1.0.1 15 Tested up to: 3.6 6 Stable tag: 1.0.13 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 46 46 47 47 == Changelog == 48 49 = 1.0.13 = 50 * Removed useless capability check for displaying admin menu / props colouro 51 * Allow a pointer to be post_type specific / props colouro 48 52 49 53 = 1.0.11 = -
wordpress-gps/trunk/scenarios.php
r580217 r794422 23 23 array( 24 24 'selector' => '.add-new-h2', 25 'post_type' => 'post', 25 26 'content' => '<h3>' . GB_GPS_ADD_FROM_LIST_POINTER_TITLE . '</h3><p>' . sprintf(GB_GPS_ADD_FROM_LIST_POINTER_CONTENT, __('post')) . '</p>', 26 27 'position' => array( … … 53 54 array( 54 55 'selector' => '#title', 56 'post_type' => 'post', 55 57 'content' => '<h3>' . GB_GPS_ADD_CAT_TO_POST_LIST_POINTER_TITLE . '</h3><p>' . GB_GPS_ADD_CAT_TO_POST_LIST_POINTER_CONTENT . '</p>', 56 58 'position' => array( … … 64 66 array( 65 67 'selector' => '#categorydiv', 68 'post_type' => 'post', 66 69 'content' => '<h3>' . GB_GPS_ADD_CAT_TO_POST_CATEGORY_POINTER_TITLE . '</h3><p>' . GB_GPS_ADD_CAT_TO_POST_CATEGORY_POINTER_CONTENT .'</p>', 67 70 'position' => array(
Note: See TracChangeset
for help on using the changeset viewer.