getPageBanner()
Get Page Banner
@param string $mainTitle
@param string $bodytag
@return string banner
507554
public function getPageBanner($mainTitle, $bodytag=null) {
    $bodytag = $bodytag ? $bodytag : "<body>";

    if(!is_null($this->bannerFile)) {
      // BLP 2015-04-25 -- if return use it.
      if(($b = require($this->bannerFile)) != 1) {
        $pageBannerText = $b;
      }
    } else {
      // a default banner
      // The default banner does not have the IE warnings etc.
      $pageBannerText =<<<EOF
<!-- Default Header/Banner -->
<header>
<div id='pagetitle'>
$mainTitle
</div>
<noscript style="color: red; border: 1px solid black; padding: 10px; font-size: large;">
<strong>Your browser either does not support JavaScripts
or you have JavaScripts disabled.</strong>
</noscript>
</header>

EOF;
    }

    // Return the Banner

    return <<<EOF
$bodytag
$pageBannerText

EOF;
  }
105329
private static function updateUrl(BBApplication $application, Page $page, AbstractClassContent $maincontent = null)
    {
        $urlGenerator = $application->getUrlGenerator();

        $em = $application->getEntityManager();

        $uow = $em->getUnitOfWork();
        $changeSet = $uow->getEntityChangeSet($page);

        if (null === $maincontent && 0 < count($urlGenerator->getDiscriminators())) {
            if ($uow->isScheduledForInsert($page)) {
               foreach($uow->getScheduledEntityInsertions() as $entity) {
                   if ($entity instanceof \BackBee\ClassContent\AbstractClassContent && $page === $entity->getMainNode()) {
                       $maincontent = $entity;
                       break;
                   }
               }
            } else {
                $maincontent = $em->getRepository('BackBee\ClassContent\AbstractClassContent')
                    ->getLastByMainnode($page, $urlGenerator->getDiscriminators())
                ;
            }
        }

        $newUrl = null;
        $url = $page->getUrl(false);
        if (isset($changeSet['_url']) && !empty($url)) {
            $newUrl = $urlGenerator->getUniqueness($page, $page->getUrl());
        } else {
            $force = isset($changeSet['_state']) && !($changeSet['_state'][0] & Page::STATE_ONLINE);
            $newUrl = $urlGenerator->generate($page, $maincontent, $force);
        }

        self::$alreadyDone[] = $page->getUid();

        if ($newUrl !== $page->getUrl(false)) {
            $page->setUrl($newUrl);

            $classMetadata = $em->getClassMetadata('BackBee\NestedNode\Page');
            if ($uow->isScheduledForInsert($page) || $uow->isScheduledForUpdate($page)) {
                $uow->recomputeSingleEntityChangeSet($classMetadata, $page);
            } elseif (!$uow->isScheduledForDelete($page)) {
                $uow->computeChangeSet($classMetadata, $page);
            }

            return true;
        }

        return false;
    }
905093
public function getTitle($allowBasicTags = false)
    {
        $titleParts = [];

        if ($allowBasicTags === true) {
            $allowedTags = '<b><del><em><i><strong><s>';
        } else {
            $allowedTags = '';
        }

        foreach ($this->getTitleColumnName() as $fieldName) {
            // Make sure we add strings only, as some fields may be an array or DateTime.
            $value = is_array($this->values[$fieldName]) ? implode(' ', $this->values[$fieldName]) : (string) $this->values[$fieldName];
            if (strip_tags($value, $allowedTags) !== '') {
                $titleParts[] = strip_tags($value, $allowedTags);
            }
        }

        if (!empty($titleParts)) {
            $title = implode(' ', $titleParts);
        } else {
            // nope, no title was found.
            $title = '';
        }

        return $title;
    }
158880
static public function fetchSynonyms( $mainTagID, $mainTranslation = false )
    {
        return self::fetchList( array( 'main_tag_id' => $mainTagID ), null, null, $mainTranslation );
    }
1001306
protected function addBannerText( &$Banner )
    {
        $arrBannersStat = array();
        // Kurz URL (nur Domain)
        $this->setBannerURL($Banner);
        $Banner['banner_url'] = \Idna::decode($Banner['banner_url']); // #79
        $treffer = parse_url($Banner['banner_url']);
        $banner_url_kurz = $treffer['host'];
        if (isset($treffer['port']))
        {
            $banner_url_kurz .= ':'.$treffer['port'];
        }
        $MaxViewsClicks = $this->getMaxViewsClicksStatus($Banner);
        $this->setBannerPublishedActive($Banner);
        
        $arrBannersStat['banner_id'       ]    = $Banner['id'];
        $arrBannersStat['banner_name'     ]    = specialchars(ampersand($Banner['banner_name']));
        $arrBannersStat['banner_comment'  ]    = nl2br($Banner['banner_comment']);
        $arrBannersStat['banner_url_kurz' ]    = $banner_url_kurz;
        $arrBannersStat['banner_url'      ]    = (strlen($Banner['banner_url']) <61 ? $Banner['banner_url'] : substr($Banner['banner_url'], 0, 28)."[...]".substr($Banner['banner_url'],-24,24) );
        $arrBannersStat['banner_prio'     ]    = $GLOBALS['TL_LANG']['tl_banner_stat']['prio'][$Banner['banner_weighting']];
        $arrBannersStat['banner_views'    ]    = ($MaxViewsClicks[0]) ? $Banner['banner_views']  .'<br />'.$GLOBALS['TL_LANG']['tl_banner_stat']['max_yes'] : $Banner['banner_views'];
        $arrBannersStat['banner_clicks'   ]    = ($MaxViewsClicks[1]) ? $Banner['banner_clicks'] .'<br />'.$GLOBALS['TL_LANG']['tl_banner_stat']['max_yes'] : $Banner['banner_clicks'];
        $arrBannersStat['banner_active'   ]    = $Banner['banner_active'];
        $arrBannersStat['banner_pub_class']    = $Banner['banner_published_class'];
        $arrBannersStat['banner_zero'     ]    = $GLOBALS['TL_LANG']['tl_banner_stat']['zero_text'];
        $arrBannersStat['banner_confirm'  ]    = $GLOBALS['TL_LANG']['tl_banner_stat']['zero_confirm'];
        $arrBannersStat['banner_pic'      ]    = false; // Es ist kein Bild
        $arrBannersStat['banner_flash'    ]    = false;
        $arrBannersStat['banner_text'     ]    = true;   // Es ist ein Textbanner
        
        return $arrBannersStat;
    }
225269
public function getMainTemplateFile()
    {
    	$main = $this->getPath() . '/main.ss';

    	if(file_exists($main)) {
    		return $main;
    	}

    	$main = (string) $this->getConfiguration()->main_template;
    	if($main) {
    		return SSViewer::getTemplateFileByType($main, 'main');
    	}

    	return false;
    }
1157350
private static function retrieveDomainPrefix(int $mainDomainLevel): string
    {
        $host  = $_SERVER['HTTP_HOST'];
        $parts = explode('.', $host);
        for ($i = 0; $i < $mainDomainLevel; $i++) {
            array_pop($parts);
        }

        return implode('.', $parts);
    }
24217
public static function mainPageTitle()
    {
        if (is_home())
        {
            if (get_option('page_for_posts', true))
            {
                return get_the_title(get_option('page_for_posts', true));
            }
            else
            {
                return __('Latest Posts', 'baobab');
            }
        }
        elseif (is_archive())
        {
            $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
            if ($term)
            {
                return apply_filters('single_term_title', $term->name);
            }
            elseif (is_post_type_archive())
            {
                return apply_filters('the_title', get_queried_object()->labels->name);
            }
            elseif (is_day())
            {
                return sprintf(__('Daily Archives: %s', 'baobab'), get_the_date());
            }
            elseif (is_month())
            {
                return sprintf(__('Monthly Archives: %s', 'baobab'), get_the_date('F Y'));
            }
            elseif (is_year())
            {
                return sprintf(__('Yearly Archives: %s', 'baobab'), get_the_date('Y'));
            }
            elseif (is_author())
            {
                $author = get_queried_object();

                return sprintf(__('Author Archives: %s', 'baobab'),
                    apply_filters('the_author', is_object($author) ? $author->display_name : null));
            }
            else
            {
                return single_cat_title('', false);
            }
        }
        elseif (is_search())
        {
            return sprintf(__('Search Results for %s', 'baobab'), get_search_query());
        }
        elseif (is_404())
        {
            return __('Not Found', 'baobab');
        }
        else
        {
            return get_the_title();
        }
    }
731740
public function getTitle( $throwException = TRUE )
	{
		$nodes	= $this->document->getElementsByTagName( "title" );
		if( $nodes->length )
			return $nodes->item(0)->textContent;
		$tags	= $this->getMetaTags( TRUE );
		if( isset( $tags['dc.title'] ) )
			return $tags['dc.title'];
		if( $throwException )
			throw new RuntimeException( 'Neither Title Tag not Title Meta Tag found.' );
		return "";
	}
751900
public function pageTitle($route = null, array  $replacements = []) {
        if(!$route) {
            $route = \Route::currentRouteName();
        }

        return $this->applyReplacement(Arr::get(self::pageTitleValues(), $route, 'title'), $replacements);
    }
923034
public function getPageTitle()
    {
        $titleParts = [];
        $titleParts[] = $this->getTitlePrefix();
        $titleParts[] = $this->getTitle();
        $titleParts[] = $this->getTitleSuffix();
        $titleParts[] = $this->getTitlePageSuffix();

        $titleParts = array_filter($titleParts);

        return implode(' | ', $titleParts);
    }
428800
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
    {
        $element = parent::getDOM($doc, $majorVersion, $minorVersion);
        foreach ($this->_entry as $entry) {
            $element->appendChild($entry->getDOM($element->ownerDocument));
        }
        return $element;
    }
690361
public function listBanner($row)
    {
        switch ($row['banner_type'])
        {
            case self::BANNER_TYPE_INTERN :
                return $this->listBannerInternal($row);
                break;
            case self::BANNER_TYPE_EXTERN :
                return $this->listBannerExternal($row);
                break;
            case self::BANNER_TYPE_TEXT :
                return $this->listBannerText($row);
                break;
            default :
                return false;
                break;
        }
    }
80237
public function getTitle($session = false)
    {
        if ($session) {
            return $this->metatags()->getTitleSession();
        }

        return $this->metatags()->getTitle();
    }
256059
function createBanner( generator ) {
   'use strict';
   var placeholder = generator.placeholder;

   if( placeholder.banner ) {
      return placeholder.banner;
   }

   return createBannerFromPrompts( placeholder );

   ///////////////////////////////////////////////////////////////////////////////////////////////////////////

   function createBannerFromPrompts( placeholder ) {
      var banner = '/**\n * Copyright ' + new Date().getFullYear();

      if( placeholder.author ) {
         banner = banner + ' ' +  placeholder.author;
      }
      banner = banner + '\n';

      if( placeholder.licenses !== true ) {
         banner = banner + ' * Released under the ' + placeholder.licenseText + '\n';
      }

      if( placeholder.homepage ) {
         banner = banner + ' * ' + placeholder.homepage + '\n';
      }

      banner = banner + ' */';
      return banner;
   }
}
591400
public function extractTitle($content, $retrieveTitle = false) {
		if ($retrieveTitle) {
			
		} else {
			if ($this->isImage($content)) {
				return 'Image: ' . basename($content);
			}
			
			if ($this->isWebpage($content)) {
				return 'Website: ' . basename($content);
			}
			
			return DBField::create_field('Text', $content)->LimitWordCount(5, '');
		}
	}
77431
public static function plain_page($title, $content, $meta = '') {
        if (function_exists('get_string') && function_exists('get_html_lang')) {
            $htmllang = get_html_lang();
        } else {
            $htmllang = '';
        }

        $footer = '';
        if (MDL_PERF_TEST) {
            $perfinfo = get_performance_info();
            $footer = '<footer>' . $perfinfo['html'] . '</footer>';
        }

        return '<!DOCTYPE html>
<html ' . $htmllang . '>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
'.$meta.'
<title>' . $title . '</title>
</head><body>' . $content . $footer . '</body></html>';
    }