Plugin Directory

Changeset 515453


Ignore:
Timestamp:
03/06/2012 05:00:35 PM (14 years ago)
Author:
Albert Bertilsson
Message:

Collective commit for various changes.

Location:
database-peek/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • database-peek/trunk/database-peek.php

    r515448 r515453  
    100100           
    101101            if (is_multisite()) {
    102                 if (!$this->is_wp_ms_table($table)) {
     102                if ($this->is_wp_ms_table($table)) {
    103103                    if (preg_match('#' . $wpdb->base_prefix . '(\d*)_.*#', $table, $matches))
    104104                        return intval($matches[1]);
     
    118118           
    119119            $blogid = $this->get_table_blog_id($table);
    120            
    121             if ($blogid == -1) return '';
    122            
    123120            if (is_multisite()) {
    124121                return get_blog_option($blogid, 'blogname');
  • database-peek/trunk/integrate.php

    r513959 r515453  
    55       
    66        function integrate() {
    7             add_action( 'add_meta_boxes', array($this,'create_metaboxes') );
     7            if (!ABDatabasePeekSettings::option_integrate()) return;
     8       
    89            add_action( 'post_row_actions', array($this,'add_post_row_action'), 10, 2);
    910            add_filter( 'page_row_actions', array($this,'add_post_row_action'), 10, 2);
     
    1213            add_filter( 'tag_row_actions', array($this,'add_tag_row_action'), 10, 2);
    1314            add_filter( 'user_row_actions', array($this,'add_user_row_action'), 10, 2);
     15            add_filter( 'get_sample_permalink_html', array($this, 'link_to_examine'));
    1416        }
    15        
    16         function create_metaboxes() {
    17        
    18             if (!ABDatabasePeekSettings::option_integrate()) return;
    19        
    20             add_meta_box(
    21                 'ab_database_peek_post_meta_box',
    22                 __( 'Database'),
    23                 array($this,'post_custom_box'),
    24                 'post',
    25                 'side',
    26                 'low'
    27             );
    28        
    29             add_meta_box(
    30                 'ab_database_peek_page_meta_box',
    31                 __( 'Database'),
    32                 array($this,'post_custom_box'),
    33                 'page',
    34                 'side',
    35                 'low'
    36             );
    37         }
    38        
    39        
    40         function post_custom_box($post) {
     17
     18        function link_to_examine( $content ) {
     19            global $post;
    4120            global $wpdb;
    42        
     21           
     22            $link = "";
     23
    4324            $examine = _('Examine');
    4425            $url = ABDatabasePeek::show_table_link($wpdb->posts, $post->ID);           
    45             echo "<a href=\"$url\">$examine</a>";           
    46         }       
     26            $link = "<span id=\"examine-post-btn\"><a href=\"$url\" class=\"button\">$examine</a></span>";
    4727
    48        
     28            return $content . $link;
     29        }
     30
    4931        function add_post_row_action($actions, $post){
    5032            global $wpdb;
  • database-peek/trunk/settings.php

    r514852 r515453  
    7575                        <td>
    7676                            <input type="checkbox" id="ABDatabasePeek-integrate" name="ABDatabasePeek-integrate" value="1" <?php if ($this->option_integrate()) echo 'checked'; ?> />
    77                             <span class="description">Display a link on edit page for pages and posts.</span>
     77                            <span class="description">Display "Examine" links in admin UI.</span>
    7878                        </td>
    7979                    </tr>
Note: See TracChangeset for help on using the changeset viewer.