/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. <form method="post" action="<?php echo $this->uri->uri_string(); ?>" class="default">
  2. <h1 class="headingleft">Add
  3. <?php echo ($type == 'css' || $type == 'js') ? 'File' : 'Include'; ?>
  4. <?php
  5. if ($type == 'C') $typeLink = 'css';
  6. elseif ($type == 'J') $typeLink = 'js';
  7. else $typeLink = '';
  8. ?>
  9. <small>(<a href="/admin/pages/includes/<?php echo $typeLink; ?>">Back to Includes</a>)</small>
  10. </h1>
  11. <div class="headingright">
  12. <input type="submit" value="Save Changes" class="button" />
  13. </div>
  14. <div class="clear"></div>
  15. <?php if ($errors = validation_errors()): ?>
  16. <div class="error">
  17. <?php echo $errors; ?>
  18. </div>
  19. <?php endif; ?>
  20. <?php if ($type == 'css'): ?>
  21. <label for="includeRef">Filename:</label>
  22. <?php echo @form_input('includeRef',set_value('includeRef', $data['includeRef']), 'id="includeRef" class="formelement"'); ?>
  23. <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" />
  24. <?php echo @form_hidden('type', 'C'); ?>
  25. <?php elseif ($type == 'js'): ?>
  26. <label for="includeRef">Filename:</label>
  27. <?php echo @form_input('includeRef',set_value('includeRef', $data['includeRef']), 'id="includeRef" class="formelement"'); ?>
  28. <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" />
  29. <?php echo @form_hidden('type', 'J'); ?>
  30. <?php else: ?>
  31. <label for="includeRef">Reference:</label>
  32. <?php echo @form_input('includeRef',set_value('includeRef', $data['includeRef']), 'id="includeRef" class="formelement"'); ?>
  33. <span class="tip">To access this include just use {include:REFERENCE} in your template.</span><br class="clear" />
  34. <?php echo @form_hidden('type', 'H'); ?>
  35. <?php endif; ?>
  36. <div class="autosave">
  37. <label for="body">Markup:</label>
  38. <?php echo @form_textarea('body',set_value('body', $data['body']), 'id="body" class="code editor"'); ?>
  39. <br class="clear" />
  40. </div>
  41. <p class="clear" style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
  42. </form>