/halogy/application/modules/images/views/admin/edit.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 74 lines · 62 code · 12 blank · 0 comment · 2 complexity · d5dfe995305fc224ebd599f7d6d61b5f MD5 · raw file

  1. <?php if ($errors = validation_errors()): ?>
  2. <div class="error clear">
  3. <?php echo $errors; ?>
  4. </div>
  5. <?php endif; ?>
  6. <div style="float: right;">
  7. <?php
  8. $image = $this->uploads->load_image($data['imageRef']);
  9. $thumb = $this->uploads->load_image($data['imageRef'], true);
  10. $imagePath = $image['src'];
  11. $imageThumbPath = $thumb['src'];
  12. ?>
  13. <?php echo ($thumb = display_image($imageThumbPath, $data['imageName'], 100, 'class="pic" ')) ? $thumb : display_image($imagePath, $data['imageName'], 100, 'class="pic"'); ?>
  14. </div>
  15. <form method="post" action="<?php echo $this->uri->uri_string(); ?>" enctype="multipart/form-data" class="default" style="width: 450px; float: left;">
  16. <label for="image">Image:</label>
  17. <div class="uploadfile">
  18. <?php echo @form_upload('image', '', 'size="16" id="image"'); ?>
  19. </div>
  20. <br class="clear" />
  21. <label for="folderID">Folder: <small>[<a href="/admin/images/folders" onclick="return confirm('You will lose any unsaved changes.\n\nContinue anyway?')">update</a>]</small></label>
  22. <?php
  23. $options[0] = 'No Folder';
  24. if ($folders):
  25. foreach ($folders as $folderID):
  26. $options[$folderID['folderID']] = $folderID['folderName'];
  27. endforeach;
  28. endif;
  29. echo @form_dropdown('folderID',$options,set_value('folderID', $data['folderID']),'id="folderID" class="formelement"');
  30. ?>
  31. <br class="clear" />
  32. <label for="imageName">Description:</label>
  33. <?php echo @form_input('imageName', $data['imageName'], 'class="formelement" id="imageName"'); ?>
  34. <br class="clear" />
  35. <label for="imageRef">Reference:</label>
  36. <?php echo @form_input('imageRef', $data['imageRef'], 'class="formelement" id="imageRef"'); ?>
  37. <br class="clear" />
  38. <label for="class">Display:</label>
  39. <?php
  40. $values = array(
  41. 'default' => 'Default',
  42. 'left' => 'Left Align',
  43. 'center' => 'Center Align',
  44. 'right' => 'Right Align',
  45. 'bordered' => 'Border',
  46. 'bordered left' => 'Border - Left Align',
  47. 'bordered center' => 'Border - Center Align',
  48. 'bordered right' => 'Border - Right Align',
  49. 'full' => 'Full Width',
  50. '' => 'No Style'
  51. );
  52. echo @form_dropdown('class',$values,$data['class'], 'class="formelement"');
  53. ?>
  54. <br class="clear" />
  55. <label for="maxsize">Max Size (px):</label>
  56. <?php echo @form_input('maxsize', set_value('maxsize', (($data['maxsize']) ? $data['maxsize'] : '')), 'class="formelement" id="maxsize"'); ?>
  57. <br class="clear" /><br />
  58. <input type="submit" value="Save Changes" class="button nolabel" id="submit" />
  59. <a href="<?php echo $this->session->userdata('lastPage'); ?>" class="button cancel grey">Cancel</a>
  60. <br class="clear" />
  61. </form>
  62. <br class="clear" />