moved galleria logic into gallery mod
This commit is contained in:
parent
25bf7833e1
commit
db061a830f
@ -2,18 +2,9 @@
|
||||
class default_galerie extends SYSTEM\PAGE\Page {
|
||||
public function html() {
|
||||
//return saimod_webcraft_gallery::getGallery(1);
|
||||
$vars['default_gallery'] = $this->gallery();
|
||||
$vars['default_gallery'] = saimod_webcraft_gallery::getGalleryGalleria(1);
|
||||
//return $vars['rhein_wohnung'].'</br></br>'.saimod_webcraft_gallery::getGallery(2);
|
||||
return SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PPAGE(),'default_galerie/default_gallery.tpl'), $vars);
|
||||
|
||||
}
|
||||
|
||||
private function gallery(){
|
||||
$pics = \SYSTEM\FILES\files::get('gallery');
|
||||
$result = '';
|
||||
foreach($pics as $pic){
|
||||
$result .= '<img src="api.php?call=files&cat=gallery&id='.$pic.'" alt="" />';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,4 @@
|
||||
<div id="galleria" style="border-radius: 5px; height: 500px;">
|
||||
${default_gallery}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
Galleria.loadTheme('rhein/page/default_page/js/galleria/themes/classic/galleria.classic.min.js');
|
||||
Galleria.run('#galleria');
|
||||
</script>
|
||||
</div>
|
||||
@ -3,17 +3,7 @@
|
||||
class default_wohnung extends SYSTEM\PAGE\Page {
|
||||
public function html() {
|
||||
$vars = \SYSTEM\locale::getStrings(\DBD\locale_string::CATEGORY_RHEIN_TEXT);
|
||||
$vars['gallery_house'] = $this->gallery();
|
||||
//return $vars['rhein_wohnung'].'</br></br>'.saimod_webcraft_gallery::getGallery(2);
|
||||
$vars['gallery_house'] = saimod_webcraft_gallery::getGalleryGalleria(2);
|
||||
return SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PPAGE(),'default_wohnung/default_wohnung.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function gallery(){
|
||||
$pics = \SYSTEM\FILES\files::get('house');
|
||||
$result = '';
|
||||
foreach($pics as $pic){
|
||||
$result .= '<img src="api.php?call=files&cat=house&id='.$pic.'" alt="" />';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@ -3,8 +3,4 @@
|
||||
<div id="galleria" style="border-radius: 5px; height: 500px;">
|
||||
${gallery_house}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
Galleria.loadTheme('rhein/page/default_page/js/galleria/themes/classic/galleria.classic.min.js');
|
||||
Galleria.run('#galleria');
|
||||
</script>
|
||||
</div>
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
class saimod_webcraft_gallery extends \SYSTEM\SAI\SaiModule {
|
||||
|
||||
public static function getGallery($id){
|
||||
$gallery = DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ID::QQ(array($id));
|
||||
public static function getGalleryBootstrap($id){
|
||||
$gallery = \DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ID::QQ(array($id));
|
||||
$gallery_items = '';
|
||||
$first = true;
|
||||
while($img = $gallery->next()){
|
||||
@ -13,6 +13,15 @@ class saimod_webcraft_gallery extends \SYSTEM\SAI\SaiModule {
|
||||
array('gallery' => $id, 'items' => $gallery_items));
|
||||
}
|
||||
|
||||
public static function getGalleryGalleria($id){
|
||||
$gallery = \DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ID::QQ(array($id));
|
||||
$result = '';
|
||||
while($img = $gallery->next()){
|
||||
$result .= '<img class="carousel-img" src="./api.php?call=files&cat='.$img['file_cat'].'&id='.$img['file_id'].'" alt="">';}
|
||||
$result .= '<script>Galleria.loadTheme(\'rhein/page/default_page/js/galleria/themes/classic/galleria.classic.min.js\');Galleria.run(\'#galleria\');</script>';
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function sai_mod_saimod_webcraft_gallery_action_addgalleryitem($gallery, $position, $heading, $description, $file_cat, $file_id){
|
||||
if(!\DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ITEM_ADD::QI(array($gallery, $position, $heading, $description, $file_cat, $file_id))){
|
||||
throw new SYSTEM\LOG\ERROR("Problem with adding Galleryitem!");}
|
||||
@ -76,7 +85,7 @@ class saimod_webcraft_gallery extends \SYSTEM\SAI\SaiModule {
|
||||
while($entry = $gallery->next()){
|
||||
$content .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_tabentry.tpl'), $entry);}
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_tab.tpl'),
|
||||
array('content' => $content, 'gallery' => self::getGallery($name)));
|
||||
array('content' => $content, 'gallery' => self::getGalleryBootstrap($name)));
|
||||
}
|
||||
|
||||
public static function html_li_menu(){return '<li><a href="#" saimenu="saimod_webcraft_gallery">Gallery</a></li><li class="divider"></li>';}
|
||||
|
||||
Reference in New Issue
Block a user