1
0
mirror of https://github.com/ackxolotl/wp-theme-dpsg-ebersberg synced 2025-10-06 00:12:48 +02:00

Initial commit

This commit is contained in:
Simon Ellmann
2019-07-14 13:21:04 +02:00
commit 6ee4949a67
131 changed files with 5905 additions and 0 deletions

31
404.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
/**
* The template for displaying 404 pages (Not Found).
*
* @package dpsg-ebersberg
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'dpsg-ebersberg' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<p><?php _e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'dpsg-ebersberg' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .page-content -->
</section><!-- .error-404 -->
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

44
README.md Normal file
View File

@@ -0,0 +1,44 @@
_s
===
Hi. I'm a starter theme called `_s`, or `underscores`, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.
My ultra-minimal CSS might make me look like theme tartare but that means less stuff to get in your way when you're designing your awesome theme. Here are some of the other more interesting things you'll find here:
* A just right amount of lean, well-commented, modern, HTML5 templates.
* A helpful 404 template.
* A sample custom header implementation in `inc/custom-header.php` that can be activated by uncommenting one line in functions.php and adding the code snippet found the comments of `inc/custom-header.php` to your `header.php` template.
* Custom template tags in `inc/template-tags.php` that keep your templates clean and neat and prevent code duplication.
* Some small tweaks in `inc/extras.php` that can improve your theming experience.
* Keyboard navigation for image attachment templates. The script can be found in `js/keyboard-navigation.js`. It's enqueued in `functions.php`.
* A script at `js/navigation.js` that makes your menu a toggled dropdown on small screens (like your phone), ready for CSS artistry. It's enqueued in `functions.php`.
* 2 sample CSS layouts in `layouts` for a sidebar on either side of your content.
* Smartly organized starter CSS in `style.css` that will help you to quickly get your design off the ground.
* Licensed under GPLv2 or later. :) Use it to make something cool.
Getting Started
---------------
If you want to keep it simple, head over to http://underscores.me and generate your `_s` based theme from there. You just input the name of the theme you want to create, click the "Generate" button, and you get your ready-to-awesomize starter theme.
If you want to set things up manually, download `_s` from github. The first thing you want to do is copy the `_s` directory and change the name to something else - Like, say, `megatherium` - then you'll need to do a five-step find and replace on the name in all the templates.
1. Search for `'_s'` (inside single quotations) to capture the text domain.
2. Search for `_s_` to capture all the function names.
3. Search for <code>&nbsp;_s</code> (with a space before it) to capture DocBlocks.
4. Search for `_s-` to capture prefixed handles.
5. Search for `Text Domain: _s` in style.css.
OR
* Search for: `'_s'` and replace with: `'megatherium'`
* Search for: `_s_` and replace with: `megatherium_`
* Search for: <code>&nbsp;_s</code> and replace with: <code>&nbsp;Megatherium</code>
* Search for: `_s-` and replace with: `megatherium-`
* Search for: `Text Domain: _s` and replace with: `Text Domain: megatherium` in style.css.
Then, update the stylesheet header in style.css and the links in footer.php with your own information. Next, update or delete this readme.
Now you're ready to go! The next step is easy to say, but harder to do: make an awesome WordPress theme. :)
Good luck!

102
archive.php Normal file
View File

@@ -0,0 +1,102 @@
<?php
/**
* The template for displaying Archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package dpsg-ebersberg
*/
get_header(); ?>
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title">
<?php
if ( is_category() ) :
single_cat_title();
elseif ( is_tag() ) :
single_tag_title();
elseif ( is_author() ) :
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*/
the_post();
printf( __( 'Author: %s', 'dpsg-ebersberg' ), '<span class="vcard">' . get_the_author() . '</span>' );
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
elseif ( is_day() ) :
printf( __( 'Day: %s', 'dpsg-ebersberg' ), '<span>' . get_the_date() . '</span>' );
elseif ( is_month() ) :
printf( __( 'Month: %s', 'dpsg-ebersberg' ), '<span>' . get_the_date( 'F Y' ) . '</span>' );
elseif ( is_year() ) :
printf( __( 'Year: %s', 'dpsg-ebersberg' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
_e( 'Asides', 'dpsg-ebersberg' );
elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
_e( 'Images', 'dpsg-ebersberg');
elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
_e( 'Videos', 'dpsg-ebersberg' );
elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
_e( 'Quotes', 'dpsg-ebersberg' );
elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
_e( 'Links', 'dpsg-ebersberg' );
else :
_e( 'Archives', 'dpsg-ebersberg' );
endif;
?>
</h1>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>
</header><!-- .page-header -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php dpsg_ebersberg_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'archive' ); ?>
<?php endif; ?>
</main><!-- #main -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

77
bp_widget.php Normal file
View File

@@ -0,0 +1,77 @@
<?php
/**
* Adds Baden_Powell widget.
*/
class Baden_Powell extends WP_Widget {
/**
* Register widget with WordPress.
*/
function __construct() {
parent::__construct(
'bp_widget', // Base ID
'Baden-Powell', // Name
array( 'description' => 'Zitate von Baden-Powell' ) // Args
);
}
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget( $args, $instance ) {
$title = apply_filters( 'widget_title', $instance['title'] );
echo $args['before_widget'];
$f_contents = file(get_bloginfo('template_url').'/bp_zitate.txt');
$line = $f_contents[rand(0, count($f_contents) - 1)];
echo $line;
echo $args['after_widget'];
}
/**
* Back-end widget form.
*
* @see WP_Widget::form()
*
* @param array $instance Previously saved values from database.
*/
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
}
else {
$title = '';
}
?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
}
/**
* Sanitize widget form values as they are saved.
*
* @see WP_Widget::update()
*
* @param array $new_instance Values just sent to be saved.
* @param array $old_instance Previously saved values from database.
*
* @return array Updated safe values to be saved.
*/
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
return $instance;
}
} // class Baden_Powell

46
bp_zitate.txt Normal file
View File

@@ -0,0 +1,46 @@
Aufgabe des Leiters ist es, die Jungen in die richtige Richtung zu begeistern.
Da mindestens 5% Gutes in allem ist, sind auch weitere 5% Spaß darin enthalten.
Das Leben ist zu kurz für Erörterungen.
Der Mensch, der blind ist für die Schönheiten der Natur, hat nur das halbe Vergnügen am Leben gehabt.
Der Mensch, der keine Pläne macht, macht im Leben keine Fortschritte.
Die Natur gab uns eine Zunge, aber zwei Ohren, so dass wir doppelt so viel hören können als wir sprechen.
Ein Lächeln ist ein geheimer Schlüssel, der viele Herzen aufschließt.
Ein Motto sagt: Sei gut, und du wirst glücklich sein. Meine Version ist: Sei gutgelaunt, und du wirst glücklich sein.
Ein Paar geschulte Augen sind ebenso gut wie ein Dutzend Paar ungeschulte.
Ein Pfadfinder ist aktiv darin, Gutes zu tun, nicht passiv, gut zu sein.
Ein alter Pfadfinder ist voller Findigkeit. Aus allen Schwierigkeiten oder Nöten findet er einen Weg.
Ein anerkennender Klaps auf den Rücken ist ein stärkerer Anreiz als ein Nadelstich.
Eine Schwierigkeit hört auf, eine solche zu sein, sobald ihr darüber lächelt und sie in Angriff nehmt.
Es gibt ein 11., ungeschriebenes Pfadfindergesetz, nämlich: „Ein Pfadfinder ist kein Narr“.
Es ist derjenige der Glücklichste, der mit dem geringsten Bedauern zurückblicken kann.
Etwas Gutes sollst du an jedem Tag deines Lebens tun.
Etwas, das dir geschenkt wurde, gehört dir erst, wenn du dem Schenkenden dafür gedankt hast.
Geduld kann man erwerben, indem man auf das Endziel blickt und erkennt, wie notwendig die Zwischenstufen sein müssen.
Hat man den Willen zu etwas, gelingt es auch, gleich, was einem im Wege steht.
Ich persönlich habe festgestellt, dass das beste Gegenmittel gegen Zorn darin besteht, anzufangen zu pfeifen.
Ihr solltet euch immer auf euch selbst und nicht darauf verlassen, was andere für euch tun können.
In Liebe gegründete Freiheit kann Wunder wirken. Denk darüber nach.
Jede Frage hat zwei Seiten. Beide sollten erforscht werden, ehe man mit ihnen fertig ist.
Leben ohne Würdigung der Schönheit ist wie ein trüber Tag ohne Sonne.
Leistet die gute Tat nicht nur für eure Freunde, sondern auch für Fremde, selbst für eure Feinde.
Mein Berg sagt: Blicke weiter, blicke höher, blicke voraus und du wirst einen Weg sehen.
Mit Ruhe meine ich nicht Leerlauf, sondern Änderung der Tätigkeit.
Ohne Abenteuer wäre das Leben tödlich langweilig.
Optimismus ist eine Form des Mutes, die Vertrauen in andere gibt und zum Erfolg führt.
Pfadfindertum ohne Spurenverfolgung ist wie Brot und Butter ohne Butter.
Pfeif auf die Regeln! Probiere es aus.
Schaut auf die helle Seite der Dinge anstatt auf die dunkle.
Seid nicht zufrieden mit dem Was, sondern erforscht das Warum und das Wie.
Selbstachtung, nicht Selbsteinschätzung, erzeugt Respekt bei anderen.
Sonntag ist ein Ruhetag. Müßiggang ist nicht Ruhe.
Stillstand ist nutzlos. Es gibt eines oder das andere, entweder Fortschritt oder Nachlassen.
Versucht, die Welt ein bisschen besser zurückzulassen als Ihr sie vorgefunden habt.
Welch einen Unterschied macht es aus, wenn ihr etwas aus Liebe zur Sache tut.
Wende dich zur richtigen Seite und gehe vorwärts.
Wenn du deinen Weg durchs Leben machst wirst du Freude daran haben, neue Herausforderungen anzunehmen.
Wenn eure Zeit zum Sterben gekommen ist, versucht, dass ihr glücklich in dem Gefühl sterben könnt, dass ihr euer Bestes getan habt.
Wenn ich von Wandern rede, meine ich flottes Wandern, nicht nachlässiges Schlendern.
Wir haben nur eine kurze Lebenszeit. Daher ist es wesentlich, Dinge zu tun, die es wert sind, und diese jetzt zu tun.
Während du dein Leben auf dieser Erde lebst versuche einiges Gute zu tun, das nach dir hier verbleiben wird.
Zuerst hatte ich eine Idee, dann ein Ideal. Nun haben wir eine Bewegung - werden wir in einer Organisation enden?
„Seid bereit“ bedeutet, dass ein Pfadfinder jeden Moment in der Lage sein muss, seine Pflicht zu tun.

38
calendar.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
/*
Template Name: Scoutnet Kalender
*/
get_header();
require_once get_stylesheet_directory()."/scoutnet-api/src/scoutnet.php";
$events = scoutnet()->group(71)->events('start_date >= "'.date("Y-m-d").'" OR end_date >= "'.date("Y-m-d").'"');
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<article id="post-<?php the_ID(); ?>" class="post-<?php the_ID(); ?> page type-page status-<?php echo get_post_status(); ?> hentry hyphenate">
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p>&nbsp;</p>
<table border="0" width="465" cellspacing="0" cellpadding="0">
<tbody>
<?php foreach( $events as $event) : ?>
<tr>
<td valign="top" width="98"><?php echo ($event->start_date != $event->end_date) ? date_format(date_create($event->start_date), 'd').". - ".date_format(date_create($event->end_date), 'd.m.Y') : date_format(date_create($event->start_date), 'd.m.Y'); ?></td>
<td valign="top" width="363"><strong><?php echo $event->title; echo ($event->location != "") ? " in ".$event->location : ""; ?></strong></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php the_content(); ?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
</main><!-- #main -->
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

73
comments.php Normal file
View File

@@ -0,0 +1,73 @@
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to dpsg_ebersberg_comment() which is
* located in the inc/template-tags.php file.
*
* @package dpsg-ebersberg
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
//if ( post_password_required() )
return;
?>
<div id="comments" class="comments-area">
<?php // You can start editing here -- including this comment! ?>
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'dpsg-ebersberg' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
</h2>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-above" class="comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'dpsg-ebersberg' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'dpsg-ebersberg' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'dpsg-ebersberg' ) ); ?></div>
</nav><!-- #comment-nav-above -->
<?php endif; // check for comment navigation ?>
<ol class="comment-list">
<?php
/* Loop through and list the comments. Tell wp_list_comments()
* to use dpsg_ebersberg_comment() to format the comments.
* If you want to override this in a child theme, then you can
* define dpsg_ebersberg_comment() and that will be used instead.
* See dpsg_ebersberg_comment() in inc/template-tags.php for more.
*/
wp_list_comments( array( 'callback' => 'dpsg_ebersberg_comment' ) );
?>
</ol><!-- .comment-list -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'dpsg-ebersberg' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'dpsg-ebersberg' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'dpsg-ebersberg' ) ); ?></div>
</nav><!-- #comment-nav-below -->
<?php endif; // check for comment navigation ?>
<?php endif; // have_comments() ?>
<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'dpsg-ebersberg' ); ?></p>
<?php endif; ?>
<?php comment_form(); ?>
</div><!-- #comments -->

24
content-page.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
/**
* The template used for displaying page content in page.php
*
* @package dpsg-ebersberg
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('hyphenate'); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="edit"><?php edit_post_link( __( 'Edit', 'dpsg-ebersberg' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?></div>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'dpsg-ebersberg' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
</article><!-- #post-## -->

66
content-single.php Normal file
View File

@@ -0,0 +1,66 @@
<?php
/**
* @package dpsg-ebersberg
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="edit"><?php edit_post_link( __( 'Edit', 'dpsg-ebersberg' ), '<span class="edit-link">', '</span>' ); ?></div>
<div class="entry-meta">
<?php dpsg_ebersberg_posted_on(); ?>
<?php
/* translators: used between list items, there is a space after the comma */
$category_list = get_the_category_list( __( ', ', 'dpsg-ebersberg' ) );
/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( '', __( ', ', 'dpsg-ebersberg' ) );
if ( ! dpsg_ebersberg_categorized_blog() ) {
// This blog only has 1 category so we just need to worry about tags in the meta text
if ( '' != $tag_list ) {
$meta_text = __( '| Tags: %2$s', 'dpsg-ebersberg' );
} /*else {
$meta_text = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'dpsg-ebersberg' );
}*/
} /*else {
// But this blog has loads of categories so we should probably display them here
if ( '' != $tag_list ) {
$meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'dpsg-ebersberg' );
} else {
$meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'dpsg-ebersberg' );
}
}*/ // end check for categories on this blog
printf(
$meta_text,
$category_list,
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
?>
</div><!-- .entry-meta -->
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
the_post_thumbnail(array(900,375));
} ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'dpsg-ebersberg' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<footer class="entry-meta">
</footer><!-- .entry-meta -->
</article><!-- #post-## -->

62
content.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
/**
* @package dpsg-ebersberg
*/
?>
<div class="article-wrapper"><article id="post-<?php the_ID(); ?>" <?php post_class('hyphenate'); ?>>
<header class="entry-header">
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail(array(900,375)); ?></a>
<?php endif; ?>
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php if ( 'post' == get_post_type() && !is_home() ) : ?>
<div class="entry-meta">
<?php dpsg_ebersberg_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'dpsg-ebersberg' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php if ( 'post' == get_post_type() ) : ?>
<?php
/* translators: used between list items, there is a space after the comma */
//$categories_list = get_the_category_list( __( ', ', 'dpsg-ebersberg' ) );
//if ( $categories_list && dpsg_ebersberg_categorized_blog() ) :
?>
<span class="cat-links">
</span>
<?php
/* translators: used between list items, there is a space after the comma */
//$tags_list = get_the_tag_list( '', __( ', ', 'dpsg-ebersberg' ) );
//if ( $tags_list ) :
?>
<span class="tags-links">
</span>
<?php endif; ?>
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<span class="comments-link"></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'dpsg-ebersberg' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article></div><!-- #post-## -->

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

26
footer.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the id=main div and all content after
*
* @package dpsg-ebersberg
*/
?>
</div><!-- #content -->
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="site-info">
<?php do_action( 'dpsg_ebersberg_credits' ); ?>
<a href="<?php echo home_url('/'); ?>" title="<?php bloginfo('name'); ?>" rel="home">© <?php echo date('Y')." ".get_bloginfo('name'); ?></a>
<span class="sep"> | </span>
<?php wp_loginout(); ?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>

183
functions.php Normal file
View File

@@ -0,0 +1,183 @@
<?php
/**
* dpsg-ebersberg functions and definitions
*
* @package dpsg-ebersberg
*/
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) )
$content_width = 640; /* pixels */
if ( ! function_exists( 'dpsg_ebersberg_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*/
function dpsg_ebersberg_setup() {
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on dpsg-ebersberg, use a find and replace
* to change 'dpsg-ebersberg' to the name of your theme in all the template files
*/
load_theme_textdomain( 'dpsg-ebersberg', get_template_directory() . '/languages' );
/**
* Add default posts and comments RSS feed links to head
*/
add_theme_support( 'automatic-feed-links' );
/**
* Enable support for Post Thumbnails on posts and pages
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
//add_theme_support( 'post-thumbnails' );
/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'dpsg-ebersberg' ),
) );
/**
* Enable support for Post Formats
*/
//add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
/**
* Setup the WordPress core custom background feature.
*/
add_theme_support( 'custom-background', apply_filters( 'dpsg_ebersberg_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif; // dpsg_ebersberg_setup
add_action( 'after_setup_theme', 'dpsg_ebersberg_setup' );
include 'bp_widget.php';
// register Baden_Powell widget
function register_bp_widget() {
register_widget( 'Baden_Powell' );
}
add_action( 'widgets_init', 'register_bp_widget' );
// Image sizes
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'article-large', 900, 375, true );
}
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 );
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
/**
* Register widgetized area and update sidebar with default widgets
*/
function dpsg_ebersberg_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'dpsg-ebersberg' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s hyphenate">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
}
add_action( 'widgets_init', 'dpsg_ebersberg_widgets_init' );
/**
* Enqueue scripts and styles
*/
function dpsg_ebersberg_scripts() {
wp_enqueue_style( 'dpsg-ebersberg-style', get_stylesheet_uri() );
wp_enqueue_script( 'dpsg-ebersberg-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'dpsg-ebersberg-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'dpsg-ebersberg-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
}
}
add_action( 'wp_enqueue_scripts', 'dpsg_ebersberg_scripts' );
/**
* Hier kommt mein Code
*/
if ( function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
}
/**
* Force post titles.
*/
function force_post_title_init()
{
wp_enqueue_script('jquery');
}
function force_post_title()
{
echo "<script type='text/javascript'>\n";
echo "
jQuery('#publish').click(function(){
var testervar = jQuery('[id^=\"titlediv\"]')
.find('#title');
if (testervar.val().length < 1)
{
setTimeout(\"jQuery('#ajax-loading').css('visibility', 'hidden');\", 100);
alert('Bitte gib einen Titel ein!');
setTimeout(\"jQuery('#publish').removeClass('button-primary-disabled');\", 100);
jQuery('[id^=\"title\"]').focus();
return false;
}
});
";
echo "</script>\n";
}
add_action('admin_init', 'force_post_title_init');
add_action('edit_form_advanced', 'force_post_title');
/**
* Implement the Custom Header feature.
*/
//require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';

81
header.php Normal file
View File

@@ -0,0 +1,81 @@
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <main id="main">
*
* @package dpsg-ebersberg
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/hyphenator.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.10.2.min.js"></script>
<link rel="shortcut icon" href="https://pfadfinder-ebersberg.de/favicon.ico" />
<script type="text/javascript">
$(function(){
// Check the initial Position of the Sticky Header
var stickyHeaderTop = $('.red').offset().top;
$(window).scroll(function(){
if( !$( "body" ).hasClass( "logged-in" ) ) {
if( $(window).scrollTop()-13 > stickyHeaderTop && $( window ).width() > 750) {
$('.red').css({position: 'fixed', top: '-13px'});
$('.main-navigation').css({position: 'fixed', top: '17px'});
$('.site-content').css({padding: '80px 0px 0px 0px'});
} else {
$('.red').css({position: 'static', top: '0px'});
$('.main-navigation').css({position: 'static', top: '0px'});
$('.site-content').css({padding: '0'});
}
} else {
if( $(window).scrollTop()+14 > stickyHeaderTop && $( window ).width() > 750) {
$('.red').css({position: 'fixed', top: '15px'});
$('.main-navigation').css({position: 'fixed', top: '45px'});
$('.site-content').css({padding: '80px 0px 0px 0px'});
} else {
$('.red').css({position: 'static', top: '0px'});
$('.main-navigation').css({position: 'static', top: '0px'});
$('.site-content').css({padding: '0'});
}
}
});
});
</script>
<?php if( false ) : ?>
<meta property="og:url" content="<?php echo home_url('/'); ?>" />
<meta property="og:title" content="<?php echo bloginfo('name'); ?>" />
<meta property="og:image" content="<?php echo get_stylesheet_directory_uri()."/images/fbimage.png"; ?>" />
<meta property="og:description" content="<?php echo bloginfo('description'); ?>" />
<?php endif; ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<?php do_action( 'before' ); ?>
<header id="masthead" class="site-header" role="banner">
<div class="site-branding">
<div class="yellow">
<a href="http://dpsg.de/" title="DPSG" target="_blank"><div class="dpsg"></div></a>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><div class="ebersberg"></div></a>
</div>
<div class="green"></div>
<!--<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>-->
</div>
<div class="red"></div>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Menu', 'dpsg-ebersberg' ); ?></h1>
<div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'dpsg-ebersberg' ); ?>"><?php _e( 'Skip to content', 'dpsg-ebersberg' ); ?></a></div>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- #site-navigation -->
</header><!-- #masthead -->
<div id="content" class="site-content">

94
image.php Normal file
View File

@@ -0,0 +1,94 @@
<?php
/**
* The template for displaying image attachments.
*
* @package dpsg-ebersberg
*/
get_header();
?>
<div id="primary" class="content-area image-attachment">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<div class="entry-meta">
<?php
$metadata = wp_get_attachment_metadata();
printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>', 'dpsg-ebersberg' ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( wp_get_attachment_url() ),
$metadata['width'],
$metadata['height'],
esc_url( get_permalink( $post->post_parent ) ),
esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
get_the_title( $post->post_parent )
);
edit_post_link( __( 'Edit', 'dpsg-ebersberg' ), '<span class="edit-link">', '</span>' );
?>
</div><!-- .entry-meta -->
<nav role="navigation" id="image-navigation" class="image-navigation">
<div class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'dpsg-ebersberg' ) ); ?></div>
<div class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'dpsg-ebersberg' ) ); ?></div>
</nav><!-- #image-navigation -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<div class="attachment">
<?php dpsg_ebersberg_the_attached_image(); ?>
</div><!-- .attachment -->
<?php if ( has_excerpt() ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div><!-- .entry-caption -->
<?php endif; ?>
</div><!-- .entry-attachment -->
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'dpsg-ebersberg' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php
if ( comments_open() && pings_open() ) : // Comments and trackbacks open
printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'dpsg-ebersberg' ), esc_url( get_trackback_url() ) );
elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open
printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'dpsg-ebersberg' ), esc_url( get_trackback_url() ) );
elseif ( comments_open() && ! pings_open() ) : // Only comments open
_e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a comment">post a comment</a>.', 'dpsg-ebersberg' );
elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed
_e( 'Both comments and trackbacks are currently closed.', 'dpsg-ebersberg' );
endif;
edit_post_link( __( 'Edit', 'dpsg-ebersberg' ), ' <span class="edit-link">', '</span>' );
?>
</footer><!-- .entry-meta -->
</article><!-- #post-## -->
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template();
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>

BIN
images/badge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/badge@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
images/border.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
images/border@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
images/bp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/bp@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
images/dpsg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
images/dpsg@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/fbimage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
images/green.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/green@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
images/kluft.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
images/kluft@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
images/navigation.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

BIN
images/navigation@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
images/redbottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/redbottom@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
images/redtop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/redtop@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
images/smashing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
images/smashing@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
images/smashing_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
images/yellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
images/yellow@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

129
inc/custom-header.php Normal file
View File

@@ -0,0 +1,129 @@
<?php
/**
* Sample implementation of the Custom Header feature
* http://codex.wordpress.org/Custom_Headers
*
* You can add an optional custom header image to header.php like so ...
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
</a>
<?php } // if ( ! empty( $header_image ) ) ?>
*
* @package dpsg-ebersberg
*/
/**
* Setup the WordPress core custom header feature.
*
* @uses dpsg_ebersberg_header_style()
* @uses dpsg_ebersberg_admin_header_style()
* @uses dpsg_ebersberg_admin_header_image()
*
* @package dpsg-ebersberg
*/
function dpsg_ebersberg_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'dpsg_ebersberg_custom_header_args', array(
'default-image' => '',
'default-text-color' => '000',
'width' => 1000,
'height' => 250,
'flex-height' => true,
'wp-head-callback' => 'dpsg_ebersberg_header_style',
'admin-head-callback' => 'dpsg_ebersberg_admin_header_style',
'admin-preview-callback' => 'dpsg_ebersberg_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'dpsg_ebersberg_custom_header_setup' );
if ( ! function_exists( 'dpsg_ebersberg_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @see dpsg_ebersberg_custom_header_setup().
*/
function dpsg_ebersberg_header_style() {
$header_text_color = get_header_textcolor();
// If no custom options for text are set, let's bail
// get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
if ( HEADER_TEXTCOLOR == $header_text_color )
return;
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( 'blank' == $header_text_color ) :
?>
.site-title,
.site-description {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
}
<?php
// If the user has set a custom color for the text use that
else :
?>
.site-title a,
.site-description {
color: #<?php echo $header_text_color; ?>;
}
<?php endif; ?>
</style>
<?php
}
endif; // dpsg_ebersberg_header_style
if ( ! function_exists( 'dpsg_ebersberg_admin_header_style' ) ) :
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*
* @see dpsg_ebersberg_custom_header_setup().
*/
function dpsg_ebersberg_admin_header_style() {
?>
<style type="text/css">
.appearance_page_custom-header #headimg {
border: none;
}
#headimg h1,
#desc {
}
#headimg h1 {
}
#headimg h1 a {
}
#desc {
}
#headimg img {
}
</style>
<?php
}
endif; // dpsg_ebersberg_admin_header_style
if ( ! function_exists( 'dpsg_ebersberg_admin_header_image' ) ) :
/**
* Custom header image markup displayed on the Appearance > Header admin panel.
*
* @see dpsg_ebersberg_custom_header_setup().
*/
function dpsg_ebersberg_admin_header_image() {
$style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
$header_image = get_header_image();
?>
<div id="headimg">
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<div class="displaying-header-text" id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
<?php if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo esc_url( $header_image ); ?>" alt="">
<?php endif; ?>
</div>
<?php
}
endif; // dpsg_ebersberg_admin_header_image

26
inc/customizer.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
/**
* dpsg-ebersberg Theme Customizer
*
* @package dpsg-ebersberg
*/
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function dpsg_ebersberg_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
}
add_action( 'customize_register', 'dpsg_ebersberg_customize_register' );
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function dpsg_ebersberg_customize_preview_js() {
wp_enqueue_script( 'dpsg_ebersberg_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );
}
add_action( 'customize_preview_init', 'dpsg_ebersberg_customize_preview_js' );

70
inc/extras.php Normal file
View File

@@ -0,0 +1,70 @@
<?php
/**
* Custom functions that act independently of the theme templates
*
* Eventually, some of the functionality here could be replaced by core features
*
* @package dpsg-ebersberg
*/
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*/
function dpsg_ebersberg_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'dpsg_ebersberg_page_menu_args' );
/**
* Adds custom classes to the array of body classes.
*/
function dpsg_ebersberg_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
return $classes;
}
add_filter( 'body_class', 'dpsg_ebersberg_body_classes' );
/**
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
*/
function dpsg_ebersberg_enhanced_image_navigation( $url, $id ) {
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
return $url;
$image = get_post( $id );
if ( ! empty( $image->post_parent ) && $image->post_parent != $id )
$url .= '#main';
return $url;
}
add_filter( 'attachment_link', 'dpsg_ebersberg_enhanced_image_navigation', 10, 2 );
/**
* Filters wp_title to print a neat <title> tag based on what is being viewed.
*/
function dpsg_ebersberg_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'dpsg-ebersberg' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'dpsg_ebersberg_wp_title', 10, 2 );

19
inc/jetpack.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
/**
* Jetpack Compatibility File
* See: http://jetpack.me/
*
* @package dpsg-ebersberg
*/
/**
* Add theme support for Infinite Scroll.
* See: http://jetpack.me/support/infinite-scroll/
*/
function dpsg_ebersberg_jetpack_setup() {
add_theme_support( 'infinite-scroll', array(
'container' => 'main',
'footer' => 'page',
) );
}
add_action( 'after_setup_theme', 'dpsg_ebersberg_jetpack_setup' );

234
inc/template-tags.php Normal file
View File

@@ -0,0 +1,234 @@
<?php
/**
* Custom template tags for this theme.
*
* Eventually, some of the functionality here could be replaced by core features
*
* @package dpsg-ebersberg
*/
if ( ! function_exists( 'dpsg_ebersberg_content_nav' ) ) :
/**
* Display navigation to next/previous pages when applicable
*/
function dpsg_ebersberg_content_nav( $nav_id ) {
global $wp_query, $post;
// Don't print empty markup on single pages if there's nowhere to navigate.
if ( is_single() ) {
$previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous )
return;
}
// Don't print empty markup in archives if there's only one page.
if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) )
return;
$nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation';
?>
<nav role="navigation" id="<?php echo esc_attr( $nav_id ); ?>" class="<?php echo $nav_class; ?>">
<h1 class="screen-reader-text"><?php _e( 'Post navigation', 'dpsg-ebersberg' ); ?></h1>
<?php if ( is_single() ) : // navigation links for single posts ?>
<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'dpsg-ebersberg' ) . '</span> %title' ); ?>
<?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'dpsg-ebersberg' ) . '</span>' ); ?>
<?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
<?php if ( get_next_posts_link() ) : ?>
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'dpsg-ebersberg' ) ); ?></div>
<?php endif; ?>
<?php if ( get_previous_posts_link() ) : ?>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'dpsg-ebersberg' ) ); ?></div>
<?php endif; ?>
<?php endif; ?>
</nav><!-- #<?php echo esc_html( $nav_id ); ?> -->
<?php
}
endif; // dpsg_ebersberg_content_nav
if ( ! function_exists( 'dpsg_ebersberg_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*/
function dpsg_ebersberg_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
<li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
<div class="comment-body">
<?php _e( 'Pingback:', 'dpsg-ebersberg' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit', 'dpsg-ebersberg' ), '<span class="edit-link">', '</span>' ); ?>
</div>
<?php else : ?>
<li id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>>
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
<?php printf( __( '%s <span class="says">says:</span>', 'dpsg-ebersberg' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
</div><!-- .comment-author -->
<div class="comment-metadata">
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
<time datetime="<?php comment_time( 'c' ); ?>">
<?php printf( _x( '%1$s at %2$s', '1: date, 2: time', 'dpsg-ebersberg' ), get_comment_date(), get_comment_time() ); ?>
</time>
</a>
<?php edit_comment_link( __( 'Edit', 'dpsg-ebersberg' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .comment-metadata -->
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'dpsg-ebersberg' ); ?></p>
<?php endif; ?>
</footer><!-- .comment-meta -->
<div class="comment-content">
<?php comment_text(); ?>
</div><!-- .comment-content -->
<?php
comment_reply_link( array_merge( $args, array(
'add_below' => 'div-comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '<div class="reply">',
'after' => '</div>',
) ) );
?>
</article><!-- .comment-body -->
<?php
endif;
}
endif; // ends check for dpsg_ebersberg_comment()
if ( ! function_exists( 'dpsg_ebersberg_the_attached_image' ) ) :
/**
* Prints the attached image with a link to the next attached image.
*/
function dpsg_ebersberg_the_attached_image() {
$post = get_post();
$attachment_size = apply_filters( 'dpsg_ebersberg_attachment_size', array( 1200, 1200 ) );
$next_attachment_url = wp_get_attachment_url();
/**
* Grab the IDs of all the image attachments in a gallery so we can get the
* URL of the next adjacent image in a gallery, or the first image (if
* we're looking at the last image in a gallery), or, in a gallery of one,
* just the link to that image file.
*/
$attachment_ids = get_posts( array(
'post_parent' => $post->post_parent,
'fields' => 'ids',
'numberposts' => -1,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID'
) );
// If there is more than 1 attachment in a gallery...
if ( count( $attachment_ids ) > 1 ) {
foreach ( $attachment_ids as $attachment_id ) {
if ( $attachment_id == $post->ID ) {
$next_id = current( $attachment_ids );
break;
}
}
// get the URL of the next image attachment...
if ( $next_id )
$next_attachment_url = get_attachment_link( $next_id );
// or get the URL of the first image attachment.
else
$next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
}
printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
esc_url( $next_attachment_url ),
the_title_attribute( array( 'echo' => false ) ),
wp_get_attachment_image( $post->ID, $attachment_size )
);
}
endif;
if ( ! function_exists( 'dpsg_ebersberg_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function dpsg_ebersberg_posted_on() {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) )
$time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
printf( __( '<span class="posted-on">Posted on %1$s</span><span class="byline"> by %2$s</span>', 'dpsg-ebersberg' ),
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
$time_string
),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'dpsg-ebersberg' ), get_the_author() ) ),
esc_html( get_the_author() )
)
);
}
endif;
/**
* Returns true if a blog has more than 1 category
*/
function dpsg_ebersberg_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {
// Create an array of all the categories that are attached to posts
$all_the_cool_cats = get_categories( array(
'hide_empty' => 1,
) );
// Count the number of categories that are attached to the posts
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'all_the_cool_cats', $all_the_cool_cats );
}
if ( '1' != $all_the_cool_cats ) {
// This blog has more than 1 category so dpsg_ebersberg_categorized_blog should return true
return true;
} else {
// This blog has only 1 category so dpsg_ebersberg_categorized_blog should return false
return false;
}
}
/**
* Flush out the transients used in dpsg_ebersberg_categorized_blog
*/
function dpsg_ebersberg_category_transient_flusher() {
// Like, beat it. Dig?
delete_transient( 'all_the_cool_cats' );
}
add_action( 'edit_category', 'dpsg_ebersberg_category_transient_flusher' );
add_action( 'save_post', 'dpsg_ebersberg_category_transient_flusher' );

47
index.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package dpsg-ebersberg
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'index' ); ?>
<?php endif; ?>
</main><!-- #main -->
<?php dpsg_ebersberg_content_nav( 'nav-below' ); ?>
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

36
js/customizer.js Normal file
View File

@@ -0,0 +1,36 @@
/**
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function( $ ) {
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'color': to,
'position': 'relative'
} );
}
} );
} );
} )( jQuery );

56
js/hyphenator.js Normal file

File diff suppressed because one or more lines are too long

6
js/jquery-1.10.2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
jQuery( document ).ready( function( $ ) {
$( document ).keydown( function( e ) {
var url = false;
if ( e.which === 37 ) { // Left arrow key code
url = $( '.nav-previous a' ).attr( 'href' );
}
else if ( e.which === 39 ) { // Right arrow key code
url = $( '.entry-attachment a' ).attr( 'href' );
}
if ( url && ( !$( 'textarea, input' ).is( ':focus' ) ) ) {
window.location = url;
}
} );
} );

34
js/navigation.js Normal file
View File

@@ -0,0 +1,34 @@
/**
* navigation.js
*
* Handles toggling the navigation menu for small screens.
*/
( function() {
var container, button, menu;
container = document.getElementById( 'site-navigation' );
if ( ! container )
return;
button = container.getElementsByTagName( 'h1' )[0];
if ( 'undefined' === typeof button )
return;
menu = container.getElementsByTagName( 'ul' )[0];
// Hide menu toggle button if menu is empty and return early.
if ( 'undefined' === typeof menu ) {
button.style.display = 'none';
return;
}
if ( -1 === menu.className.indexOf( 'nav-menu' ) )
menu.className += ' nav-menu';
button.onclick = function() {
if ( -1 !== container.className.indexOf( 'toggled' ) )
container.className = container.className.replace( ' toggled', '' );
else
container.className += ' toggled';
};
} )();

35
js/resize.js Normal file
View File

@@ -0,0 +1,35 @@
$( document ).ready(function() {
var changed = 0;
if($( window ).width()>600) {
set_image_sizes("900x500");
changed = 1;
}
$( window ).resize(function() {
if(changed==0 && $( window ).width()>560) {
set_image_sizes("900x500");
changed = 1;
}
});
});
function set_image_sizes(size) {
var dvImages = $("article .entry-header img");
$.each(dvImages, function(index){
var exists = 1;
var source = $(this).attr("src");
var output = source.substr(0, source.lastIndexOf('-')+1)+size+source.substr(source.lastIndexOf('.')) || source;
$.ajax({
url: output,
async: false,
success: function(data){
exists = 0;
},
error: function(data){
exists = 1;
}
})
if(exists==0) $(this).attr("src", output);
});
}

19
js/skip-link-focus-fix.js Normal file
View File

@@ -0,0 +1,19 @@
( function() {
var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,
is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;
if ( ( is_webkit || is_opera || is_ie ) && 'undefined' !== typeof( document.getElementById ) ) {
var eventMethod = ( window.addEventListener ) ? 'addEventListener' : 'attachEvent';
window[ eventMethod ]( 'hashchange', function() {
var element = document.getElementById( location.hash.substring( 1 ) );
if ( element ) {
if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )
element.tabIndex = -1;
element.focus();
}
}, false );
}
})();

356
languages/_s.pot Normal file
View File

@@ -0,0 +1,356 @@
# Copyright (C) 2013 Automattic
# This file is distributed under the GNU General Public License v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: _s 1.3-wpcom\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tags/_s\n"
"POT-Creation-Date: 2013-05-28 16:41:49+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
"Last-Translator: Simon Ellmann <simon@dpsg-rott.de>\n"
"Language-Team: Sid Inc. <kontakt@simonellmann.de>\n"
#: 404.php:15
msgid "Oops! That page can&rsquo;t be found."
msgstr ""
#: 404.php:19
msgid ""
"It looks like nothing was found at this location. Maybe try one of the links "
"below or a search?"
msgstr ""
#: 404.php:27
msgid "Most Used Categories"
msgstr ""
#. translators: %1$s: smiley
#: 404.php:44
msgid "Try looking in the monthly archives. %1$s"
msgstr ""
#: archive.php:21
msgid "Category Archives: %s"
msgstr ""
#: archive.php:24
msgid "Tag Archives: %s"
msgstr ""
#: archive.php:31
msgid "Author Archives: %s"
msgstr ""
#: archive.php:39
msgid "Daily Archives: %s"
msgstr ""
#: archive.php:42
msgid "Monthly Archives: %s"
msgstr ""
#: archive.php:45
msgid "Yearly Archives: %s"
msgstr ""
#: archive.php:48
msgid "Asides"
msgstr ""
#: archive.php:51
msgid "Images"
msgstr ""
#: archive.php:54
msgid "Videos"
msgstr ""
#: archive.php:57
msgid "Quotes"
msgstr ""
#: archive.php:60
msgid "Links"
msgstr ""
#: archive.php:63 sidebar.php:17
msgid "Archives"
msgstr ""
#: comments.php:29
msgctxt "comments title"
msgid "One thought on &ldquo;%2$s&rdquo;"
msgid_plural "%1$s thoughts on &ldquo;%2$s&rdquo;"
msgstr[0] ""
msgstr[1] ""
#: comments.php:36 comments.php:56
msgid "Comment navigation"
msgstr ""
#: comments.php:37 comments.php:57
msgid "&larr; Older Comments"
msgstr ""
#: comments.php:38 comments.php:58
msgid "Newer Comments &rarr;"
msgstr ""
#: comments.php:68
msgid "Comments are closed."
msgstr ""
#: content-page.php:18 content-single.php:20 content.php:27 image.php:95
msgid "Pages:"
msgstr ""
#: content-page.php:23 content-single.php:61 content.php:63 image.php:34
#: image.php:112 inc/template-tags.php:71 inc/template-tags.php:90
msgid "Edit"
msgstr ""
#. translators: used between list items, there is a space after the comma
#: content-single.php:29 content-single.php:32 content.php:38 content.php:48
msgid ", "
msgstr ""
#: content-single.php:37
msgid ""
"This entry was tagged %2$s. Bookmark the <a href=\"%3$s\" title=\"Permalink "
"to %4$s\" rel=\"bookmark\">permalink</a>."
msgstr ""
#: content-single.php:39
msgid ""
"Bookmark the <a href=\"%3$s\" title=\"Permalink to %4$s\" rel=\"bookmark"
"\">permalink</a>."
msgstr ""
#: content-single.php:45
msgid ""
"This entry was posted in %1$s and tagged %2$s. Bookmark the <a href=\"%3$s\" "
"title=\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
msgstr ""
#: content-single.php:47
msgid ""
"This entry was posted in %1$s. Bookmark the <a href=\"%3$s\" title="
"\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
msgstr ""
#: content.php:24
msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
msgstr ""
#: content.php:42
msgid "Posted in %1$s"
msgstr ""
#: content.php:53
msgid "Tagged %1$s"
msgstr ""
#: content.php:60
msgid "Leave a comment"
msgstr ""
#: content.php:60
msgid "1 Comment"
msgstr ""
#: content.php:60
msgid "% Comments"
msgstr ""
#: footer.php:16
msgid "A Semantic Personal Publishing Platform"
msgstr ""
#: footer.php:16
msgid "Proudly powered by %s"
msgstr ""
#: footer.php:18
msgid "Theme: %1$s by %2$s."
msgstr ""
#: functions.php:48
msgid "Primary Menu"
msgstr ""
#: functions.php:95
msgid "Sidebar"
msgstr ""
#: header.php:31
msgid "Menu"
msgstr ""
#: header.php:32
msgid "Skip to content"
msgstr ""
#: image.php:23
msgid ""
"Published <span class=\"entry-date\"><time class=\"entry-date\" datetime="
"\"%1$s\">%2$s</time></span> at <a href=\"%3$s\" title=\"Link to full-size "
"image\">%4$s &times; %5$s</a> in <a href=\"%6$s\" title=\"Return to %7$s\" "
"rel=\"gallery\">%8$s</a>"
msgstr ""
#: image.php:38
msgid "<span class=\"meta-nav\">&larr;</span> Previous"
msgstr ""
#: image.php:39
msgid "Next <span class=\"meta-nav\">&rarr;</span>"
msgstr ""
#: image.php:104
msgid ""
"<a class=\"comment-link\" href=\"#respond\" title=\"Post a comment\">Post a "
"comment</a> or leave a trackback: <a class=\"trackback-link\" href=\"%s\" "
"title=\"Trackback URL for your post\" rel=\"trackback\">Trackback URL</a>."
msgstr ""
#: image.php:106
msgid ""
"Comments are closed, but you can leave a trackback: <a class=\"trackback-link"
"\" href=\"%s\" title=\"Trackback URL for your post\" rel=\"trackback"
"\">Trackback URL</a>."
msgstr ""
#: image.php:108
msgid ""
"Trackbacks are closed, but you can <a class=\"comment-link\" href=\"#respond"
"\" title=\"Post a comment\">post a comment</a>."
msgstr ""
#: image.php:110
msgid "Both comments and trackbacks are currently closed."
msgstr ""
#: inc/extras.php:66
msgid "Page %s"
msgstr ""
#: inc/template-tags.php:34
msgid "Post navigation"
msgstr ""
#: inc/template-tags.php:38
msgctxt "Previous post link"
msgid "&larr;"
msgstr ""
#: inc/template-tags.php:39
msgctxt "Next post link"
msgid "&rarr;"
msgstr ""
#: inc/template-tags.php:44
msgid "<span class=\"meta-nav\">&larr;</span> Older posts"
msgstr ""
#: inc/template-tags.php:48
msgid "Newer posts <span class=\"meta-nav\">&rarr;</span>"
msgstr ""
#: inc/template-tags.php:71
msgid "Pingback:"
msgstr ""
#: inc/template-tags.php:81
msgid "%s <span class=\"says\">says:</span>"
msgstr ""
#: inc/template-tags.php:87
msgctxt "1: date, 2: time"
msgid "%1$s at %2$s"
msgstr ""
#: inc/template-tags.php:94
msgid "Your comment is awaiting moderation."
msgstr ""
#: inc/template-tags.php:117
msgid ""
"Posted on <a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class="
"\"entry-date\" datetime=\"%3$s\">%4$s</time></a><span class=\"byline\"> by "
"<span class=\"author vcard\"><a class=\"url fn n\" href=\"%5$s\" title=\"%6$s"
"\" rel=\"author\">%7$s</a></span></span>"
msgstr ""
#: inc/template-tags.php:123
msgid "View all posts by %s"
msgstr ""
#: no-results.php:13
msgid "Nothing Found"
msgstr ""
#: no-results.php:19
msgid ""
"Ready to publish your first post? <a href=\"%1$s\">Get started here</a>."
msgstr ""
#: no-results.php:23
msgid ""
"Sorry, but nothing matched your search terms. Please try again with some "
"different keywords."
msgstr ""
#: no-results.php:28
msgid ""
"It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps "
"searching can help."
msgstr ""
#: search.php:16
msgid "Search Results for: %s"
msgstr ""
#: searchform.php:9
msgctxt "assistive text"
msgid "Search"
msgstr ""
#: searchform.php:10
msgctxt "placeholder"
msgid "Search &hellip;"
msgstr ""
#: searchform.php:11
msgctxt "submit button"
msgid "Search"
msgstr ""
#: sidebar.php:24
msgid "Meta"
msgstr ""
#. Theme Name of the plugin/theme
msgid "_s"
msgstr ""
#. Theme URI of the plugin/theme
msgid "http://underscores.me"
msgstr ""
#. Description of the plugin/theme
msgid ""
"Hi. I'm a starter theme called <code>_s</code>, or <em>underscores</em>, if "
"you like. I'm a theme meant for hacking so don't use me as a <em>Parent "
"Theme</em>. Instead try turning me into the next, most awesome, WordPress "
"theme out there. That's what I'm here for."
msgstr ""
#. Author of the plugin/theme
msgid "Automattic"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://automattic.com/"
msgstr ""

BIN
languages/de_DE.mo Normal file

Binary file not shown.

346
languages/de_DE.po Normal file
View File

@@ -0,0 +1,346 @@
msgid ""
msgstr ""
"Project-Id-Version: dpsg-ebersberg v1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2013-10-28 11:45:54+0000\n"
"Last-Translator: Simon Ellmann\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: CSL v1.x\n"
"X-Poedit-Language: German\n"
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-SearchPath-0: .\n"
"X-Textdomain-Support: yes"
#: 404.php:16
#@ dpsg-ebersberg
msgid "Oops! That page can&rsquo;t be found."
msgstr "Ups! Die Seite konnte leider nicht gefunden werden."
#: 404.php:20
#@ dpsg-ebersberg
msgid "It looks like nothing was found at this location. Maybe try one of the links below or a search?"
msgstr "Vielleicht hilft dir ja die Suche weiter:"
#: 404.php:28
#@ dpsg-ebersberg
msgid "Most Used Categories"
msgstr ""
#. translators: %1$s: smiley
#: 404.php:45
#, php-format
#@ dpsg-ebersberg
msgid "Try looking in the monthly archives. %1$s"
msgstr ""
#: archive.php:31
#, php-format
#@ dpsg-ebersberg
msgid "Author: %s"
msgstr "Autor: %s"
#: archive.php:39
#, php-format
#@ dpsg-ebersberg
msgid "Day: %s"
msgstr "Tag: %s"
#: archive.php:42
#, php-format
#@ dpsg-ebersberg
msgid "Month: %s"
msgstr "Monat: %s"
#: archive.php:45
#, php-format
#@ dpsg-ebersberg
msgid "Year: %s"
msgstr "Jahr: %s"
#: archive.php:48
#@ dpsg-ebersberg
msgid "Asides"
msgstr ""
#: archive.php:51
#@ dpsg-ebersberg
msgid "Images"
msgstr "Bilder"
#: archive.php:54
#@ dpsg-ebersberg
msgid "Videos"
msgstr ""
#: archive.php:57
#@ dpsg-ebersberg
msgid "Quotes"
msgstr ""
#: archive.php:60
#@ dpsg-ebersberg
msgid "Links"
msgstr ""
#: archive.php:63
#: sidebar.php:17
#@ dpsg-ebersberg
msgid "Archives"
msgstr "Archive"
#: bp_widget.php:55
#@ default
msgid "Title:"
msgstr ""
#: comments.php:29
#, php-format
#@ dpsg-ebersberg
msgctxt "comments title"
msgid "One thought on &ldquo;%2$s&rdquo;"
msgid_plural "%1$s thoughts on &ldquo;%2$s&rdquo;"
msgstr[0] ""
msgstr[1] ""
#: comments.php:36
#: comments.php:56
#@ dpsg-ebersberg
msgid "Comment navigation"
msgstr ""
#: comments.php:37
#: comments.php:57
#@ dpsg-ebersberg
msgid "&larr; Older Comments"
msgstr ""
#: comments.php:38
#: comments.php:58
#@ dpsg-ebersberg
msgid "Newer Comments &rarr;"
msgstr ""
#: comments.php:68
#@ dpsg-ebersberg
msgid "Comments are closed."
msgstr ""
#. translators: used between list items, there is a space after the comma
#: content-page.php:12
#: content-single.php:10
#: content.php:64
#: image.php:34
#: image.php:78
#: inc/template-tags.php:71
#: inc/template-tags.php:90
#@ dpsg-ebersberg
msgid "Edit"
msgstr "Bearbeiten"
#: content-page.php:19
#: content-single.php:57
#: content.php:30
#: image.php:60
#@ dpsg-ebersberg
msgid "Pages:"
msgstr "Seiten:"
#. translators: used between list items, there is a space after the comma
#: content-single.php:16
#: content-single.php:19
#@ dpsg-ebersberg
msgid ", "
msgstr ""
#: functions.php:48
#@ dpsg-ebersberg
msgid "Primary Menu"
msgstr ""
#: functions.php:93
#@ dpsg-ebersberg
msgid "Sidebar"
msgstr ""
#: header.php:73
#@ dpsg-ebersberg
msgid "Menu"
msgstr "Menü"
#: header.php:74
#@ dpsg-ebersberg
msgid "Skip to content"
msgstr ""
#: image.php:23
#, php-format
#@ dpsg-ebersberg
msgid "Published <span class=\"entry-date\"><time class=\"entry-date\" datetime=\"%1$s\">%2$s</time></span> at <a href=\"%3$s\" title=\"Link to full-size image\">%4$s &times; %5$s</a> in <a href=\"%6$s\" title=\"Return to %7$s\" rel=\"gallery\">%8$s</a>"
msgstr ""
#: image.php:39
#@ dpsg-ebersberg
msgid "<span class=\"meta-nav\">&larr;</span> Previous"
msgstr ""
#: image.php:40
#@ dpsg-ebersberg
msgid "Next <span class=\"meta-nav\">&rarr;</span>"
msgstr ""
#: image.php:69
#, php-format
#@ dpsg-ebersberg
msgid "<a class=\"comment-link\" href=\"#respond\" title=\"Post a comment\">Post a comment</a> or leave a trackback: <a class=\"trackback-link\" href=\"%s\" title=\"Trackback URL for your post\" rel=\"trackback\">Trackback URL</a>."
msgstr ""
#: image.php:71
#, php-format
#@ dpsg-ebersberg
msgid "Comments are closed, but you can leave a trackback: <a class=\"trackback-link\" href=\"%s\" title=\"Trackback URL for your post\" rel=\"trackback\">Trackback URL</a>."
msgstr ""
#: image.php:73
#@ dpsg-ebersberg
msgid "Trackbacks are closed, but you can <a class=\"comment-link\" href=\"#respond\" title=\"Post a comment\">post a comment</a>."
msgstr ""
#: image.php:75
#@ dpsg-ebersberg
msgid "Both comments and trackbacks are currently closed."
msgstr ""
#: inc/extras.php:66
#, php-format
#@ dpsg-ebersberg
msgid "Page %s"
msgstr ""
#: inc/template-tags.php:34
#@ dpsg-ebersberg
msgid "Post navigation"
msgstr ""
#: inc/template-tags.php:38
#@ dpsg-ebersberg
msgctxt "Previous post link"
msgid "&larr;"
msgstr ""
#: inc/template-tags.php:39
#@ dpsg-ebersberg
msgctxt "Next post link"
msgid "&rarr;"
msgstr ""
#: inc/template-tags.php:44
#@ dpsg-ebersberg
msgid "<span class=\"meta-nav\">&larr;</span> Older posts"
msgstr "Ältere Einträge <span class=\"meta-nav\">&rarr;</span>"
#: inc/template-tags.php:48
#@ dpsg-ebersberg
msgid "Newer posts <span class=\"meta-nav\">&rarr;</span>"
msgstr "<span class=\"meta-nav\">&larr;</span> Neuere Einträge"
#: inc/template-tags.php:71
#@ dpsg-ebersberg
msgid "Pingback:"
msgstr ""
#: inc/template-tags.php:81
#, php-format
#@ dpsg-ebersberg
msgid "%s <span class=\"says\">says:</span>"
msgstr ""
#: inc/template-tags.php:87
#, php-format
#@ dpsg-ebersberg
msgctxt "1: date, 2: time"
msgid "%1$s at %2$s"
msgstr ""
#: inc/template-tags.php:94
#@ dpsg-ebersberg
msgid "Your comment is awaiting moderation."
msgstr ""
#: inc/template-tags.php:186
#, php-format
#@ dpsg-ebersberg
msgid "<span class=\"posted-on\">Posted on %1$s</span><span class=\"byline\"> by %2$s</span>"
msgstr "<span class=\"posted-on\">Veröffentlicht am %1$s</span><span class=\"byline\"> von %2$s</span>"
#: inc/template-tags.php:194
#, php-format
#@ dpsg-ebersberg
msgid "View all posts by %s"
msgstr "Alle Einträge von %s ansehen"
#: no-results.php:13
#@ dpsg-ebersberg
msgid "Nothing Found"
msgstr ""
#: no-results.php:19
#, php-format
#@ dpsg-ebersberg
msgid "Ready to publish your first post? <a href=\"%1$s\">Get started here</a>."
msgstr ""
#: no-results.php:23
#@ dpsg-ebersberg
msgid "Sorry, but nothing matched your search terms. Please try again with some different keywords."
msgstr ""
#: no-results.php:28
#@ dpsg-ebersberg
msgid "It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help."
msgstr ""
#: search.php:16
#, php-format
#@ dpsg-ebersberg
msgid "Search Results for: %s"
msgstr "Suchergebnisse für: %s"
#: searchform.php:10
#: searchform.php:11
#@ dpsg-ebersberg
msgctxt "label"
msgid "Search for:"
msgstr ""
#: searchform.php:11
#@ dpsg-ebersberg
msgctxt "placeholder"
msgid "Search &hellip;"
msgstr ""
#: searchform.php:13
#@ dpsg-ebersberg
msgctxt "submit button"
msgid "Search"
msgstr ""
#: sidebar.php:24
#@ dpsg-ebersberg
msgid "Meta"
msgstr ""
#: content-single.php:24
#, php-format
#@ dpsg-ebersberg
msgid "| Tags: %2$s"
msgstr "| Schlagworte: %2$s"

6
languages/readme.txt Normal file
View File

@@ -0,0 +1,6 @@
Place your theme language files in this directory.
Please visit the following links to learn more about translating WordPress themes:
http://codex.wordpress.org/Translating_WordPress
http://codex.wordpress.org/Function_Reference/load_theme_textdomain

View File

@@ -0,0 +1,22 @@
/*
Theme Name: dpsg-ebersberg
Layout: Content-Sidebar
*/
.content-area {
float: left;
margin: 0 -25% 0 0;
width: 100%;
}
.site-main {
margin: 0 25% 0 0;
}
.site-content .widget-area {
float: right;
overflow: hidden;
width: 25%;
}
.site-footer {
clear: both;
width: 100%;
}

View File

@@ -0,0 +1,22 @@
/*
Theme Name: dpsg-ebersberg
Layout: Sidebar-Content
*/
.content-area {
float: right;
margin: 0 0 0 -25%;
width: 100%;
}
.site-main {
margin: 0 0 0 25%;
}
.site-content .widget-area {
float: left;
overflow: hidden;
width: 25%;
}
.site-footer {
clear: both;
width: 100%;
}

33
no-results.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
/**
* The template part for displaying a message that posts cannot be found.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package dpsg-ebersberg
*/
?>
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Nothing Found', 'dpsg-ebersberg' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'dpsg-ebersberg' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php elseif ( is_search() ) : ?>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'dpsg-ebersberg' ); ?></p>
<?php get_search_form(); ?>
<?php else : ?>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'dpsg-ebersberg' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
</div><!-- .page-content -->
</section><!-- .no-results -->

34
page.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package dpsg-ebersberg
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template();
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

17
rtl.css Normal file
View File

@@ -0,0 +1,17 @@
/*
Theme Name: dpsg-ebersberg
Adding support for language written in a Right To Left (RTL) direction is easy -
it's just a matter of overwriting all the horizontal positioning attributes
of your CSS stylesheet in a separate stylesheet file named rtl.css.
http://codex.wordpress.org/Right_to_Left_Language_Support
*/
/*
body {
direction: rtl;
unicode-bidi: embed;
}
*/

View File

@@ -0,0 +1,32 @@
<?php
abstract class SN_API_Base extends SN_Object implements ScoutNet_API{
private static $_instances = array();
protected function __construct(){
$this->_managers = array();
foreach( $this->_kinds as $kind ){
if( $this->isValidKind($kind) ){
$this->_managers[$kind] = $this->create_manager( $kind );
} else {
die( "$kind is not a valid kind" );
}
}
}
public static function _instance( $class ){
if( !isset(self::$_instances[$class]) ){
self::$_instances[$class] = new $class();
}
return self::$_instances[$class];
}
/**
* @return SN_Data_Manager_Base
*/
function getManager( $kind ){
if( isset($this->_managers[$kind]) ){
return $this->_managers[$kind];
}
throw new Exception( "count not find manager for $kind" );
}
function isValidKind( $kind ){
return in_array( $kind, $this->_kinds );
}
}

View File

@@ -0,0 +1,13 @@
<?php
class SN_API_Client extends SN_API_Generated_Client{
function create_manager( $kind ){
return new SN_Data_Manager_Client( $this, $kind );
}
/**
*
* @return ScoutNet_API
*/
static function instance(){
return self::_instance( __CLASS__ );
}
}

View File

@@ -0,0 +1,88 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
abstract class SN_API_Generated_Client extends SN_API_Base{
protected $_kinds = array('group','event','section','url',);
/**
* find a group given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Group
*/
function group( $id_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'group', $args );
}
/**
* returns the collection of groups matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Group
*/
function groups( $ids_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'groups', $args );
}
/**
* find a event given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Event
*/
function event( $id_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'event', $args );
}
/**
* returns the collection of events matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Event
*/
function events( $ids_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'events', $args );
}
/**
* find a section given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Section
*/
function section( $id_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'section', $args );
}
/**
* returns the collection of sections matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Section
*/
function sections( $ids_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'sections', $args );
}
/**
* find a url given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Url
*/
function url( $id_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'url', $args );
}
/**
* returns the collection of urls matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Url
*/
function urls( $ids_or_query, $args = array() ){
$args = func_get_args();
return SN_API_REST_Client::request( $this, 'urls', $args );
}
}

View File

@@ -0,0 +1,77 @@
<?php
class SN_API_REST_Client{
private static $api;
private static $url;
private static $helpers;
static function post( $api, $api_method, $api_method_args, $object_method=null, $object_method_args = array() ){
die(); // not active yet
self::$helpers = new SN_API_REST_Helpers( $api );
$url = SN_API_URL.$api_method.'/';
if( !is_array($api_method_args) ){
$url .= $api_method_args.'/';
if($object_method){
$url .= $object_method.'/';
if($object_method_args){
$data = json_encode($object_method_args);
}
}
}else{
$data = json_encode($api_method_args);
}
$postdata = http_build_query(
array(
'json' => json_serialize($data)
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$json = file_get_contents($url, false, $context);
$json = file_get_contents( $url );
$data = json_decode($json,true);
if( $data === NULL ){
throw new Exception(''.stripslashes($url)."\n canot parse JSON:\n".$json);
}
self::$api = $api;
self::$url = $url;
self::objectify( $data ); // this raises exception in case of error
return true;
}
static function request( $api, $api_method, $api_method_args, $object_method=null, $object_method_args = array() ){
global $sn_api_version;
self::$helpers = new SN_API_REST_Helpers( $api );
$url = SN_API_URL.$sn_api_version.'/'.$api_method.'/';
if( !is_array($api_method_args) ){
$url .= $api_method_args.'/';
if($object_method){
$url .= $object_method.'/';
if($object_method_args){
$url .= '?json='.urlencode(json_encode(self::$helpers->arrayify($object_method_args)));
}
}
}else{
$url .= '?json='.urlencode(json_encode(self::$helpers->arrayify($api_method_args)));
}
$json = file_get_contents( $url );
$data = json_decode($json,true);
if( $data === NULL ){
throw new Exception(''.stripslashes($url)."\n canot parse JSON:\n".var_export($json,true));
}
self::$api = $api;
self::$url = $url;
try{
return self::$helpers->objectify( $data );
} catch( SN_Exception_EndUser $e ){
throw new SN_Exception_EndUser( $e->getMessage() . ' (REST URL: '.$url.' )' );
}
}
}

View File

@@ -0,0 +1,96 @@
<?php
class SN_API_REST_Helpers{
function __construct( $api ){
$this->api = $api;
}
function objectify( $data ){
if( is_array($data) && array_key_exists("kind",$data) ){
if($data['kind'] === 'exception'){
throw new SN_Exception_EndUser( $data['message'] );
}
if( substr( $data['kind'], -strlen('collection') ) == 'collection' ){
if(!empty($data['element_kind'])){
$coll_class = "SN_Data_Collection_Custom_".ucwords($data['element_kind']);
}else{
$coll_class = "SN_Data_Collection";
}
assert( class_exists($coll_class) );
return new $coll_class( array_map( array($this,'objectify'), $data['elements'] ) );
}
$class = 'SN_Data_Object_Custom_'.ucwords($data['kind']);
assert( class_exists($class) );
return new $class(
array_map( array($this,'objectify'), $data ),
array('manager'=>$this->api->getManager($data['kind']))
);
}elseif(is_array($data)) {
return array_map( array($this,'objectify'), $data );
}
return $data;
}
function json_serialize($result){
if( !is_object($result) && !is_array($result) ){
if( $_SERVER['SERVER_NAME'] == 'localhost'){
echo "Fehler: Derzeit können nur ganze Objekte abgefragt werden, keine Attribute!";
echo "<pre>\n\n";
var_dump($result);
echo "\n\n";
debug_print_backtrace();
echo "\n\n</pre>";
}
throw new SN_Exception_EndUser( "Derzeit können nur ganze Objekte abgefragt werden, keine Attribute!" );
die();
}
$json = json_encode ( $this->arrayify($result) );
if(array_key_exists('beautify',$_GET)){
$json = json_indent($json);
}
return $json;
}
function arrayify( $data ){
if( !is_array($data) && !is_object($data) ){
return $data;
}
$data_ = $data;
if( $data instanceof SN_Data_Collection ){ // || is_array($result) ){ # last operand checks for 2d array
$data_ = array('kind' => 'collection');
if( !empty($data->element_kind) ){
$data_['element_kind'] = $data->element_kind;
}
$data_['elements'] = $data->getArrayCopy();
}elseif( $data instanceof SN_Data_Object ){
$data_ = $data->getArrayCopy();
}
$returnme = array();
foreach( $data_ as $k=>$v ){
$returnme[$k] = self::arrayify( $v );
}
return $returnme;
}
function json_dserialize( $args ){
if( get_magic_quotes_gpc() ){
$args = stripslashes($args);
}
$nojson = json_decode($args,true);
if ( is_null($nojson) ){
throw new SN_Exception_EndUser("Kein gültiges JSON in der URL: ".$args );
}
return $this->objectify( $nojson );
}
function decode_args( $exploded ){
$returnme = array();
foreach( $exploded as $arg ){
$matches = array();
if( preg_match('/^Kind:([a-zA-Z]*)\([0-9]*\)$/', (string)$arg, $matches) ) {
$returnme[] = $this->api->getManager($matches[1])->findById($matches[2]);
} else {
$returnme[] = $arg;
}
}
return $returnme;
}
}

View File

@@ -0,0 +1,196 @@
<?php
/* used as a universally unique identifier within SN_Array */
define( "SN_UNIQUE_TOKEN", "Oo5nIZ3XTtPa CjI1rBUMfZSJzrBQa_1xv-EkagrOdLtygVupPAPyYamSu ilAaQd4Vp-vMjU5tDs1EUNr8Zbm8r8dz QQxxEHvDOM3yDFTtyZcUYX-8f fKR2cxKHHhhy1dSOYq23Y5sdXK8Si5NYkCota0o060E1WJmeaS80ndhFHeUf0sfLNU7zW K4F-AT DO6ilNkD7hQ0wUdU09L1oJ8BRADBuYq07MRtudhcK5x-JvucoGUiaBZ5J0o" );
if( !defined('DISABLE_SHORT_SN_ARRAY_PLACEHOLDER_TOKEN') ){
define( "_", SN_UNIQUE_TOKEN );
}
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Array extends SN_Object implements ArrayAccess, Countable, IteratorAggregate{
protected $_error_proxy;
protected $php;
protected $array;
protected $result_class = "SN_Array";
function __construct( $array = array() ){
assert(is_array($array));
$this->_error_proxy = new _SN_Array_Error_Proxy("Do no use reset(...), current(...), etc. on SN_Collection_*. Use e.g. ->first() instead.");
$this->array = $array;
$this->php = new _SN_Array_PHPFunction_Proxy( $this, $this->result_class );
}
function contains( $item ){
return in_array( $item, $this->array );
}
function implode( $separator ){
return $this->php->implode( $separator, _ );
}
function map( $callback ){
return $this->php->array_map( $callback, _ );
}
function filter( $callback ){
return $this->php->array_filter( _, $callback );
}
function reduce( $function, $initial = NULL ){
$array = $this->array;
assert( count($array) >= 2 );
$result = array_reduce( $array, $function, $initial );
if( is_array($result) ){
return new SN_Data_Collection_Custom($result);
}
return $result;
}
private function _flatten_helper( $a, $b ){
if( $a === NULL || $a === 0 ){ // 0 is a workaround for different array_reduce behavior
return $b;
}
if( is_object($a) && is_object($b) && (get_class($a) == get_class($b)) ){
$coll_class = get_class($a);
} else {
$coll_class = "SN_Data_Collection";
}
if( is_object($a) ){
assert( is_a($a,'SN_Array') || is_a($a,'ArrayObject') );
$a_array = $a->getArrayCopy();
} else{
if( !is_array($a) ){
trigger_error( "Expected SN_Array, ArrayObject or array, got ".var_export($a,true), E_USER_WARNING );
}
$a_array = $a;
}
if( is_object($b) ){
assert( is_a($b,'SN_Array') || is_a($b,'ArrayObject') );
$b_array = $b->getArrayCopy();
} else{
if( !is_array($b) ){
trigger_error( "Expected SN_Array, ArrayObject or array, got ".var_export($b,true), E_USER_WARNING );
}
$b_array = $b;
}
return new $coll_class( array_merge($a_array,$b_array) );
}
/**
* Turns an SN_Array of SN_Arrays into a flat SN_Array, e.g. (new SN_Array( new SN_Array(1,2), new SN_Array(3) ))->flatten()->getArrayCopy() == array( 1,2,3 )
*/
function flatten(){
return $this->reduce( array($this,'_flatten_helper') );
}
// function copy(){
// $new = clone $this;
// $new->array_object = clone $this->array_object;
// return $new;
// }
// function exchangeArray ($array) {
// $new = $this->copy();
// $new->array_object->exchangeArray($array);
// return $new;
// }
function to( $class ){
return new $class( $this->array );
}
function toArray () { return $this->array; }
function getArrayCopy () { return $this->array; }
private function _getArrayCopyDeep( $obj ){
if(method_exists($obj,'getArrayCopyDeep')){
return $obj->getArrayCopyDeep();
} elseif( is_array($obj) ){
return array_map(array($this,'_getArrayCopyDeep'),$array);
}
return $obj;
}
function getArrayCopyDeep(){ return array_map(array($this,'_getArrayCopyDeep'),$this->array); }
// Countable interface
function count () { return count($this->array); }
// IteratorAggregate interface
function getIterator () { return new ArrayIterator($this->array); }
// ArrayAccess interface
function offsetExists ($index) {
return array_key_exists( $index, $this->array );
}
function offsetGet ($index){
return $this->array[$index];
}
function offsetSet ($index, $newval){
if( is_null($index) ){
$this->array[] = $newval;
} else {
$this->array[$index] = $newval;
}
}
function offsetUnset($index){
unset($this->array[$index]);
}
/* // Iterator interface
public function rewind() {
return reset($this->array);
}
public function current() {
return current($this->array);
}
public function key() {
return key($this->array);
}
public function next() {
return next($this->array);
}
public function valid() {
return key($this->array) !== NULL;
}*/
function __toString(){
return $this->result_class.substr( print_r( $this->array, true ), 5 );
}
}
class _SN_Array_PHPFunction_Proxy{
function __construct( $collection, $result_class ){
$this->_collection = $collection;
$this->result_class = $result_class;
}
function __call( $name, $args ){
if( !is_callable($name) ){
throw new Exception("not a valid callback: ".var_export($name, true) );
}
if( in_array(_, $args) ){
$args[ array_search(_, $args) ] = $this->_collection->getArrayCopy();
$result = sn_call_user_func_array( $name, $args );
if( is_array($result) ){
$result_class = $this->result_class;
return new $result_class($result);
} else {
return $result;
}
}
throw new Exception("undefined method "+$name);
}
}
/**
* catches uses of reset( ... ), etc. on an object when being the first field of the object.
* @see https://bugs.php.net/bug.php?id=38478
* @see https://bugs.php.net/bug.php?id=49369
*/
class _SN_Array_Error_Proxy{
function __construct($msg){
$this->msg = $msg;
}
function __toString(){
throw new Exception($this->msg);
}
function __call($a,$b){
throw new Exception($this->msg);
}
function __invoke($a,$b){
throw new Exception($this->msg);
}
function __get($a){
throw new Exception($this->msg);
}
function offsetGet($a){
throw new Exception($this->msg);
}
}

View File

@@ -0,0 +1,42 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Collection extends SN_Array{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
protected $result_class = "SN_Collection";
function first(){
if(!count($this->array)){
throw new Exception("collection is empty");
}
return reset($this->array);
}
/* function sort(){
$args = func_get_args();
$copy = $this->getArrayCopy();
array_unshift( $args, $copy );
sort( $copy );
$class = get_class( $this );
return new $class( $copy );
}*/
/*
// function exists($index){
// return $this->offsetExists($index);
// }
function get($index){
return $this->offsetGet($index);
}
function set($index, $value){
$array = $this->array;
$array[$index] = $value;
$class = get_class($this);
return new $class( $array );
}
function remove($index){
$array = $this->array;
unset($array[$index]);
$class = get_class($this);
return new $class( $array );
}
*/
}

View File

@@ -0,0 +1,56 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Collection extends SN_Collection{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
protected $result_class = "SN_Data_Collection_Custom";
/**
*
* @deprecated Bitte stattdessen select_one( $attribut_name ) verwenden.
*/
function field( $name ){
$result_class = $this->result_class;
$field = new $result_class();
foreach( $this as $element ){
$field[] = $element->$name;
}
return $field;
}
/**
* Erzeugt aus einer Liste von Datenobjekte eine Liste mit den Werten des angegeben Attributs jedes Objekts
* @param $name
*/
function select_one( $attribut ){
$result_class = $this->result_class;
$field = new SN_Data_Collection_Custom();
foreach( $this as $element ){
$field[] = $element->$attribut;
}
return $field;
}
/**
* Erzeugt aus einer Liste von Datenobjekte eine Liste mit den Datenobjekten mit den angegebenen Attributen der Ausgangsobjekte (wie SQL SELECT)
* @varargs
* @param $attribute
*/
function select( $attributes ){
if( is_array($attributes) ){
$names = $attributes;
} elseif(is_object($attributes) && method_exists($attributes,'getArrayCopy')){
$names = $attributes->getArrayCopy();
} else {
$names = func_get_args();
}
$result_class = $this->result_class;
$result = new SN_Data_Collection_Custom();
foreach( $this as $element ){
$row = new SN_Data_Object( array(), NULL );
foreach( $names as $name ){
$row[$name] = $element->$name;
}
$result[] = $row;
}
return $result;
}
}

View File

@@ -0,0 +1,19 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Collection_Base_Event extends SN_Data_Collection_Generated_Event{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
function Group_By_Start_Date_Time( $format ){
$result = new ArrayObject();
foreach( $this as $event ){
$key = strftime( $format, strtotime($event->start_date." ".$event->start_time) );
if( !isset($result[$key]) ){
$class = get_class($this);
$result[$key] = new $class();
}
$result[$key][] = $event;
}
return $result;
}
}

View File

@@ -0,0 +1,8 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Collection_Base_Group extends SN_Data_Collection_Generated_Group{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
}

View File

@@ -0,0 +1,8 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Collection_Base_Section extends SN_Data_Collection_Generated_Section{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
}

View File

@@ -0,0 +1,8 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Collection_Base_Url extends SN_Data_Collection_Generated_Url{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
}

View File

@@ -0,0 +1,8 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
class SN_Data_Collection_Generated_Event extends SN_Data_Collection_Custom{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
var $element_kind = "event";
}

View File

@@ -0,0 +1,8 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
class SN_Data_Collection_Generated_Group extends SN_Data_Collection_Custom{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
var $element_kind = "group";
}

View File

@@ -0,0 +1,8 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
class SN_Data_Collection_Generated_Section extends SN_Data_Collection_Custom{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
var $element_kind = "section";
}

View File

@@ -0,0 +1,8 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
class SN_Data_Collection_Generated_Url extends SN_Data_Collection_Custom{
protected $_error_proxy; // <- nötig für debugging, bitte an erster Stelle lassen
var $element_kind = "url";
}

View File

@@ -0,0 +1,49 @@
<?php
class SN_Data_Manager_Client extends SN_Object{
private $kind;
private $_api;
public function __construct( $api, $kind ){
$this->_api = $api;
$this->kind = $kind;
}
function __call( $method, $args ){
if( !$args ){
throw new SN_Exception( "please provide arguments for method ScoutNet_Manager_$this->kind::$method" );
}
if( $id = $this->get_id($args[0]) ){
unset( $args[0] );
}
if( !$id && is_numeric($args[0]) ){
$id = $args[0];
unset( $args[0] );
}
#print "CALLED WEBSERVICE by method: $method(".implode(",",$this->encode_args($args)).") \n";
return SN_API_REST_Client::request( $this->_api, $this->kind, $id, $method, $this->encode_args($args) );
#print "CALLED WEBSERVICE via url: $this->url \n\n";
}
private function get_id( $object ){
if( is_a($object,'SN_Data_Object') ){
if( isset($object['global_id']) ){
return $object['global_id'];
}else if( isset($object['id']) ){
return $object['id'];
}
}
}
private function encode_args( $args ){
$encoded_args = array();
foreach( $args as $a ){
if( is_a($a,'SN_Data_Object') ){
$data = $a->getArrayCopy();
$data['kind'] = $a->kind;
$encoded_args[] = 'Kind:'.$data['kind'].'('.$this->get_id($a).')';
} elseif( is_string($a) || is_numeric($a) ){
$encoded_args[] = $a;
} elseif( is_null($a) ){
} else {
$encoded_args[] = $a;
}
}
return $encoded_args;
}
}

View File

@@ -0,0 +1,62 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Object extends ArrayObject{
/**
* This effectively turns 'Fatal error: Call to undefined method' into a catchable exception
*/
function __call( $name, $args ){
throw new SN_Exception_UndefinedMethod("Call to undefined method ".get_class($this)."::".$name);
}
private $_manager;
function _manager(){
return $this->_manager;
}
function __construct( $array, $options = array() ){
parent::__construct($array);
$this->_manager = $options['manager'];
}
function __get( $name ){
if( $name[0] == '_' ){
return $this->$name;
} else {
return $this->$name();
}
}
function __set( $name, $value ){
if( $name[0] == '_' ){
$this->$name = $value;
} else {
$this[$name] = $value;
}
}
function __isset( $name ){
if( $name[0] == '_' ){
return isset($this->$name);
} else {
return isset($this[$name]);
}
}
function __unset( $name ){
if( $name[0] == '_' ){
unset($this->$name);
} else {
unset($this[$name]);
}
}
/**
* this is for debug output. do NOT parse this!
* @return string
*/
function __toString(){
$array = $this->getArrayCopy();
foreach( $array as $key => $value ){
if( is_object($value) ){
$array[$key] = (string)$value;
}
}
// ucwords leads to wrong class name for ScoutNet_URL
return (isset($this->kind) ?"ScoutNet_".ucwords($this->kind):"SN_Data_Object").substr( print_r($array,true), 5 );
}
}

View File

@@ -0,0 +1,9 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Object_Base_Event extends SN_Data_Object_Generated_Event{
function group(){
return $this->_manager()->group( $this );
}
}

View File

@@ -0,0 +1,73 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Object_Base_Group extends SN_Data_Object_Generated_Group{
/**
*
* @return ScoutNet_Group
*/
function parent( $layer = null ){
return $this->_manager()->parent( $this, $layer );
}
function parents( $options = array() ){
return $this->_manager()->parents( $this, $options );
}
function children(){
return $this->_manager()->children( $this );
}
/* function _national_association(){
return $this->parent( 'national_association' );
}*/
function sections(){
return $this->_manager()->sections($this);
}
function events( $query = NULL, $args = array() ){
return $this->_manager()->events( $this, $query, $args );
}
function urls( $query = NULL, $args = array() ){
return $this->_manager()->urls( $this, $query, $args );
}
/* function _layer_name(){
switch($this->layer()){
case 'wosm':
return National_Association
default:
return parent::name();
}
}
function _short_name(){
switch($this->layer()){
case 'wagggs':
case 'wosm':
case 'isgf':
case 'wagggs_region':
case 'wosm_region':
case 'isgf_region':
case 'wagggs_national_federation':
case 'wosm_national_federation':
case 'isgf_national_federation':
case 'national_association':
return $this->${$this->layer()}();
default:
return parent::name();
}
}
function _long_name(){
switch($this->layer()){
case 'wagggs':
case 'wosm':
case 'isgf':
case 'wagggs_region':
case 'wosm_region':
case 'isgf_region':
case 'wagggs_national_federation':
case 'wosm_national_federation':
case 'isgf_national_federation':
case 'national_association':
return parent::name();
default:
return parent::name().", ".parent::city()."-".parent::district();
}
}*/
}

View File

@@ -0,0 +1,9 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Object_Base_Section extends SN_Data_Object_Generated_Section{
function __toString(){
return $this->name;
}
}

View File

@@ -0,0 +1,9 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Data_Object_Base_Url extends SN_Data_Object_Generated_Url{
function group(){
return $this->_manager()->group( $this );
}
}

View File

@@ -0,0 +1,68 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
abstract class SN_Data_Object_Generated_Event extends SN_Data_Object_Custom implements ScoutNet_Event{
/**
*
* @return string
*/
function kind(){
return "event";
}
function id(){
return $this['id'];
}
function uid(){
return $this['uid'];
}
function group_id(){
return $this['group_id'];
}
function title(){
return $this['title'];
}
function organizer(){
return $this['organizer'];
}
function target_group(){
return $this['target_group'];
}
function start_date(){
return $this['start_date'];
}
function start_time(){
return $this['start_time'];
}
function end_date(){
return $this['end_date'];
}
function end_time(){
return $this['end_time'];
}
function zip(){
return $this['zip'];
}
function location(){
return $this['location'];
}
function url_text(){
return $this['url_text'];
}
function url(){
return $this['url'];
}
function description(){
return $this['description'];
}
function last_modified_by(){
return $this['last_modified_by'];
}
function last_modified_on(){
return $this['last_modified_on'];
}
function keywords(){
return $this['keywords'];
}
}

View File

@@ -0,0 +1,45 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
abstract class SN_Data_Object_Generated_Group extends SN_Data_Object_Custom implements ScoutNet_Group{
/**
*
* @return string
*/
function kind(){
return "group";
}
/**
*
* @return int
*/
function global_id(){
return $this['global_id'];
}
function name(){
return $this['name'];
}
function zip(){
return $this['zip'];
}
function city(){
return $this['city'];
}
function district(){
return $this['district'];
}
function internal_id(){
return $this['internal_id'];
}
function layer(){
return $this['layer'];
}
function federal_state(){
return $this['federal_state'];
}
function country(){
return $this['country'];
}
}

View File

@@ -0,0 +1,29 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
abstract class SN_Data_Object_Generated_Section extends SN_Data_Object_Custom implements ScoutNet_Section{
/**
*
* @return string
*/
function kind(){
return "section";
}
function id(){
return $this['id'];
}
function name(){
return $this['name'];
}
function start_age(){
return $this['start_age'];
}
function end_age(){
return $this['end_age'];
}
function color(){
return $this['color'];
}
}

View File

@@ -0,0 +1,26 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
abstract class SN_Data_Object_Generated_Url extends SN_Data_Object_Custom implements ScoutNet_Url{
/**
*
* @return string
*/
function kind(){
return "url";
}
function id(){
return $this['id'];
}
function group_id(){
return $this['group_id'];
}
function url(){
return $this['url'];
}
function text(){
return $this['text'];
}
}

View File

@@ -0,0 +1,2 @@
<?php
class SN_Exception extends ScoutNet_Exception{}

View File

@@ -0,0 +1,7 @@
<?php
class SN_Exception_EndUser extends ScoutNet_Exception{
function __construct( $message = "", $data = array() ){
parent::__construct( $message );
$this->data = $data;
}
}

View File

@@ -0,0 +1,3 @@
<?php
class SN_Exception_UndefinedAttribute extends SN_Exception{
}

View File

@@ -0,0 +1,3 @@
<?php
class SN_Exception_UndefinedMethod extends SN_Exception{
}

View File

@@ -0,0 +1,16 @@
<?php
# Note to ScoutNet team:
# All public methods in this class are exposed via the webservice
# and therefore publicly available over the Internet.
class SN_Object{
function __get( $name ){
trigger_error( "object of class '".get_class($this)."' has no attribute '$name'", E_USER_WARNING );
}
/**
* This effectively turns 'Fatal error: Call to undefined method' into a catchable exception
* (Note: Is this needed? Or is this a Catchable Fatal Error? Maybe only in newer PHP versions?)
*/
function __call( $name, $args ){
trigger_error( "object of class '".get_class($this)."' has no method '$name'", E_USER_WARNING );
}
}

View File

@@ -0,0 +1,63 @@
<?php
# DO NOT CHANGE THIS FILE
# This file has been auto-generated
interface ScoutNet_API{
/**
* find a group given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Group
*/
function group( $id_or_query, $args = array() );
/**
* returns the collection of groups matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Group
*/
function groups( $ids_or_query, $args = array() );
/**
* find a event given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Event
*/
function event( $id_or_query, $args = array() );
/**
* returns the collection of events matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Event
*/
function events( $ids_or_query, $args = array() );
/**
* find a section given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Section
*/
function section( $id_or_query, $args = array() );
/**
* returns the collection of sections matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Section
*/
function sections( $ids_or_query, $args = array() );
/**
* find a url given its id or a query
* @param $id_or_query int|string the id or query
* @param $args [array] optional query parameters
* @return ScoutNet_Url
*/
function url( $id_or_query, $args = array() );
/**
* returns the collection of urls matching the given ids or query
* @param $ids_or_query mixed either an array of int ids or a PfadiQL query string
* @param $args array arguments to fill the placeholders
* @return ScoutNet_Collection_Url
*/
function urls( $ids_or_query, $args = array() );
}

View File

@@ -0,0 +1,4 @@
<?php
interface ScoutNet_Collection extends IteratorAggregate, ArrayAccess, Countable{
}

Some files were not shown because too many files have changed in this diff Show More