<?php
	defined( 'ABSPATH' ) || exit;

	// registered

	if( mfn_is_registered() ){
		$registered = 'registered';
	} else {
		$registered = 'unregistered';
	}

	// theme support

	$disable = mfn_opts_get('theme-disable');
?>

<?php if( !post_type_exists('template') ){ echo '<div class="mfn-modal modal-small mfn-modal-templates-disabled"> <div style="height: auto;" class="mfn-modalbox mfn-form mfn-shadow-1"> <div class="modalbox-header"> <div class="options-group"> <div class="modalbox-title-group"> <span class="modalbox-icon mfn-icon-be"></span> <div class="modalbox-desc"> <h4 class="modalbox-title">Templates</h4> </div> </div> </div> <div class="options-group"> <a class="mfn-option-btn mfn-option-blank btn-large btn-modal-close" href="#"><span class="mfn-icon mfn-icon-close"></span></a> </div> </div> <div class="modalbox-content"> <p style="text-align: center;">Templates have been disabled in <br><a href="'.admin_url('admin.php?page=be-options#advanced').'" class="mfn-templates-doesnt-exists-link">Theme Options > Global > Advanced > Theme functions</a></p> </div> </div> </div>'; } ?>

<header class="mfn-dashboard-menu">

	<?php
		$logo = '<div class="logo '. $registered .'"></div>';

		if( ! WHITE_LABEL ) {
			echo apply_filters('betheme_logo', $logo);
		}
	?>

	<div class="menu-wrapper">

		<ul class="dashboard-menu">
			<li data-page="dashboard"><a href="admin.php?page=<?php echo apply_filters('betheme_dynamic_slug', 'betheme'); ?>"><span class="mfn-icon mfn-icon-dashboard"></span><?php _e('پیشخوان','mfn-opts'); ?></a></li>
			<li data-page="plugins"><a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-plugins"><span class="mfn-icon mfn-icon-plugins"></span><?php _e('افزونه ها','mfn-opts'); ?></a></li>

			<?php if( ! WHITE_LABEL && ! isset($disable['demo-data']) ): ?>
			<li data-page="websites"><a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-websites"><span class="mfn-icon mfn-icon-websites"></span><?php _e('وب سایت ها','mfn-opts'); ?></a></li>
			<?php endif; ?>

			<li data-page="templates"><a href="edit.php?post_type=template" class="<?php if( !post_type_exists('template') ){ echo 'mfn-templates-doesnt-exists'; } ?>"><span class="mfn-icon mfn-icon-templates"></span><?php _e('قالب ها','mfn-opts'); ?></a></li>

			<li data-page="options"><a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-options"><span class="mfn-icon mfn-icon-theme-options"></span><?php _e('تنظیمات','mfn-opts'); ?></a></li>
			<li>
				<a><span class="mfn-icon mfn-icon-maintenance"></span>در دست ساخت</a>
				<ul>
					<?php if( ! WHITE_LABEL && ! isset($disable['demo-data']) ): ?>
					<li>
						<a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-setup">
							<span class="mfn-icon mfn-icon-setup-wizzard"></span>
							<div class="inner-link">
								<span class="label">نصب آسان</span>
								<span class="desc">کانفیگ سایت</span>
							</div>
						</a>
					</li>
					<?php endif; ?>
					<li data-page="status">
						<a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-status">
							<span class="mfn-icon mfn-icon-system-status"></span>
							<div class="inner-link">
								<span class="label">وضعیت سیستم</span>
								<span class="desc">بررسی وضعیت سیستم</span>
							</div>
						</a>
					</li>
					<?php if( ! WHITE_LABEL && ! apply_filters('betheme_disable_support', false) ): ?>
					<li data-page="support">
						<a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-support">
							<span class="mfn-icon mfn-icon-support"></span>
							<div class="inner-link">
								<span class="label">آموزش اصلی</span>
								<span class="desc">راهنمای اصلی</span>
							</div>
						</a>
					</li>
					<?php endif; ?>
					<?php if( ! WHITE_LABEL && ! apply_filters('betheme_disable_changelog', false) ): ?>
					<li data-page="changelog">
						<a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-changelog">
							<span class="mfn-icon mfn-icon-changelog"></span>
							<div class="inner-link">
								<span class="label">تغییرات</span>
								<span class="desc">تازه چه خبر</span>
							</div>
						</a>
					</li>
					<?php endif; ?>
					<?php if( ! WHITE_LABEL ): ?>
					<li data-page="tools">
						<a href="admin.php?page=<?php echo apply_filters('betheme_slug', 'be'); ?>-tools">
							<span class="mfn-icon mfn-icon-settings"></span>
							<div class="inner-link">
								<span class="label">ابزار</span>
								<span class="desc">سایر ابزار ها</span>
							</div>
						</a>
					</li>
					<?php endif; ?>
				</ul>
			</li>
		</ul>

	</div>

	<?php
		if( ! empty($is_theme_options) ){
			echo '<a class="mfn-option-btn btn-large mfn-option-blank responsive-menu" href="#"><span class="mfn-icon mfn-icon-menu"></span></a>';
		}
	?>

	<a class="mfn-option-btn btn-large mfn-option-blank mfn-color-scheme">
		<i class="icon-moon dark"></i>
		<i class="icon-light-up light"></i>
	</a>

</header>
