-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Third batch of module tmpl codestyle #17855
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6498dce
some clean up and rewrite
zero-24 2dcbfa8
thanks @quy
zero-24 90aef02
Remove space (#31)
2a8715b
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 5b0ca4c
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 8274231
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 8a93827
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 2a9a73a
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 2161be1
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 965f6d2
Merge branch 'modules#3' of github.com:zero-24/joomla-cms into modules#3
zero-24 b4e742d
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 aa7dc12
Merge branch 'staging' of github.com:joomla/joomla-cms into modules#3
zero-24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,83 +19,49 @@ | |
// The menu class is deprecated. Use nav instead | ||
?> | ||
<ul class="nav menu<?php echo $class_sfx; ?>"<?php echo $id; ?>> | ||
<?php foreach ($list as $i => &$item) | ||
{ | ||
$class = 'item-' . $item->id; | ||
|
||
if ($item->id == $default_id) | ||
{ | ||
$class .= ' default'; | ||
} | ||
|
||
if ($item->id == $active_id || ($item->type === 'alias' && $item->params->get('aliasoptions') == $active_id)) | ||
{ | ||
$class .= ' current'; | ||
} | ||
|
||
if (in_array($item->id, $path)) | ||
{ | ||
$class .= ' active'; | ||
} | ||
elseif ($item->type === 'alias') | ||
{ | ||
$aliasToId = $item->params->get('aliasoptions'); | ||
|
||
if (count($path) > 0 && $aliasToId == $path[count($path) - 1]) | ||
{ | ||
$class .= ' active'; | ||
} | ||
elseif (in_array($aliasToId, $path)) | ||
{ | ||
$class .= ' alias-parent-active'; | ||
} | ||
} | ||
|
||
if ($item->type === 'separator') | ||
{ | ||
$class .= ' divider'; | ||
} | ||
|
||
if ($item->deeper) | ||
{ | ||
$class .= ' deeper'; | ||
} | ||
|
||
if ($item->parent) | ||
{ | ||
$class .= ' parent'; | ||
} | ||
|
||
echo '<li class="' . $class . '">'; | ||
|
||
switch ($item->type) : | ||
case 'separator': | ||
case 'component': | ||
case 'heading': | ||
case 'url': | ||
require JModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type); | ||
break; | ||
|
||
default: | ||
require JModuleHelper::getLayoutPath('mod_menu', 'default_url'); | ||
break; | ||
endswitch; | ||
|
||
// The next item is deeper. | ||
if ($item->deeper) | ||
{ | ||
echo '<ul class="nav-child unstyled small">'; | ||
} | ||
// The next item is shallower. | ||
elseif ($item->shallower) | ||
{ | ||
echo '</li>'; | ||
echo str_repeat('</ul></li>', $item->level_diff); | ||
} | ||
// The next item is on the same level. | ||
else | ||
{ | ||
echo '</li>'; | ||
} | ||
} | ||
?></ul> | ||
<?php foreach ($list as $i => &$item) : ?> | ||
<?php $class = 'item-' . $item->id; ?> | ||
<?php if ($item->id == $default_id) : ?> | ||
<?php $class .= ' default'; ?> | ||
<?php endif; ?> | ||
<?php if ($item->id == $active_id || ($item->type === 'alias' && $item->params->get('aliasoptions') == $active_id)) : ?> | ||
<?php $class .= ' current'; ?> | ||
<?php endif; ?> | ||
<?php if (in_array($item->id, $path)) : ?> | ||
<?php $class .= ' active'; ?> | ||
<?php elseif ($item->type === 'alias') : ?> | ||
<?php $aliasToId = $item->params->get('aliasoptions'); ?> | ||
<?php if (count($path) > 0 && $aliasToId == $path[count($path) - 1]) : ?> | ||
<?php $class .= ' active'; ?> | ||
<?php elseif (in_array($aliasToId, $path)) : ?> | ||
<?php $class .= ' alias-parent-active'; ?> | ||
<?php endif; ?> | ||
<?php endif; ?> | ||
<?php if ($item->type === 'separator') : ?> | ||
<?php $class .= ' divider'; ?> | ||
<?php endif; ?> | ||
<?php if ($item->deeper) : ?> | ||
<?php $class .= ' deeper'; ?> | ||
<?php endif; ?> | ||
<?php if ($item->parent) : ?> | ||
<?php $class .= ' parent'; ?> | ||
<?php endif; ?> | ||
<li class=" <?php echo $class; ?>"> | ||
<?php if (in_array($item->type, array('separator', 'component', 'heading', 'url'))) : ?> | ||
<?php require JModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type); ?> | ||
<?php else : ?> | ||
<?php require JModuleHelper::getLayoutPath('mod_menu', 'default_url'); ?> | ||
<?php endif; ?> | ||
<?php // The next item is deeper. ?> | ||
<?php if ($item->deeper) : ?> | ||
<?php echo '<ul class="nav-child unstyled small">'; ?> | ||
<?php elseif ($item->shallower) : ?> | ||
<?php // The next item is shallower. ?> | ||
<?php echo '</li>'; ?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use HTML only |
||
<?php echo str_repeat('</ul></li>', $item->level_diff); ?> | ||
<?php else : ?> | ||
<?php // The next item is on the same level. ?> | ||
<?php echo '</li>'; ?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use HTML only |
||
<?php endif; ?> | ||
<?php endforeach; ?> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use HTML only