Permalink
Browse files

frontend templates refactoring without breaking changes

  • Loading branch information...
greatestview committed Apr 12, 2017
1 parent 3f49b04 commit 71e2aac48b2daa7ef192f4e7ec6602c299dd3a2a
@@ -1,4 +1,4 @@
<?php
<?php
/**
* @author Palasthotel <rezeption@palasthotel.de>
* @copyright Copyright (c) 2014, Palasthotel
@@ -7,26 +7,31 @@
*/
?>
<div class="grid-box-editmode">
<?php
if(is_string($content)){
echo $content;
} else if(is_object($content)) {
echo $this->type();
if(null != $this->grid){
$vars = get_object_vars($content);
foreach ($vars as $field => $value) {
if(!empty($value)){
echo "<br/><i>".$field.":</i> ";
if(is_string($value) || is_numeric($value)){
echo $value;
} else {
echo t("no working template for value");
}
}
}
}
} else {
echo t("There is no working editmode template");
}
?>
<?php
if (is_string($content)) {
echo $content;
}
else {
if (is_object($content)) {
echo $this->type();
if (NULL != $this->grid) {
$vars = get_object_vars($content);
foreach ($vars as $field => $value) {
if (!empty($value)) {
echo "<br/><i>" . $field . ":</i> ";
if (is_string($value) || is_numeric($value)) {
echo $value;
}
else {
echo t("no working template for value");
}
}
}
}
}
else {
echo t("There is no working editmode template");
}
}
?>
</div>
@@ -1,48 +1,51 @@
<?php
<?php
/**
* @author Palasthotel <rezeption@palasthotel.de>
* @copyright Copyright (c) 2014, Palasthotel
* @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2
* @package Palasthotel\Grid
*/
$classes = $this->classes;
array_push($classes, 'grid-box');
if ($this->style) {
array_push($classes, $this->style);
}
if (!empty($this->title)) {
array_push($classes, 'has-title');
}
?>
<div class="grid-box<?php echo ($this->style)? " ".$this->style." ": " "; echo implode($this->classes," ")?>">
<?php
if ($this->title!=""){
if ($this->titleurl !=""){
?>
<h2 class="grid-box-title b-title"><a href="<?php echo $this->titleurl?>"><?php echo $this->title?></a></h2>
<?php }else{?>
<h2 class="grid-box-title b-title"><?php echo $this->title?></h2>
<?php }?>
<?php }?>
<?php if($this->prolog != "") { ?>
<div class="grid-box-prolog b-prolog">
<?php echo $this->prolog?>
</div>
<?php } ?>
<?php
if(is_string($content) ){
echo $content;
} else {
?>
<p><?php echo t("There is no working template for this Box."); ?></p>
<?php
}
?>
<?php if($this->epilog != ""){ ?>
<div class="grid-box-epilog b-epilog">
<?php echo $this->epilog?>
</div>
<?php } ?>
<?php
if ($this->readmore!=""){?>
<a href="<?php echo $this->readmoreurl?>" class="grid-box-readmore-link b-readmore-link"><?php echo $this->readmore?></a>
<?php }?>
<div class="<?php echo implode($classes, ' '); ?>">
<?php if (!empty($this->title)): ?>
<?php if (!empty($this->titleurl)): ?>
<h2 class="grid-box-title b-title"><a class="grid-box-title-link grid-box-title-text" href="<?php echo $this->titleurl; ?>"><?php echo $this->title; ?></a></h2>
<?php else: ?>
<h2 class="grid-box-title grid-box-title-text b-title"><?php echo $this->title; ?></h2>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($this->prolog)): ?>
<div class="grid-box-prolog b-prolog">
<?php echo $this->prolog; ?>
</div>
<?php endif; ?>
<?php if (is_string($content)): ?>
<?php echo $content; ?>
<?php else: ?>
<p><?php echo t("There is no working template for this Box."); ?></p>
<?php endif; ?>
<?php if (!empty($this->epilog)): ?>
<div class="grid-box-epilog b-epilog">
<?php echo $this->epilog; ?>
</div>
<?php endif; ?>
<?php if (!empty($this->readmore)): ?>
<a href="<?php echo $this->readmoreurl; ?>" class="grid-box-readmore-link b-readmore-link"><?php echo $this->readmore; ?></a>
<?php endif; ?>
</div>
@@ -1,11 +1,19 @@
<?php
<?php
/**
* @author Palasthotel <rezeption@palasthotel.de>
* @copyright Copyright (c) 2014, Palasthotel
* @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2
* @package Palasthotel\Grid
*/
$classes = $this->classes;
array_push($classes, 'grid-box');
if ($this->style) {
array_push($classes, $this->style);
}
?>
<div class="grid-box<?php echo ($this->style)? " ".$this->style." ": " "; echo implode($this->classes," ")?>">
<?php echo $content; ?>
<div class="<?php echo implode($classes, ' '); ?>">
<?php echo $content; ?>
</div>
@@ -7,21 +7,14 @@
*/
?>
<div class="grid-box-editmode">
<?php
if(is_string($content)){
?>RSS Feed<?php
} else {
?>
<p><strong><?php echo $this->content->url; ?></strong></p>
<ul>
<?php
foreach($content as $item){
echo "<li>".$item->getTitle()."</li>";
}
?>
</ul>
<?php
}
?>
</div>
<?php if (is_string($content)): ?>
RSS Feed
<?php else: ?>
<p><strong><?php echo $this->content->url; ?></strong></p>
<ul>
<?php foreach ($content as $item): ?>
<li><?php echo $item->getTitle(); ?> </li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
@@ -5,62 +5,57 @@
* @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2
* @package Palasthotel\Grid
*/
?>
<div class="grid-box<?php echo ($this->style)? " ".$this->style." ": " "; echo implode($this->classes," ")?>">
<?php
if ($this->title!=""){
if ($this->titleurl !=""){
?>
<h2 class="grid-box-title b-title"><a href="<?php echo $this->titleurl?>"><?php echo $this->title?></a></h2>
<?php }else{?>
<h2 class="grid-box-title b-title"><?php echo $this->title?></h2>
<?php }?>
<?php }?>
$classes = $this->classes;
array_push($classes, 'grid-box');
if ($this->style) {
array_push($classes, $this->style);
}
<?php if($this->prolog != "") { ?>
<div class="grid-box-prolog b-prolog">
<?php echo $this->prolog?>
</div>
<?php } ?>
?>
<div class="<?php echo implode($classes, ' '); ?>">
<?php if (!empty($this->title)): ?>
<?php if (!empty($this->titleurl)): ?>
<h2 class="grid-box-title b-title">
<a href="<?php echo $this->titleurl; ?>"><?php echo $this->title; ?></a>
</h2>
<?php else: ?>
<h2 class="grid-box-title b-title"><?php echo $this->title; ?></h2>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($this->prolog)): ?>
<div class="grid-box-prolog b-prolog">
<?php echo $this->prolog; ?>
</div>
<?php endif; ?>
<ul class="grid-rss-items">
<?php
if(is_string($content)){
// nothing selected
} else if(!empty($content) && count($content) > 0){
foreach($content as $item){
/**
* @var grid_rss_box_item $item
*/
?>
<li class="<?php echo implode(" ", $item->getClasses()); ?>"><a href="<?php
echo $item->getPermalink();
?>"><?php
echo $item->getDate("d.M.Y - H:i")."<br>";
echo $item->getTitle()."<br>";
echo $item->getDescription()
?></a></li>
<?php
}
}
?>
<?php
if (is_string($content)) {
// nothing selected
}
else if (is_array($content) && count($content) > 0) {
foreach ($content as $item) {
/**
* @var grid_rss_box_item $item
*/
?>
<li class="<?php echo implode(' ', $item->getClasses()); ?>"><a href="<?php echo $item->getPermalink(); ?>"><?php echo $item->getDate("d.M.Y - H:i") . '<br>' . $item->getTitle() . '<br>' . $item->getDescription(); ?></a></li>
<?php
}
}
?>
</ul>
<?php if($this->epilog != ""){ ?>
<div class="grid-box-epilog b-epilog">
<?php echo $this->epilog?>
</div>
<?php } ?>
<?php
if ($this->readmore!=""){?>
<a href="<?php echo $this->readmoreurl?>" class="grid-box-readmore-link b-readmore-link"><?php echo $this->readmore?></a>
<?php }?>
<?php if (!empty($this->epilog)): ?>
<div class="grid-box-epilog b-epilog">
<?php echo $this->epilog; ?>
</div>
<?php endif; ?>
<?php if (!empty($this->readmore)): ?>
<a href="<?php echo $this->readmoreurl; ?>" class="grid-box-readmore-link b-readmore-link"><?php echo $this->readmore; ?></a>
<?php endif; ?>
</div>
@@ -1,4 +1,4 @@
<?php
<?php
/**
* @author Palasthotel <rezeption@palasthotel.de>
* @copyright Copyright (c) 2014, Palasthotel
@@ -7,18 +7,18 @@
*/
?>
<div class="grid-box-editmode">
Soundcloud
<?php
/**
* if part of grid render details
*/
$fields = array("url","color","height");
if(null != $this->grid){
foreach ($fields as $field) {
if(!empty($content->{$field})){
echo "<br/>".$field.": ".$content->{$field};
}
}
}
?>
Soundcloud
<?php
/**
* if part of grid render details
*/
$fields = array('url', 'color', 'height');
if (NULL != $this->grid) {
foreach ($fields as $field) {
if (!empty($content->{$field})) {
echo '<br>' . $field . ': ' . $content->{$field};
}
}
}
?>
</div>
@@ -1,4 +1,4 @@
<?php
<?php
/**
* @author Palasthotel <rezeption@palasthotel.de>
* @copyright Copyright (c) 2014, Palasthotel
@@ -7,18 +7,18 @@
*/
?>
<div class="grid-box-editmode">
Video
<?php
/**
* if part of grid render details
*/
$fields = array("url","title","related");
if(null != $this->grid){
foreach ($fields as $field) {
if(!empty($content->{$field})){
echo "<br/>".$field.": ".$content->{$field};
}
}
}
?>
Video
<?php
/**
* if part of grid render details
*/
$fields = array('url', 'title', 'related');
if (NULL != $this->grid) {
foreach ($fields as $field) {
if (!empty($content->{$field})) {
echo '<br>' . $field . ': ' . $content->{$field};
}
}
}
?>
</div>
Oops, something went wrong.

0 comments on commit 71e2aac

Please sign in to comment.