Plugin Directory

Changeset 2422356


Ignore:
Timestamp:
11/20/2020 01:34:40 PM (5 years ago)
Author:
wpformation
Message:
  • fix css notes
Location:
wpdash-notes
Files:
49 added
3 edited

Legend:

Unmodified
Added
Removed
  • wpdash-notes/trunk/classes/plugin.php

    r2422139 r2422356  
    2020        add_action( 'wp_ajax_postit_add', array( __CLASS__, 'postit_add' ) );
    2121        add_action( 'template_redirect', array( __CLASS__, 'template_redirect' ) );
    22     }
     22        add_action( 'admin_footer', array( __CLASS__, 'admin_footer' ) );
     23    }
     24
     25    public static function admin_footer() {
     26        global $current_user;
     27        $posts = get_posts( array( 'post_type' => 'wpf_post_it' ) );
     28
     29        if ( ! empty( $posts ) && is_array( $posts ) ) :
     30            foreach ( $posts as $key => $post ) :
     31                $color           = get_post_meta( $post->ID, 'color', true );
     32                $color_text      = get_post_meta( $post->ID, 'color_text', true );
     33                $myuser          = get_post_meta( $post->ID, 'myuser', true );
     34                $all_users       = get_post_meta( $post->ID, 'all_users', true );
     35                $dsn_target      = get_post_meta( $post->ID, 'dsn_target', true );
     36                $dsn_target_user = get_post_meta( $post->ID, 'dsn_target_user', true );
     37
     38                if ( ( is_array( $dsn_target ) && in_array( $current_user->roles[0], $dsn_target ) ) ||
     39                     ( is_array( $dsn_target_user ) && in_array( get_current_user_id(), $dsn_target_user ) ) ||
     40                     $all_users === 'on' || ( $myuser === 'on' && get_current_user_id() == $post->post_author ) || ( get_current_user_id() == $post->post_author ) ) :
     41
     42                    echo '<style>#wpf-post-it-' . $post->ID . ' { background-color: ' . $color . ';color: ' . $color_text . ' }</style>';
     43                endif;
     44            endforeach;
     45            echo '<style>[id^=wpf-post-it-] .postbox-header {border-bottom: 0;}[id^=wpf-post-it-] .inside {padding-bottom: 0 !important;}[id^=wpf-post-it-] ul { list-style-type: disc;padding-left:26px }</style>';
     46        endif;
     47    }
    2348
    2449    public static function template_redirect() {
     
    178203        if ( ! empty( $posts ) && is_array( $posts ) ) :
    179204            foreach ( $posts as $key => $post ) :
    180                 $color           = get_post_meta( $post->ID, 'color', true );
    181                 $color_text      = get_post_meta( $post->ID, 'color_text', true );
    182205                $myuser          = get_post_meta( $post->ID, 'myuser', true );
    183206                $all_users       = get_post_meta( $post->ID, 'all_users', true );
     
    220243                        'dashboard_sticky_notes_post_content'
    221244                    ), 'dashboard', 'normal', 'high', $post );
    222                     echo '<style>#wpf-post-it-' . $post->ID . ' { background-color: ' . $color . ';color: ' . $color_text . ' }</style>';
    223245                endif;
    224246            endforeach;
    225             echo '<style>[id^=wpf-post-it-] .postbox-header {border-bottom: 0;}[id^=wpf-post-it-] .inside {padding-bottom: 0 !important;}[id^=wpf-post-it-] ul { list-style-type: disc;padding-left:26px }</style>';
    226247        endif;
    227248    }
  • wpdash-notes/trunk/readme.txt

    r2422228 r2422356  
    44Requires at least: 4.2
    55Tested up to: 5.5
    6 Stable tag: 1.0
     6Stable tag: 1.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7272== Changelog ==
    7373
     74= 1.0.1 =
     75* Fix css for notes in dashboard
     76
    7477= 1.0 =
    7578* Initial version.
  • wpdash-notes/trunk/wpdash-notes.php

    r2422139 r2422356  
    33Plugin Name: WPDash Notes
    44Description: WPDash Notes est un plugin qui vous permet de créer des notes sur votre tableau de bord WordPress et sur ceux des autres utilisateurs.
    5 Version: 1.0
     5Version: 1.0.1
    66Author: WPFormation, NicolasKulka, WPServeur
    77Author URI: https://wpformation.com/
     
    1818
    1919// Plugin constants
    20 define( 'WPDASH_NOTES_VERSION', '1.0' );
     20define( 'WPDASH_NOTES_VERSION', '1.0.1' );
    2121define( 'WPDASH_NOTES_FOLDER', 'wpdash-notes' );
    2222define( 'WPDASH_NOTES_BASENAME', plugin_basename( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.