/**
 * Gets the current page title.
 *
 * @since 1.3.0
 *
 * @param bool|string $title Page title override.
 *
 * @returns string The title.
 */
function jc_get_page_title($title = false)
{
    if ($title !== false) {
        $page_title = $title;
    } else {
        if (is_search()) {
            $page_title = 'Search';
        } elseif (is_404()) {
            $page_title = '404';
        } elseif (is_archive()) {
            $page_title = get_the_archive_title();
        } else {
            $page_title = get_the_title(get_top_parent_page_id());
        }
    }
    /**
     * Filters the main (burgundy bar) page title.
     *
     * @since 0.4.0
     * @hooked
     *
     * @param string $page_title The page title.
     */
    echo apply_filters('jc_page_title', $page_title);
}
 /**
  * Restricts access to pages outside of current user's site sections
  *
  * @since v1.0.0
  * @access private
  *
  * @param WP_Screen $current_screen
  */
 function restrict_page_edit($current_screen)
 {
     if (jc_userroles_current_role() != 'forms_manager') {
         return;
     }
     if (!function_exists('get_top_parent_page_id')) {
         return;
     }
     $top_parent_page_ID = get_top_parent_page_id();
     if (isset($_GET['action']) && $_GET['action'] == 'edit' && (!$this->user_forms || !in_array($top_parent_page_ID, $this->user_forms))) {
         wp_die('This site section does not belong to you.');
     }
 }
Beispiel #3
0
function is_wallpaper_pagina($id)
{
    $post = get_post($id);
    $ouder = get_top_parent_page_id($post->ID);
    $wallpaper = 42;
    if (42 == $ouder || 42 == $post->ID) {
        return true;
    } else {
        return false;
    }
}
Beispiel #4
0
		DEFAULTSLIDER	Der Code für den Slider, welcher als Default Slider auf den Seiten angezeigt wird, 
						welche keinem Bereich zugeordnet wurden.
	*/
if (!defined(STARTSEITE)) {
    define("STARTSEITE", "serviceGroup");
}
if (!defined(DEFAULTSLIDER)) {
    define("DEFAULTSLIDER", "[huge_it_slider id='3']");
}
/*MAIN PAGE ID
		liest über eine Funktion in der function.php die "Parent Page ID" aus.
		Dies ist die ID, der zu allererst ausgewählten Seite.

		!!! Achtung: Diese Funktion MUSS in der function.php bestehen bleiben !!!
	*/
$pid = get_top_parent_page_id($post->ID);
/*HAUPTSEITEN
		Description des Arrays:
		Seitenbezeichnung
		|-- 'id'				=> Dies ist die Page ID der Main Page
		|-- 'title'				=> Titel der Seite (wird auf der Startseite in der Linkliste angezeigt)
		|-- 'sc'				=> ShortCode für diesen Bereich (bsp: printtest --> pt_)
		|-- 'logo'				=> Logo des Bereiches (wird oben rechts angezeigt) Verz.: images/logo/
		|-- 'favicon'			=> Favicon des Bereiches Verz.: images/favicon/
		|-- 'slider'			=> Slidercode des Sliders, welcher auf dieser Seite angezeigt wird (Bsp: [huge_it_slider id=\'SLIDERID\'])
		|-- 'top_menu_exclude'	=> Seiten IDs der Seiten welche nicht in der Navigation (top) angezeigt werden sollen
		|-- 'secured'			=> Seite Passwortgesichert? (true/false)
		|-- 'username'			=> htmlspecialchars(trim("[BENUTZERNAME]"))
		|-- 'password'			=> htmlspecialchars(trim("[PASSWORT]"))
	*/
$MainID = array('serviceGroup' => array('id' => 56, 'title' => "LundM Service Group", 'sc' => 'sg_', 'logo' => 'sg_logo.png', 'favicon' => 'sg_favicon.ico', 'slider' => '[huge_it_slider id=\'2\']', 'top_menu_exclude' => '134,135,400,136'), 'printSolution' => array('id' => 80, 'title' => "LundM Print Solutions", 'sc' => 'ps_', 'logo' => 'ps_logo.png', 'favicon' => 'ps_favicon.ico', 'slider' => '[huge_it_slider id=\'4\']', 'top_menu_exclude' => ''), 'docManagement' => array('id' => 81, 'title' => "LundM Doc Management", 'sc' => 'dm_', 'logo' => 'dm_logo.png', 'favicon' => 'dm_favicon.ico', 'slider' => '[huge_it_slider id=\'6\']', 'top_menu_exclude' => ''), 'businessIT' => array('id' => 82, 'title' => "LundM Business IT", 'sc' => 'bi_', 'logo' => 'bi_logo.png', 'favicon' => 'bi_favicon.ico', 'slider' => '', 'top_menu_exclude' => ''), 'itAcademy' => array('id' => 83, 'title' => "LundM IT Academy", 'sc' => 'ia_', 'logo' => 'ia_logo.png', 'favicon' => 'ia_favicon.ico', 'slider' => '[huge_it_slider id=\'5\']', 'top_menu_exclude' => ''), 'kundenbereich' => array('id' => 359, 'title' => "Kundenbereich", 'sc' => 'kb_', 'logo' => 'kb_logo.png', 'favicon' => 'kb_favicon.ico', 'slider' => '[huge_it_slider id=\'5\']', 'secured' => true, 'username' => htmlspecialchars(trim("kunde")), 'password' => htmlspecialchars(trim("kontakt")), 'top_menu_exclude' => ''));
			
		<?php 
    echo fau_get_ad('werbebanner_seitlich', false);
    ?>

			<div class="row">		
				<div class="span4 span-sm-4">
					<?php 
    $offset = 0;
    if ($options['website_type'] == -1) {
        $menulevel = get_post_meta($post->ID, 'menu-level', true);
        if ($menulevel) {
            $offset = $menulevel;
        }
    }
    $parent_page = get_top_parent_page_id($post->ID, $offset);
    $parent = get_page($parent_page);
    ?>
					<h2 class="small menu-header">
						<a href="<?php 
    echo get_permalink($parent->ID);
    ?>
"><?php 
    echo $parent->post_title;
    ?>
</a>
					</h2>
					<ul id="subnav">
					<?php 
    wp_list_pages("child_of={$parent_page}&title_li=");
    ?>
/**
 * Sets up the section global.
 *
 * @since 1.3.0
 * @access private
 */
function jc_set_site_section()
{
    global $jc_site_section;
    if (is_page()) {
        $top_parent_page_ID = get_top_parent_page_id();
        if ($section_ID = rbm_get_field('is_section', $top_parent_page_ID)) {
            $jc_site_section = $top_parent_page_ID;
        }
    } elseif ($section_ID = get_post_meta(get_the_ID(), 'site_section', true)) {
        $jc_site_section = $section_ID;
    }
    $jc_site_section = apply_filters('jc_site_section', $jc_site_section);
}