<br>
<div class="row">
	<div class="col-md-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				Edit Paragraph
			</div>
			<div class="panel-body">
				<?= form_open('questions_answers/edit_paragraph/'); ?>
				<?= hidden_input(array('name' => 'paragraph_id', 'value' => $paragraph->question_resource_ID )); ?>
				<?php 
				if(isset($question_id)){
					echo hidden_input(array('name' => 'question_id', 'value' => $question_id )); 
				}
				?>
				<ul class="nav nav-tabs">
		  			<li class="active"><a data-toggle="tab" href="#tab_paragraph_content_en">English</a></li>
		  			<li><a data-toggle="tab" href="#tab_paragraph_content_hin">Hindi</a></li>
				</ul>
				<div class="tab-content">
					<br>
					<div id="tab_paragraph_content_en" class="tab-pane fade in active">
						<div class="form-group">
							<textarea class="form-control" rows="6" id="paragraph_content_en" name="paragraph_content_en">
								<?= $paragraph->resource_content_en; ?>
							</textarea>
						</div>
					</div>
					<div id="tab_paragraph_content_hin" class="tab-pane fade">
						<div class="form-group">
							<textarea class="form-control" rows="6" id="paragraph_content_hin" name="paragraph_content_hin">
								<?= $paragraph->resource_content_hin; ?>
							</textarea>
						</div>
					</div>
				</div>
				<?= form_submit(array('value'=> 'Save', 'class' => 'btn-success')); ?>
				<?= form_close(); ?>
				<?php
				if(isset($question_id)) {
					echo form_open('questions_answers/edit');
					echo hidden_input(array('name' => 'edit_id', 'value' => $question_id));
					echo form_submit(array('value'=> 'Cancel', 'class' => 'btn-primary'));
					echo form_close();
				} else {
				?>
				<a href="<?= base_url('questions_answers/create'); ?>" style="margin-left: 15px;" class="btn btn-sm btn-primary pull-right">
					Cancel
				</a>
				<?php
				}
				?>
				
			</div>
		</div>
	</div>
</div>
<script>
	//<![CDATA[
    (function($){
    	$('document').ready(function(){
    		var ckeditor_toolbar_config = [
    			{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
				{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
				{ name: 'forms', groups: [ 'forms' ] },
				{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
				{ name: 'insert', groups: [ 'insert' ] },
				{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
				{ name: 'tools', groups: [ 'tools' ] },
				{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
				{ name: 'links', groups: [ 'links' ] },
				{ name: 'styles', groups: [ 'styles' ] },
				{ name: 'colors', groups: [ 'colors' ] },
				{ name: 'about', groups: [ 'about' ] },
				{ name: 'others', groups: [ 'others' ] }
    		];

    		var remove_buttons = 'Save,NewPage,Preview,Print,Templates,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Link,Unlink,Anchor,PageBreak,Iframe,ShowBlocks,About,Image';

    		var editors = ['paragraph_content_en','paragraph_content_hin'];
    		$.each(editors, function(id, editor){
    			CKEDITOR.replace( editor, { toolbarGroups: ckeditor_toolbar_config, removeButtons: remove_buttons });
    		});    
    		
    	});
    })(jQuery);
//]]>
</script>