| @@ -2,136 +2,113 @@ | ||
| 2 | 2 | /* |
| 3 | 3 | Plugin Name: Team |
| 4 | 4 | Plugin URI: http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/ |
| 5 | 5 | Description: Fully responsive and mobile ready meet the team showcase plugin for wordpress. |
| 6 | -Version: 1.2 | |
| 7 | -Author: paratheme | |
| 6 | +Version: 1.7 | |
| 7 | +Author: paratheme, pickplugins | |
| 8 | 8 | Author URI: http://paratheme.com |
| 9 | 9 | License: GPLv2 or later |
| 10 | 10 | License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 11 | + | |
| 12 | +Copyright: 2015 ParaTheme | |
| 13 | + | |
| 11 | 14 | */ |
| 12 | 15 | |
| 13 | 16 | if ( ! defined('ABSPATH')) exit; // if direct access |
| 14 | 17 | |
| 15 | -define('team_plugin_url', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' ); | |
| 16 | -define('team_plugin_dir', plugin_dir_path( __FILE__ ) ); | |
| 17 | -define('team_wp_url', 'http://wordpress.org/plugins/team/' ); | |
| 18 | -define('team_pro_url', 'http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/' ); | |
| 19 | -define('team_demo_url', 'http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/' ); | |
| 20 | -define('team_conatct_url', 'http://paratheme.com/contact' ); | |
| 21 | -define('team_plugin_name', 'Team' ); | |
| 22 | -define('team_share_url', 'http://wordpress.org/plugins/team/' ); | |
| 23 | 18 | |
| 24 | -require_once( plugin_dir_path( __FILE__ ) . 'includes/team-meta.php'); | |
| 25 | -require_once( plugin_dir_path( __FILE__ ) . 'includes/team-functions.php'); | |
| 19 | +class Team{ | |
| 20 | + | |
| 21 | + public function __construct(){ | |
| 22 | + | |
| 23 | + define('team_plugin_url', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' ); | |
| 24 | + define('team_plugin_dir', plugin_dir_path( __FILE__ ) ); | |
| 25 | + define('team_wp_url', 'http://wordpress.org/plugins/team/' ); | |
| 26 | + define('team_wp_reviews', 'http://wordpress.org/support/view/plugin-reviews/team' ); | |
| 27 | + define('team_pro_url', 'http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/' ); | |
| 28 | + define('team_demo_url', 'http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/' ); | |
| 29 | + define('team_conatct_url', 'http://paratheme.com/contact' ); | |
| 30 | + define('team_qa_url', 'http://paratheme.com/qa/' ); | |
| 31 | + define('team_plugin_name', 'Team' ); | |
| 32 | + define('team_plugin_version', '1.7' ); | |
| 33 | + define('team_customer_type', 'free' ); // pro & free | |
| 34 | + define('team_share_url', 'http://wordpress.org/plugins/team/' ); | |
| 35 | + define('team_tutorial_video_url', '//www.youtube.com/embed/8OiNCDavSQg?rel=0' ); | |
| 36 | + define('team_tutorial_doc_url', 'http://paratheme.com/documentation/documentation/team/' ); | |
| 37 | + | |
| 38 | + include( 'includes/class-post-types.php' ); | |
| 39 | + include( 'includes/class-post-meta.php' ); | |
| 40 | + include( 'includes/class-settings.php' ); | |
| 41 | + include( 'includes/class-functions.php' ); | |
| 42 | + include( 'includes/class-shortcodes.php' ); | |
| 26 | 43 | |
| 44 | + add_action( 'wp_enqueue_scripts', array( $this, 'team_front_scripts' ) ); | |
| 45 | + add_action( 'admin_enqueue_scripts', array( $this, 'team_admin_scripts' ) ); | |
| 46 | + //add_action( 'admin_footer', array( $this, 'colorpickersjs' ) ); | |
| 47 | + //add_action( 'admin_enqueue_scripts', 'wptuts_add_color_picker' ); | |
| 27 | 48 | |
| 49 | + } | |
| 50 | + | |
| 51 | + | |
| 28 | 52 | |
| 29 | -//Themes php files | |
| 30 | -require_once( plugin_dir_path( __FILE__ ) . 'themes/flat/index.php'); | |
| 31 | -require_once( plugin_dir_path( __FILE__ ) . 'themes/flat-bg/index.php'); | |
| 53 | + | |
| 32 | 54 | |
| 55 | + | |
| 56 | + public function team_install(){ | |
| 57 | + | |
| 58 | + do_action( 'team_action_install' ); | |
| 59 | + | |
| 60 | + } | |
| 61 | + | |
| 62 | + public function team_uninstall(){ | |
| 63 | + | |
| 64 | + do_action( 'team_action_uninstall' ); | |
| 65 | + } | |
| 66 | + | |
| 67 | + public function team_deactivation(){ | |
| 68 | + | |
| 69 | + do_action( 'team_action_deactivation' ); | |
| 70 | + } | |
| 71 | + | |
| 72 | + | |
| 73 | + public function team_front_scripts(){ | |
| 74 | + | |
| 75 | + wp_enqueue_script('jquery'); | |
| 76 | + wp_enqueue_script('team_front_js', plugins_url( '/js/scripts.js' , __FILE__ ) , array( 'jquery' )); | |
| 77 | + wp_localize_script('team_front_js', 'team_ajax', array( 'team_ajaxurl' => admin_url( 'admin-ajax.php'))); | |
| 78 | + | |
| 79 | + //wp_enqueue_style('team_front_style', team_plugin_url.'css/style.css'); //ssl issue | |
| 80 | + wp_enqueue_style('team_front_style', plugins_url( 'css/style.css', __FILE__ )); | |
| 33 | 81 | |
| 34 | - | |
| 35 | -function team_init_scripts() | |
| 36 | - { | |
| 82 | + do_action('team_action_front_scripts'); | |
| 83 | + } | |
| 84 | + | |
| 85 | + public function team_admin_scripts(){ | |
| 86 | + | |
| 37 | 87 | wp_enqueue_script('jquery'); |
| 38 | - wp_enqueue_script('team_js', plugins_url( '/js/team-scripts.js' , __FILE__ ) , array( 'jquery' )); | |
| 39 | - wp_localize_script('team_js', 'team_ajax', array( 'team_ajaxurl' => admin_url( 'admin-ajax.php'))); | |
| 40 | - wp_enqueue_style('team_style', team_plugin_url.'css/style.css'); | |
| 41 | - wp_enqueue_style('ParaAdmin', team_plugin_url.'css/ParaAdmin.css'); | |
| 42 | - wp_enqueue_script('ParaAdmin', plugins_url( '/js/ParaAdmin.js' , __FILE__ ) , array( 'jquery' )); | |
| 43 | - | |
| 88 | + wp_enqueue_script('jquery-ui-core'); | |
| 89 | + wp_enqueue_script('jquery-ui-sortable'); | |
| 90 | + //wp_enqueue_script('jquery-ui-droppable'); | |
| 91 | + | |
| 92 | + wp_enqueue_style('team_admin_style', plugins_url( 'css/style-admin.css', __FILE__ )); | |
| 93 | + | |
| 94 | + wp_enqueue_script('team_admin_js', plugins_url( '/js/scripts-admin.js' , __FILE__ ) , array( 'jquery' )); | |
| 95 | + | |
| 96 | + //wp_enqueue_script( 'wp-color-picker' ); | |
| 44 | 97 | wp_enqueue_style( 'wp-color-picker' ); |
| 45 | - wp_enqueue_script( 'team_color_picker', plugins_url('/js/color-picker.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); | |
| 98 | + wp_enqueue_script( 'color-picker', plugins_url('/js/color-picker.js', __FILE__ ), array( 'wp-color-picker' ), true, true ); | |
| 46 | 99 | |
| 47 | - wp_enqueue_script('jquery.dotdotdot', plugins_url( '/js/jquery.dotdotdot.js' , __FILE__ ) , array( 'jquery' )); | |
| 48 | 100 | |
| 49 | - // Style for themes | |
| 50 | - wp_enqueue_style('team-style-flat', team_plugin_url.'themes/flat/style.css'); | |
| 51 | - wp_enqueue_style('team-style-flat-bg', team_plugin_url.'themes/flat-bg/style.css'); | |
| 52 | - | |
| 101 | + //ParaAdmin | |
| 102 | + //wp_enqueue_style('ParaAdmin', team_plugin_url.'ParaAdmin/css/ParaAdmin.css'); //ssl issue | |
| 103 | + wp_enqueue_style('ParaAdmin', plugins_url( 'ParaAdmin/css/ParaAdmin.css', __FILE__ )); | |
| 104 | + wp_enqueue_script('ParaAdmin', plugins_url( 'ParaAdmin/js/ParaAdmin.js' , __FILE__ ) , array( 'jquery' )); | |
| 53 | 105 | |
| 54 | - } | |
| 55 | -add_action("init","team_init_scripts"); | |
| 106 | + | |
| 107 | + do_action('team_action_admin_scripts'); | |
| 108 | + } | |
| 109 | + | |
| 56 | 110 | |
| 57 | 111 | |
| 58 | - | |
| 59 | - | |
| 60 | - | |
| 61 | - | |
| 62 | - | |
| 63 | -register_activation_hook(__FILE__, 'team_activation'); | |
| 64 | - | |
| 65 | - | |
| 66 | -function team_activation() | |
| 67 | - { | |
| 68 | - $team_version= "1.2"; | |
| 69 | - update_option('team_version', $team_version); //update plugin version. | |
| 70 | - | |
| 71 | - $team_customer_type= "free"; //customer_type "free" | |
| 72 | - update_option('team_customer_type', $team_customer_type); //update plugin version. | |
| 73 | 112 | } |
| 74 | - | |
| 75 | - | |
| 76 | -function team_display($atts, $content = null ) { | |
| 77 | - $atts = shortcode_atts( | |
| 78 | - array( | |
| 79 | - 'id' => "", | |
| 80 | - | |
| 81 | - ), $atts); | |
| 82 | - | |
| 83 | - | |
| 84 | - $post_id = $atts['id']; | |
| 85 | - | |
| 86 | - $team_themes = get_post_meta( $post_id, 'team_themes', true ); | |
| 87 | - | |
| 88 | - $team_display =""; | |
| 89 | - | |
| 90 | - if($team_themes== "flat") | |
| 91 | - { | |
| 92 | - $team_display.= team_body_flat($post_id); | |
| 93 | - } | |
| 94 | - | |
| 95 | - elseif($team_themes== "flat-bg") | |
| 96 | - { | |
| 97 | - $team_display.= team_body_flat_bg($post_id); | |
| 98 | - } | |
| 99 | - | |
| 100 | - | |
| 101 | -return $team_display; | |
| 102 | - | |
| 103 | - | |
| 104 | - | |
| 105 | -} | |
| 106 | - | |
| 107 | -add_shortcode('team', 'team_display'); | |
| 108 | - | |
| 109 | - | |
| 110 | - | |
| 111 | - | |
| 112 | - | |
| 113 | -add_action('admin_menu', 'team_menu_init'); | |
| 114 | - | |
| 115 | - | |
| 116 | 113 | |
| 117 | -function team_menu_help(){ | |
| 118 | - include('team-help.php'); | |
| 119 | -} | |
| 120 | - | |
| 121 | -function team_menu_settings(){ | |
| 122 | - include('team-settings.php'); | |
| 123 | -} | |
| 124 | - | |
| 125 | -function team_menu_init() | |
| 126 | - { | |
| 127 | - add_submenu_page('edit.php?post_type=team', __('Settings','menu-team'), __('Settings','menu-team'), 'manage_options', 'team_menu_settings', 'team_menu_settings'); | |
| 128 | - | |
| 129 | - add_submenu_page('edit.php?post_type=team', __('Help & Upgrade','menu-team'), __('Help & Upgrade','menu-team'), 'manage_options', 'team_menu_help', 'team_menu_help'); | |
| 130 | - | |
| 131 | - } | |
| 132 | - | |
| 133 | - | |
| 134 | - | |
| 135 | - | |
| 136 | - | |
| 137 | -?> | |
| 114 | + new Team(); | |