Ejemplo n.º 1
0
    public function group_tab_name_setting_markup()
    {
        $name = bp_docs_get_group_tab_name();
        ?>
		<input name="bp-docs-tab-name" id="bp-docs-tab-name" type="text" value="<?php 
        echo esc_html($name);
        ?>
" />
		<p class="description"><?php 
        _e("Change the word on the BuddyPress group tab from 'Docs' to whatever you'd like. Keep in mind that this will not change the text anywhere else on the page. For a more thorough text change, create a <a href='http://codex.buddypress.org/extending-buddypress/customizing-labels-messages-and-urls/'>language file</a> for BuddyPress Docs.", 'bp-docs');
        ?>
</p>

		<?php 
    }
 /**
  * Constructor
  *
  * @since 1.0-beta
  */
 public function __construct()
 {
     global $bp;
     $bp_docs_tab_name = bp_docs_get_group_tab_name();
     if (!empty($bp->groups->current_group->id)) {
         $this->maybe_group_id = $bp->groups->current_group->id;
     } else {
         if (!empty($bp->groups->new_group_id)) {
             $this->maybe_group_id = $bp->groups->new_group_id;
         } else {
             $this->maybe_group_id = false;
         }
     }
     // Load the bp-docs setting for the group, for easy access
     $this->settings = bp_docs_get_group_settings($this->maybe_group_id);
     $this->group_enable = !empty($this->settings['group-enable']) ? true : false;
     $this->name = !empty($bp_docs_tab_name) ? $bp_docs_tab_name : __('Docs', 'bp-docs');
     $this->slug = bp_docs_get_docs_slug();
     $this->enable_create_step = $this->enable_create_step();
     $this->create_step_position = 18;
     $this->nav_item_position = 45;
     $this->visibility = 'public';
     $this->enable_nav_item = $this->enable_nav_item();
     // Create some default settings if the create step is skipped
     if (apply_filters('bp_docs_force_enable_at_group_creation', false)) {
         add_action('groups_created_group', array(&$this, 'enable_at_group_creation'));
     }
     // Backward compatibility for group-based Doc URLs
     add_action('bp_actions', array($this, 'url_backpat'));
 }