[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

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

   1  <?php
   2  /**
   3   * @package        Joomla.Administrator
   4   * @subpackage    com_content
   5   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   6   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   7   */
   8  
   9  // No direct access.
  10  defined('_JEXEC') or die;
  11  
  12  // Include the component HTML helpers.
  13  JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  14  
  15  // Load the tooltip behavior.
  16  JHtml::_('behavior.tooltip');
  17  JHtml::_('behavior.formvalidation');
  18  JHtml::_('behavior.keepalive');
  19  
  20  // Create shortcut to parameters.
  21      $params = $this->state->get('params');
  22  
  23      $params = $params->toArray();
  24  
  25  // This checks if the config options have ever been saved. If they haven't they will fall back to the original settings.
  26  $editoroptions = isset($params['show_publishing_options']);
  27  
  28  if (!$editoroptions):
  29      $params['show_publishing_options'] = '1';
  30      $params['show_article_options'] = '1';
  31      $params['show_urls_images_backend'] = '0';
  32      $params['show_urls_images_frontend'] = '0';
  33  endif;
  34  
  35  // Check if the article uses configuration settings besides global. If so, use them.
  36  if (!empty($this->item->attribs['show_publishing_options'])):
  37          $params['show_publishing_options'] = $this->item->attribs['show_publishing_options'];
  38  endif;
  39  if (!empty($this->item->attribs['show_article_options'])):
  40          $params['show_article_options'] = $this->item->attribs['show_article_options'];
  41  endif;
  42  if (!empty($this->item->attribs['show_urls_images_backend'])):
  43          $params['show_urls_images_backend'] = $this->item->attribs['show_urls_images_backend'];
  44  endif;
  45  
  46  ?>
  47  
  48  <script type="text/javascript">
  49      Joomla.submitbutton = function(task) {
  50          if (task == 'article.cancel' || document.formvalidator.isValid(document.id('item-form'))) {
  51              <?php echo $this->form->getField('articletext')->save(); ?>
  52              Joomla.submitform(task, document.getElementById('item-form'));
  53          } else {
  54              alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
  55          }
  56      }
  57  </script>
  58  
  59  <form action="<?php echo JRoute::_('index.php?option=com_content&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
  60      <div class="width-60 fltlft">
  61          <fieldset class="adminform">
  62              <legend><?php echo empty($this->item->id) ? JText::_('COM_CONTENT_NEW_ARTICLE') : JText::sprintf('COM_CONTENT_EDIT_ARTICLE', $this->item->id); ?></legend>
  63              <ul class="adminformlist">
  64                  <li><?php echo $this->form->getLabel('title'); ?>
  65                  <?php echo $this->form->getInput('title'); ?></li>
  66  
  67                  <li><?php echo $this->form->getLabel('alias'); ?>
  68                  <?php echo $this->form->getInput('alias'); ?></li>
  69  
  70                  <li><?php echo $this->form->getLabel('catid'); ?>
  71                  <?php echo $this->form->getInput('catid'); ?></li>
  72  
  73                  <li><?php echo $this->form->getLabel('state'); ?>
  74                  <?php echo $this->form->getInput('state'); ?></li>
  75  
  76                  <li><?php echo $this->form->getLabel('access'); ?>
  77                  <?php echo $this->form->getInput('access'); ?></li>
  78  
  79                  <?php if ($this->canDo->get('core.admin')): ?>
  80                      <li><span class="faux-label"><?php echo JText::_('JGLOBAL_ACTION_PERMISSIONS_LABEL'); ?></span>
  81                          <div class="button2-left"><div class="blank">
  82                              <button type="button" onclick="document.location.href='#access-rules';">
  83                                  <?php echo JText::_('JGLOBAL_PERMISSIONS_ANCHOR'); ?>
  84                              </button>
  85                          </div></div>
  86                      </li>
  87                  <?php endif; ?>
  88  
  89                  <li><?php echo $this->form->getLabel('featured'); ?>
  90                  <?php echo $this->form->getInput('featured'); ?></li>
  91  
  92                  <li><?php echo $this->form->getLabel('language'); ?>
  93                  <?php echo $this->form->getInput('language'); ?></li>
  94  
  95                  <li><?php echo $this->form->getLabel('id'); ?>
  96                  <?php echo $this->form->getInput('id'); ?></li>
  97              </ul>
  98  
  99              <div class="clr"></div>
 100              <?php echo $this->form->getLabel('articletext'); ?>
 101              <div class="clr"></div>
 102              <?php echo $this->form->getInput('articletext'); ?>
 103          </fieldset>
 104      </div>
 105  
 106      <div class="width-40 fltrt">
 107          <?php echo JHtml::_('sliders.start', 'content-sliders-'.$this->item->id, array('useCookie'=>1)); ?>
 108          <?php // Do not show the publishing options if the edit form is configured not to. ?>
 109          <?php  if ($params['show_publishing_options'] || ( $params['show_publishing_options'] = '' && !empty($editoroptions)) ): ?>
 110              <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_FIELDSET_PUBLISHING'), 'publishing-details'); ?>
 111              <fieldset class="panelform">
 112                  <ul class="adminformlist">
 113                      <li><?php echo $this->form->getLabel('created_by'); ?>
 114                      <?php echo $this->form->getInput('created_by'); ?></li>
 115  
 116                      <li><?php echo $this->form->getLabel('created_by_alias'); ?>
 117                      <?php echo $this->form->getInput('created_by_alias'); ?></li>
 118  
 119                      <li><?php echo $this->form->getLabel('created'); ?>
 120                      <?php echo $this->form->getInput('created'); ?></li>
 121  
 122                      <li><?php echo $this->form->getLabel('publish_up'); ?>
 123                      <?php echo $this->form->getInput('publish_up'); ?></li>
 124  
 125                      <li><?php echo $this->form->getLabel('publish_down'); ?>
 126                      <?php echo $this->form->getInput('publish_down'); ?></li>
 127  
 128                      <?php if ($this->item->modified_by) : ?>
 129                          <li><?php echo $this->form->getLabel('modified_by'); ?>
 130                          <?php echo $this->form->getInput('modified_by'); ?></li>
 131  
 132                          <li><?php echo $this->form->getLabel('modified'); ?>
 133                          <?php echo $this->form->getInput('modified'); ?></li>
 134                      <?php endif; ?>
 135  
 136                      <?php if ($this->item->version) : ?>
 137                          <li><?php echo $this->form->getLabel('version'); ?>
 138                          <?php echo $this->form->getInput('version'); ?></li>
 139                      <?php endif; ?>
 140  
 141                      <?php if ($this->item->hits) : ?>
 142                          <li><?php echo $this->form->getLabel('hits'); ?>
 143                          <?php echo $this->form->getInput('hits'); ?></li>
 144                      <?php endif; ?>
 145                  </ul>
 146              </fieldset>
 147          <?php  endif; ?>
 148          <?php  $fieldSets = $this->form->getFieldsets('attribs'); ?>
 149              <?php foreach ($fieldSets as $name => $fieldSet) : ?>
 150                  <?php // If the parameter says to show the article options or if the parameters have never been set, we will
 151                        // show the article options. ?>
 152  
 153                  <?php if ($params['show_article_options'] || (( $params['show_article_options'] == '' && !empty($editoroptions) ))): ?>
 154                      <?php // Go through all the fieldsets except the configuration and basic-limited, which are
 155                            // handled separately below. ?>
 156  
 157                      <?php if ($name != 'editorConfig' && $name != 'basic-limited') : ?>
 158                          <?php echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name.'-options'); ?>
 159                          <?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
 160                              <p class="tip"><?php echo $this->escape(JText::_($fieldSet->description));?></p>
 161                          <?php endif; ?>
 162                          <fieldset class="panelform">
 163                              <ul class="adminformlist">
 164                              <?php foreach ($this->form->getFieldset($name) as $field) : ?>
 165                                  <li><?php echo $field->label; ?>
 166                                  <?php echo $field->input; ?></li>
 167                              <?php endforeach; ?>
 168                              </ul>
 169                          </fieldset>
 170                      <?php endif ?>
 171                      <?php // If we are not showing the options we need to use the hidden fields so the values are not lost.  ?>
 172                  <?php  elseif ($name == 'basic-limited'): ?>
 173                          <?php foreach ($this->form->getFieldset('basic-limited') as $field) : ?>
 174                              <?php  echo $field->input; ?>
 175                          <?php endforeach; ?>
 176  
 177                  <?php endif; ?>
 178              <?php endforeach; ?>
 179                  <?php // We need to make a separate space for the configuration
 180                        // so that those fields always show to those wih permissions ?>
 181                  <?php if ( $this->canDo->get('core.admin')   ):  ?>
 182                      <?php  echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_SLIDER_EDITOR_CONFIG'), 'configure-sliders'); ?>
 183                          <fieldset  class="panelform" >
 184                              <ul class="adminformlist">
 185                              <?php foreach ($this->form->getFieldset('editorConfig') as $field) : ?>
 186                                  <li><?php echo $field->label; ?>
 187                                  <?php echo $field->input; ?></li>
 188                              <?php endforeach; ?>
 189                              </ul>
 190                          </fieldset>
 191                  <?php endif ?>
 192  
 193          <?php // The url and images fields only show if the configuration is set to allow them.  ?>
 194          <?php // This is for legacy reasons. ?>
 195          <?php if ($params['show_urls_images_backend']): ?>
 196              <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_FIELDSET_URLS_AND_IMAGES'), 'urls_and_images-options'); ?>
 197                  <fieldset class="panelform">
 198                  <ul class="adminformlist">
 199                      <li>
 200                      <?php echo $this->form->getLabel('images'); ?>
 201                      <?php echo $this->form->getInput('images'); ?></li>
 202  
 203                      <?php foreach($this->form->getGroup('images') as $field): ?>
 204                          <li>
 205                              <?php if (!$field->hidden): ?>
 206                                  <?php echo $field->label; ?>
 207                              <?php endif; ?>
 208                              <?php echo $field->input; ?>
 209                          </li>
 210                      <?php endforeach; ?>
 211                          <?php foreach($this->form->getGroup('urls') as $field): ?>
 212                          <li>
 213                              <?php if (!$field->hidden): ?>
 214                                  <?php echo $field->label; ?>
 215                              <?php endif; ?>
 216                              <?php echo $field->input; ?>
 217                          </li>
 218                      <?php endforeach; ?>
 219                  </ul>
 220                  </fieldset>
 221          <?php endif; ?>
 222          <?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_FIELDSET_METADATA_OPTIONS'), 'meta-options'); ?>
 223              <fieldset class="panelform">
 224                  <?php echo $this->loadTemplate('metadata'); ?>
 225  
 226          <?php echo JHtml::_('sliders.end'); ?>
 227      </div>
 228  
 229      <div class="clr"></div>
 230      <?php if ($this->canDo->get('core.admin')): ?>
 231          <div class="width-100 fltlft">
 232              <?php echo JHtml::_('sliders.start', 'permissions-sliders-'.$this->item->id, array('useCookie'=>1)); ?>
 233  
 234                  <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_FIELDSET_RULES'), 'access-rules'); ?>
 235                  <fieldset class="panelform">
 236                      <?php echo $this->form->getLabel('rules'); ?>
 237                      <?php echo $this->form->getInput('rules'); ?>
 238                  </fieldset>
 239  
 240              <?php echo JHtml::_('sliders.end'); ?>
 241          </div>
 242      <?php endif; ?>
 243      <div>
 244          <input type="hidden" name="task" value="" />
 245          <input type="hidden" name="return" value="<?php echo JRequest::getCmd('return');?>" />
 246          <?php echo JHtml::_('form.token'); ?>
 247      </div>
 248  </form>


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1