Plugin Directory

Changeset 1895629


Ignore:
Timestamp:
06/20/2018 07:43:56 AM (8 years ago)
Author:
emudde
Message:

Replace original Impulse method with new link method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • impulse-widget/trunk/impulse.php

    r1857097 r1895629  
    33    Plugin Name: Impulse Widget
    44    Description: This plugin implements the Impulse functionality. Check the Impulse Settings for instructions.
    5     Version: 1.0.16
     5    Version: 1.0.18
    66    Author: Enock Mudde, Annemiek Pronk
    77    License: GPL2
     
    2020            function impulse_load_textdomain() {
    2121              $loaded = load_plugin_textdomain( 'impulse', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
     22            }
     23
     24            if(!function_exists('deactivate_impulse')){
     25                register_deactivation_hook( __FILE__, 'impulse_deactivate' );
     26                function impulse_deactivate(){
     27                    error_log('Impulse has been deactivated');
     28                }
    2229            }
    2330
     
    509516                        if(isset($atts['button']) && $atts['button'] != ''){
    510517                            $buttonText = esc_html( $atts['button'] );
    511                             $result = "<button class='impulseButton' clientId='$clientId'>$buttonText</button>";
     518                            $result = "<a href='https://impulse.click'><button>$buttonText</button></a>";
    512519                        }
    513520
     
    515522                            $linkTitle = esc_html( $atts['title'] );
    516523
    517                             $result = "<a class='impulseButton' clientId='$clientId'>$linkTitle</a>";
     524                            $result = "<a href='https://impulse.click'>$linkTitle</a>";
    518525                        }
    519526
     
    530537                                    $width = '100%';
    531538
    532                                     if($selectedWidth == 'small') $width = '90px';
     539                                    if($selectedWidth == 'small') $width = '150px';
    533540                                    if($selectedWidth == 'medium') $width = '300px';
    534541
    535542                                    if($align== 'left' || $align == 'right'){
    536                                         $result = "<img style='margin: 7px; float: $align;' class='impulseButton' clientId='" . esc_attr( $clientId ) . "' src='" . esc_attr( $imageUrl ) ."' width='$width' />";
     543                                        $result = "<a href='https://impulse.click'><img style='margin: 7px; float: $align;' class='impulseButton' src='" . esc_attr( $imageUrl ) ."' width='$width' /></a>";
    537544                                    }
    538545                                    else{
    539546                                        #none, center?!
    540                                         $result = "<div style='text-align: center;'><img class='impulseButton' clientId='" . esc_attr( $clientId ) . "' src='" . esc_attr( $imageUrl ) ."' width='$width' /></div>";
     547                                        $result = "<div style='text-align: center;'><a href='https://impulse.click'><img src='" . esc_attr( $imageUrl ) ."' width='$width' /></a></div>";
    541548                                    }
    542549                                }
    543550                                else{
    544551                                    if($align== 'left' || $align == 'right'){
    545                                         $result = "<img style='margin: 7px; float: $align;' class='impulseButton' clientId='" . esc_attr( $clientId ) . "' src='" . esc_attr( $imageUrl ) ."' width='90' height='90' />";
     552                                        $result = "<a href='https://impulse.click'><img style='margin: 7px; float: $align;' src='" . esc_attr( $imageUrl ) ."' width='90' height='90' /></a>";
    546553                                    }
    547554                                    else{
    548555                                        #none, center?!
    549                                         $result = "<div style='text-align: center'><img class='impulseButton' clientId='" . esc_attr( $clientId ) . "' src='" . esc_attr( $imageUrl ) ."' style='align:$align;' width='90' height='90' /></div>";
     556                                        $result = "<div style='text-align: center'><a href='https://impulse.click'><img src='" . esc_attr( $imageUrl ) ."' style='align:$align;' width='90' height='90' /></a></div>";
    550557                                    }
    551558                                }
     
    10591066                                        <label for="contactChoice2"><?php esc_html_e( 'Image Size (only for custom triggers): ', 'impulse' ); ?></label><br>
    10601067                                        <select id="trigger-image-size">
    1061                                             <option value="small"><?php esc_html_e( 'Small (width: 90px)', 'impulse' ); ?></option>
     1068                                            <option value="small"><?php esc_html_e( 'Small (width: 150px)', 'impulse' ); ?></option>
    10621069                                            <option value="medium"><?php esc_html_e( 'Medium (width: 300px)', 'impulse' ); ?></option>
    10631070                                            <option selected value="normal"><?php esc_html_e( 'Original Size (default)', 'impulse' ); ?></option>
Note: See TracChangeset for help on using the changeset viewer.