Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated Setup Joomla Menu

  • Loading branch information...
commit 9576413edd0cb745d2b35ecba18631b807161c7d 1 parent 8dc595d
@steffans steffans authored
View
10 docs/Warp Themes/01 Getting Started/05 Setup the Joomla Menu.html
@@ -16,15 +16,7 @@ <h1 class="title">Set up the Joomla menu</h1>
<h2>Menu Styles</h2>
-<p>Basically there are two menu styles <em>Mega Drop Down</em> and <em>Accordion</em>. The menu will choose its style automatically depending on what position it is published on. The template's <em>menu</em> position will give you the horizontal <em>Mega Drop Down</em> style, while the <em>sidebar</em> positions will render the menu using the <em>Accordion</em> style.</p>
-
-<h2>Mega Drop Down</h2>
-
-<p>To get the dropdown effect of the main menu, you must set <em>Always Show Submenu Items</em> to <em>Yes</em>.</p>
-
-<h2>Accordion</h2>
-
-<p>To get the accordion effect of the side menus, you must make sure the Level 1 menu item is a <em>Separator Type</em> menu item.</p>
+<p>Basically there are two menu styles <em>Mega Drop Down</em> and <em>Accordion</em>. The menu will choose its style automatically depending on what position it is published on. The template's <em>menu</em> position will give you the horizontal <em>Mega Drop Down</em> style, while the <em>sidebar</em> positions will render the menu using the <em>Accordion</em> style. For the <em>Mega Drop Down</em> used in main menu, you must set in your menu module settings <em>Always Show Submenu Items</em> to <em>Yes</em>. Further to get the accordion effect of the side menus, you must make sure the Level 1 menu item is a <em>Separator Type</em> menu item.</p>
<h2>Menu columns</h2>
View
61 index.php
@@ -1,12 +1,12 @@
<?php
-$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'docs';
+define('ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'docs');
if (isset($_REQUEST['doc']) && !empty($_REQUEST['doc'])) {
- $doc = $dir . '/' . $_REQUEST['doc'];
+ $doc = ROOT . '/' . $_REQUEST['doc'];
- if (($fullpath = realpath($doc)) && file_exists($fullpath) && stripos($fullpath, $dir, 0) === 0) {
+ if (($fullpath = realpath($doc)) && file_exists($fullpath) && stripos($fullpath, ROOT, 0) === 0) {
echo '<link rel="stylesheet" href="assets/css/styles.css">';
echo '<div class="box box-text documentation">';
@@ -19,38 +19,45 @@
} else {
- $iterator = new RecursiveDirectoryIterator($dir);
-
- $renderer = function ($iterator) use (&$renderer, $dir) {
- $html = array();
- foreach ($iterator as $path) {
- if ($path->isDir()) {
- $html[] = "\n<li>";
- $html[] = $path->getBaseName();
- $html[] = '<ul>';
- $html[] = $renderer(new RecursiveDirectoryIterator($path));
- $html[] = '</ul>';
- $html[] = '</li>';
- } else {
- $link = ltrim(preg_replace('/^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', $dir), '/').'/i', '', str_replace(DIRECTORY_SEPARATOR, '/', $path)), '/');
- $html[] = "\n<li>";
- $html[] = '<a href="index.php?doc='.urlencode($link).'">'.$path->getBaseName().'</a>';
- $html[] = '</li>';
- }
- }
- return implode("\n", $html);
- }
-
?>
<h1>Documentation</h1>
<ul class="sections">
- <?php echo $renderer($iterator); ?>
+ <?php
+
+ function ls($path, &$html = array()) {
+
+ foreach (new FilesystemIterator($path, FilesystemIterator::SKIP_DOTS) as $file) {
+
+ if ($file->getFilename() == '.DS_Store') {
+ continue;
+ } elseif ($file->isDir()) {
+ $html[] = "\n<li>";
+ $html[] = $file->getBaseName();
+ $html[] = '<ul>';
+ $html[] = ls($file->getPathname());
+ $html[] = '</ul>';
+ $html[] = '</li>';
+ } else {
+ $link = ltrim(preg_replace('/^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', ROOT), '/').'/i', '', str_replace(DIRECTORY_SEPARATOR, '/', $file)), '/');
+ $html[] = "\n<li>";
+ $html[] = '<a href="index.php?doc='.urlencode($link).'">'.$file->getBaseName().'</a>';
+ $html[] = '</li>';
+ }
+
+ }
+
+ return implode("\n", $html);
+ }
+
+ echo ls(ROOT);
+
+ ?>
</ul>
<?php
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.