public function __construct()
 {
     //$is_enabled = mpp_is_active_component( 'groups' );
     $args = array('slug' => MPP_GALLERY_SLUG, 'name' => __('Gallery', 'mediapress'), 'visibility' => 'public', 'nav_item_position' => 80, 'nav_item_name' => __('Gallery', 'mediapress'), 'enable_nav_item' => mpp_group_is_gallery_enabled(), 'screens' => array('create' => array('enabled' => false), 'edit' => array('enabled' => false), 'admin' => array('enabled' => false)));
     parent::init($args);
 }
Exemplo n.º 2
0
/**
 * Add various upload icons to activity post form
 * @return type
 */
function mpp_activity_upload_buttons()
{
    if (!mpp_is_activity_upload_enabled(mpp_get_current_component())) {
        return;
    }
    //if we are here, the gallery activity stream upload is enabled,
    //let us see if we are on user profile and gallery is enabled
    if (bp_is_user() && !mpp_is_active_component('members')) {
        return;
    }
    //if we are on group page and either the group component is not enabled or gallery is not enabled for current group, do not show the icons
    if (function_exists('bp_is_group') && bp_is_group() && (!mpp_is_active_component('groups') || !(function_exists('mpp_group_is_gallery_enabled') && mpp_group_is_gallery_enabled()))) {
        return;
    }
    //for now, avoid showing it on single gallery/media activity stream
    if (mpp_is_single_gallery() || mpp_is_single_media()) {
        return;
    }
    $component = mpp_get_current_component();
    ?>
    <div id="mpp-activity-upload-buttons" class="mpp-upload-buttons">
        <?php 
    do_action("mpp_before_activity_upload_buttons");
    //allow to add more type
    ?>
        
    <?php 
    if (mpp_is_active_type('photo') && mpp_component_supports_type($component, 'photo')) {
        ?>
        <a href="#" id="mpp-photo-upload" data-media-type="photo"><img src="<?php 
        echo mediapress()->get_url() . 'assets/images/media-button-image.gif';
        ?>
"/></a>
     <?php 
    }
    ?>
        
    <?php 
    if (mpp_is_active_type('audio') && mpp_component_supports_type($component, 'audio')) {
        ?>
        <a href="#" id="mpp-audio-upload" data-media-type="audio"><img src="<?php 
        echo mediapress()->get_url() . 'assets/images/media-button-music.gif';
        ?>
"/></a>
     <?php 
    }
    ?>

     <?php 
    if (mpp_is_active_type('video') && mpp_component_supports_type($component, 'video')) {
        ?>
        <a href="#" id="mpp-video-upload"  data-media-type="video"><img src="<?php 
        echo mediapress()->get_url() . 'assets/images/media-button-video.gif';
        ?>
"/></a>
    <?php 
    }
    ?>
		
     <?php 
    if (mpp_is_active_type('doc') && mpp_component_supports_type($component, 'doc')) {
        ?>
        <a href="#" id="mpp-doc-upload"  data-media-type="doc"><img src="<?php 
        echo mediapress()->get_url() . 'assets/images/media-button-doc.png';
        ?>
" /></a>
    <?php 
    }
    ?>
		
    <?php 
    //someone please provide me doc icon and some better icons
    ?>
 
    
	<?php 
    do_action('mpp_after_activity_upload_buttons');
    //allow to add more type
    ?>

    </div>
  <?php 
}