public function homeIntro($data) {\r
$this->data = $data;\r
\r
- $res = $this->title($data['title']);\r
- $res .= $this->markupDotclear($data['content']);\r
- $res .= $this->linkCMS($data['button'], ['class' => 'btn', 'style' => 'background:'. $data['themecolor']]);\r
+ $res=$this->_leftText();\r
\r
return $this->_layer($res, 'intro');\r
}\r
+\r
+\r
}
\ No newline at end of file
class Fluidbook_View_Helper_HomeLayer extends CubeIT_View_Helper_Abstract {\r
public $data;\r
\r
- protected function _layer($content, $class, $attributes = array()) {\r
+ protected function _layer($content, $class, $attributes = array(), $outerContent = '') {\r
\r
- $class .= ' section ' . $this->data['headerstyle'];\r
+ $class .= ' section ' . $this->data['headerstyle'];\r
\r
$defaultAttributes = array('class' => $class, 'data-headerstyle' => $this->data['headerstyle']);\r
$attributes = $this->_mergeAttributes($attributes, $defaultAttributes);\r
\r
- $content = $this->htmlElement($content, 'div', array('class' => 'content-inner'));\r
-\r
+ $content = $this->htmlElement($content, 'div', array('class' => 'content-inner'));\r
+ $content .= $outerContent;\r
$content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight'));\r
\r
return $this->htmlElement($content, 'section', $attributes);\r
}\r
+\r
+ protected function _leftText() {\r
+ $res = $this->title($this->data['title']);\r
+ $res .= $this->markupDotclear($this->data['content']);\r
+ $res .= $this->linkCMS($this->data['button'], ['class' => 'btn', 'style' => 'background:' . $this->data['themecolor']]);\r
+ return $res;\r
+ }\r
}
\ No newline at end of file
* @return string\r
*/\r
public function homeReferences($data) {\r
- $this->data=$data;\r
+ $this->headScript()->addScriptAndStyle('215-home-references');\r
\r
+ $this->data = $data;\r
+\r
+ $res = $this->_leftText();\r
+ return $this->_layer($res, 'references', array(), $this->_references());\r
+ }\r
+\r
+ protected function _references() {\r
+ $fluidbooks = Fluidbook_Model_Reference::factory()->where('homeimage != ?', '')->order('date DESC')->limit(6)->find();\r
$res = '';\r
+ $i = 0;\r
+ foreach ($fluidbooks as $fluidbook) {\r
+ $res .= $this->_reference($fluidbook, $i % 6 == 2 || $i % 6 == 3);\r
+ $i++;\r
+ }\r
+ return $this->htmlElement($res, 'div', array('class' => 'links'));\r
+ }\r
+\r
+ /**\r
+ * @param $fluidbook Fluidbook_Model_Reference\r
+ * @return mixed\r
+ */\r
+ protected function _reference($fluidbook, $big = false) {\r
+ $w = 1024;\r
+ $h = $w / 2;\r
+ if ($big) {\r
+ $h = $w;\r
+ }\r
+ $fluidbook = $fluidbook->unserialize();\r
+ $res = $this->imageProcess($fluidbook->getHomeimage(), $fluidbook->getTitle(), $w, $h, array());\r
+ $attributes = array('class' => array('reference'));\r
+ if ($big) {\r
+ $attributes['class'][] = 'big';\r
+ }\r
\r
- return $this->_layer($res, 'references');\r
+ return $this->htmlElement($res, 'div', $attributes);\r
}\r
}
\ No newline at end of file
\r
\r
resizeHomeContact(ww, wh);\r
+ resizeHomeReferences(ww,wh);\r
}\r
\r
function resizeHomeContact(ww, wh) {\r
--- /dev/null
+registerLoader(load_home_references, true);\r
+\r
+function load_home_references() {\r
+\r
+}\r
+\r
+function resizeHomeReferences(ww, wh) {\r
+ var links = $("section.references .links");\r
+ $(links).css({width: wh, height: wh});\r
+\r
+ var i = 0;\r
+ var x = 0;\r
+ var y = 0;\r
+ var u = wh / 2;\r
+ $(links).find('.reference').each(function () {\r
+ $(this).css({width: u, left: x, top: y});\r
+ if ($(this).hasClass('big')) {\r
+ y += u;\r
+ } else {\r
+ y += u / 2;\r
+ }\r
+ i++;\r
+ if (i % 3 == 0) {\r
+ y = 0;\r
+ x += u;\r
+ }\r
+ });\r
+}
\ No newline at end of file
--- /dev/null
+@import "000-imports";\r
+\r
+section.references {\r
+ position: relative;\r
+ .links {\r
+ position: absolute;\r
+ right: 0;\r
+ top: 0;\r
+ height: 100%;\r
+ overflow: hidden;\r
+\r
+ .reference{\r
+ display: block;\r
+ position: absolute;\r
+ }\r
+\r
+ img {\r
+ width: 100%;\r
+ height: auto;\r
+ display: block;\r
+ }\r
+ }\r
+}
\ No newline at end of file