<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$title_content_form = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('themeoption/newsletter_form/title_content_form', \Magento\Store\Model\ScopeInterface::SCOPE_STORE );
$content_form = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('themeoption/newsletter_form/content_form', \Magento\Store\Model\ScopeInterface::SCOPE_STORE );
$add_newsletter_image = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('themeoption/newsletter_form/add_newsletter_image', \Magento\Store\Model\ScopeInterface::SCOPE_STORE );
$imagelogoUrl = "";
if($add_newsletter_image){
	$folderName = \Rokanthemes\Themeoption\Model\Config\Newsletterformimages::UPLOAD_DIR;
	$path = $folderName . '/' .$add_newsletter_image;
	$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
	$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
	$imagelogoUrl = $storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).$path;
}
?>
<div class="section block-newsletter-form">
	<div class="container">
		<div class="block newsletter newsletter-form"> 
			<?php
				if($add_newsletter_image != ''){ 
					?>
					<img src="<?php echo $imagelogoUrl ?>" alt="Images Newsletter">
			<?php }		
			?>
			<?php if($title_content_form && $title_content_form != '' || $content_form && $content_form != ''): ?>
				<div class="rokan-title">
					<?php if($title_content_form && $title_content_form != ''): ?>
						<h3 class="module-title">
							<?= $title_content_form;?>
						</h3>
					<?php endif; ?> 
					<?php if($content_form && $content_form != ''): ?>
						<p class="short-des rokan-description">
							<?= $content_form;?>
						</p>
					<?php endif; ?> 
				</div>
			<?php endif; ?> 
			<div class="content">
				<form class="form subscribe"
					novalidate
					action="<?php /* @escapeNotVerified */ echo $block->getFormActionUrl() ?>"
					method="post"
					data-mage-init='{"validation": {"errorClass": "mage-error"}}'
					id="newsletter-validate-detail">
					<div class="field newsletter">
						<label class="label" for="newsletter"><span><?php /* @escapeNotVerified */ echo __('Sign Up for Our Newsletter:') ?></span></label>
						<div class="control">
							<div class="input-focus">
								<input name="email" type="email" id="newsletter"
											placeholder="<?php /* @escapeNotVerified */ echo __('Enter your email') ?>"
											data-validate="{required:true, 'validate-email':true}"/>
							</div>	
							 <div class="actions">
								<button class="action subscribe primary" title="<?php /* @escapeNotVerified */ echo __('Subscribe') ?>" type="submit">
									<span><?php /* @escapeNotVerified */ echo __('Subscribe') ?></span>
								</button>
							</div>
						</div>
					</div>
				   
				</form>
			</div>
		</div>
	</div>
</div>
