<?php
define("WP_ADMIN", true);
// Call WP Load
$wp_include = "../wp-load.php";$i = 0;
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
if ( !is_user_logged_in() || !current_user_can('edit_posts') ) 
	wp_die(__("You are not allowed to be here","cloudfw"));

if ( !is_user_logged_in() || !current_user_can('edit_posts') ) 
	wp_die(__("You are not allowed to be here"));


$icon_list = cloudfw_get_icons();
	
	echo '<div id="icon-box-title">
		Icon List <span id="icon-box-append"></span>
		<a class="icon-box-icons" style="display:none;" id="icon-box-back" href="#"></a>
		<a class="icon-box-icons" id="icon-box-close" href="#"></a>
	</div>
	<div id="icon-box-content">
	';

foreach((array)$icon_list as $icon_cat_name => $icon_cat) {
	
	echo '
	<div class="icon-loop">
	<a href="#" class="icon-cat-title">'.$icon_cat_name.'</a>';
	echo '<ul class="grouped">';
	
	foreach((array)$icon_cat as $icon_url => $icon_name) {
	
		echo '<li>';
			echo '
			<a href="#" class="the-icon" data-id="'.$icon_url.'">
				<div><img src="'.cloudfw_make_icon_url($icon_url).'" alt="'.$icon_name.'" /></div>
			</a>';
		echo '</li>';
		//echo "[icon src=\"{$icon_url}\"]<br/>";
			
	}
	
	echo '</ul></div>';

}
	echo '</div>';

?>