Plugin Directory

Changeset 1666247


Ignore:
Timestamp:
05/29/2017 06:32:04 AM (9 years ago)
Author:
MikeGillihan
Message:

update 2.0

Location:
bb-connect-for-give-donations
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • bb-connect-for-give-donations/trunk/bb-connect-give.php

    r1599407 r1666247  
    44 * Plugin URI: https://wordpress.org/plugins/bb-connect-for-give-donations/
    55 * Description: Easily integrate Give Donations with Beaver Builder.
    6  * Version: 1.1
     6 * Version: 2.0
    77 * Author: PurposeWP
    88 * Author URI: https://purposewp.com
     
    1414 */
    1515
    16 /**
    17  * WordPress resources for developers
    18  *
    19  * Codex:            https://codex.wordpress.org/
    20  * Plugin Handbook:  https://developer.wordpress.org/plugins/
    21  * Coding Standards: http://make.wordpress.org/core/handbook/coding-standards/
    22  * Contribute:       https://make.wordpress.org/
    23  */
    24 
    2516// Exit if accessed directly.
    2617if ( ! defined( 'ABSPATH' ) ) {
     
    2920
    3021if ( ! class_exists( 'BBC_GiveWP' ) ) :
    31     /**
    32      * Main BBC_GiveWP Class.
    33      *
    34      * @since 1.0
    35      */
    3622    final class BBC_GiveWP {
    3723        /**
     
    5844
    5945        /**
    60          * Main BBC_GiveWP Instance.
    61          *
    62          * Insures that only one instance of BBC_GiveWP exists in memory at any one
    63          * time. Also prevents needing to define globals all over the place.
     46         * Main BBC_GiveWP Instance
    6447         *
    6548         * @since     1.0
    6649         * @static
    67          * @staticvar array $instance
    68          * @uses      BBC_GiveWP::define_constants() Setup the constants needed.
    69          * @uses      BBC_GiveWP::load_modules() Include the required files.
    70          * @uses      BBC_GiveWP::load_textdomain() load the language files.
    7150         * @see       BBC_GiveWP()
    7251         * @return object|BBC_GiveWP The one true BBC_GiveWP
    7352         */
    74         public function instance() {
     53        public static function instance() {
    7554
    7655            if ( ! isset( self::$instance ) && ! ( self::$instance instanceof BBC_GiveWP ) ) {
     
    9170         * Throw error on object clone.
    9271         *
    93          * The whole idea of the singleton design pattern is that there is a single
    94          * object therefore, we don't want the object to be cloned.
    95          *
    9672         * @since  1.0
    9773         * @access protected
     
    141117
    142118        /**
    143          * Initiate the plugins functions
     119         * Initiate the plugin
    144120         */
    145121        public function init() {
    146122            add_action( 'plugins_loaded', array( $this, 'plugins_check' ) );
    147123            add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
    148             add_action( 'init', array( $this, 'load_modules' ) );
     124            add_action( 'init', array( $this, 'includes' ) );
    149125        }
    150126
     
    181157         * @return void
    182158         */
    183         public function load_modules() {
    184             // Modules
     159        public function includes() {
    185160            if ( class_exists( 'FLBuilder' ) ) {
     161                // Custom Fields
     162                include_once BBC_GIVE_DIR . 'fields/bbc-toggle/bbc-toggle.php';
     163
     164                // Modules
    186165                include_once BBC_GIVE_DIR . 'modules/bbc-give-forms/bbc-give-forms.php';
    187166                include_once BBC_GIVE_DIR . 'modules/bbc-give-goal/bbc-give-goal.php';
     167                include_once BBC_GIVE_DIR . 'modules/bbc-give-account/bbc-give-account.php';
    188168            }
    189169        }
     
    254234 * The main function that returns BBC_GiveWP
    255235 *
    256  * The main function responsible for returning the one true BBC_GiveWP instance to functions everywhere. Use this
    257  * function like you would a global variable, except without needing to declare the global.
    258  *
    259  * Example: <?php $give = BBC_Give(); ?>
    260  *
    261  * @credit Pippin Williamson - This pattern is pretty much a direct copy of Easy Digital Downloads's main wrapper.
    262236 * @since  1.0
    263  * @return object|BBC_GiveWP one true BBC_GiveWP instance.
     237 * @return object|BBC_GiveWP The main BBC_GiveWP instance.
    264238 */
    265239function BBC_Give() {
  • bb-connect-for-give-donations/trunk/modules/bbc-give-forms/bbc-give-forms.php

    r1596011 r1666247  
    55 *
    66 * @class BBC_Give_Forms
     7 * @since 1.0
    78 */
    89class BBC_Give_Forms extends FLBuilderModule {
     
    3132     */
    3233    public static function list_forms() {
    33         $list = array( '' => __( 'None', 'bbc-give' ) );
     34        $list = array( '' => __( 'Select a Form', 'bbc-give' ) );
    3435
    3536        $forms = get_posts( array(
     
    6263                        'options' => BBC_Give_Forms::list_forms()
    6364                    ),
     65                )
     66            ),
     67            'form_settings' => array( // Section
     68                'title'  => '', // Section Title
     69                'fields' => array( // Section Fields
    6470                    'show_title'        => array(
    65                         'type'    => 'select',
    66                         'label'   => __( 'Show Title', 'bbc-give' ),
    67                         'default' => 'true',
    68                         'options' => array(
    69                             'true'  => 'Show',
    70                             'false' => 'Hide'
    71                         )
     71                        'type'        => 'bbc-toggle',
     72                        'label'       => __( 'Show Title', 'bbc-give' ),
     73                        'default'     => 'true',
     74                        'options'     => array(
     75                            'true'  => __( 'Show', 'bbc-give' ),
     76                            'false' => __( 'Hide', 'bbc-give' ),
     77                        ),
     78                        'help'    => __( 'Show/hide the form title. Default is “show”', 'bbc-give' )
    7279                    ),
    7380                    'show_goal'         => array(
    74                         'type'    => 'select',
    75                         'label'   => __( 'Show Goal', 'bbc-give' ),
    76                         'default' => 'true',
    77                         'options' => array(
    78                             'true'  => 'Show',
    79                             'false' => 'Hide'
    80                         )
     81                        'type'        => 'bbc-toggle',
     82                        'label'       => __( 'Show Goal', 'bbc-give' ),
     83                        'default'     => 'false',
     84                        'options'     => array(
     85                            'true'  => __( 'Show', 'bbc-give' ),
     86                            'false' => __( 'Hide', 'bbc-give' ),
     87                        ),
     88                        'help'    => __( 'Show/hide the form goal. Default is “hide”', 'bbc-give' )
    8189                    ),
    8290                    'show_content'      => array(
    8391                        'type'    => 'select',
    8492                        'label'   => __( 'Show Content', 'bbc-give' ),
    85                         'default' => '',
     93                        'default' => 'default',
    8694                        'options' => array(
    87                             ''      => ' - ',
    88                             'none'  => 'No Content',
    89                             'above' => 'Display content ABOVE the fields.',
    90                             'below' => 'Display content BELOW the fields.'
    91                         )
     95                            'default' => 'Use default setting',
     96                            'none'    => 'No Content',
     97                            'above'   => 'Display content ABOVE the fields.',
     98                            'below'   => 'Display content BELOW the fields.'
     99                        ),
     100                        'help'    => __( 'Show/hide the form content. You can choose from None, Below, or Above. This will override the default settings of the form. The Default value is whatever you chose when you created the form.', 'bbc-give' )
    92101                    ),
    93102                    'display_style'     => array(
    94103                        'type'    => 'select',
    95104                        'label'   => __( 'Display Style', 'bbc-give' ),
    96                         'default' => '',
     105                        'default' => 'default',
    97106                        'options' => array(
    98                             ''       => ' - ',
    99                             'onpage' => 'Show on page.',
    100                             'reveal' => 'Reveal on click.',
    101                             'modal'  => 'Popup on click',
    102                             'button' => 'Button Only',
    103                         )
     107                            'default' => 'Use default setting',
     108                            'onpage'  => 'Show on page.',
     109                            'reveal'  => 'Reveal on click.',
     110                            'modal'   => 'Popup on click',
     111                            'button'  => 'Button Only',
     112                        ),
     113                        'help'    => __( 'Override the setting you set when you created the form. You can choose from “Show on Page”, “Reveal on Click”, or “Modal Window on Click”, or “Button only”.', 'bbc-give' )
    104114                    ),
    105115                    'float_labels'      => array(
    106116                        'type'    => 'select',
    107117                        'label'   => __( 'Floating Labels', 'bbc-give' ),
    108                         'default' => '',
     118                        'default' => 'default',
    109119                        'options' => array(
    110                             ''         => ' - ',
     120                            'default'  => 'Use default setting',
    111121                            'enabled'  => 'Enabled',
    112122                            'disabled' => 'Disabled',
    113                         )
     123                        ),
     124                        'help'    => __( 'Enable/disable Floating labels. The default is whatever you chose when you created the form. This setting overrides that default.', 'bbc-give' )
    114125                    ),
    115126                )
  • bb-connect-for-give-donations/trunk/modules/bbc-give-forms/includes/frontend.php

    r1587907 r1666247  
    1 <div class="fl-example-text">
     1<div class="bbc-give-form">
    22    <?php
    33    if ( $settings->select_form_field ) {
    4         $show_content = isset( $settings->show_content )
     4        $show_content = 'default' !== $settings->show_content
    55            ? $settings->show_content
    66            : get_post_meta( $settings->select_form_field, '_give_content_option', true );
    77
    8         $display_style = isset( $settings->display_style )
     8        $display_style = 'default' !== $settings->display_style
    99            ? $settings->display_style
    1010            : get_post_meta( $settings->select_form_field, '_give_payment_display', true );
    1111
    12         $float_labels = isset( $settings->float_labels )
     12        $float_labels = 'default' !== $settings->float_labels
    1313            ? $settings->float_labels
    1414            : get_post_meta( $settings->select_form_field, '_give_form_floating_labels', true );
     
    1919            $settings->show_goal,
    2020            $show_content,
    21             $display_style,
    22             $float_labels
     21            $display_style,
     22            $float_labels
    2323        );
    2424
  • bb-connect-for-give-donations/trunk/modules/bbc-give-goal/bbc-give-goal.php

    r1587907 r1666247  
    55 *
    66 * @class BBC_Give_Goal
     7 * @since 1.0
    78 */
    89class BBC_Give_Goal extends FLBuilderModule {
     
    1516    public function __construct() {
    1617        parent::__construct( array(
    17             'name'          => __( 'Donation Form Goal', 'bbc-give' ),
    18             'description'   => __( 'Add your Give Donation Form Goal to your page.', 'bbc-give' ),
    19             'category'      => __( 'Give Modules', 'bbc-give' ),
    20             'dir'           => BBC_GIVE_DIR . 'modules/bbc-give-goal/',
    21             'url'           => BBC_GIVE_DIR . 'modules/bbc-give-goal/',
    22             'editor_export' => true, // Defaults to true and can be omitted.
    23             'enabled'       => true, // Defaults to true and can be omitted.
     18            'name'        => __( 'Donation Form Goal', 'bbc-give' ),
     19            'description' => __( 'Add your Give Donation Form Goal to your page.', 'bbc-give' ),
     20            'category'    => __( 'Give Modules', 'bbc-give' ),
     21            'dir'         => BBC_GIVE_DIR . 'modules/bbc-give-goal/',
     22            'url'         => BBC_GIVE_DIR . 'modules/bbc-give-goal/',
    2423        ) );
    2524    }
     
    3130     */
    3231    public static function list_forms() {
    33         $list = array( '' => __( 'None', 'bbc-give' ) );
     32        $list = array( '' => __( 'Select a Form', 'bbc-give' ) );
    3433
    3534        $forms = get_posts( array(
     
    6261                        'options' => BBC_Give_Goal::list_forms()
    6362                    ),
    64                     'show_text'        => array(
    65                         'type'    => 'select',
    66                         'label'   => __( 'Show Text', 'bbc-give' ),
    67                         'default' => 'true',
    68                         'options' => array(
    69                             'true'  => 'Show',
    70                             'false' => 'Hide'
    71                         )
     63                )
     64            ),
     65            'form_settings' => array( // Section
     66                'title'  => '', // Section Title
     67                'fields' => array( // Section Fields
     68                    'show_text'         => array(
     69                        'type'        => 'bbc-toggle',
     70                        'label'       => __( 'Show Text', 'bbc-give' ),
     71                        'default'     => 'true',
     72                        'options'     => array(
     73                            'true'  => __( 'Show', 'bbc-give' ),
     74                            'false' => __( 'Hide', 'bbc-give' ),
     75                        ),
     76                        'help'    => __( 'Displays the goal text. Default is “Show”', 'bbc-give' )
    7277                    ),
    7378                    'show_bar'         => array(
    74                         'type'    => 'select',
    75                         'label'   => __( 'Show Progress Bar', 'bbc-give' ),
    76                         'default' => 'true',
    77                         'options' => array(
    78                             'true'  => 'Show',
    79                             'false' => 'Hide'
    80                         )
     79                        'type'        => 'bbc-toggle',
     80                        'label'       => __( 'Show Progress Bar', 'bbc-give' ),
     81                        'default'     => 'true',
     82                        'options'     => array(
     83                            'true'  => __( 'Show', 'bbc-give' ),
     84                            'false' => __( 'Hide', 'bbc-give' ),
     85                        ),
     86                        'help'    => __( 'Shows the progress bar. Default is “Show”', 'bbc-give' )
    8187                    ),
    8288                )
    83             )
     89            ),
    8490        )
    8591    )
  • bb-connect-for-give-donations/trunk/modules/bbc-give-goal/includes/frontend.php

    r1587907 r1666247  
    1 <div class="fl-example-text">
     1<div class="bbc-give-goal">
    22    <?php
    33    if ( $settings->select_form_field ) {
  • bb-connect-for-give-donations/trunk/readme.txt

    r1596027 r1666247  
    33Tags: beaver builder, give, donations, nonprofits, fundraising
    44Requires at least: 4.4
    5 Tested up to: 4.7.2
    6 Stable tag: 1.1
     5Tested up to: 4.7.5
     6Stable tag: 2.0
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2424== Screenshots ==
    2525
    26 1. Give Modules
    27 2. Donation Form Module
    28 3. Donation Form Goal Module
     261. Donation Form and Goal modules
     272. Donation Form settings
     283. Donation Form Goal settings
     294. Account Details settings
     305. Account Details module
    2931
    3032== Installation ==
     
    5456== Changelog ==
    5557
    56 = [1.0] - 2017-01-27 =
    57 * Initial release
     58= [2.0] - 2017-05-28 =
     59* New: Give Account Details module
     60* Enhancement: Added help tooltips
     61* Enhancement: Added Show/Hide toggles
     62* Fix: Non-static method called statically
    5863
    5964= [1.1] - 2017-02-14 =
    6065* Enhancement: Added new Button Only display style
     66
     67= [1.0] - 2017-01-27 =
     68* Initial release
Note: See TracChangeset for help on using the changeset viewer.