PageRenderTime 53ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/wafl/html/com_content/article/form.php

https://github.com/DanielTichy/plagat.com
PHP | 196 lines | 160 code | 32 blank | 4 comment | 12 complexity | a7b14684a6d92827764fc86ba9fa0141 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-3-Clause, AGPL-1.0, MIT
  1. <?php // @version: $Id$
  2. defined('_JEXEC') or die('Restricted access');
  3. ?>
  4. <script language="javascript" type="text/javascript">
  5. <!--
  6. function setgood() {
  7. // TODO: Put setGood back
  8. return true;
  9. }
  10. var sectioncategories = new Array;
  11. <?php
  12. $i = 0;
  13. foreach ($this->lists['sectioncategories'] as $k=>$items) {
  14. foreach ($items as $v) {
  15. echo "sectioncategories[".$i++."] = new Array( '$k','".addslashes( $v->id )."','".addslashes( $v->title )."' );\n\t\t";
  16. }
  17. }
  18. ?>
  19. function submitbutton(pressbutton) {
  20. var form = document.adminForm;
  21. if (pressbutton == 'cancel') {
  22. submitform( pressbutton );
  23. return;
  24. }
  25. try {
  26. form.onsubmit();
  27. } catch(e) {
  28. alert(e);
  29. }
  30. // do field validation
  31. var text = <?php echo $this->editor->getContent( 'text' ); ?>
  32. if (form.title.value == '') {
  33. return alert ( "<?php echo JText::_( 'Article must have a title', true ); ?>" );
  34. } else if (text == '') {
  35. return alert ( "<?php echo JText::_( 'Article must have some text', true ); ?>");
  36. } else if (parseInt('<?php echo $this->article->sectionid;?>')) {
  37. // for articles
  38. if (form.catid && getSelectedValue('adminForm','catid') < 1) {
  39. return alert ( "<?php echo JText::_( 'Please select a category', true ); ?>" );
  40. }
  41. }
  42. <?php echo $this->editor->save( 'text' ); ?>
  43. submitform(pressbutton);
  44. }
  45. //-->
  46. </script>
  47. <form action="<?php echo $this->action ?>" method="post" name="adminForm" onSubmit="setgood();" class="editor">
  48. <fieldset>
  49. <legend><?php echo JText::_('Editor'); ?></legend>
  50. <div>
  51. <label for="title">
  52. <?php echo JText::_( 'Title' ); ?>:
  53. </label>
  54. <input class="inputbox" type="text" id="title" name="title" style="width:100%;" value="<?php echo $this->escape($this->article->title); ?>" />
  55. </div>
  56. <div class="save">
  57. <button type="button" onclick="submitbutton('save')">
  58. <?php echo JText::_('Save') ?>
  59. </button>
  60. <button type="button" onclick="submitbutton('cancel')" />
  61. <?php echo JText::_('Cancel') ?>
  62. </button>
  63. </div>
  64. <div class="wrap">&nbsp;</div>
  65. <?php
  66. echo $this->editor->display('text', $this->article->text, '100%', '400', '70', '15');
  67. ?>
  68. </fieldset>
  69. <fieldset class="publishing">
  70. <legend><?php echo JText::_('Publishing'); ?></legend>
  71. <div>
  72. <label for="sectionid">
  73. <?php echo JText::_( 'Section' ); ?>:
  74. </label>
  75. <?php echo $this->lists['sectionid']; ?>
  76. </div>
  77. <div class="wrap">&nbsp;</div>
  78. <div>
  79. <label for="catid">
  80. <?php echo JText::_( 'Category' ); ?>:
  81. </label>
  82. <?php echo $this->lists['catid']; ?>
  83. </div>
  84. <div class="wrap">&nbsp;</div>
  85. <?php if ($this->user->authorize('com_content', 'publish', 'content', 'all')) : ?>
  86. <div class="radio">
  87. <label for="state" >
  88. <span><?php echo JText::_( 'Published' ); ?>:</span>
  89. </label>
  90. <?php echo $this->lists['state']; ?>
  91. </div>
  92. <?php endif; ?>
  93. <div class="radio">
  94. <label for="frontpage">
  95. <span><?php echo JText::_( 'Show on Front Page' ); ?>:</span>
  96. </label>
  97. <?php echo $this->lists['frontpage']; ?>
  98. </div>
  99. <div class="wrap">&nbsp;</div>
  100. <div>
  101. <label for="created_by_alias">
  102. <?php echo JText::_( 'Author Alias' ); ?>:
  103. </label>
  104. <input type="text" id="created_by_alias" name="created_by_alias" style="width:100%;" value="<?php echo $this->article->created_by_alias; ?>" class="inputbox" />
  105. </div>
  106. <div class="wrap">&nbsp;</div>
  107. <div>
  108. <label for="publish_up">
  109. <?php echo JText::_( 'Start Publishing' ); ?>:
  110. </label>
  111. <?php echo JHTML::_('calendar', $this->article->publish_up, 'publish_up', 'publish_up', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25', 'maxlength'=>'19')); ?>
  112. </div>
  113. <div class="wrap">&nbsp;</div>
  114. <div>
  115. <label for="publish_down">
  116. <?php echo JText::_( 'Finish Publishing' ); ?>:
  117. </label>
  118. <?php echo JHTML::_('calendar', $this->article->publish_down, 'publish_down', 'publish_down', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25', 'maxlength'=>'19')); ?>
  119. </div>
  120. <div class="wrap">&nbsp;</div>
  121. <div>
  122. <label for="access">
  123. <?php echo JText::_( 'Access Level' ); ?>:
  124. </label>
  125. <?php echo $this->lists['access']; ?>
  126. </div>
  127. <div class="wrap">&nbsp;</div>
  128. <div>
  129. <label for="ordering">
  130. <?php echo JText::_( 'Ordering' ); ?>:
  131. </label>
  132. <?php echo $this->lists['ordering']; ?>
  133. </div>
  134. <div class="wrap">&nbsp;</div>
  135. </fieldset>
  136. <fieldset class="metadata">
  137. <legend><?php echo JText::_('Metadata'); ?></legend>
  138. <label for="metadesc">
  139. <?php echo JText::_( 'Description' ); ?>:
  140. </label>
  141. <textarea rows="5" cols="50" style="width:100%; height:120px" class="inputbox" id="metadesc" name="metadesc"><?php echo str_replace('&','&amp;',$this->article->metadesc); ?></textarea>
  142. <label for="metakey">
  143. <?php echo JText::_( 'Keywords' ); ?>:
  144. </label>
  145. <textarea rows="5" cols="50" style="width:100%; height:50px" class="inputbox" id="metakey" name="metakey"><?php echo str_replace('&','&amp;',$this->article->metakey); ?></textarea>
  146. </fieldset>
  147. <div class="save">
  148. <button type="button" onclick="submitbutton('save')">
  149. <?php echo JText::_('Save') ?>
  150. </button>
  151. <button type="button" onclick="submitbutton('cancel')" />
  152. <?php echo JText::_('Cancel') ?>
  153. </button>
  154. </div>
  155. <input type="hidden" name="option" value="com_content" />
  156. <input type="hidden" name="Returnid" value="<?php echo $this->returnid; ?>" />
  157. <input type="hidden" name="id" value="<?php echo $this->article->id; ?>" />
  158. <input type="hidden" name="version" value="<?php echo $this->article->version; ?>" />
  159. <input type="hidden" name="created_by" value="<?php echo $this->article->created_by; ?>" />
  160. <input type="hidden" name="referer" value="<?php echo @$_SERVER['HTTP_REFERER']; ?>" />
  161. <input type="hidden" name="task" value="" />
  162. <?php echo JHTML::_( 'form.token' ); ?>
  163. </form>
  164. <?php echo JHTML::_('behavior.keepalive'); ?>