Skip to content
Snippets Groups Projects

Local site search and Directory CSS updates

Merged Kevin Abel requested to merge four into master

If the local site content scrape fails the default UNL content should be shown.

Adds some space under the .fn of directory results.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
66
67 $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
68 $page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
69 $page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
70 $page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
71 if (!empty($scanned->leftcollinks)) {
72 $page->leftcollinks = $purifier->purify($scanned->leftcollinks);
73 }
74 if (!empty($scanned->contactinfo)) {
75
76 $page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
77 }
78 if (!empty($scanned->footercontent)) {
79 $page->footercontent = $purifier->purify($scanned->footercontent);
71 if (!$isEmbed) {
72 if (isset($scanned->titlegraphic)) {
  • Kevin Abel
  • 66
    67 $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
    68 $page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
    69 $page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
    70 $page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
    71 if (!empty($scanned->leftcollinks)) {
    72 $page->leftcollinks = $purifier->purify($scanned->leftcollinks);
    73 }
    74 if (!empty($scanned->contactinfo)) {
    75
    76 $page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
    77 }
    78 if (!empty($scanned->footercontent)) {
    79 $page->footercontent = $purifier->purify($scanned->footercontent);
    71 if (!$isEmbed) {
    72 if (isset($scanned->titlegraphic)) {
    • Author Contributor

      I figured it was safer to assume that if titlegraphic was there, so would the others. The previous assumption was only if navlinks was there. Perhaps we should check them all, but I didn't want to have a super long if.

  • 66
    67 $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
    68 $page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
    69 $page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
    70 $page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
    71 if (!empty($scanned->leftcollinks)) {
    72 $page->leftcollinks = $purifier->purify($scanned->leftcollinks);
    73 }
    74 if (!empty($scanned->contactinfo)) {
    75
    76 $page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
    77 }
    78 if (!empty($scanned->footercontent)) {
    79 $page->footercontent = $purifier->purify($scanned->footercontent);
    71 if (!$isEmbed) {
    72 if (isset($scanned->titlegraphic)) {
    • Would it make sense to put in default content if a region does not exist?

      if (isset($scanned->titlegraphic)) { 
          $page->titlegraphic = $scanned->titlegraphic;
      } else {
          $page->titlegraphic = $default;
      }
      
      if (isset($scanned->navlinks)) { 
          $page->navlinks = $scanned->navlinks;
      } else {
          $page->navlinks = $default;
      }
      
      //etc...
      

      That way we can get as much of their content in as we can?

  • 66
    67 $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
    68 $page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
    69 $page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
    70 $page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
    71 if (!empty($scanned->leftcollinks)) {
    72 $page->leftcollinks = $purifier->purify($scanned->leftcollinks);
    73 }
    74 if (!empty($scanned->contactinfo)) {
    75
    76 $page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
    77 }
    78 if (!empty($scanned->footercontent)) {
    79 $page->footercontent = $purifier->purify($scanned->footercontent);
    71 if (!$isEmbed) {
    72 if (isset($scanned->titlegraphic)) {
  • Kevin Abel
  • 66
    67 $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
    68 $page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
    69 $page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
    70 $page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
    71 if (!empty($scanned->leftcollinks)) {
    72 $page->leftcollinks = $purifier->purify($scanned->leftcollinks);
    73 }
    74 if (!empty($scanned->contactinfo)) {
    75
    76 $page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
    77 }
    78 if (!empty($scanned->footercontent)) {
    79 $page->footercontent = $purifier->purify($scanned->footercontent);
    71 if (!$isEmbed) {
    72 if (isset($scanned->titlegraphic)) {
    • Author Contributor

      I like the all-or-nothing approach as it sets up the expectation that you either get the default presence OR you get your site's content, never somewhere in between.

  • 66
    67 $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
    68 $page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
    69 $page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
    70 $page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
    71 if (!empty($scanned->leftcollinks)) {
    72 $page->leftcollinks = $purifier->purify($scanned->leftcollinks);
    73 }
    74 if (!empty($scanned->contactinfo)) {
    75
    76 $page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
    77 }
    78 if (!empty($scanned->footercontent)) {
    79 $page->footercontent = $purifier->purify($scanned->footercontent);
    71 if (!$isEmbed) {
    72 if (isset($scanned->titlegraphic)) {
  • Kevin Abel
  • 66
    67 $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
    68 $page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
    69 $page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
    70 $page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
    71 if (!empty($scanned->leftcollinks)) {
    72 $page->leftcollinks = $purifier->purify($scanned->leftcollinks);
    73 }
    74 if (!empty($scanned->contactinfo)) {
    75
    76 $page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
    77 }
    78 if (!empty($scanned->footercontent)) {
    79 $page->footercontent = $purifier->purify($scanned->footercontent);
    71 if (!$isEmbed) {
    72 if (isset($scanned->titlegraphic)) {
  • Please register or sign in to reply
    Loading