diff --git a/lib/QUI/Bricks/Controls/Banner.html b/lib/QUI/Bricks/Controls/Banner.html new file mode 100644 index 0000000000000000000000000000000000000000..1b1deaa5aba9108e71686082a5a7d602e13656bc --- /dev/null +++ b/lib/QUI/Bricks/Controls/Banner.html @@ -0,0 +1,7 @@ + +<header> + <h2>{$this->getAttribute('title')}</h2> + <p> + {$this->getAttribute('text')} + </p> +</header> diff --git a/lib/QUI/Bricks/Controls/SideBox1.html b/lib/QUI/Bricks/Controls/SideBox1.html new file mode 100644 index 0000000000000000000000000000000000000000..3122194cd50966c00f2e9a42a6c7e89d3905ddd8 --- /dev/null +++ b/lib/QUI/Bricks/Controls/SideBox1.html @@ -0,0 +1,35 @@ + +{if $this->getAttribute( 'showImage' ) && $Site->getAttribute('image_site')} +<a href="{url site=$Site}" class="image"> + {image src=$Site->getAttribute('image_site') width=1400} +</a> +{/if} + +{if $this->getAttribute( 'showTitle' ) || $this->getAttribute( 'showShort' )} +<header> + {if $this->getAttribute( 'showTitle' )} + <h2> + <a href="{url site=$Site}"> + {$Site->getAttribute('title')} + </a> + </h2> + {/if} + {if $this->getAttribute( 'showShort' )} + <p> + {$Site->getAttribute('short')} + </p> + {/if} +</header> +{/if} + +{if $this->getAttribute( 'showContent' )} +<p> + {$Site->getAttribute('content')} +</p> +{/if} + +<footer> + <a href="{url site=$Site}" class="button"> + {locale group="quiqqer/bricks" var="continue.reading"} + </a> +</footer> diff --git a/lib/QUI/Bricks/Controls/SideBox2.html b/lib/QUI/Bricks/Controls/SideBox2.html new file mode 100644 index 0000000000000000000000000000000000000000..a56ab022fe1b7c4329d2fd72ee088f7288e1190e --- /dev/null +++ b/lib/QUI/Bricks/Controls/SideBox2.html @@ -0,0 +1,55 @@ + +{if $this->getAttribute('header-title') && $this->getAttribute('header-short')} +<header> + <h2>{$this->getAttribute('header-title')}</h2> + <p>{$this->getAttribute('header-short')}</p> +</header> +{/if} + +<div class="{$this->getAttribute('grid-class-row')}"> + + {foreach from=$children item=Site key=key} + <article class="{$this->getAttribute('grid-class-article')}"> + {if $this->getAttribute( 'showImage' ) && $Site->getAttribute('image_site')} + <a href="{url site=$Site}" class="image"> + {image src=$Site->getAttribute('image_site') width=640} + </a> + {/if} + + {if $this->getAttribute( 'showTitle' ) || $this->getAttribute( 'showShort' )} + <header> + {if $this->getAttribute( 'showTitle' )} + <h3> + <a href="{url site=$Site}"> + {$Site->getAttribute('title')} + </a> + </h3> + {/if} + </header> + {/if} + + {if $this->getAttribute( 'showShort' )} + <p> + {text_passage text=$Site->getAttribute('short') start=0 end=120 striphtml=true append="..."} + </p> + {/if} + + {if $this->getAttribute( 'showContent' )} + {$Site->getAttribute('content')} + {/if} + + <footer> + <a href="{url site=$Site}" class="button"> + {locale group="quiqqer/bricks" var="continue.reading"} + </a> + </footer> + </article> + + {assign var=modKey value=$key+1} + {if $modKey && $modKey % 2 === 0} + </div> + <div class="{$this->getAttribute('grid-class-row')}"> + {/if} + + {/foreach} +</div> diff --git a/lib/QUI/Bricks/Controls/SideBox2.php b/lib/QUI/Bricks/Controls/SideBox2.php new file mode 100644 index 0000000000000000000000000000000000000000..846cac60f1e59d77b8eccc5d17c9dc48ddcc848a --- /dev/null +++ b/lib/QUI/Bricks/Controls/SideBox2.php @@ -0,0 +1,113 @@ +<?php + +/** + * This file contains QUI\Bricks\Controls\SideBox2 + */ + +namespace QUI\Bricks\Controls; + +use QUI; + +/** + * Class SocialBox + * + * @package quiqqer/bricks + */ +class SideBox2 extends QUI\Control +{ + /** + * constructor + * @param Array $attributes + */ + public function __construct($attributes = array()) + { + // default options + $this->setAttributes(array( + 'showImage' => true, + 'showTitle' => true, + 'showDescription' => true, + 'showContent' => false, + + 'class' => 'quiqqer-bricks-sidebox2', + 'nodeName' => 'section', + 'site' => false, + 'limit' => 2, + + 'grid-class-row' => 'row', + 'grid-class-article' => '6u' + )); + + parent::setAttributes( $attributes ); + } + + /** + * (non-PHPdoc) + * @see \QUI\Control::create() + */ + public function getBody() + { + $Engine = QUI::getTemplateManager()->getEngine(); + + $Engine->assign(array( + 'this' => $this, + 'children' => $this->_getSites() + )); + + return $Engine->fetch( dirname( __FILE__ ) .'/SideBox2.html' ); + } + + /** + * Return the site objects + * + * @return array + */ + protected function _getSites() + { + $Project = $this->_getProject(); + $site = $this->getAttribute( 'site' ); + $limit = $this->getAttribute( 'limit' ); + + if ( !$limit ) { + $limit = 2; + } + + $sitetypes = explode( ';', $site ); + + $ids = array(); + $types = array(); + $where = array(); + + foreach ( $sitetypes as $sitetypeEntry ) + { + if ( is_numeric( $sitetypeEntry ) ) + { + $ids[] = $sitetypeEntry; + continue; + } + + $types[] = $sitetypeEntry; + } + + if ( !empty( $ids ) ) + { + $where['id'] = array( + 'type' => 'IN', + 'value' => $ids + ); + } + + if ( !empty( $types ) ) + { + $where['type'] = array( + 'type' => 'IN', + 'value' => $types + ); + } + + return $Project->getSites(array( + 'where_or' => $where, + 'limit' => $limit, + 'order' => 'release_from ASC' + )); + } +} \ No newline at end of file diff --git a/lib/QUI/Bricks/Controls/SideBox3.html b/lib/QUI/Bricks/Controls/SideBox3.html new file mode 100644 index 0000000000000000000000000000000000000000..8dce498366effdbe30284d832419cc58ae72974a --- /dev/null +++ b/lib/QUI/Bricks/Controls/SideBox3.html @@ -0,0 +1,55 @@ + +{if $this->getAttribute('header-title') && $this->getAttribute('header-short')} +<header> + <h2>{$this->getAttribute('header-title')}</h2> + <p>{$this->getAttribute('header-short')}</p> +</header> +{/if} + +<div class="{$this->getAttribute('grid-class-row')}"> + + {foreach from=$children item=Site key=key} + <article class="{$this->getAttribute('grid-class-article')}"> + {if $this->getAttribute( 'showImage' )} + <a href="{url site=$Site}" class="image"> + {image src=$Site->getAttribute('image_site') width=640} + </a> + {/if} + + {if $this->getAttribute( 'showTitle' ) || $this->getAttribute( 'showShort' )} + <header> + {if $this->getAttribute( 'showTitle' )} + <h3> + <a href="{url site=$Site}"> + {$Site->getAttribute('title')} + </a> + </h3> + {/if} + </header> + {/if} + + {if $this->getAttribute( 'showShort' )} + <p> + {text_passage text=$Site->getAttribute('short') start=0 end=120 striphtml=true append="..."} + </p> + {/if} + + {if $this->getAttribute( 'showContent' )} + {$Site->getAttribute('content')} + {/if} + + <footer> + <a href="{url site=$Site}" class="button"> + {locale group="quiqqer/bricks" var="continue.reading"} + </a> + </footer> + </article> + + {assign var=modKey value=$key+1} + {if $modKey && $modKey % 3 === 0} + </div> + <div class="{$this->getAttribute('grid-class-row')}"> + {/if} + + {/foreach} +</div> diff --git a/lib/QUI/Bricks/Controls/SideBox3.php b/lib/QUI/Bricks/Controls/SideBox3.php new file mode 100644 index 0000000000000000000000000000000000000000..68b1ba6668f7c76577908b8a34a8f4cd2a605b17 --- /dev/null +++ b/lib/QUI/Bricks/Controls/SideBox3.php @@ -0,0 +1,58 @@ +<?php + +/** + * This file contains QUI\Bricks\Controls\SideBox3 + */ + +namespace QUI\Bricks\Controls; + +use QUI; + +/** + * Class SocialBox + * + * @package quiqqer/bricks + */ +class SideBox3 extends QUI\Bricks\Controls\SideBox2 +{ + /** + * constructor + * @param Array $attributes + */ + public function __construct($attributes = array()) + { + // default options + $this->setAttributes(array( + 'showImage' => true, + 'showTitle' => true, + 'showDescription' => true, + 'showContent' => false, + + 'class' => 'quiqqer-bricks-sidebox3', + 'nodeName' => 'section', + 'site' => false, + 'limit' => 3, + + 'grid-class-row' => 'row', + 'grid-class-article' => '4u' + )); + + parent::setAttributes( $attributes ); + } + + /** + * (non-PHPdoc) + * @see \QUI\Control::create() + */ + public function getBody() + { + $Engine = QUI::getTemplateManager()->getEngine(); + + $Engine->assign(array( + 'this' => $this, + 'children' => $this->_getSites() + )); + + return $Engine->fetch( dirname( __FILE__ ) .'/SideBox3.html' ); + } +} \ No newline at end of file diff --git a/lib/QUI/Bricks/Manager.php b/lib/QUI/Bricks/Manager.php index 6ed62dc652c74f8da56148d26c9d0efb010fdc27..a5b88eac2ffe80db94f976d825e4def2b9d44a59 100644 --- a/lib/QUI/Bricks/Manager.php +++ b/lib/QUI/Bricks/Manager.php @@ -96,6 +96,10 @@ public function getAreasByProject(Project $Project, $layoutType=false) $projectName = $Project->getName(); + if ( !$layoutType ) { + $layoutType = $Project->getAttribute( 'layout' ); + } + // get all vhosts, and the used templates of the project $vhosts = QUI::getRewrite()->getVHosts();