<?php 

function edit_roles_cb() {
	$roles = get_option('user_roles');
	$capabilities = get_system_capabilities($roles);
	$selectOption = array();
	if(_count($capabilities)) {
		foreach ($capabilities as $key => $value) {
			$selectOption[str_replace('_', ' ', $value)] = $value;
		}
	}
	global $post_meta;
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	?>
	<div class="row">
		<div class="col-md-8">
			<div class="panel">
				<div class="panel-heading">
					<h1 class="">User Roles</h1>
				</div>
				<div class="panel-body">
					<form id="edit_roles_form" method="post">
						<?php 
							if(_count($roles)) {
								foreach ($roles as $key => $value) {
									select(['label' => get_role_name($key), 'id' => $key, 'name' => 'roles['.$key.'][]', 'multiple' => 'multiple'], $selectOption, $value);
								}
							}
							alert(); submit_btn("edit_roles", "<i class=\"fas fa-save\"></i> Save");
						 ?>
					</form>
				</div>
			</div>
		</div>
	</div>
	<?php
}