Beispiel #1
0
 /**
  * Constructor
  *
  * @package CollabPress
  * @subpackage CP BP
  * @since 1.2
  */
 function __construct()
 {
     global $bp;
     parent::start('collabpress', __('CollabPress', 'collabpress'), COLLABPRESS_PLUGIN_DIR);
     // Register ourselves as an active BP component
     $bp->active_components['collabpress'] = '1';
     add_filter('bp_get_template_stack', array($this, 'add_cp_to_template_stack'));
     // Register BP-specific taxonomies
     $this->register_taxonomies();
     // Set up the CP query
     add_action('cp_bp_setup_item', array(&$this, 'do_cp_query'), 5);
     // Load the notification framework
     require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-notifications.php';
     // Load the Groups integration, if active
     if (bp_is_active('groups')) {
         require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-groups.php';
         bp_register_group_extension('CP_BP_Group_Extension');
     }
     // Add the admin menus
     add_action('cp_after_advanced_settings', array(&$this, 'render_settings'));
     // Todo: this MUST check to see whether we're in a BP context!!
     add_filter('cp_calendar_permalink', array($this, 'filter_cp_calendar_permalink'), 10, 4);
     add_filter('post_type_link', array(&$this, 'filter_permalinks'), 10, 4);
     add_filter('cp_task_list_link', array(&$this, 'filter_item_link'), 10, 3);
     add_filter('cp_task_link', array(&$this, 'filter_item_link'), 10, 3);
     add_action('cp_project_added', array(&$this, 'mark_post_in_group'));
     add_action('wp_print_styles', array(&$this, 'enqueue_styles'));
 }
 /**
  * Constructor method
  *
  * You can do all sorts of stuff in your constructor, but it's recommended that, at the
  * very least, you call the parent::start() function. This tells the parent BP_Component
  * to begin its setup routine.
  *
  * BP_Component::start() takes three parameters:
  *   (1) $id   - A unique identifier for the component. Letters, numbers, and underscores
  *		 only.
  *   (2) $name - This is a translatable name for your component, which will be used in
  *               various places through the BuddyPress admin screens to identify it.
  *   (3) $path - The path to your plugin directory. Primarily, this is used by
  *		 BP_Component::includes(), to include your plugin's files. See loader.php
  *		 to see how BP_course_PLUGIN_DIR was defined.
  *
  * @package BuddyPress_Course_Component
  * @since 1.6
  */
 function __construct()
 {
     global $bp;
     parent::start(BP_COURSE_SLUG, __('Course', 'vibe'), BP_COURSE_MOD_PLUGIN_DIR);
     if (!defined('BP_COURSE_RESULTS_SLUG')) {
         define('BP_COURSE_RESULTS_SLUG', 'course-results');
     }
     if (!defined('BP_COURSE_STATS_SLUG ')) {
         define('BP_COURSE_STATS_SLUG', 'course-stats');
     }
     /**
      * BuddyPress-dependent plugins are loaded too late to depend on BP_Component's
      * hooks, so we must call the function directly.
      */
     $this->includes();
     /**
      * Put your component into the active components array, so that
      *   bp_is_active( 'course' );
      * returns true when appropriate. We have to do this manually, because non-core
      * components are not saved as active components in the database.
      */
     $bp->active_components[$this->id] = '2';
     /**
      * Hook the register_post_types() method. If you're using custom post types to store
      * data (which is recommended), you will need to hook your function manually to
      * 'init'.
      */
     add_action('init', array(&$this, 'register_post_types'));
 }
 function __construct()
 {
     global $bp;
     parent::start('social_articles', __('Social Articles', 'articles'), SA_BASE_PATH);
     $this->includes();
     $bp->active_components[$this->id] = '1';
 }
Beispiel #4
0
 /**
  * Constructor
  *
  * @since 1.2
  */
 function __construct()
 {
     global $bp;
     parent::start('bp_docs', __('BuddyPress Docs', 'bp-docs'), BP_DOCS_INSTALL_PATH);
     $bp->active_components[$this->id] = '1';
     $this->setup_hooks();
 }
Beispiel #5
0
 /**
  * Constructor method
  *
  * @package BP Reshare
  * @subpackage Component
  * @since 1.0
  *
  * @uses buddyreshare_get_component_id() to get the id of the component
  * @uses buddyreshare_get_component_name() to get the name of the component
  * @uses buddyreshare_get_includes_dir() to get plugin's include dir
  * @uses buddypress() to get BuddyPress main instance
  */
 function __construct()
 {
     parent::start(buddyreshare_get_component_id(), buddyreshare_get_component_name(), buddyreshare_get_includes_dir());
     buddypress()->active_components[$this->id] = '1';
     $this->includes();
     $this->setup_hooks();
 }
 /**
  * Start the site subscriber component creation process
  */
 public function __construct()
 {
     parent::start('site_subscriber', __('Site Subscriber', 'bp-site-subscriber'), BP_PLUGIN_DIR);
     // Wordpress init
     add_action('init', array($this, 'init'));
     /**
      * Actions and filters for notification adding and deleting
      */
     // Add new notification when a new post is published
     add_action('publish_post', array($this, 'add_notification'), 10, 2);
     // Mark users notification connected to a post as read
     add_action('the_post', array($this, 'mark_notification_as_read'));
     // Delete notifications if post is deleted
     add_action('delete_post', array($this, 'delete_notifications'));
     // Delete notifications if post is trashed
     add_action('wp_trash_post', array($this, 'delete_notifications'));
     /**
      * Actions and filters for subscribing
      */
     add_action('wp_ajax_bp_site_subscriber_subscribe', array($this, 'change_subscription'));
     /**
      * Actions and filters for settings
      */
     // Action run when displaying notification settings (enable or disable emails)
     add_action('bp_notification_settings', array($this, 'settings_screen'));
 }
Beispiel #7
0
 /**
  * Initialize component
  */
 public function __construct()
 {
     parent::start('buddyblog', __('BuddyBlog', 'buddyblog'), untrailingslashit(plugin_dir_path(__FILE__)));
     $this->includes();
     //load files
     buddypress()->active_components[$this->id] = 1;
 }
 /**
  * Initiate the class
  *
  * @package BuddyForms
  * @since 0.1 beta
  */
 public function __construct()
 {
     global $bp;
     parent::start($this->id, 'BuddyForms', BUDDYFORMS_MEMBERS_INSTALL_PATH);
     $bp->active_components[$this->id] = '1';
     $this->setup_hooks();
 }
 function __construct()
 {
     global $bp;
     parent::start('buatp', __('User Account Type', 'buatp'), BUATP_ROOT . '_inc');
     $this->includes();
     $bp->active_components[$this->id] = '1';
 }
 function __construct()
 {
     parent::start('links', _x('User Links', 'Link screen page <title>', 'buddypress-links'), BP_LINKS_PLUGIN_DIR);
     $this->includes();
     bp_links_init_settings();
     buddypress()->active_components[$this->id] = '1';
 }
 /**
  * Start the creation process.
  *
  * @since 1.0.0
  * @access public
  */
 function __construct()
 {
     global $bp;
     parent::start('mute', __('Mute', 'buddypress-mute'), dirname(dirname(__FILE__)));
     $this->includes();
     $bp->active_components[$this->id] = '1';
 }
 /**
  * Initialize the component
  */
 public function __construct()
 {
     global $bp;
     parent::start('portfolio', __('Portfolio', 'bp-portfolio'), BP_PORTFOLIO_PLUGIN_DIR);
     $this->includes();
     $bp->active_components[$this->id] = '1';
     // add_action('init', array(&$this, 'register_post_types'));
 }
Beispiel #13
0
 function __construct()
 {
     global $bp;
     parent::start('events', __('Events', 'dbem'), EM_DIR);
     $this->includes();
     //TODO make BP component optional
     $bp->active_components[$this->id] = '1';
 }
 /**
  * Constructor for the BuddyPress Media Component
  * 
  * @since BP Media 2.0
  */
 function __construct()
 {
     global $bp;
     parent::start(BP_MEDIA_SLUG, BP_MEDIA_LABEL, BP_MEDIA_PLUGIN_DIR);
     $this->includes();
     $bp->active_components[$this->id] = '1';
     add_action('init', array(&$this, 'register_post_types'));
 }
Beispiel #15
0
 /**
  * Start the forums component creation process
  *
  * @since bbPress (r3552)
  */
 public function __construct()
 {
     parent::start('forums', __('Forums', 'bbpress'), bbpress()->includes_dir . 'extend/buddypress/');
     $this->includes();
     $this->setup_globals();
     $this->setup_actions();
     $this->fully_loaded();
 }
Beispiel #16
0
 /**
  * Everything starts here
  */
 private function __construct()
 {
     parent::start('mediapress', __('Gallery', 'mediapress'), untrailingslashit(mediapress()->get_path()));
     //mark it as active component, otherwise notifications will not be rendered
     buddypress()->active_components[$this->id] = 1;
     add_action('bp_member_plugin_options_nav', array($this, 'context_menu_edit'));
     add_action('mpp_group_nav', array($this, 'context_menu_edit'));
 }
 /**
  * Plugin settings
  */
 function __construct()
 {
     parent::start('bp_smp', __('BuddyPress Social Media Profiles', 'bp-smp'), BP_SMP_PLUGIN_DIR);
     $this->setup_hooks();
     if (is_super_admin() && (is_admin() || is_network_admin())) {
         include BP_SMP_PLUGIN_DIR . 'includes/admin.php';
         $this->admin = new BP_SMP_Admin();
     }
 }
 /**
  * Initial component setup.
  */
 public function __construct()
 {
     global $bp;
     parent::start('humcore_deposits', __('Humanities CORE Deposits', 'humcore_domain'), dirname(__FILE__));
     $this->includes();
     $this->setup_filters();
     bp_register_template_stack('humcore_register_template_location', 14);
     $bp->active_components[$this->id] = '1';
 }
 /**
  * Register our 'Projects' Component to BuddyPress Components
  */
 function __construct()
 {
     $this->id = task_breaker_component_id();
     $this->name = task_breaker_component_name();
     parent::start($this->id, $this->name, task_breaker_include_dir());
     $this->includes();
     $this->actions();
     return $this;
 }
Beispiel #20
0
 /**
  * Start the forums component creation process
  *
  * @since bbPress (r3552)
  */
 public function __construct()
 {
     parent::start('forums', __('Forums', 'bbpress'), BP_PLUGIN_DIR);
     $this->includes();
     $this->setup_globals();
     $this->setup_actions();
     $this->setup_nav();
     $this->fully_loaded();
 }
	/**
	 * Start the friends component creation process.
	 *
	 * @since BuddyPress (1.5.0)
	 */
	public function __construct() {
		parent::start(
			'friends',
			_x( 'Friend Connections', 'Friends screen page <title>', 'buddypress' ),
			buddypress()->plugin_dir,
			array(
				'adminbar_myaccount_order' => 60
			)
		);
	}
	/**
	 * Start the members component creation process.
	 *
	 * @since BuddyPress (1.5.0)
	 */
	public function __construct() {
		parent::start(
			'members',
			__( 'Members', 'buddypress' ),
			buddypress()->plugin_dir,
			array(
				'adminbar_myaccount_order' => 20
			)
		);
	}
	/**
	 * Start the blogs component creation process.
	 *
	 * @since BuddyPress (1.5.0)
	 */
	public function __construct() {
		parent::start(
			'blogs',
			__( 'Site Directory', 'buddypress' ),
			buddypress()->plugin_dir,
			array(
				'adminbar_myaccount_order' => 30
			)
		);
	}
 /**
  * Constructor method
  *
  * @package Rendez_Vous
  * @subpackage Component
  *
  * @since Rendez Vous (1.0.0)
  */
 function __construct()
 {
     $bp = buddypress();
     parent::start('rendez_vous', rendez_vous()->get_component_name(), rendez_vous()->includes_dir);
     $this->includes();
     $bp->active_components[$this->id] = '1';
     /**
      * Only register the post type on the blog where BuddyPress is activated.
      */
     if (get_current_blog_id() == bp_get_root_blog_id()) {
         add_action('init', array(&$this, 'register_post_types'));
     }
 }
 /**
  * Constructor.
  *
  * @global obj $bp BuddyPress instance
  */
 public function __construct()
 {
     global $bp;
     // setup misc parameters
     $this->params = array('adminbar_myaccount_order' => apply_filters('bp_follow_following_nav_position', 61));
     // let's start the show!
     parent::start('follow', __('Follow', 'bp-follow'), constant('BP_FOLLOW_DIR') . '/_inc', $this->params);
     // include our files
     $this->includes();
     // setup hooks
     $this->setup_hooks();
     // register our component as an active component in BP
     $bp->active_components[$this->id] = '1';
 }
 /**
  * Constructor method
  *
  *
  * @package BP Checkins
  * @since 1.0
  */
 function __construct()
 {
     global $bp, $blog_id;
     parent::start(BP_CHECKINS_SLUG, __('Checkins', 'bp-checkins'), BP_CHECKINS_PLUGIN_DIR);
     $this->includes();
     $bp->active_components[$this->id] = '1';
     /**
      * Register the places custom post type
      * If the priority is 10 or more, then taxo is not set when using ajax.
      */
     if ($blog_id == BP_ROOT_BLOG) {
         add_action('init', array(&$this, 'register_post_types'), 9);
         add_action('init', array(&$this, 'register_taxonomies'), 9);
     }
 }
Beispiel #27
0
 /**
  * Constructor method
  *
  * @package GMW 
  */
 function __construct()
 {
     global $bp, $blog_id;
     /*
      * Define Globals
      */
     define('GMW_FL_DB_VERSION', '1.2.1');
     define('GMW_FL_URL', GMW_URL . '/plugins/friends/');
     define('GMW_FL_PATH', GMW_PATH . '/plugins/friends/');
     define('GMW_FL_SLUG', 'location');
     add_action('wp_enqueue_scripts', array($this, 'frontend_register_scripts'));
     add_action('bp_activity_filter_options', array($this, 'location_filter_options'), 10);
     add_action('bp_member_activity_filter_options', array($this, 'location_filter_options'), 10);
     parent::start(GMW_FL_SLUG, __('Location', 'GMW'), GMW_FL_PATH);
     $this->includes();
     $bp->active_components[$this->id] = '1';
 }
 /**
  * Start the mutual-friends component creation process.
  *
  * @since BuddyPress (1.0)
  */
 public function __construct()
 {
     global $bp;
     parent::start('mutual-friends', _x('Mutual Friend Connections', 'Mutual Friends screen page <title>', 'buddypress'), BP_MUTUAL_FRIENDS_PLUGIN_DIR);
     /**
      * BuddyPress-dependent plugins are loaded too late to depend on BP_Component's
      * hooks, so we must call the function directly.
      */
     $this->includes();
     /**
      * Put your component into the active components array, so that
      *   bp_is_active( 'example' );
      * returns true when appropriate. We have to do this manually, because non-core
      * components are not saved as active components in the database.
      */
     $bp->active_components[$this->id] = '1';
 }
 /**
  * Initialize BP_Compliments_Component class.
  *
  * @since 0.0.1
  * @package BuddyPress_Compliments
  *
  * @global object $bp BuddyPress instance.
  */
 public function __construct()
 {
     global $bp;
     /**
      * Filters the value of compliment nav position.
      *
      * @since 0.0.1
      * @package BuddyPress_Compliments
      */
     $this->params = array('adminbar_myaccount_order' => apply_filters('bp_compliments_nav_position', 71));
     parent::start('compliments', __('Compliments', 'bp-compliments'), constant('BP_COMPLIMENTS_DIR') . '/includes', $this->params);
     // include our files
     $this->includes();
     // setup hooks
     $this->setup_hooks();
     // register our component as an active component in BP
     $bp->active_components[$this->id] = '1';
 }
 /**
  * Constructor method
  *
  * You can do all sorts of stuff in your constructor, but it's recommended that, at the
  * very least, you call the parent::start() function. This tells the parent BP_Component
  * to begin its setup routine.
  *
  * BP_Component::start() takes three parameters:
  *   (1) $id   - A unique identifier for the component. Letters, numbers, and underscores
  *		 only.
  *   (2) $name - This is a translatable name for your component, which will be used in
  *               various places through the BuddyPress admin screens to identify it.
  *   (3) $path - The path to your plugin directory. Primarily, this is used by
  *		 BP_Component::includes(), to include your plugin's files. See loader.php
  *		 to see how BP_EXAMPLE_PLUGIN_DIR was defined.
  *
  * @package BuddyPress_Skeleton_Component
  * @since 1.6
  */
 function __construct()
 {
     global $bp;
     parent::start('example', __('Example', 'bp-example'), BP_EXAMPLE_PLUGIN_DIR);
     /**
      * BuddyPress-dependent plugins are loaded too late to depend on BP_Component's
      * hooks, so we must call the function directly.
      */
     $this->includes();
     /**
      * Put your component into the active components array, so that
      *   bp_is_active( 'example' );
      * returns true when appropriate. We have to do this manually, because non-core
      * components are not saved as active components in the database.
      */
     $bp->active_components[$this->id] = '1';
     /**
      * Hook the register_post_types() method. If you're using custom post types to store
      * data (which is recommended), you will need to hook your function manually to
      * 'init'.
      */
     add_action('init', array(&$this, 'register_post_types'));
 }