if(div.style.display == '') div.style.display = 'none'; if(div.style.display == 'none'){ div.style.display = 'block'; label.innerHTML = 'Hide'; }else{ div.style.display = 'none'; label.innerHTML = 'Show'; } } </script> <?php if (isset($_POST['saveMemSet']) && isset($_POST['category'])) { saveMemSettings(); } echo ContentBlockHead("Membership settings"); echo displayOptions(); echo ContentBlockFoot(); echo ContentBlockHead("Manage Membership Types"); echo membershipList(); echo ContentBlockFoot(); switch ($_GET['edit']) { case 'pricing': echo membershipPricing($_GET['edit_level']); break; case 'actions': echo membershipActions($_GET['edit_level']); } BottomCode();
<p class="xx-subtitle">This is the patchwork view which doesn't include the markup preview and usage examples. This view is particularly useful for device testing because it shows elements at full-width, presented on the page as they would appear on the site.</p> <div class="global-nav deluxe xx-nav"> <ul class="inline-items"> <li><a href="http://alistapart.com">Home</a></li> <li><a href="/">View with code examples</a></li> <li><a href="https://github.com/alistapart/pattern-library">Github Repo</a></li> </ul> <form action="" method="post" id="pattern" class="pattern-jump"> <select name="section" id="pattern-select" class="nav-section-select"> <option value="">Jump to…</option> <?php displayOptions($patternsPath); ?> </select> <input type="hidden" name="uri" value="<?php echo $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; ?> "> <button type="submit" id="pattern-submit">Go</button> </form> </div> <main role="main"> <?php displayPatchwork($patternsPath);
function displayOptions($dir) { global $patternsPath; global $styleguidePath; $ffs = scandir($dir); foreach ($ffs as $ff) { if ($ff != '.' && $ff != '..') { $fName = basename($ff, '.html'); $fPlain = ucwords(str_replace('-', '. ', $fName)); $pathToFile = str_replace($patternsPath, '', $dir); if (is_dir($dir . '/' . $ff)) { // If main section if ($fName == 'article') { echo "<optgroup label=\"" . $fPlain . "\"/>\n"; } else { echo " <option value=\"#" . $fName . "\">" . $fPlain . "</option>\n"; } } else { // If sub section if (pathinfo($ff, PATHINFO_EXTENSION) == 'html' && $ff != 'foot.html') { // Skip non-HTML files echo " <option value=\"#" . $fName . "\">    " . $fName . "</option>\n"; } } if (is_dir($dir . '/' . $ff)) { displayOptions($dir . '/' . $ff); } if (is_dir($dir . '/' . $ff)) { // If main section if ($fName == 'article') { echo "</optgroup>\n"; } } } } }