/** * Creates a link documentation help link for a given menu section. If * section has no help assigned or section is null link to main help is * returned. * * @param OA_Admin_Menu_Section $menuSection menu section to find help for * @return string url to documentation page */ function getHelpLink($menuSection) { if ($menuSection != null) { $relativeHelpPath = $menuSection->getHelpLink(); } else { $relativeHelpPath = ""; } // The link is not relative, we directly link to it if (strpos($relativeHelpPath, '://') !== false) { return $relativeHelpPath; } // Convert original help links to new Revive Adserver format if (strpos($relativeHelpPath, 'settings') !== false) { if (strpos($relativeHelpPath, '/') !== 0) { $relativeHelpPath = '/admin/' . $relativeHelpPath; } else { $relativeHelpPath = '/admin' . $relativeHelpPath; } } else { if (strpos($relativeHelpPath, '/') !== 0) { $relativeHelpPath = '/user/' . $relativeHelpPath; } else { $relativeHelpPath = '/user' . $relativeHelpPath; } } return OA_Admin_Help::buildHelpLink($relativeHelpPath); }
/** * Creates a link documentation help link for a given menu section. If section has no help assigned or section is null * link to main help is returned * * @param OA_Admin_Menu_Section $menuSection menu section to find help for * @return string url to documentation page */ function getHelpLink($menuSection) { if ($menuSection != null) { $relativeHelpPath = $menuSection->getHelpLink(); } else { $relativeHelpPath = ""; } return OA_Admin_Help::buildHelpLink($relativeHelpPath); }
/** * Need to do checks manually, PHP fails on circular references between * section and its parent * * @param OA_Admin_Menu_Section $section1 * @param OA_Admin_Menu_Section $section2 */ function assertSectionsEqual($section1, $section2) { $this->assertEqual($section1->getId(), $section2->getId()); $this->assertEqual($section1->getName(), $section2->getName()); $this->assertEqual($section1->getLink(array()), $section2->getLink(array())); $this->assertEqual($section1->getHelpLink(), $section2->getHelpLink()); $this->assertEqual($section1->getRank(), $section2->getRank()); $this->assertEqual($section1->isExclusive(), $section2->isExclusive()); $this->assertEqual($section1->isAffixed(), $section2->isAffixed()); $this->assertEqual($section1->getChecker(), $section2->getChecker()); }