Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First batch of module tmpl codestyle #17851

Closed
wants to merge 17 commits into from
Closed

Conversation

zero-24
Copy link
Contributor

@zero-24 zero-24 commented Sep 3, 2017

Summary of Changes

First batch of module tmpl codestyle

Testing Instructions

Please test and review the following frontend modules using the testing sampledata

  • mod_articles_archive
  • mod_articles_categories
  • mod_articles_category
  • mod_articles_latest
  • mod_articles_news
  • mod_articles_popular
  • mod_banners
  • mod_breadcrumbs
  • mod_custom

Expected result

Still works

Actual result

Works with codestyle problems

Documentation Changes Required

none

title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8'); ?>">
<img
src="<?php echo $baseurl . $imageurl; ?>"
alt="<?php echo $alt;?>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space before ?>". Do the same for the following 2 lines.

title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8'); ?>">
<img
src="<?php echo $baseurl . $imageurl; ?>"
alt="<?php echo $alt;?>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space before ?>". Do the same for the following 2 lines.

<img
src="<?php echo $baseurl . $imageurl; ?>"
alt="<?php echo $alt;?>"
<?php if (!empty($width)) echo ' width="' . $width . '"';?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space before ?>". Do the same for the following 2 lines.

<?php if (isset($item->link) && $item->readmore != 0 && $params->get('readmore')) : ?>
<?php echo '<a class="readmore" href="' . $item->link . '">' . $item->linkText . '</a>'; ?>
<a class="readmore" href="'<?php echo $item->link; ?>'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ' before and after the php code

loop="false"
pluginspage="http://www.macromedia.com/go/get/flashplayer"
type="application/x-shockwave-flash"
<?php if (!empty($width)) echo ' width="' . $width . '"';?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space before ?>. Do the same below.

<?php // Just display the image if no link specified ?>
<img
src="<?php echo $baseurl . $imageurl; ?>"
alt="<?php echo $alt;?>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space before ?>". Do the same for the following 2 lines.

@dgrammatiko
Copy link
Contributor

@zero-24 you're killing us, do it in J4...

<?php if (($key !== $penult_item_key) || $show_last) : ?>
<span class="divider">
<?php echo $separator; ?>
</span>
<?php endif; ?>
<meta itemprop="position" content="<?php echo $key + 1; ?>">
<meta itemprop="position" content="<?php echo $key + 1; ?>" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have added a closing / here but this is not required for html5

@mbabker
Copy link
Contributor

mbabker commented Sep 3, 2017

you're killing us, do it in J4...

It'd actually be better if the code style were consistent across branches. If you're making massive code style changes in only one branch you're making even more merge conflict issues as time goes on.

@zero-24
Copy link
Contributor Author

zero-24 commented Sep 3, 2017

It'd actually be better if the code style were consistent across branches. If you're making massive code style changes in only one branch you're making even more merge conflict issues as time goes on.

So what is your suggestion? Doing it against staging or 4.0?

@mbabker
Copy link
Contributor

mbabker commented Sep 3, 2017

Keep going against staging. In theory there should only be one merge that has major conflicts, every merge after that should only deal with lines changed between the two branches.


<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id)); ?>">
<?php echo $item->title; ?>
<?php if ($params->get('numitems')) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 18-20: Remove tab

<?php echo $readmore; ?>
<?php echo JHtml::_('string.truncate', $item->title, $params->get('readmore_limit')); ?>
<?php if ($params->get('show_readmore_title', 0) != 0) : ?>
<?php echo JHtml::_('string.truncate', $this->item->title, $params->get('readmore_limit')); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 66-68: Don't indent?

<?php endif; ?>
<?php if ($params->get('show_readmore')) : ?>
<p class="mod-articles-category-readmore">
<a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm can you please doube check that? Looks good to me?

</span>
<?php endif; ?>
<?php if ($item->displayDate) : ?>
<span class="mod-articles-category-date"><?php echo $item->displayDate; ?></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines.


?>
<div class="custom<?php echo $moduleclass_sfx; ?>" <?php if ($params->get('backgroundimage')) : ?> style="background-image:url(<?php echo $params->get('backgroundimage'); ?>)"<?php endif; ?> >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space > >

@@ -9,29 +9,29 @@

defined('_JEXEC') or die;

foreach ($list as $item) : ?>
?>
<?php foreach ($list as $item) : ?>
<li <?php if ($_SERVER['REQUEST_URI'] === JRoute::_(ContentHelperRoute::getCategoryRoute($item->id))) echo ' class="active"'; ?>> <?php $levelup = $item->level - $startLevel - 1; ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space after <li .
Move the second <?php next line.

<?php if ($params->get('show_readmore')) : ?>
<p class="mod-articles-category-readmore">
<li>
<div class="mod-articles-category-group"><?php echo $group_name; ?></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines?

@@ -10,13 +10,13 @@
defined('_JEXEC') or die;
?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add blank line above.

Is it possible to add lines when editing a file using Github web interface?

@Quy
Copy link
Contributor

Quy commented Sep 16, 2017

I have tested this item ✅ successfully on d46f2c1

Code review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17851.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants