<div class="white_container">
		
		<h2 style="margin-bottom:20px;"><i class="fa fa-cog"></i><span> <?php echo Lang::get('admin.site_settings'); ?></span></h2>
		<form method="POST" action="<?php echo URL::to('admin/') . '/update_settings'; ?>" id="media-form" accept-charset="UTF-8" file="1" enctype="multipart/form-data">
			<ul>
				<li>
					<label for="website_name"><?php echo Lang::get('admin.website_name'); ?>:</label>
					<?php echo Form::text('website_name', $settings->website_name, array('class'=>'form-control')); ?>
				</li>

				<li>
					<label for="website_description"><?php echo Lang::get('admin.website_description'); ?>:</label>
					<?php echo Form::text('website_description', $settings->website_description, array('class'=>'form-control')); ?>
				</li>

				<li>
					<label for="logo"><?php echo Lang::get('admin.logo'); ?>:</label>
					<img src="<?php echo URL::to('/') . '/' . $settings->logo; ?>" width="200" />
					<input type="file" name="logo" id="logo" style="margin-top:10px;" />
				</li>

				<li>
					<label for="favicon"><?php echo Lang::get('admin.favicon'); ?>:</label>
					<img src="<?php echo URL::to('/') . '/' . $settings->favicon; ?>" width="16px" />
					<input type="file" name="favicon" id="favicon" style="margin-top:10px;" />
				</li>

				<li>
					<label for="color_scheme"><?php echo Lang::get('admin.color_scheme'); ?>:</label>
					<?php if(!isset($settings->color_scheme)): ?>
						<?php $settings->color_scheme = ''; ?>
					<?php endif; ?>
					<?php echo Form::select('color_scheme', array('light' => 'light', 'dark' => 'dark'), $settings->color_scheme); ?>
				</li>

				<li>
					<?php if(isset($settings->primary_color)): ?><?php $primary_color = $settings->primary_color ?><?php else: ?><?php $primary_color = ''; ?><?php endif; ?>
					<label for="primary_color"><?php echo Lang::get('admin.primary_color'); ?>:</label>
					<?php echo Form::text('primary_color', $primary_color, array('class'=>'form-control', 'id' => 'primary_color',  'style'=> 'width:110px;')); ?>
				</li>

				<li>
					<?php if(isset($settings->secondary_color)): ?><?php $secondary_color = $settings->secondary_color ?><?php else: ?><?php $secondary_color = ''; ?><?php endif; ?>
					<label for="secondary_color"><?php echo Lang::get('admin.secondary_color'); ?>:</label>
					<?php echo Form::text('secondary_color', $secondary_color, array('class'=>'form-control', 'id' => 'secondary_color',  'style'=> 'width:110px;')); ?>
				</li>

				<li>
					<label for="like_icon"><?php echo Lang::get('admin.like_icon'); ?>:</label>
					<?php if(!isset($settings->like_icon)): ?>
						<?php $settings->like_icon = ''; ?>
					<?php endif; ?>
					<?php echo Form::select('like_icon', array('fa-thumbs-o-up' => 'Thumbs Up', 'fa-star' => 'Star', 'fa-heart' => 'Heart', 'fa-sun-o' => 'Sun', 'fa-smile-o' => 'Smile', 'fa-check' => 'Checkmark'), $settings->like_icon); ?>
				</li>

				<li>
					<?php if(isset($settings->fb_key)): ?><?php $fb_key = $settings->fb_key ?><?php else: ?><?php $fb_key = ''; ?><?php endif; ?>
					<label for="fb_key"><?php echo Lang::get('admin.fb_app_key'); ?>:</label>
					<?php echo Form::text('fb_key', $fb_key, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->fb_secret_key)): ?><?php $fb_secret_key = $settings->fb_secret_key ?><?php else: ?><?php $fb_secret_key = ''; ?><?php endif; ?>
					<label for="fb_secret_key"><?php echo Lang::get('admin.fb_app_secret'); ?>:</label>
					<?php echo Form::text('fb_secret_key', $fb_secret_key, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->facebook_page_id)): ?><?php $facebook_page_id = $settings->facebook_page_id ?><?php else: ?><?php $facebook_page_id = ''; ?><?php endif; ?>
					<label for="facebook_page_id"><?php echo Lang::get('admin.fb_page_id'); ?>:</label>
					<?php echo Form::text('facebook_page_id', $facebook_page_id, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->google_key)): ?><?php $google_key = $settings->google_key ?><?php else: ?><?php $google_key = ''; ?><?php endif; ?>
					<label for="google_key"><?php echo Lang::get('admin.google_oauth_key'); ?>:</label>
					<?php echo Form::text('google_key', $google_key, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->google_secret_key)): ?><?php $google_secret_key = $settings->google_secret_key ?><?php else: ?><?php $google_secret_key = ''; ?><?php endif; ?>
					<label for="google_secret_key"><?php echo Lang::get('admin.google_secret_key'); ?>:</label>
					<?php echo Form::text('google_secret_key', $google_secret_key, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->google_page_id)): ?><?php $google_page_id = $settings->google_page_id ?><?php else: ?><?php $google_page_id = ''; ?><?php endif; ?>
					<label for="google_page_id"><?php echo Lang::get('admin.google_page_id'); ?>:</label>
					<?php echo Form::text('google_page_id', $google_page_id, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->twitter_page_id)): ?><?php $twitter_page_id = $settings->twitter_page_id ?><?php else: ?><?php $twitter_page_id = ''; ?><?php endif; ?>
					<label for="twitter_page_id"><?php echo Lang::get('admin.twitter_username'); ?>:</label>
					<?php echo Form::text('twitter_page_id', $twitter_page_id, array('class'=>'form-control')); ?>
				</li>

				<li>
					<label for="auto_approve_posts"><?php echo Lang::get('admin.auto_approve_posts'); ?>:</label>

					<?php if(isset($settings->auto_approve_posts)): ?><?php $auto_approve = $settings->auto_approve_posts ?><?php else: ?><?php $auto_approve = 1 ?><?php endif; ?>	
					<div class="onoffswitch">
						<?php echo Form::checkbox('auto_approve_posts', '', $auto_approve, array('class' => 'onoffswitch-checkbox', 'id' => 'auto_approve_posts')); ?>					   
					    <label class="onoffswitch-label" for="auto_approve_posts">
					        <div class="onoffswitch-inner"></div>
					        <div class="onoffswitch-switch"></div>
					    </label>
					</div>

				</li>

				<li>
					<label for="user_registration"><?php echo Lang::get('admin.allow_user_register'); ?>:</label>

					<?php if(isset($settings->user_registration)): ?><?php $user_registration = $settings->user_registration ?><?php else: ?><?php $user_registration = 1 ?><?php endif; ?>
					<div class="onoffswitch">
						<?php echo Form::checkbox('user_registration', '', $user_registration, array('class' => 'onoffswitch-checkbox', 'id' => 'user_registration')); ?>					   
					    <label class="onoffswitch-label" for="user_registration">
					        <div class="onoffswitch-inner"></div>
					        <div class="onoffswitch-switch"></div>
					    </label>
					</div>
				</li>

				<li>
					<label for="infinite_scroll"><?php echo Lang::get('admin.enable_infinite_scr'); ?>:</label>

					<?php if(isset($settings->infinite_scroll)): ?><?php $infinite_scroll = $settings->infinite_scroll ?><?php else: ?><?php $infinite_scroll = 1 ?><?php endif; ?>
					<div class="onoffswitch">
						<?php echo Form::checkbox('infinite_scroll', '', $infinite_scroll, array('class' => 'onoffswitch-checkbox', 'id' => 'infinite_scroll')); ?>					   
					    <label class="onoffswitch-label" for="infinite_scroll">
					        <div class="onoffswitch-inner"></div>
					        <div class="onoffswitch-switch"></div>
					    </label>
					</div>
				</li>

				<li>
					<label for="random_bar_enabled"><?php echo Lang::get('admin.random_bar_enabled'); ?>:</label>

					<?php if(isset($settings->random_bar_enabled)): ?><?php $random_bar_enabled = $settings->random_bar_enabled ?><?php else: ?><?php $random_bar_enabled = 1 ?><?php endif; ?>
					<div class="onoffswitch">
						<?php echo Form::checkbox('random_bar_enabled', '', $random_bar_enabled, array('class' => 'onoffswitch-checkbox', 'id' => 'random_bar_enabled')); ?>					   
					    <label class="onoffswitch-label" for="random_bar_enabled">
					        <div class="onoffswitch-inner"></div>
					        <div class="onoffswitch-switch"></div>
					    </label>
					</div>
				</li>

				<li>
					<label for="media_description"><?php echo Lang::get('admin.media_description'); ?>:</label>

					<?php if(isset($settings->media_description)): ?><?php $media_description = $settings->media_description ?><?php else: ?><?php $media_description = 1 ?><?php endif; ?>
					<div class="onoffswitch">
						<?php echo Form::checkbox('media_description', '', $media_description, array('class' => 'onoffswitch-checkbox', 'id' => 'media_description')); ?>					   
					    <label class="onoffswitch-label" for="media_description">
					        <div class="onoffswitch-inner"></div>
					        <div class="onoffswitch-switch"></div>
					    </label>
					</div>
				</li>


				<li>
					<label for="enable_watermark"><?php echo Lang::get('admin.enable_watermark'); ?>:</label>

					<?php if(isset($settings->enable_watermark)): ?><?php $enable_watermark = $settings->enable_watermark ?><?php else: ?><?php $enable_watermark = 1 ?><?php endif; ?>
					<div class="onoffswitch">
						<?php echo Form::checkbox('enable_watermark', '', $enable_watermark, array('class' => 'onoffswitch-checkbox', 'id' => 'enable_watermark')); ?>					   
					    <label class="onoffswitch-label" for="enable_watermark">
					        <div class="onoffswitch-inner"></div>
					        <div class="onoffswitch-switch"></div>
					    </label>
					</div>
					<div class="enable_watermark_info" <?php if(isset($settings->enable_watermark) && $settings->enable_watermark == 1): ?> style="display:block" <?php endif; ?>>
						<div class="image">
							<label for="watermark_image"><?php echo Lang::get('admin.watermark'); ?>:</label>
							<img src="<?php echo URL::to('/') . '/' . $settings->watermark_image; ?>" width="auto" />
							<input type="file" name="watermark_image" id="watermark_image" style="margin-top:10px;" />
						</div>
						<div class="position">
							<label for="watermark_position"><?php echo Lang::get('admin.watermark_position'); ?>:</label>
							<?php if(!isset($settings->watermark_position)): ?>
								<?php $settings->watermark_position = 'bottom-right'; ?>
							<?php endif; ?>
							<?php echo Form::select('watermark_position', array('top-left' => 'Top Left', 'top-center' => 'Top Center', 'top-right' => 'Top Right', 'left' => 'Left', 'center' => 'Center', 'right' => 'Right', 'bottom-left' => 'Bottom Left', 'bottom' => 'Bottom', 'bottom-right' => 'Bottom Right'), $settings->watermark_position); ?>
						</div>

						<div class="clear" style="padding-top:20px;"></div>
						<label for="watermark_offset_x"><?php echo Lang::get('admin.watermark_offset_x'); ?>:</label>
						<?php echo Form::text('watermark_offset_x', $settings->watermark_offset_x, array('class'=>'form-control')); ?>

						<label for="watermark_offset_y"><?php echo Lang::get('admin.watermark_offset_y'); ?>:</label>
						<?php echo Form::text('watermark_offset_y', $settings->watermark_offset_y, array('class'=>'form-control')); ?>
						<div class="clear"></div>
					</div>
				</li>


				<li>
					<?php if(isset($settings->square_ad)): ?><?php $square_ad = $settings->square_ad ?><?php else: ?><?php $square_ad = ''; ?><?php endif; ?>
					<label for="square_ad"><?php echo Lang::get('admin.sidebar_advertisement'); ?>:</label>
					<?php echo Form::textarea('square_ad', $square_ad, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->inbetween_ads)): ?><?php $inbetween_ads = $settings->inbetween_ads ?><?php else: ?><?php $inbetween_ads = ''; ?><?php endif; ?>
					<label for="inbetween_ads"><?php echo Lang::get('admin.inbetween_ads'); ?>:</label>
					<?php echo Form::textarea('inbetween_ads', $inbetween_ads, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->inbetween_ads_repeat)): ?><?php $inbetween_ads_repeat = $settings->inbetween_ads_repeat ?><?php else: ?><?php $inbetween_ads_repeat = ''; ?><?php endif; ?>
					<label for="inbetween_ads_repeat"><?php echo Lang::get('admin.inbetween_ads_repeat'); ?>:</label>
					<?php echo Form::text('inbetween_ads_repeat', $inbetween_ads_repeat, array('class'=>'form-control')); ?>
				</li>

				<li>
					<?php if(isset($settings->analytics)): ?><?php $analytics = $settings->analytics ?><?php else: ?><?php $analytics = ''; ?><?php endif; ?>
					<label for="analytics"><?php echo Lang::get('admin.analytics_code'); ?>:</label>
					<?php echo Form::textarea('analytics', $analytics, array('class'=>'form-control')); ?>
				</li>


				<li style="min-height:45px">
					<input type="submit" class="btn btn-color pull-right" value="<?php echo Lang::get('admin.update_settings'); ?>" />
				</li>
				<div style="clear:both"></div>
			</ul>
		</form>
</div>

<script type="text/javascript" src="<?php echo URL::asset('assets/js/jquery-minicolors/jquery.minicolors.js'); ?>"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('input#primary_color, input#secondary_color').minicolors();

		$('#enable_watermark').change(function(){
			$('.enable_watermark_info').slideToggle();
		});
	});
</script>

