PageRenderTime 22ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/halogy/application/modules/pages/views/admin/add_include.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 60 lines | 42 code | 18 blank | 0 comment | 11 complexity | f3ae62bc47c20a88c70e4c867bb83850 MD5 | raw file
 1
 2<form method="post" action="<?php echo $this->uri->uri_string(); ?>" class="default">
 3
 4	<h1 class="headingleft">Add 
 5		<?php echo ($type == 'css' || $type == 'js') ? 'File' : 'Include'; ?>
 6		<?php
 7			if ($type == 'C') $typeLink = 'css';
 8			elseif ($type == 'J') $typeLink = 'js';
 9			else $typeLink = '';
10		?>
11		<small>(<a href="/admin/pages/includes/<?php echo $typeLink; ?>">Back to Includes</a>)</small>
12	</h1>
13
14	<div class="headingright">
15		<input type="submit" value="Save Changes" class="button" />
16	</div>
17	
18	<div class="clear"></div>	
19
20	<?php if ($errors = validation_errors()): ?>
21		<div class="error">
22			<?php echo $errors; ?>
23		</div>
24	<?php endif; ?>
25
26<?php if ($type == 'css'): ?>
27
28	<label for="includeRef">Filename:</label>
29	<?php echo @form_input('includeRef',set_value('includeRef', $data['includeRef']), 'id="includeRef" class="formelement"'); ?>
30	<span class="tip">Your file will be found at &ldquo;/css/filename.css&rdquo; (make sure you use the '.css' extension).</span><br class="clear" />
31
32	<?php echo @form_hidden('type', 'C'); ?>
33
34<?php elseif ($type == 'js'): ?>
35
36	<label for="includeRef">Filename:</label>
37	<?php echo @form_input('includeRef',set_value('includeRef', $data['includeRef']), 'id="includeRef" class="formelement"'); ?>
38	<span class="tip">Your file will be found at &ldquo;/js/filename.js&rdquo; (make sure you use the '.js' extension).</span><br class="clear" />
39
40	<?php echo @form_hidden('type', 'J'); ?>
41
42<?php else: ?>
43
44	<label for="includeRef">Reference:</label>
45	<?php echo @form_input('includeRef',set_value('includeRef', $data['includeRef']), 'id="includeRef" class="formelement"'); ?>
46	<span class="tip">To access this include just use {include:REFERENCE} in your template.</span><br class="clear" />
47
48	<?php echo @form_hidden('type', 'H'); ?>
49
50<?php endif; ?>
51
52	<div class="autosave">
53		<label for="body">Markup:</label>	
54		<?php echo @form_textarea('body',set_value('body', $data['body']), 'id="body" class="code editor"'); ?>
55		<br class="clear" />
56	</div>
57		
58	<p class="clear" style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
59	
60</form>