Skip to content

Commit

Permalink
[CS] Code style Tabs must be used to indent lines; round 2 (#19351)
Browse files Browse the repository at this point in the history
* [CS] Code style Tabs must be used to indent lines; round 2

- Tabs must be used to indent lines; spaces are not allowed

* fix some indenting not fixed by the auto fixer

* Fix some more indenting and spacing

* use and/or in template mixed HTML/PHP files

For consistancy, Until a decision is made on joomla/coding-standards#191
use `and`/`or` in template mixed HTML/PHP files rather than our normal
required `&&`/`||` requierment that we have for full PHP files

* Use the && and || operators

preferences to Use the && and || operators
  • Loading branch information
photodude authored and zero-24 committed Feb 8, 2018
1 parent 9ba27e5 commit 30581d3
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 128 deletions.
2 changes: 1 addition & 1 deletion modules/mod_articles_categories/tmpl/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
(<?php echo $item->numitems; ?>)
<?php endif; ?>
</a>
</h<?php echo $params->get('item_heading') + $levelup; ?>>
</h<?php echo $params->get('item_heading') + $levelup; ?>>

<?php if ($params->get('show_description', 0)) : ?>
<?php echo JHtml::_('content.prepare', $item->description, $item->getParams(), 'mod_articles_categories.content'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<?php echo JHtml::_('content.prepare', $item->description, '', 'com_contact.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

<?php if ($this->params->get('show_cat_items_cat') == 1) :?>
<dl><dt>
Expand Down
14 changes: 7 additions & 7 deletions templates/beez3/html/com_contact/category/default_children.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
<?php echo JHtml::_('content.prepare', $child->description, '', 'com_contact.category'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

<?php if ($this->params->get('show_cat_items') == 1) :?>
<dl><dt>
<?php echo JText::_('COM_CONTACT_CAT_NUM'); ?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php if ($this->params->get('show_cat_items') == 1) :?>
<dl><dt>
<?php echo JText::_('COM_CONTACT_CAT_NUM'); ?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0 ) :
<?php if (count($child->getChildren()) > 0 ) :
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
Expand Down
46 changes: 23 additions & 23 deletions templates/beez3/html/com_contact/contact/default_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,30 @@
<div class="control-label"><?php echo $this->form->getLabel('contact_email_copy'); ?></div>
<div class="controls"><?php echo $this->form->getInput('contact_email_copy'); ?></div>
</div>
<?php } ?>
<?php } ?>
<?php //Dynamically load any additional fields from plugins. ?>
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php if ($fieldset->name !== 'contact'):?>
<?php $fields = $this->form->getFieldset($fieldset->name);?>
<?php foreach ($fields as $field) : ?>
<div class="control-group">
<?php if ($field->hidden) : ?>
<div class="controls">
<?php echo $field->input;?>
</div>
<?php else:?>
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !== 'Spacer') : ?>
<span class="optional"><?php echo JText::_('COM_CONTACT_OPTIONAL');?></span>
<?php endif; ?>
</div>
<div class="controls"><?php echo $field->input;?></div>
<?php endif;?>
</div>
<?php endforeach;?>
<?php endif ?>
<?php endforeach;?>
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php if ($fieldset->name !== 'contact'):?>
<?php $fields = $this->form->getFieldset($fieldset->name);?>
<?php foreach ($fields as $field) : ?>
<div class="control-group">
<?php if ($field->hidden) : ?>
<div class="controls">
<?php echo $field->input;?>
</div>
<?php else:?>
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !== 'Spacer') : ?>
<span class="optional"><?php echo JText::_('COM_CONTACT_OPTIONAL');?></span>
<?php endif; ?>
</div>
<div class="controls"><?php echo $field->input;?></div>
<?php endif;?>
</div>
<?php endforeach;?>
<?php endif ?>
<?php endforeach;?>
<div class="form-actions"><button class="btn btn-primary validate" type="submit"><?php echo JText::_('COM_CONTACT_CONTACT_SEND'); ?></button>
<input type="hidden" name="option" value="com_contact" />
<input type="hidden" name="task" value="contact.submit" />
Expand Down
2 changes: 1 addition & 1 deletion templates/beez3/html/com_contact/contact/default_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
?>
<li>
<a href="<?php echo $link; ?>">
<?php echo $label; ?>
<?php echo $label; ?>
</a>
</li>
<?php endforeach; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<?php echo JHtml::_('content.prepare', $item->description); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_num_articles_cat') == 1) :?>
<dl class="article-count"><dt>
<?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?></dt>
Expand Down
12 changes: 6 additions & 6 deletions templates/beez3/html/com_content/category/blog_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@

<?php // to do not that elegant would be nice to group the params ?>

<?php if ($params->get('show_author') or $params->get('show_category') or $params->get('show_create_date') or $params->get('show_modify_date') or $params->get('show_publish_date') or $params->get('show_parent_category') or $params->get('show_hits')) : ?>
<dl class="article-info">
<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
<?php if ($params->get('show_author') || $params->get('show_category') || $params->get('show_create_date') || $params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_parent_category') || $params->get('show_hits')) : ?>
<dl class="article-info">
<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
<?php endif; ?>
<?php if ($params->get('show_parent_category') && $this->item->parent_id != 1) : ?>
<dd class="parent-category-name">
Expand Down Expand Up @@ -115,10 +115,10 @@
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_author') or $params->get('show_category') or $params->get('show_create_date') or $params->get('show_modify_date') or $params->get('show_publish_date') or $params->get('show_parent_category') or $params->get('show_hits')) :?>
</dl>
<?php if ($params->get('show_author') || $params->get('show_category') || $params->get('show_create_date') || $params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_parent_category') || $params->get('show_hits')) :?>
</dl>
<?php endif; ?>
<?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
<?php $imgfloat = empty($images->float_intro) ? $params->get('float_intro') : $images->float_intro; ?>
<div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>">
<img
Expand Down
18 changes: 6 additions & 12 deletions templates/beez3/html/com_content/category/blog_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@
?>

<div class="items-more">
<h3><?php echo JText::_('COM_CONTENT_MORE_ARTICLES'); ?></h3>

<ol>

<?php
foreach ($this->link_items as &$item) :
?>
<li>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>">
<h3><?php echo JText::_('COM_CONTENT_MORE_ARTICLES'); ?></h3>
<ol>
<?php foreach ($this->link_items as &$item) : ?>
<li>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>">
<?php echo $item->title; ?></a>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
</ol>
</div>


11 changes: 3 additions & 8 deletions templates/beez3/html/com_content/category/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@
</div>
<?php endif; ?>


<?php if ($this->params->get('maxLevel') != 0 && is_array($this->children[$this->category->id]) && count($this->children[$this->category->id]) > 0) : ?>
<div class="cat-children">
<div class="cat-children">

<?php if ($showCategoryTitle === true or $pageSubHeading)
{
Expand All @@ -69,7 +68,7 @@
{
echo '<h2>';
} ?>
<?php if ($showCategoryHeadingTitleText === true) : ?>
<?php if ($showCategoryHeadingTitleText === true) : ?>
<?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?>
<?php endif; ?>
<?php if ($showCategoryTitle === true or $pageSubHeading)
Expand All @@ -80,14 +79,10 @@
{
echo '</h2>';
} ?>
</div>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?>


<div class="cat-items">
<?php echo $this->loadTemplate('articles'); ?>
</div>

</section>

42 changes: 20 additions & 22 deletions templates/beez3/html/com_newsfeeds/categories/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,26 @@
JHtml::_('behavior.caption');
?>
<div class="categories-list<?php echo $this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>

<?php if ($this->params->get('show_base_description')) : ?>
<?php //If there is a description in the menu parameters use that; ?>
<?php if ($this->params->get('categories_description')) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare', $this->params->get('categories_description'), '', 'com_newsfeeds.categories'); ?>
</div>
<?php else: ?>
<?php //Otherwise get one from the database if it exists. ?>
<?php if ($this->parent->description) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare', $this->parent->description, '', 'com_newsfeeds.categories'); ?>
<?php if ($this->params->get('show_base_description')) : ?>
<?php // If there is a description in the menu parameters use that. ?>
<?php if ($this->params->get('categories_description')) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare', $this->params->get('categories_description'), '', 'com_newsfeeds.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php
echo $this->loadTemplate('items');
?>
<?php else : ?>
<?php // Otherwise get one from the database if it exists. ?>
<?php if ($this->parent->description) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare', $this->parent->description, '', 'com_newsfeeds.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<?php echo JHtml::_('content.prepare', $item->description, '', 'com_newsfeeds.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items_cat') == 1) :?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items_cat') == 1) : ?>
<dl class="newsfeed-count"><dt>
<?php echo JText::_('COM_NEWSFEEDS_CAT_NUM'); ?></dt>
<dd><?php echo $item->numitems; ?></dd>
Expand Down
16 changes: 8 additions & 8 deletions templates/beez3/html/com_newsfeeds/category/default_children.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
<?php echo $this->escape($child->title); ?></a>
</span>

<?php if ($this->params->get('show_subcat_desc') == 1) :?>
<?php if ($this->params->get('show_subcat_desc') == 1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare', $child->description, '', 'com_newsfeeds.category'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

<?php if ($this->params->get('show_cat_items') == 1) :?>
<dl class="newsfeed-count"><dt>
<?php echo JText::_('COM_NEWSFEEDS_CAT_NUM'); ?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items') == 1) : ?>
<dl class="newsfeed-count"><dt>
<?php echo JText::_('COM_NEWSFEEDS_CAT_NUM'); ?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php endif; ?>

<?php if (count($child->getChildren()) > 0) :
$this->children[$child->id] = $child->getChildren();
Expand Down
42 changes: 20 additions & 22 deletions templates/beez3/html/com_newsfeeds/category/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@
<table class="category">
<?php if ($this->params->get('show_headings') == 1) : ?>
<thead><tr>

<th class="item-title" id="tableOrdering">
<?php echo JHtml::_('grid.sort', 'COM_NEWSFEEDS_FEED_NAME', 'a.name', $listDirn, $listOrder); ?>
</th>


<?php if ($this->params->get('show_articles')) : ?>
<th class="item-num-art" id="tableOrdering2">
<?php echo JHtml::_('grid.sort', 'COM_NEWSFEEDS_NUM_ARTICLES', 'a.numarticles', $listDirn, $listOrder); ?>
Expand All @@ -59,30 +57,30 @@

<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($this->items[$i]->published == 0) : ?>
<tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else: ?>
<tr class="cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>
<?php if ($this->items[$i]->published == 0) : ?>
<tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else: ?>
<tr class="cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>

<td class="item-title">
<a href="<?php echo JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catid)); ?>">
<?php echo $item->name; ?></a>
</td>
<td class="item-title">
<a href="<?php echo JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catid)); ?>">
<?php echo $item->name; ?></a>
</td>

<?php if ($this->params->get('show_articles')) : ?>
<td class="item-num-art">
<?php echo $item->numarticles; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_articles')) : ?>
<td class="item-num-art">
<?php echo $item->numarticles; ?>
</td>
<?php endif; ?>

<?php if ($this->params->get('show_link')) : ?>
<td class="item-link">
<a href="<?php echo $item->link; ?>"><?php echo $item->link; ?></a>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_link')) : ?>
<td class="item-link">
<a href="<?php echo $item->link; ?>"><?php echo $item->link; ?></a>
</td>
<?php endif; ?>

</tr>
</tr>

<?php endforeach; ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php echo JRoute::_(WeblinksHelperRoute::getCategoryRoute($item->id));?>">
<span class="item-title"><a href="<?php echo JRoute::_(WeblinksHelperRoute::getCategoryRoute($item->id)); ?>">
<?php echo $this->escape($item->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) :?>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare', $item->description, '', 'com_weblinks.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_num_links_cat') == 1) :?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_num_links_cat') == 1) : ?>
<dl class="weblink-count"><dt>
<?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt>
<dd><?php echo $item->numitems; ?></dd>
Expand Down
Loading

0 comments on commit 30581d3

Please sign in to comment.