Plugin Directory

Changeset 1110142


Ignore:
Timestamp:
03/11/2015 08:11:35 AM (11 years ago)
Author:
Asitha
Message:

Tagging version 1.1

Location:
classy
Files:
22 edited
2 copied

Legend:

Unmodified
Added
Removed
  • classy/tags/1.1/admin/class-classy-admin.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    2323     * The ID of this plugin.
    2424     *
    25      * @since    1.0.0
     25     * @since    1.1
    2626     * @access   private
    2727     * @var      string    $classy    The ID of this plugin.
     
    3232     * The version of this plugin.
    3333     *
    34      * @since    1.0.0
     34     * @since    1.1
    3535     * @access   private
    3636     * @var      string    $version    The current version of this plugin.
     
    4141     * Initialize the class and set its properties.
    4242     *
    43      * @since    1.0.0
     43     * @since    1.1
    4444     * @param      string    $classy       The name of this plugin.
    4545     * @param      string    $version    The version of this plugin.
    4646     */
     47
    4748    public function __construct( $classy, $version ) {
    48 
    4949        $this->classy = $classy;
    5050        $this->version = $version;
    51 
    5251    }
    5352
     
    5554     * Register the stylesheets for the Dashboard.
    5655     *
    57      * @since    1.0.0
     56     * @since    1.1
    5857     */
    5958    public function enqueue_styles() {
     
    6463     * Register the JavaScript for the dashboard.
    6564     *
    66      * @since    1.0.0
     65     * @since    1.1
    6766     */
    6867    public function enqueue_scripts() {
     
    7271    public function admin_menus(){
    7372        if(isset($_POST['update'])){
    74             $token = $_POST['token'];
    75             $cid = $_POST['cid'];
    76             $url = 'https://www.classy.org/api1/account-info?token=' . $token . '&cid='. $cid;
    77             $ch = curl_init();
    78             curl_setopt($ch, CURLOPT_URL, $url);
    79             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    80             $output = curl_exec($ch);
    81             $output = json_decode($output);
    82             if($output->status_code == "SUCCESS"){
    83                 update_option('classy_token', $token);
    84                 update_option('classy_cid', $cid); 
    85                 update_option('classy_org_name', $output->name);
    86                 update_option('classy_url', $output->charity_url);
    87                 add_action( 'admin_notices', 'valid_api_notice' );
    88             } else {
    89                 update_option('classy_token', $token);
    90                 update_option('classy_cid', $cid);
    91                 update_option('classy_org_name', '');                   
    92                 update_option('classy_url', $output->charity_url);
    93                 add_action( 'admin_notices', 'invalid_api_notice');
    94             }
    95         }
     73            $account = new Classy_Account($_POST['token'], $_POST['cid']);
     74            $account->update() ? add_action( 'admin_notices', 'valid_api_notice' ) : add_action( 'admin_notices', 'invalid_api_notice');
     75        }   
    9676
    9777        add_menu_page( 'Classy', 'Classy', 'manage_options', plugin_dir_path( __FILE__ ) . 'partials/classy-admin-display.php', '', 'dashicons-groups');
     
    10989        }
    11090    }
    111 
    11291}
  • classy/tags/1.1/admin/partials/classy-admin-display.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
    1010 * @subpackage Classy/admin/partials
    1111 */
    12 global $error;
     12
     13$classy = new Classy_API();
     14$account = $classy->account_info();
     15$activities = $classy->account_activity();
    1316?>
    1417
     
    3033            </form>
    3134            <hr>
    32             <p>Organization: <?php echo get_option('classy_org_name') ? get_option('classy_org_name') : 'None'; ?></p>
     35            <?php if($account->status_code == "SUCCESS"): ?>
     36            <p>Organization: <?php echo $account->name; ?></p>
     37            <p>Total Raised: $<?php echo $account->total_raised; ?></p>
     38            <p>Total Events: <?php echo $account->total_active_events; ?></p>
     39            <p>Total Supporters: <?php echo $account->total_supporters; ?></p>
     40            <p>Total Teams: <?php echo $account->total_fund_teams; ?></p>
     41            <?php endif; ?>
     42            <?php  ?>
    3343        </div>
    3444    </div>
    3545</div>
     46<?php if($activities->status_code == "SUCCESS"): ?>
     47<h1><span class="dashicons dashicons-update"></span> Activity Stream</h1>
     48<div class="wrap">
     49    <div class="classy-form postbox">
     50        <div class="inside">
     51            <ul>
     52                <?php foreach ($activities->activity as $activity) {
     53                    echo '<li><a href="'. $activity->url .'" target="_blank">' . $activity->activity_string . '</a></li>';
     54                }
     55                ?>
     56            </ul>
     57        </div>
     58    </div>
     59</div>
     60<?php endif; ?>
  • classy/tags/1.1/classy.php

    r1107257 r1110142  
    55 *
    66 * @link              http://mediacause.org
    7  * @since             1.0.0
     7 * @since             1.1
    88 * @package           Classy
    99 *
     
    1212 * Plugin URI:        http://mediacause.org
    1313 * Description:       A tool used to integrate Classy's API into easily accessible shortcodes
    14  * Version:           1.0.0
     14 * Version:           1.1
    1515 * Author:            Media Cause
    1616 * Author URI:        http://mediacause.org
     
    6060 * not affect the page life cycle.
    6161 *
    62  * @since    1.0.0
     62 * @since    1.1
    6363 */
    6464function run_classy() {
  • classy/tags/1.1/includes/class-classy-activator.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    1616 * This class defines all code necessary to run during the plugin's activation.
    1717 *
    18  * @since      1.0.0
     18 * @since      1.1
    1919 * @package    Classy
    2020 * @subpackage Classy/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.0.0
     30     * @since    1.1
    3131     */
    3232    public static function activate() {
  • classy/tags/1.1/includes/class-classy-deactivator.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    1616 * This class defines all code necessary to run during the plugin's deactivation.
    1717 *
    18  * @since      1.0.0
     18 * @since      1.1
    1919 * @package    Classy
    2020 * @subpackage Classy/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.0.0
     30     * @since    1.1
    3131     */
    3232    public static function deactivate() {
  • classy/tags/1.1/includes/class-classy-i18n.php

    r1107257 r1110142  
    88 *
    99 * @link       http://mediacause.org
    10  * @since      1.0.0
     10 * @since      1.1
    1111 *
    1212 * @package    Classy
     
    2020 * so that it is ready for translation.
    2121 *
    22  * @since      1.0.0
     22 * @since      1.1
    2323 * @package    Classy
    2424 * @subpackage Classy/includes
     
    3030     * The domain specified for this plugin.
    3131     *
    32      * @since    1.0.0
     32     * @since    1.1
    3333     * @access   private
    3434     * @var      string    $domain    The domain identifier for this plugin.
     
    3939     * Load the plugin text domain for translation.
    4040     *
    41      * @since    1.0.0
     41     * @since    1.1
    4242     */
    4343    public function load_plugin_textdomain() {
     
    5454     * Set the domain equal to that of the specified domain.
    5555     *
    56      * @since    1.0.0
     56     * @since    1.1
    5757     * @param    string    $domain    The domain that represents the locale of this plugin.
    5858     */
  • classy/tags/1.1/includes/class-classy-loader.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    2727     * The array of actions registered with WordPress.
    2828     *
    29      * @since    1.0.0
     29     * @since    1.1
    3030     * @access   protected
    3131     * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
     
    3636     * The array of filters registered with WordPress.
    3737     *
    38      * @since    1.0.0
     38     * @since    1.1
    3939     * @access   protected
    4040     * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
     
    4545     * Initialize the collections used to maintain the actions and filters.
    4646     *
    47      * @since    1.0.0
     47     * @since    1.1
    4848     */
    4949    public function __construct() {
     
    5757     * Add a new action to the collection to be registered with WordPress.
    5858     *
    59      * @since    1.0.0
     59     * @since    1.1
    6060     * @param      string               $hook             The name of the WordPress action that is being registered.
    6161     * @param      object               $component        A reference to the instance of the object on which the action is defined.
     
    7171     * Add a new filter to the collection to be registered with WordPress.
    7272     *
    73      * @since    1.0.0
     73     * @since    1.1
    7474     * @param      string               $hook             The name of the WordPress filter that is being registered.
    7575     * @param      object               $component        A reference to the instance of the object on which the filter is defined.
     
    8686     * collection.
    8787     *
    88      * @since    1.0.0
     88     * @since    1.1
    8989     * @access   private
    9090     * @param      array                $hooks            The collection of hooks that is being registered (that is, actions or filters).
     
    113113     * Register the filters and actions with WordPress.
    114114     *
    115      * @since    1.0.0
     115     * @since    1.1
    116116     */
    117117    public function run() {
  • classy/tags/1.1/includes/class-classy.php

    r1107257 r1110142  
    88 *
    99 * @link       http://mediacause.org
    10  * @since      1.0.0
     10 * @since      1.1
    1111 *
    1212 * @package    Classy
     
    2323 * version of the plugin.
    2424 *
    25  * @since      1.0.0
     25 * @since      1.1
    2626 * @package    Classy
    2727 * @subpackage Classy/includes
     
    3434     * the plugin.
    3535     *
    36      * @since    1.0.0
     36     * @since    1.1
    3737     * @access   protected
    3838     * @var      Classy_Loader    $loader    Maintains and registers all hooks for the plugin.
     
    4343     * The unique identifier of this plugin.
    4444     *
    45      * @since    1.0.0
     45     * @since    1.1
    4646     * @access   protected
    4747     * @var      string    $classy    The string used to uniquely identify this plugin.
     
    5252     * The current version of the plugin.
    5353     *
    54      * @since    1.0.0
     54     * @since    1.1
    5555     * @access   protected
    5656     * @var      string    $version    The current version of the plugin.
     
    6565     * the public-facing side of the site.
    6666     *
    67      * @since    1.0.0
     67     * @since    1.1
    6868     */
    6969    public function __construct() {
    7070
    7171        $this->classy = 'classy';
    72         $this->version = '1.0.0';
     72        $this->version = '1.1';
    7373
    7474        $this->load_dependencies();
     
    9292     * with WordPress.
    9393     *
    94      * @since    1.0.0
     94     * @since    1.1
    9595     * @access   private
    9696     */
     
    103103        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-classy-loader.php';
    104104
     105        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-classy-api.php';
     106
     107
    105108        /**
    106109         * The class responsible for defining internationalization functionality
     
    130133     * with WordPress.
    131134     *
    132      * @since    1.0.0
     135     * @since    1.1
    133136     * @access   private
    134137     */
     
    146149     * of the plugin.
    147150     *
    148      * @since    1.0.0
     151     * @since    1.1
    149152     * @access   private
    150153     */
     
    162165     * of the plugin.
    163166     *
    164      * @since    1.0.0
     167     * @since    1.1
    165168     * @access   private
    166169     */
     
    177180     * Run the loader to execute all of the hooks with WordPress.
    178181     *
    179      * @since    1.0.0
     182     * @since    1.1
    180183     */
    181184    public function run() {
     
    187190     * WordPress and to define internationalization functionality.
    188191     *
    189      * @since     1.0.0
     192     * @since     1.1
    190193     * @return    string    The name of the plugin.
    191194     */
     
    197200     * The reference to the class that orchestrates the hooks with the plugin.
    198201     *
    199      * @since     1.0.0
     202     * @since     1.1
    200203     * @return    Classy_Loader    Orchestrates the hooks of the plugin.
    201204     */
     
    207210     * Retrieve the version number of the plugin.
    208211     *
    209      * @since     1.0.0
     212     * @since     1.1
    210213     * @return    string    The version number of the plugin.
    211214     */
  • classy/tags/1.1/public/class-classy-public.php

    r1107270 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    2323     * The ID of this plugin.
    2424     *
    25      * @since    1.0.0
     25     * @since    1.1
    2626     * @access   private
    2727     * @var      string    $classy    The ID of this plugin.
     
    3232     * The version of this plugin.
    3333     *
    34      * @since    1.0.0
     34     * @since    1.1
    3535     * @access   private
    3636     * @var      string    $version    The current version of this plugin.
     
    3939
    4040    /**
     41     * The version of this plugin.
     42     *
     43     * @since    1.1
     44     * @access   private
     45     * @var      object    $api    The current account API Object
     46     */
     47    private $api;
     48
     49    /**
    4150     * Initialize the class and set its properties.
    4251     *
    43      * @since    1.0.0
     52     * @since    1.1
    4453     * @param      string    $classy       The name of the plugin.
    4554     * @param      string    $version    The version of this plugin.
    4655     */
     56
    4757    public function __construct( $classy, $version ) {
    48 
    4958        $this->classy = $classy;
    5059        $this->version = $version;
    51 
     60        $this->api = new Classy_API();
    5261    }
    5362
     
    5564     * Register the stylesheets for the public-facing side of the site.
    5665     *
    57      * @since    1.0.0
     66     * @since    1.1
    5867     */
    5968    public function enqueue_styles() {
     
    6473     * Register the stylesheets for the public-facing side of the site.
    6574     *
    66      * @since    1.0.0
     75     * @since    1.1
    6776     */
    6877    public function enqueue_scripts() {
     
    7685    }
    7786
    78     // Gets Latest campaigns Created
     87    // Gets Latest campaigns created
    7988    function get_campaigns_func($atts){
    8089        // Shortcode Attributes Setup
     
    8796        ), $atts );
    8897
    89         // Get Token and CID
    90         $a['token'] = get_option('classy_token');
    91         $a['cid'] = get_option('classy_cid');
    92 
    9398        // Build URL Parameters
    9499        $attrs = http_build_query($a);
    95         $url = 'https://www.classy.org/api1/campaigns?' . $attrs;
    96 
    97         // Curl it
    98         $ch = curl_init();
    99         curl_setopt($ch, CURLOPT_URL, $url);
    100         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    101         $output = curl_exec($ch);
    102         $output = json_decode($output);
    103         curl_close($ch);
     100        $output = $this->api->campaigns($attrs);
    104101
    105102        $count = 0;
     
    114111                            $output .= '
    115112                                    <div class="single-campaign">
    116                                         <p class="campaign-title"><a href="'. $campaign->campaign_url .'">'. $campaign->name .'</a></p>
     113                                        <p class="campaign-title"><a href="'. $campaign->event_url .'">'. $campaign->name .'</a></p>
    117114                                        <p class="campaign-date">'. esc_attr(date_i18n('d M, Y',$date)) .'</p>
    118115                                        <p class="campaign-address">'. $location . ', ' . $campaign->city . ', ' . $campaign->state .'</p>
     
    132129    }
    133130
     131    // Get latest fundraisers
    134132    function get_fundraisers_func($atts){
    135133        // Shortcode Attributes Setup
     
    153151        ), $atts );
    154152
    155         // Get Token and CID
    156         $a['token'] = get_option('classy_token');
    157         $a['cid'] = get_option('classy_cid');
    158 
    159153        // Build URL Parameters
    160154        $attrs = http_build_query($a);
    161         $url = 'https://www.classy.org/api1/fundraisers?' . $attrs;
    162 
    163         // Curl it
    164         $ch = curl_init();
    165         curl_setopt($ch, CURLOPT_URL, $url);
    166         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    167         $output = curl_exec($ch);
    168         $output = json_decode($output);
    169         curl_close($ch);
     155        $output = $this->api->fundraisers($attrs);
    170156
    171157        if($output->status_code == "SUCCESS"){
     
    184170                                            </div>
    185171                                        </div>';
    186 
    187172                        }
    188173            $output .= '</div></div>';
     
    192177    }
    193178
     179    // Get latest donations
    194180    function get_donations_func($atts){
    195181        // Shortcode Attributes Setup
     
    206192        ), $atts );
    207193
    208         // Get Token and CID
    209         $a['token'] = get_option('classy_token');
    210         $a['cid'] = get_option('classy_cid');
    211 
    212194        // Build URL Parameters
    213195        $attrs = http_build_query($a);
    214         $url = 'https://www.classy.org/api1/donations?' . $attrs;
    215 
    216         // Curl it
    217         $ch = curl_init();
    218         curl_setopt($ch, CURLOPT_URL, $url);
    219         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    220         $output = curl_exec($ch);
    221         $output = json_decode($output);
    222         curl_close($ch);
     196        $output = $this->api->donations($attrs);
    223197
    224198        if($output->status_code == "SUCCESS"){
  • classy/tags/1.1/public/partials/classy-public-display.php

    r1107257 r1110142  
    77 *
    88 * @link       http://mediacause.org
    9  * @since      1.0.0
     9 * @since      1.1
    1010 *
    1111 * @package    Classy
  • classy/tags/1.1/uninstall.php

    r1107257 r1110142  
    2121 *
    2222 * @link       http://mediacause.org
    23  * @since      1.0.0
     23 * @since      1.1
    2424 *
    2525 * @package    Classy
  • classy/trunk/admin/class-classy-admin.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    2323     * The ID of this plugin.
    2424     *
    25      * @since    1.0.0
     25     * @since    1.1
    2626     * @access   private
    2727     * @var      string    $classy    The ID of this plugin.
     
    3232     * The version of this plugin.
    3333     *
    34      * @since    1.0.0
     34     * @since    1.1
    3535     * @access   private
    3636     * @var      string    $version    The current version of this plugin.
     
    4141     * Initialize the class and set its properties.
    4242     *
    43      * @since    1.0.0
     43     * @since    1.1
    4444     * @param      string    $classy       The name of this plugin.
    4545     * @param      string    $version    The version of this plugin.
    4646     */
     47
    4748    public function __construct( $classy, $version ) {
    48 
    4949        $this->classy = $classy;
    5050        $this->version = $version;
    51 
    5251    }
    5352
     
    5554     * Register the stylesheets for the Dashboard.
    5655     *
    57      * @since    1.0.0
     56     * @since    1.1
    5857     */
    5958    public function enqueue_styles() {
     
    6463     * Register the JavaScript for the dashboard.
    6564     *
    66      * @since    1.0.0
     65     * @since    1.1
    6766     */
    6867    public function enqueue_scripts() {
     
    7271    public function admin_menus(){
    7372        if(isset($_POST['update'])){
    74             $token = $_POST['token'];
    75             $cid = $_POST['cid'];
    76             $url = 'https://www.classy.org/api1/account-info?token=' . $token . '&cid='. $cid;
    77             $ch = curl_init();
    78             curl_setopt($ch, CURLOPT_URL, $url);
    79             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    80             $output = curl_exec($ch);
    81             $output = json_decode($output);
    82             if($output->status_code == "SUCCESS"){
    83                 update_option('classy_token', $token);
    84                 update_option('classy_cid', $cid); 
    85                 update_option('classy_org_name', $output->name);
    86                 update_option('classy_url', $output->charity_url);
    87                 add_action( 'admin_notices', 'valid_api_notice' );
    88             } else {
    89                 update_option('classy_token', $token);
    90                 update_option('classy_cid', $cid);
    91                 update_option('classy_org_name', '');                   
    92                 update_option('classy_url', $output->charity_url);
    93                 add_action( 'admin_notices', 'invalid_api_notice');
    94             }
    95         }
     73            $account = new Classy_Account($_POST['token'], $_POST['cid']);
     74            $account->update() ? add_action( 'admin_notices', 'valid_api_notice' ) : add_action( 'admin_notices', 'invalid_api_notice');
     75        }   
    9676
    9777        add_menu_page( 'Classy', 'Classy', 'manage_options', plugin_dir_path( __FILE__ ) . 'partials/classy-admin-display.php', '', 'dashicons-groups');
     
    10989        }
    11090    }
    111 
    11291}
  • classy/trunk/admin/partials/classy-admin-display.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
    1010 * @subpackage Classy/admin/partials
    1111 */
    12 global $error;
     12
     13$classy = new Classy_API();
     14$account = $classy->account_info();
     15$activities = $classy->account_activity();
    1316?>
    1417
     
    3033            </form>
    3134            <hr>
    32             <p>Organization: <?php echo get_option('classy_org_name') ? get_option('classy_org_name') : 'None'; ?></p>
     35            <?php if($account->status_code == "SUCCESS"): ?>
     36            <p>Organization: <?php echo $account->name; ?></p>
     37            <p>Total Raised: $<?php echo $account->total_raised; ?></p>
     38            <p>Total Events: <?php echo $account->total_active_events; ?></p>
     39            <p>Total Supporters: <?php echo $account->total_supporters; ?></p>
     40            <p>Total Teams: <?php echo $account->total_fund_teams; ?></p>
     41            <?php endif; ?>
     42            <?php  ?>
    3343        </div>
    3444    </div>
    3545</div>
     46<?php if($activities->status_code == "SUCCESS"): ?>
     47<h1><span class="dashicons dashicons-update"></span> Activity Stream</h1>
     48<div class="wrap">
     49    <div class="classy-form postbox">
     50        <div class="inside">
     51            <ul>
     52                <?php foreach ($activities->activity as $activity) {
     53                    echo '<li><a href="'. $activity->url .'" target="_blank">' . $activity->activity_string . '</a></li>';
     54                }
     55                ?>
     56            </ul>
     57        </div>
     58    </div>
     59</div>
     60<?php endif; ?>
  • classy/trunk/classy.php

    r1107257 r1110142  
    55 *
    66 * @link              http://mediacause.org
    7  * @since             1.0.0
     7 * @since             1.1
    88 * @package           Classy
    99 *
     
    1212 * Plugin URI:        http://mediacause.org
    1313 * Description:       A tool used to integrate Classy's API into easily accessible shortcodes
    14  * Version:           1.0.0
     14 * Version:           1.1
    1515 * Author:            Media Cause
    1616 * Author URI:        http://mediacause.org
     
    6060 * not affect the page life cycle.
    6161 *
    62  * @since    1.0.0
     62 * @since    1.1
    6363 */
    6464function run_classy() {
  • classy/trunk/includes/class-classy-activator.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    1616 * This class defines all code necessary to run during the plugin's activation.
    1717 *
    18  * @since      1.0.0
     18 * @since      1.1
    1919 * @package    Classy
    2020 * @subpackage Classy/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.0.0
     30     * @since    1.1
    3131     */
    3232    public static function activate() {
  • classy/trunk/includes/class-classy-deactivator.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    1616 * This class defines all code necessary to run during the plugin's deactivation.
    1717 *
    18  * @since      1.0.0
     18 * @since      1.1
    1919 * @package    Classy
    2020 * @subpackage Classy/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.0.0
     30     * @since    1.1
    3131     */
    3232    public static function deactivate() {
  • classy/trunk/includes/class-classy-i18n.php

    r1107257 r1110142  
    88 *
    99 * @link       http://mediacause.org
    10  * @since      1.0.0
     10 * @since      1.1
    1111 *
    1212 * @package    Classy
     
    2020 * so that it is ready for translation.
    2121 *
    22  * @since      1.0.0
     22 * @since      1.1
    2323 * @package    Classy
    2424 * @subpackage Classy/includes
     
    3030     * The domain specified for this plugin.
    3131     *
    32      * @since    1.0.0
     32     * @since    1.1
    3333     * @access   private
    3434     * @var      string    $domain    The domain identifier for this plugin.
     
    3939     * Load the plugin text domain for translation.
    4040     *
    41      * @since    1.0.0
     41     * @since    1.1
    4242     */
    4343    public function load_plugin_textdomain() {
     
    5454     * Set the domain equal to that of the specified domain.
    5555     *
    56      * @since    1.0.0
     56     * @since    1.1
    5757     * @param    string    $domain    The domain that represents the locale of this plugin.
    5858     */
  • classy/trunk/includes/class-classy-loader.php

    r1107257 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    2727     * The array of actions registered with WordPress.
    2828     *
    29      * @since    1.0.0
     29     * @since    1.1
    3030     * @access   protected
    3131     * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
     
    3636     * The array of filters registered with WordPress.
    3737     *
    38      * @since    1.0.0
     38     * @since    1.1
    3939     * @access   protected
    4040     * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
     
    4545     * Initialize the collections used to maintain the actions and filters.
    4646     *
    47      * @since    1.0.0
     47     * @since    1.1
    4848     */
    4949    public function __construct() {
     
    5757     * Add a new action to the collection to be registered with WordPress.
    5858     *
    59      * @since    1.0.0
     59     * @since    1.1
    6060     * @param      string               $hook             The name of the WordPress action that is being registered.
    6161     * @param      object               $component        A reference to the instance of the object on which the action is defined.
     
    7171     * Add a new filter to the collection to be registered with WordPress.
    7272     *
    73      * @since    1.0.0
     73     * @since    1.1
    7474     * @param      string               $hook             The name of the WordPress filter that is being registered.
    7575     * @param      object               $component        A reference to the instance of the object on which the filter is defined.
     
    8686     * collection.
    8787     *
    88      * @since    1.0.0
     88     * @since    1.1
    8989     * @access   private
    9090     * @param      array                $hooks            The collection of hooks that is being registered (that is, actions or filters).
     
    113113     * Register the filters and actions with WordPress.
    114114     *
    115      * @since    1.0.0
     115     * @since    1.1
    116116     */
    117117    public function run() {
  • classy/trunk/includes/class-classy.php

    r1107257 r1110142  
    88 *
    99 * @link       http://mediacause.org
    10  * @since      1.0.0
     10 * @since      1.1
    1111 *
    1212 * @package    Classy
     
    2323 * version of the plugin.
    2424 *
    25  * @since      1.0.0
     25 * @since      1.1
    2626 * @package    Classy
    2727 * @subpackage Classy/includes
     
    3434     * the plugin.
    3535     *
    36      * @since    1.0.0
     36     * @since    1.1
    3737     * @access   protected
    3838     * @var      Classy_Loader    $loader    Maintains and registers all hooks for the plugin.
     
    4343     * The unique identifier of this plugin.
    4444     *
    45      * @since    1.0.0
     45     * @since    1.1
    4646     * @access   protected
    4747     * @var      string    $classy    The string used to uniquely identify this plugin.
     
    5252     * The current version of the plugin.
    5353     *
    54      * @since    1.0.0
     54     * @since    1.1
    5555     * @access   protected
    5656     * @var      string    $version    The current version of the plugin.
     
    6565     * the public-facing side of the site.
    6666     *
    67      * @since    1.0.0
     67     * @since    1.1
    6868     */
    6969    public function __construct() {
    7070
    7171        $this->classy = 'classy';
    72         $this->version = '1.0.0';
     72        $this->version = '1.1';
    7373
    7474        $this->load_dependencies();
     
    9292     * with WordPress.
    9393     *
    94      * @since    1.0.0
     94     * @since    1.1
    9595     * @access   private
    9696     */
     
    103103        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-classy-loader.php';
    104104
     105        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-classy-api.php';
     106
     107
    105108        /**
    106109         * The class responsible for defining internationalization functionality
     
    130133     * with WordPress.
    131134     *
    132      * @since    1.0.0
     135     * @since    1.1
    133136     * @access   private
    134137     */
     
    146149     * of the plugin.
    147150     *
    148      * @since    1.0.0
     151     * @since    1.1
    149152     * @access   private
    150153     */
     
    162165     * of the plugin.
    163166     *
    164      * @since    1.0.0
     167     * @since    1.1
    165168     * @access   private
    166169     */
     
    177180     * Run the loader to execute all of the hooks with WordPress.
    178181     *
    179      * @since    1.0.0
     182     * @since    1.1
    180183     */
    181184    public function run() {
     
    187190     * WordPress and to define internationalization functionality.
    188191     *
    189      * @since     1.0.0
     192     * @since     1.1
    190193     * @return    string    The name of the plugin.
    191194     */
     
    197200     * The reference to the class that orchestrates the hooks with the plugin.
    198201     *
    199      * @since     1.0.0
     202     * @since     1.1
    200203     * @return    Classy_Loader    Orchestrates the hooks of the plugin.
    201204     */
     
    207210     * Retrieve the version number of the plugin.
    208211     *
    209      * @since     1.0.0
     212     * @since     1.1
    210213     * @return    string    The version number of the plugin.
    211214     */
  • classy/trunk/public/class-classy-public.php

    r1107270 r1110142  
    55 *
    66 * @link       http://mediacause.org
    7  * @since      1.0.0
     7 * @since      1.1
    88 *
    99 * @package    Classy
     
    2323     * The ID of this plugin.
    2424     *
    25      * @since    1.0.0
     25     * @since    1.1
    2626     * @access   private
    2727     * @var      string    $classy    The ID of this plugin.
     
    3232     * The version of this plugin.
    3333     *
    34      * @since    1.0.0
     34     * @since    1.1
    3535     * @access   private
    3636     * @var      string    $version    The current version of this plugin.
     
    3939
    4040    /**
     41     * The version of this plugin.
     42     *
     43     * @since    1.1
     44     * @access   private
     45     * @var      object    $api    The current account API Object
     46     */
     47    private $api;
     48
     49    /**
    4150     * Initialize the class and set its properties.
    4251     *
    43      * @since    1.0.0
     52     * @since    1.1
    4453     * @param      string    $classy       The name of the plugin.
    4554     * @param      string    $version    The version of this plugin.
    4655     */
     56
    4757    public function __construct( $classy, $version ) {
    48 
    4958        $this->classy = $classy;
    5059        $this->version = $version;
    51 
     60        $this->api = new Classy_API();
    5261    }
    5362
     
    5564     * Register the stylesheets for the public-facing side of the site.
    5665     *
    57      * @since    1.0.0
     66     * @since    1.1
    5867     */
    5968    public function enqueue_styles() {
     
    6473     * Register the stylesheets for the public-facing side of the site.
    6574     *
    66      * @since    1.0.0
     75     * @since    1.1
    6776     */
    6877    public function enqueue_scripts() {
     
    7685    }
    7786
    78     // Gets Latest campaigns Created
     87    // Gets Latest campaigns created
    7988    function get_campaigns_func($atts){
    8089        // Shortcode Attributes Setup
     
    8796        ), $atts );
    8897
    89         // Get Token and CID
    90         $a['token'] = get_option('classy_token');
    91         $a['cid'] = get_option('classy_cid');
    92 
    9398        // Build URL Parameters
    9499        $attrs = http_build_query($a);
    95         $url = 'https://www.classy.org/api1/campaigns?' . $attrs;
    96 
    97         // Curl it
    98         $ch = curl_init();
    99         curl_setopt($ch, CURLOPT_URL, $url);
    100         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    101         $output = curl_exec($ch);
    102         $output = json_decode($output);
    103         curl_close($ch);
     100        $output = $this->api->campaigns($attrs);
    104101
    105102        $count = 0;
     
    114111                            $output .= '
    115112                                    <div class="single-campaign">
    116                                         <p class="campaign-title"><a href="'. $campaign->campaign_url .'">'. $campaign->name .'</a></p>
     113                                        <p class="campaign-title"><a href="'. $campaign->event_url .'">'. $campaign->name .'</a></p>
    117114                                        <p class="campaign-date">'. esc_attr(date_i18n('d M, Y',$date)) .'</p>
    118115                                        <p class="campaign-address">'. $location . ', ' . $campaign->city . ', ' . $campaign->state .'</p>
     
    132129    }
    133130
     131    // Get latest fundraisers
    134132    function get_fundraisers_func($atts){
    135133        // Shortcode Attributes Setup
     
    153151        ), $atts );
    154152
    155         // Get Token and CID
    156         $a['token'] = get_option('classy_token');
    157         $a['cid'] = get_option('classy_cid');
    158 
    159153        // Build URL Parameters
    160154        $attrs = http_build_query($a);
    161         $url = 'https://www.classy.org/api1/fundraisers?' . $attrs;
    162 
    163         // Curl it
    164         $ch = curl_init();
    165         curl_setopt($ch, CURLOPT_URL, $url);
    166         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    167         $output = curl_exec($ch);
    168         $output = json_decode($output);
    169         curl_close($ch);
     155        $output = $this->api->fundraisers($attrs);
    170156
    171157        if($output->status_code == "SUCCESS"){
     
    184170                                            </div>
    185171                                        </div>';
    186 
    187172                        }
    188173            $output .= '</div></div>';
     
    192177    }
    193178
     179    // Get latest donations
    194180    function get_donations_func($atts){
    195181        // Shortcode Attributes Setup
     
    206192        ), $atts );
    207193
    208         // Get Token and CID
    209         $a['token'] = get_option('classy_token');
    210         $a['cid'] = get_option('classy_cid');
    211 
    212194        // Build URL Parameters
    213195        $attrs = http_build_query($a);
    214         $url = 'https://www.classy.org/api1/donations?' . $attrs;
    215 
    216         // Curl it
    217         $ch = curl_init();
    218         curl_setopt($ch, CURLOPT_URL, $url);
    219         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    220         $output = curl_exec($ch);
    221         $output = json_decode($output);
    222         curl_close($ch);
     196        $output = $this->api->donations($attrs);
    223197
    224198        if($output->status_code == "SUCCESS"){
  • classy/trunk/public/partials/classy-public-display.php

    r1107257 r1110142  
    77 *
    88 * @link       http://mediacause.org
    9  * @since      1.0.0
     9 * @since      1.1
    1010 *
    1111 * @package    Classy
  • classy/trunk/uninstall.php

    r1107257 r1110142  
    2121 *
    2222 * @link       http://mediacause.org
    23  * @since      1.0.0
     23 * @since      1.1
    2424 *
    2525 * @package    Classy
Note: See TracChangeset for help on using the changeset viewer.