<commit_before><?php
/**
 * The markup for the Muut page editor metabox.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
global $post;

$is_forum = Muut_Post_Utility::isMuutPost( $post->ID );

$forum_show_class = '';
if ( $is_forum != '1' ) {
	$forum_show_class = 'hidden';
}

$remote_path = '/' . rawurldecode( Muut_Post_Utility::getChannelRemotePath( get_the_ID(), true ) );

$tabs = Muut_Admin_Post_Editor::instance()->getMetaBoxTabsForCurrentPostType();
$last_active_tab = get_post_meta( get_the_ID(), 'muut_last_active_tab', true );

$post_type_object = get_post_type_object( get_post_type() );

?>
<div id="muut_metabox_tabs">
	<div class="wp-tab-bar">
		<ul id="muut_metabox_tabs_list" class="category-tabs">
			<?php
			$first_tab = true;
			$active_tab = $last_active_tab;
			foreach( $tabs as $slug => $tab ) {
				$class = '';
				$active_value = '0';
				if ( !Muut_Admin_Post_Editor::instance()->isTabEnabled( $slug, $post->ID ) ) {
					$class .= 'disabled ';
				} else {
					$class .= 'enabled ';
					$active_tab = $tab['name'];
					$active_value = '1';
				}
				if ( ( $last_active_tab && $tab['name'] == $last_active_tab ) || ( !$last_active_tab && $first_tab === true ) ) {
					$class .= ' tabs';
					$first_tab = $slug;
					if ( $post->post_status == 'auto-draft' ) {
						$active_value = '1';
						$active_tab = $tab['name'];
					}
				}
				echo '<li class="' . $class . '" id="muut_tab-' . $tab['name'] . '" data-muut_tab="' . $tab['name'] . '"><a href="#muut_tab_content-' . $tab['name'] . '" class="muut_metabox_tab">' . $tab['label'] . '</a><input type="hidden" class="muut_tab_last_active" name="muut_tab_last_active_' . $tab['name'] . '" value="' . $active_value . '" /></li>';
			}
			?>
		</ul>
		<?php
			foreach( $tabs as $slug => $tab ) {
				$class = 'wp-tab-panel muut-tab-panel ';
				if ( $tab['name'] != $active_tab ) {
					$class .= 'hidden ';
				}
				if ( !Muut_Admin_Post_Editor::instance()->isTabEnabled( $slug, $post->ID ) ) {
					$class .= 'disabled ';
				} else {
					$class .= 'enabled ';
				}
				echo '<div id="muut_tab_content-' . $tab['name'] . '" class="' . $class . '">'; ?>
				<?php
				include ( $tab['template_location'] );
				echo '</div>';
			}
		?>
	</div>
</div>
<div id="muut_tabs_disable_dialog" class="hidden">
	<?php printf( __( 'Enabling this will disable other types of Muut embeds on this %s.', 'muut' ), $post_type_object->labels->singular_name ); ?>
</div><commit_msg>https://trello.com/c/at6iweMp: If muut commenting globally disabled, metabox on pages does not default to channel enabled.<commit_after><?php
/**
 * The markup for the Muut page editor metabox.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
global $post;

$is_forum = Muut_Post_Utility::isMuutPost( $post->ID );

$forum_show_class = '';
if ( $is_forum != '1' ) {
	$forum_show_class = 'hidden';
}

$remote_path = '/' . rawurldecode( Muut_Post_Utility::getChannelRemotePath( get_the_ID(), true ) );

$tabs = Muut_Admin_Post_Editor::instance()->getMetaBoxTabsForCurrentPostType();
$last_active_tab = get_post_meta( get_the_ID(), 'muut_last_active_tab', true );

$post_type_object = get_post_type_object( get_post_type() );

?>
<div id="muut_metabox_tabs">
	<div class="wp-tab-bar">
		<ul id="muut_metabox_tabs_list" class="category-tabs">
			<?php
			$first_tab = true;
			$active_tab = $last_active_tab;
			foreach( $tabs as $slug => $tab ) {
				$class = '';
				$active_value = '0';
				if ( !Muut_Admin_Post_Editor::instance()->isTabEnabled( $slug, $post->ID ) ) {
					$class .= 'disabled ';
				} else {
					$class .= 'enabled ';
					$active_tab = $tab['name'];
					$active_value = '1';
				}
				if ( ( $last_active_tab && $tab['name'] == $last_active_tab ) || ( !$last_active_tab && $first_tab === true ) ) {
					$class .= ' tabs';
					$first_tab = $slug;
					if ( $post->post_status == 'auto-draft' && $tab['name'] == 'commenting-tab' ) {
						$active_value = '1';
						$active_tab = $tab['name'];
					}
				}
				echo '<li class="' . $class . '" id="muut_tab-' . $tab['name'] . '" data-muut_tab="' . $tab['name'] . '"><a href="#muut_tab_content-' . $tab['name'] . '" class="muut_metabox_tab">' . $tab['label'] . '</a><input type="hidden" class="muut_tab_last_active" name="muut_tab_last_active_' . $tab['name'] . '" value="' . $active_value . '" /></li>';
			}
			?>
		</ul>
		<?php
			foreach( $tabs as $slug => $tab ) {
				$class = 'wp-tab-panel muut-tab-panel ';
				if ( $tab['name'] != $active_tab ) {
					$class .= 'hidden ';
				}
				if ( !Muut_Admin_Post_Editor::instance()->isTabEnabled( $slug, $post->ID ) ) {
					$class .= 'disabled ';
				} else {
					$class .= 'enabled ';
				}
				echo '<div id="muut_tab_content-' . $tab['name'] . '" class="' . $class . '">'; ?>
				<?php
				include ( $tab['template_location'] );
				echo '</div>';
			}
		?>
	</div>
</div>
<div id="muut_tabs_disable_dialog" class="hidden">
	<?php printf( __( 'Enabling this will disable other types of Muut embeds on this %s.', 'muut' ), $post_type_object->labels->singular_name ); ?>
</div>
{'fraction_non_alphanumeric': 0.20742056443655021, 'fraction_numerical': 0.0033550424314189855, 'mean_word_length': 3.5330948121645798, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 65, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4984496', 'n_tokens_mistral': 2187, 'n_tokens_neox': 1904, 'n_words': 355}