-
-
Couldn't load subscription status.
- Fork 3.7k
[6.1] New backend Joomla! Help page #46355
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
Open
ceford
wants to merge
15
commits into
joomla:6.1-dev
Choose a base branch
from
ceford:helptoc
base: 6.1-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+575
−423
Open
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c40e2e1
New Joomla! Help page
ceford e900ced
Fixed code style issues
ceford c916c1f
Corrected case in use statement
ceford 4389fed
Added suggested changes and changed menu order.
ceford ce6507b
Changes admin-hlp.js as suggested
ceford 659dc53
Updated javascript and styles.
ceford 981a310
Merge branch '6.1-dev' into helptoc
richard67 2949e75
Moved inline styles to css
ceford 34e85b7
Fixed spacing in admin-help.css
ceford 1f91630
Set build helpurl minor version to 0. Fixed css syntax.
ceford 2914721
Revert changes helpurl minor version.
ceford c866a7f
Updated frame title, created help/en-GB/index.html.
ceford b3e8657
Adjusted padding-inline-end of item links.
ceford 523c037
Set css margin before color.
ceford 007b0bb
Removed class from toc-build.php, revised js and css.
ceford 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 hidden or 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 hidden or 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 hidden or 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
103 changes: 103 additions & 0 deletions
103
administrator/components/com_admin/tmpl/help/toc-build.php
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @package Joomla.Administrator | ||
| * @subpackage com_admin | ||
| * | ||
| * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> | ||
richard67 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| namespace Joomla\Component\Admin\Administrator\View\Help; | ||
|
|
||
| use Joomla\CMS\Help\Help; | ||
| use Joomla\CMS\Language\Text; | ||
|
|
||
| // phpcs:disable PSR1.Files.SideEffects | ||
| \defined('_JEXEC') or die; | ||
| // phpcs:enable PSR1.Files.SideEffects | ||
|
|
||
| class Toc | ||
| { | ||
| /** | ||
| * The id of each ul submenu - incremented for each. | ||
| * | ||
| * @var int | ||
| */ | ||
| protected $tocid = 1000; | ||
|
|
||
| /** | ||
| * The level of menu / submenu items. | ||
| * | ||
| * @var int | ||
| */ | ||
| protected $toclevel = 1; | ||
|
|
||
| /** | ||
| * The id of each li that contains a sub menu | ||
| * | ||
| * @var int | ||
| */ | ||
| protected $liid = 0; | ||
|
|
||
| /** | ||
| * Method to get the table of contents | ||
| * | ||
| * @return array Table of contents | ||
| */ | ||
| public function &getToc() | ||
| { | ||
| require __DIR__ . '/toc-src.php'; | ||
| $html = $this->buildMenu($menu, true); | ||
| return $html; | ||
| } | ||
|
|
||
| protected function buildMenu(array $items, $pass = false): string | ||
| { | ||
| // don't set a ul on the first pass | ||
| if ($pass) { | ||
| $html = ""; | ||
| } else { | ||
| $this->tocid += 1; | ||
| // Increase the toclevel on entry | ||
| $this->toclevel += 1; | ||
| if ($this->toclevel > 1) { | ||
| $collapse = ' mm-collapse'; | ||
| } else { | ||
| $collapse = ''; | ||
| } | ||
| $html = "<ul id=\"collapse{$this->tocid}\" class=\"collapse-level-1{$collapse}\">\n"; | ||
| } | ||
| foreach ($items as $label => $value) { | ||
| $text = Text::_('COM_ADMIN_HELP_' . $label); | ||
| $lclabel = strtolower(str_replace('_', '-', $label)); | ||
| $this->liid += 1; | ||
| // Numeric keys mean leaf items (not headings) | ||
| if (is_array($value)) { | ||
| $icon = "<span class=\"icon-folder icon-fw\" aria-hidden=\"true\"></span>"; | ||
| $wrap_label = "<span class=\"item-title\">{$text}</span>"; | ||
| $html .= "<li id=\"li{$this->liid}\" class=\"item parent item-level-{$this->toclevel}\">"; | ||
| $html .= "<a href=\"#\" class=\"has-arrow\">"; | ||
| $html .= "{$icon}{$wrap_label}</a>\n"; | ||
| if (!empty($value)) { | ||
| $html .= $this->buildMenu($value); // Recursively build sublist | ||
| } | ||
| $html .= "</li>\n"; | ||
| } else { | ||
| $icon = "<span class=\"icon-file-alt icon-fw\" aria-hidden=\"true\"></span>"; | ||
| // The label is help.joomla.org help key. | ||
| $url = Help::createUrl($label); | ||
| $link = "<a data-id=\"{$lclabel}\" href=\"{$url}\" target=\"helpFrame\">{$icon}{$text}</a>\n"; | ||
| $html .= "<li class=\"item item-level-{$this->toclevel}\">{$link}</li>\n"; | ||
| } | ||
| } | ||
| // don't set a ul on the first pass | ||
| if ($pass) { | ||
| } else { | ||
| $html .= "</ul>\n"; | ||
| } | ||
| // On return decrease the toclevel | ||
| $this->toclevel -= 1; | ||
| return $html; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.