function view_GET(Web &$w) { $p = $w->pathMatch("m", "a"); // first see if we need to split into sub modules $module = $p['m']; $action = $p['a']; // check if help is allowed for this topic if (!$w->Auth->allowed($p['m'] . '/' . $p['a'])) { $w->ctx("help_content", "Sorry, there is no help for this topic."); } $submodule = ""; // check for submodule if (strcontains($p['m'], array("-"))) { $ms = explode("-", $p['m']); $module = $ms[0]; $submodule = $ms[1]; } // find a module toc $tocf = getHelpFileContent($w, $module, null, $module . "_toc"); if ($tocf) { $w->ctx("module_toc", $module . '/' . $module . "_toc"); $w->ctx("module_title", HelpLib::extractTitle($tocf)); } // load help file $help_file = HelpLib::getHelpFilePath($w, $module, $submodule, $action); $content = "Sorry, this help topic is not yet written."; if (file_exists($help_file)) { $content = file_get_contents($help_file); } // set context $w->ctx("help_content", helpMarkup(pruneRestricted($w, $content), $module)); $w->ctx("module", $module); $w->ctx("submodule", $submodule); $w->ctx("action", $action); }
<ul class="menu"> <li><a href="index.php?view=shop&show=additem" class="item">Add item</a></li> <li><a href="index.php?view=shop&show=edititem" class="item">Edit item</a></li> </ul> </li> <?php } ?> </ul> </div> <div class="clear"></div> </div> <div id="nav-right"> <div class="nav-divider"> </div> <?php if (strcontains($_SESSION['user_permissions'], "user")) { ?> <a href="index.php?view=users"><img src="images/forms/nav_myaccount.gif" width="67" height="14" title="Accounts" alt="Accounts" /></a> <?php } ?> <a href="index.php?logout"><img src="images/forms/nav_logout.gif" width="64" height="14" alt="Logout" /></a> <div class="clear"> </div> </div> </div> </div> <?php } else { header('Location: index.php'); }