/**
 * 
 * This function provides an easier way to display projects. Instead of having
 * to repeat the same code over and over on every page that should display the
 * projects gallery, with this function you just type in 'projects()' and  
 * your options.
 *
 * @author Irvin Dominguez <*****@*****.**>
 * @version 1.0.0
 *
 *
 * Usage:
 * ======
 * <?php projects() ?>
 *
 * Example:
 * <div class="gallery">
 *      <?php projects() ?>
 * </div>
 *
 *
 *
 * Options:
 * ========
 *
 * You can control the limit of the projects to display and other options
 * by supplying an associative array.
 *
 * <?php projects(array('visibleOnly' => true, 'limit' => 4)); ?>
 *
 *
 * Possible options (defaults in parenthesis):
 * -------------------------------------------
 *
 * 'visibleOnly'    (true)  	If true, only shows visible projects.
 *
 * 'limit'          (9)     	The number of projects to display.
 *
 * 'columns'        (3)     	The number of columns that will be displayed
 *
 * 'shuffle'		(false)		Displays random projects
 *
 * 'filterBy'		(empty)		Filters projects by a defined set of options which are 'by', 'tag', and 'separator'
 *
 */
function projects($options = array())
{
    /**
     * Default Options
     */
    $defaults = array('limit' => 9, 'columns' => 3, 'shuffle' => FALSE, 'filterBy' => NULL);
    /**
     * Merge default and given options
     */
    $options = array_merge($defaults, $options);
    /**
     * Get projects from the Projects page
     */
    $projects = page('projects')->images();
    /*if ($options['visibleOnly']) { 
    		$projects = $projects->visible(); 
    	}*/
    if ($options['shuffle']) {
        $projects = $projects->shuffle();
    }
    /*if (!array_key_exists('filterBy', $options)) {
    		$projects = $projects->filterBy(
    			$options['filterBy']['by'], 
    			$options['filterBy']['tag'],
    			$options['filterBy']['separator']
    		);
    	}*/
    $projects = $projects->limit($options['limit']);
    /**
     * Main Loop
     */
    $count = 0;
    foreach ($projects as $project) {
        $count++;
        ?>
		<div class="project__thumb<?php 
        ecco($count % $options['columns'] == 0, ' last');
        ?>
">
			<a href="<?php 
        echo page('projects')->url();
        ?>
">
				<?php 
        echo $project->crop(400, 280, 75)->html();
        ?>
				<button class="btn btn-line aligncenter"><?php 
        echo l::get('view_projects_btn');
        ?>
</button>
			</a>
		</div>

<?php 
    }
    // End foreach
}
          <h1>Christian Zehetner</h1>

          <?php 
// main menu items
$items = $pages->visible();
?>

          <?php 
if ($items->count() > 0) {
    ?>
          <ul class="site-nav__list">
            <?php 
    foreach ($items as $item) {
        ?>
            <li class="site-nav__item"><a class="site-nav__link <?php 
        ecco($item->isOpen(), 'site-nav__link--active');
        ?>
" href="<?php 
        echo $item->url();
        ?>
"><?php 
        echo html($item->title());
        ?>
</a></li>
            <?php 
    }
    ?>
          </ul>
          <?php 
}
?>
<!DOCTYPE html>
<html lang="<?php 
ecco($page->lang() == '', 'de', $page->lang());
?>
" />
<!-- header.php -->
<head>
	<title><?php 
ecco($page->title() == 'Zuhause', html($site->title()), html($site->title()) . ': ' . html($page->title()));
?>
    </title>
	<meta charset="utf-8" />
	<meta name="description" content="<?php 
echo html($site->description());
?>
" />
	<meta name="robots" content="index, follow" />
	<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">

    <!-- DEBUG (disable caching) -->
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
	<META HTTP-EQUIV="Expires" CONTENT="-1">
    <!-- END DEBUG -->

    <?php 
echo css('assets/css/octavo.css');
?>

	<!-- link rel="icon" href="/assets/images/favicon-16.png" sizes="16x16" type="image/png">
	<link rel="icon" href="/assets/images/favicon-32.png" sizes="32x32" type="image/png">
	<link rel="icon" href="/assets/images/favicon-48.png" sizes="48x48" type="image/png">
<?php

if ($page->hasImages()) {
    ?>
	<section class="gallery">
		
		<?php 
    $first = true;
    ?>
		<?php 
    foreach ($page->images() as $photo) {
        ?>
	
			<!-- Radio button (hidden with CSS) -->
			<input <?php 
        ecco($first, 'checked');
        ?>
 type="radio" name="thumbnail" id="<?php 
        echo $photo->hash();
        ?>
">
			
			<!-- Large photo -->
			<img src="<?php 
        echo thumb($photo, array('height' => 300))->dataUri();
        ?>
" title="<?php 
        echo $photo->title();
        ?>
"/>
Exemple #5
0
?>
				<?php 
if (count($prices)) {
    ?>
					<ul class="prices small-block-grid-1 medium-block-grid-2">
						<?php 
    foreach ($prices as $price) {
        ?>
							<li>
								<div class="small-12 columns">
									<strong><?php 
        echo $price->name();
        ?>
</strong>
									<?php 
        ecco(trim($price->description()) != '', $price->description()->kirbytext());
        ?>
								</div>
					            <form class="small-12 columns" method="post" action="<?php 
        echo url('shop/cart');
        ?>
">
					                <input type="hidden" name="action" value="add">
					                <input type="hidden" name="uri" value="<?php 
        echo $page->uri();
        ?>
">
					                <input type="hidden" name="variant" value="<?php 
        echo str::slug($price->name());
        ?>
">
Exemple #6
0
echo ecco($facebook->isNotEmpty(), '<li><a href="' . $facebook->toURL() . '"><i class="fa fa-facebook"></i></a></li>');
?>

		                <!-- Twitter -->
		                <?php 
echo ecco($twitter->isNotEmpty(), '<li><a href="' . $twitter->toURL() . '"><i class="fa fa-twitter"></i></a></li>');
?>

		                <!-- Instagram -->
		                <?php 
echo ecco($instagram->isNotEmpty(), '<li><a href="' . $instagram->toURL() . '"><i class="fa fa-instagram"></i></a></li>');
?>

		                <!-- Google Plus -->
		                <?php 
echo ecco($googleplus->isNotEmpty(), '<li><a href="' . $googleplus->toURL() . '"><i class="fa fa-google-plus"></i></a></li>');
?>

		            </ul>
		        </div>

		    </div>
		</footer>


		<!-- JavaScript -->
		<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>-->
		<?php 
echo js('assets/js/vendor/jquery-2.2.0.min.js');
?>
		<?php 
Exemple #7
0
				            	<input type="hidden" name="variant" value="<?php 
        echo str::slug($variant->name());
        ?>
">

								<h3 dir="auto" class="uk-margin-small-bottom" property="name" content="<?php 
        echo $page->title() . ' &ndash; ' . $variant->name();
        ?>
"><?php 
        echo $variant->name();
        ?>
</h3>

								<div property="description">
									<?php 
        ecco(trim($variant->description()) != '', $variant->description()->kirbytext()->bidi());
        ?>
								</div>

								<?php 
        if ($variant->hasOptions) {
            ?>
									<select dir="auto" class="uk-width-1-1" name="option">
										<?php 
            foreach (str::split($variant->options()) as $option) {
                ?>
											<option value="<?php 
                echo str::slug($option);
                ?>
"><?php 
                echo str::ucfirst($option);
<section id="content">
	<article>
        <header>
            <hgroup>
    		    <?php 
echo $page->title_styled()->markdown();
?>
            </hgroup>
    		<hr>

    		<section class="subtitle"><?php 
echo $page->subtitle()->kirbytext();
?>
</section>
    		<?php 
ecco($page->subtitle(), "<hr>", "");
?>

    		<aside id="post-meta">
    			<div class="place"><?php 
echo $page->city()->html();
?>
</div>
    			<div class="author">Printed for &nbsp;<div class="author-name"><?php 
echo $page->author()->html();
?>
</div>,&nbsp; in <em><?php 
echo $page->borrow()->html();
?>
</em></div>
    			<hr>
    ?>
        <article class="bloglist">
            <header>
                <hgroup>
                    <?php 
    echo $article->title_styled()->markdown();
    ?>
                </hgroup>
                <hr>

                <section class="subtitle"><?php 
    echo $article->subtitle()->kirbytext();
    ?>
</section>
                <?php 
    ecco($article->subtitle(), "<hr>", "");
    ?>

                <aside id="post-meta">
                    <div class="place"><?php 
    echo $article->city()->html();
    ?>
</div>
                    <div class="author">Printed for &nbsp;<div class="author-name"><?php 
    echo $article->author()->html();
    ?>
</div>,&nbsp; in <em><?php 
    echo $article->borrow()->html();
    ?>
</em></div>
                    <hr>
<ul class="mobile-nav list-bare" data-ui-component="mobile-nav">
  <?php 
foreach ($pages->visible() as $p) {
    ?>
<!--
  --><li class="<?php 
    ecco(mg::showSubpages($p), 'dropdown');
    ?>
">
    <a class="<?php 
    ecco(mg::showSubpages($p), 'dropdown__toggle');
    ?>
 <?php 
    echo $p->isOpen() ? ' active ' : '';
    ?>
" href="<?php 
    echo $p->url();
    ?>
">
      <?php 
    echo html($p->title());
    ?>
      <?php 
    if (mg::showSubpages($p)) {
        ?>
        <span class="dropdown__icon fa fa-caret-down"></span>
      <?php 
    }
    ?>
    </a>
    <?php 
    <?php 
foreach ($pages->visible() as $item) {
    ?>
      <?php 
    if ($item->isOpen()) {
        $iscurrent = true;
    } elseif ($site->activePage() == 'home' && $item->uri() == 'register') {
        $iscurrent = true;
    } elseif ($site->activePage() == 'erweiterte-suche' && $item->uri() == 'register') {
        $iscurrent = true;
    } else {
        $iscurrent = false;
    }
    ?>
      <li<?php 
    ecco($iscurrent, ' class="active"');
    ?>
>
        <div class="triangle-left"></div>
          <a href="<?php 
    echo $item->url();
    ?>
">
            <h5><?php 
    echo html($item->title());
    ?>
</h5>
          </a>
        <div class="triangle-right"></div>
      </li>
    <?php 
        ?>
	<?php 
        $val = $img->filename();
        ?>

	<option
	value="<?php 
        echo $val;
        ?>
"
	data-img-src="<?php 
        echo thumb($img, array('width' => $width), false);
        ?>
"
	<?php 
        ecco($val == $value, ' selected="selected"');
        ?>
	>
	<?php 
        echo $img->name();
        ?>
	</option>

	<?php 
    }
    ?>

</select>

<?php 
} else {
    if ($slide->text()->isNotEmpty()) {
        ?>
						<p class="summary"><?php 
        echo $slide->text();
        ?>
</p>
						<?php 
    }
    ?>

						<?php 
    if ($slide->button_text()->isNotEmpty() && $slide->button_link()->isNotEmpty()) {
        ?>
						<a class="btn btn-big<?php 
        ecco($slide->button_style() == 'btn-line', ' btn-line');
        ecco($slide->button_style() == 'btn-dark', ' btn-dark');
        ?>
" role="button" href="<?php 
        echo $slide->button_link();
        ?>
">
							<?php 
        echo html($slide->button_text());
        ?>
						</a>
						<?php 
    }
    ?>
					</div>
				</div>
			</div>
				<!-- Logo -->
				<a href="<?php 
echo $site->language->url();
?>
" class="logo" title="<?php 
echo $site->title()->html();
?>
"></a>

				<!-- Main Navigation Menu -->
				<?php 
snippet('nav');
?>

			</div>
		</div>

		<main <?php 
ecco(!$page->isHomePage(), 'class="pad"');
?>
>

		<?php 
if (param('status') != 'free-estimate' & !$page->isHomePage()) {
    ?>
			<?php 
    snippet('free_estimate');
    ?>
		<?php 
}
      <nav>
        <ul class="submenu">
          <?php 
        foreach ($items as $item) {
            ?>
          <?php 
            if ($item->labelnavigation() != '') {
                $labelNavigation = $item->labelnavigation();
            } else {
                $labelNavigation = $item->title();
            }
            ?>
  
        
          <li><a<?php 
            ecco($item->isOpen(), ' class="active"');
            ?>
 href="<?php 
            echo $item->url();
            ?>
"><?php 
            echo html($labelNavigation);
            ?>
</a></li>
          <?php 
        }
        ?>
           <div class="uuu"></div>
        </ul>
      </nav>
          <?php 
Exemple #16
0
snippet('icon', array('vertical' => false));
?>
    <ul class="menu">
      <?php 
$isHome = $page->isHomePage();
$preHome = $isHome ? '' : $site->url();
$isBlog = $page->title() == 'Blog';
?>
      <li><a href="<?php 
echo $preHome;
?>
#main">Home</a></li>
      <li><a href="<?php 
echo $preHome;
?>
#projects">Projects</a></li>
      <li><a href="<?php 
echo $preHome;
?>
#contact">Contact</a></li>
      <li <?php 
ecco($isBlog, ' class="active"');
?>
><a href="<?php 
echo $site->url();
?>
/blog">Blog</a></li>
    </ul>
  </div>
</nav>
Exemple #17
0
<ul dir="auto" class="<?php 
if ($class) {
    echo $class;
}
?>
">
  <?php 
$class = false;
?>
  <?php 
foreach ($subpages->visible() as $p) {
    ?>
  <li>
    <a <?php 
    ecco($p->isActive(), 'class="uk-active"');
    ?>
 href="<?php 
    echo $p->url();
    ?>
"><?php 
    echo $p->title();
    ?>
</a>
    <?php 
    if ($p->hasChildren()) {
        ?>
        <?php 
        snippet('treemenu', array('subpages' => $p->children(), 'template' => 'category', 'class' => 'uk-nav-sub'));
        ?>
    <?php 
Exemple #18
0
                                    <input class="uk-button uk-button-small <?php 
            ecco($order->status()->value === 'paid', 'uk-button-success');
            ?>
" type="submit" value="<?php 
            echo l::get('paid');
            ?>
">
                                </form>
                                <form action="" method="POST">
                                    <input type="hidden" name="update_id" value="<?php 
            echo $order->uid();
            ?>
">
                                    <input type="hidden" name="action" value="mark_shipped">
                                    <input class="uk-button uk-button-small <?php 
            ecco($order->status()->value === 'shipped', 'uk-button-success');
            ?>
" type="submit" value="<?php 
            echo l::get('shipped');
            ?>
">
                                </form>
                            </div>
                        <?php 
        } else {
            switch ($order->status()->value) {
                case 'paid':
                    echo l::get('paid');
                    break;
                case 'shipped':
                    echo l::get('shipped');
Exemple #19
0
<nav class="main-navigation" role="navigation banner" id="top">
  <ul class="menu">
    <?php 
foreach ($pages->visible() as $p) {
    ?>
    <li class="menu-item <?php 
    ecco($p->isOpen(), 'menu-item-active');
    ?>
">
      <a href="<?php 
    echo $p->url();
    ?>
"><?php 
    echo $p->title()->html();
    ?>
</a>
    </li>
    <?php 
}
?>
    <li class="menu-item">
      <a href="http://www.valhead.com/">Val Head</a>
    </li>
  </ul>
</nav>
Exemple #20
0
                            </form>
                        <?php 
        }
        ?>
                    <?php 
    }
    ?>

                    <!-- Set country -->
                    <form class="col--6  right" id="setCountry" action="" method="POST">
                        <select name="country" onChange="document.forms['setCountry'].submit();">
                            <?php 
    foreach ($countries as $c) {
        ?>
                                <option <?php 
        echo ecco(s::get('country') === $c->uid(), 'selected');
        ?>
 value="<?php 
        echo $c->countrycode();
        ?>
">
                                    <?php 
        echo $c->title();
        ?>
                                </option>
                            <?php 
    }
    ?>
                        </select>
                        <button class="btn" type="submit"><?php 
    echo l::get('update-country');
							Modernizr.load('<?php 
echo $site->url();
?>
/assets/js/vendor/jquery-1.11.3.min.js');
						}
					}
				},
				// Load other necessary scripts
				{
					load: [
						'<?php 
echo $site->url();
?>
/assets/js/main.min.js',
						<?php 
ecco($page->isHomePage(), "'" . $site->url() . "/assets/js/slickslider.min.js'");
?>
					],
					callback: function() {
						jQuery('img').unveil();
					}
				},
				// For mobile devices
				{
					test: Modernizr.mq('only all and (max-width: 868px)'),
					yep: '<?php 
echo $site->url();
?>
/assets/js/mobile.min.js',
					callback: function() {
						FastClick.attach(document.body);