<?php 

function plugins_settings_cb() {
	global $plugins;
	?>
	<div class="row">
		<div class="col-md-6">
				<div class="panel">
					<div class="panel-heading">
	                    <h1>Activate/Deactivate Plugins</h1>
	                </div>
	                <div class="panel-body">
	                	<table class="table">
	                		<?php 
		                		$plugins = $plugins->plugins;
								if(_count($plugins) > 0) {
									foreach ($plugins as $plugin) { 
										$ref = (class_exists($plugin)) ? $plugin::$plugin_ref : $plugin;
									    ?>
									    <tr>
									    	<td><?php echo $ref ?></td>
									    	<td>
									    		<?php if (get_option('_is_active_'.$plugin)): ?>
									    			<small><a href="javascript:void(0)" class="ajax-action" data-content="You are about deactivate <?php echo $ref; ?> plugin. Click `continue` to proceed and `cancel` to abort" data-callback="refreshPage" data-action-callback="deactivate_plugin" data-plugin="<?php echo $plugin ?>">Deactivate</a></small>
									    		<?php else: ?>
									    			<small><a href="javascript:void(0)" class="ajax-action" data-content="You are about activate <?php echo $ref; ?> plugin. Click `continue` to proceed and `cancel` to abort" data-callback="refreshPage" data-action-callback="activate_plugin" data-plugin="<?php echo $plugin ?>">Activate</a></small>
									    		<?php endif ?>
									    	</td>
									    </tr>
									    <?php
									}
								}
		                	?>
	                	</table>
	                </div>
				</div>
		</div>
	</div>
	<?php
	global $post_meta;
	add_page_javascript('app/assets/js/page-scripts/js-functions.js');
}