[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/components/com_content/views/article/tmpl/ -> form.php (source)

   1  <?php // no direct access
   2  defined('_JEXEC') or die('Restricted access');
   3  
   4  $config =& JFactory::getConfig();
   5  $publish_up =& JFactory::getDate($this->article->publish_up);
   6  $publish_up->setOffset($config->getValue('config.offset'));
   7  $publish_up = $publish_up->toFormat();
   8  
   9  if (! isset($this->article->publish_down) || $this->article->publish_down == 'Never') {
  10      $publish_down = JText::_('Never');
  11  } else {
  12      $publish_down =& JFactory::getDate($this->article->publish_down);
  13      $publish_down->setOffset($config->getValue('config.offset'));
  14      $publish_down = $publish_down->toFormat();
  15  }
  16  ?>
  17  
  18  <script language="javascript" type="text/javascript">
  19  <!--
  20  function setgood() {
  21      // TODO: Put setGood back
  22      return true;
  23  }
  24  
  25  var sectioncategories = new Array;
  26  <?php
  27  $i = 0;
  28  foreach ($this->lists['sectioncategories'] as $k=>$items) {
  29      foreach ($items as $v) {
  30          echo "sectioncategories[".$i++."] = new Array( '$k','".addslashes( $v->id )."','".addslashes( $v->title )."' );\n\t\t";
  31      }
  32  }
  33  ?>
  34  
  35  
  36  function submitbutton(pressbutton) {
  37      var form = document.adminForm;
  38      if (pressbutton == 'cancel') {
  39          submitform( pressbutton );
  40          return;
  41      }
  42      try {
  43          form.onsubmit();
  44      } catch(e) {
  45          alert(e);
  46      }
  47  
  48      // do field validation
  49      var text = <?php echo $this->editor->getContent( 'text' ); ?>
  50      if (form.title.value == '') {
  51          return alert ( "<?php echo JText::_( 'Article must have a title', true ); ?>" );
  52      } else if (text == '') {
  53          return alert ( "<?php echo JText::_( 'Article must have some text', true ); ?>");
  54      } else if (parseInt('<?php echo $this->article->sectionid;?>')) {
  55          // for articles
  56          if (form.catid && getSelectedValue('adminForm','catid') < 1) {
  57              return alert ( "<?php echo JText::_( 'Please select a category', true ); ?>" );
  58          }
  59      }
  60      <?php echo $this->editor->save( 'text' ); ?>
  61      submitform(pressbutton);
  62  }
  63  //-->
  64  </script>
  65  <?php if ($this->params->get('show_page_title', 1)) : ?>
  66  <div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>"><?php echo $this->escape($this->params->get('page_title')); ?></div>
  67  <?php endif; ?>
  68  <form action="<?php echo $this->action ?>" method="post" name="adminForm" onSubmit="setgood();">
  69  <fieldset>
  70  <legend><?php echo JText::_('Editor'); ?></legend>
  71  <table class="adminform" width="100%">
  72  <tr>
  73      <td>
  74          <div style="float: left;">
  75              <label for="title">
  76                  <?php echo JText::_( 'Title' ); ?>:
  77              </label>
  78              <input class="inputbox" type="text" id="title" name="title" size="50" maxlength="100" value="<?php echo $this->escape($this->article->title); ?>" />
  79              <input class="inputbox" type="hidden" id="alias" name="alias" value="<?php echo $this->escape($this->article->alias); ?>" />
  80          </div>
  81          <div style="float: right;">
  82              <button type="button" onclick="submitbutton('save')">
  83                  <?php echo JText::_('Save') ?>
  84              </button>
  85              <button type="button" onclick="submitbutton('cancel')">
  86                  <?php echo JText::_('Cancel') ?>
  87              </button>
  88          </div>
  89      </td>
  90  </tr>
  91  </table>
  92  
  93  <?php
  94  echo $this->editor->display('text', $this->article->text, '100%', '400', '70', '15');
  95  ?>
  96  </fieldset>
  97  <fieldset>
  98  <legend><?php echo JText::_('Publishing'); ?></legend>
  99  <table class="adminform">
 100  <tr>
 101      <td class="key">
 102          <label for="sectionid">
 103              <?php echo JText::_( 'Section' ); ?>:
 104          </label>
 105      </td>
 106      <td>
 107          <?php echo $this->lists['sectionid']; ?>
 108      </td>
 109  </tr>
 110  <tr>
 111      <td class="key">
 112          <label for="catid">
 113              <?php echo JText::_( 'Category' ); ?>:
 114          </label>
 115      </td>
 116      <td>
 117          <?php echo $this->lists['catid']; ?>
 118      </td>
 119  </tr>
 120  <?php if ($this->user->authorize('com_content', 'publish', 'content', 'all')) : ?>
 121  <tr>
 122      <td class="key">
 123          <label for="state">
 124              <?php echo JText::_( 'Published' ); ?>:
 125          </label>
 126      </td>
 127      <td>
 128          <?php echo $this->lists['state']; ?>
 129      </td>
 130  </tr>
 131  <?php endif; ?>
 132  <tr>
 133      <td width="120" class="key">
 134          <label for="frontpage">
 135              <?php echo JText::_( 'Show on Front Page' ); ?>:
 136          </label>
 137      </td>
 138      <td>
 139          <?php echo $this->lists['frontpage']; ?>
 140      </td>
 141  </tr>
 142  <tr>
 143      <td class="key">
 144          <label for="created_by_alias">
 145              <?php echo JText::_( 'Author Alias' ); ?>:
 146          </label>
 147      </td>
 148      <td>
 149          <input type="text" id="created_by_alias" name="created_by_alias" size="50" maxlength="100" value="<?php echo $this->escape($this->article->created_by_alias); ?>" class="inputbox" />
 150      </td>
 151  </tr>
 152  <tr>
 153      <td class="key">
 154          <label for="publish_up">
 155              <?php echo JText::_( 'Start Publishing' ); ?>:
 156          </label>
 157      </td>
 158      <td>
 159          <?php echo JHTML::_('calendar', $publish_up, 'publish_up', 'publish_up', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25',  'maxlength'=>'19')); ?>
 160      </td>
 161  </tr>
 162  <tr>
 163      <td class="key">
 164          <label for="publish_down">
 165              <?php echo JText::_( 'Finish Publishing' ); ?>:
 166          </label>
 167      </td>
 168      <td>
 169          <?php echo JHTML::_('calendar', $publish_down, 'publish_down', 'publish_down', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25',  'maxlength'=>'19')); ?>
 170      </td>
 171  </tr>
 172  <tr>
 173      <td valign="top" class="key">
 174          <label for="access">
 175              <?php echo JText::_( 'Access Level' ); ?>:
 176          </label>
 177      </td>
 178      <td>
 179          <?php echo $this->lists['access']; ?>
 180      </td>
 181  </tr>
 182  <tr>
 183      <td class="key">
 184          <label for="ordering">
 185              <?php echo JText::_( 'Ordering' ); ?>:
 186          </label>
 187      </td>
 188      <td>
 189          <?php echo $this->lists['ordering']; ?>
 190      </td>
 191  </tr>
 192  </table>
 193  </fieldset>
 194  
 195  <fieldset>
 196  <legend><?php echo JText::_('Metadata'); ?></legend>
 197  <table class="adminform">
 198  <tr>
 199      <td valign="top" class="key">
 200          <label for="metadesc">
 201              <?php echo JText::_( 'Description' ); ?>:
 202          </label>
 203      </td>
 204      <td>
 205          <textarea rows="5" cols="50" style="width:500px; height:120px" class="inputbox" id="metadesc" name="metadesc"><?php echo str_replace('&','&amp;',$this->article->metadesc); ?></textarea>
 206      </td>
 207  </tr>
 208  <tr>
 209      <td  valign="top" class="key">
 210          <label for="metakey">
 211              <?php echo JText::_( 'Keywords' ); ?>:
 212          </label>
 213      </td>
 214      <td>
 215          <textarea rows="5" cols="50" style="width:500px; height:50px" class="inputbox" id="metakey" name="metakey"><?php echo str_replace('&','&amp;',$this->article->metakey); ?></textarea>
 216      </td>
 217  </tr>
 218  </table>
 219  </fieldset>
 220  
 221  <input type="hidden" name="option" value="com_content" />
 222  <input type="hidden" name="id" value="<?php echo $this->article->id; ?>" />
 223  <input type="hidden" name="version" value="<?php echo $this->article->version; ?>" />
 224  <input type="hidden" name="created_by" value="<?php echo $this->article->created_by; ?>" />
 225  <input type="hidden" name="referer" value="<?php echo str_replace(array('"', '<', '>', "'"), '', @$_SERVER['HTTP_REFERER']); ?>" />
 226  <?php echo JHTML::_( 'form.token' ); ?>
 227  <input type="hidden" name="task" value="" />
 228  </form>
 229  <?php echo JHTML::_('behavior.keepalive'); ?>


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1