diff --git a/friseurteam/files/page/background_friseur.png b/friseurteam/files/page/background_friseur.png new file mode 100644 index 0000000..0c81a0f Binary files /dev/null and b/friseurteam/files/page/background_friseur.png differ diff --git a/friseurteam/files/register_files.php b/friseurteam/files/register_files.php index 899847d..2d97336 100644 --- a/friseurteam/files/register_files.php +++ b/friseurteam/files/register_files.php @@ -1,2 +1,2 @@ - - tralala + +
+ +
+

Friseur Team, © WebCraft Media 2014

\ No newline at end of file diff --git a/friseurteam/sai/autoload.inc.php b/friseurteam/sai/autoload.inc.php index f9fb068..6950d6b 100644 --- a/friseurteam/sai/autoload.inc.php +++ b/friseurteam/sai/autoload.inc.php @@ -1,2 +1,3 @@ next()){ + $img['active'] = $first ? 'active' : ''; + $first = false; + $gallery_items .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webraft_gallery_gallery_item.tpl'), $img);} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webraft_gallery_gallery.tpl'), + 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 .= '';} + $result .= ''; + 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!");} + return \SYSTEM\LOG\JsonResult::ok();} + public static function sai_mod_saimod_webcraft_gallery_action_delgalleryitem($id){ + if(!\DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ITEM_DELETE::QI(array($id))){ + throw new SYSTEM\LOG\ERROR("Problem with deleting Galleryitem!");} + return \SYSTEM\LOG\JsonResult::ok();} + public static function sai_mod_saimod_webcraft_gallery_action_chggalleryitem($id, $gallery, $position, $heading, $description, $file_cat, $file_id){ + if(!\DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ITEM_CHG::QI(array($gallery, $position, $heading, $description, $file_cat, $file_id, $id))){ + throw new SYSTEM\LOG\ERROR("Problem with changing Galleryitem!");} + return \SYSTEM\LOG\JsonResult::ok();} + + public static function sai_mod_saimod_webcraft_gallery_action_addgallery(){ + $vars = array('file_cat_options' => self::select_options_cat(), 'file_id_options' => self::sai_mod_saimod_webcraft_gallery_action_select_options_id(array_keys(\SYSTEM\FILES\files::get())[0])); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_add.tpl'),$vars); + } + + private static function select_options_cat($cat = null){ + $result = ''; + $cats = \SYSTEM\FILES\files::get(); + foreach($cats as $name=>$path){ + $selected = $name == $cat ? 'selected' : ''; + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_file_option.tpl'), array('name' => $name, 'selected' => $selected)); + } + return $result; + } + + public static function sai_mod_saimod_webcraft_gallery_action_select_options_id($cat, $id = null){ + $result = ''; + $files = \SYSTEM\FILES\files::get($cat); + foreach($files as $file){ + $selected = $file == $id ? 'selected' : ''; + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_file_option.tpl'), array('name' => $file, 'selected' => $selected)); + } + return $result; + } + + public static function sai_mod_saimod_webcraft_gallery_action_showgalleryitem($gallery,$id){ + $vars = \DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ITEM_ID::Q1(array($gallery,$id)); + $vars = array_merge($vars, array('file_cat_options' => self::select_options_cat($vars['file_cat']), 'file_id_options' => self::sai_mod_saimod_webcraft_gallery_action_select_options_id($vars['file_cat'],$vars['file_id']))); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_show.tpl'),$vars); + } + + public static function sai_mod_saimod_webcraft_gallery(){ + $galleries = DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERIES::QQ(); + $vars = array('tabopts' => '', 'firsttab' => ''); + $first = true; + while($gallery = $galleries->next()){ + $gallery['active'] = $first ? 'active' : ''; + if($first){$vars['firsttab'] = self::sai_mod_saimod_webcraft_gallery_action_tab($gallery['gallery']);} + $first = false; + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_tabopt.tpl'), $gallery);} + + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(), 'saimod_webcraft_gallery/saimod_webcraft_gallery_tabs.tpl'),$vars); + } + + public static function sai_mod_saimod_webcraft_gallery_action_tab($name){ + $gallery = DBD\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ID::QQ(array($name)); + $content = ''; + 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::getGalleryBootstrap($name))); + } + + public static function html_li_menu(){return '
  • Gallery
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + public static function sai_mod_saimod_webcraft_gallery_flag_js(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new PSAI(),'saimod_webcraft_gallery/saimod_webcraft_gallery.js')));} + public static function sai_mod_saimod_webcraft_gallery_flag_css(){ + return \SYSTEM\LOG\JsonResult::toString(array());} + +} diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_add.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_add.tpl new file mode 100644 index 0000000..6b4106f --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_add.tpl @@ -0,0 +1,31 @@ +

    Add Gallery Element

    + + + + + + + + + + + + + + + + + + + + + +
    Gallery
    Position
    Heading
    Description
    File + + +
    + +
    +
    + + \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_file_option.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_file_option.tpl new file mode 100644 index 0000000..63340a7 --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_file_option.tpl @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_show.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_show.tpl new file mode 100644 index 0000000..3a47b86 --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_show.tpl @@ -0,0 +1,37 @@ +

    Show Gallery Element

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Gallery${gallery}
    Position${position}
    Heading${heading}
    Description${description}
    File./api.php?call=files&cat=${file_cat}&id=${file_id} + + +
    + +
    +
    + + + \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tab.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tab.tpl new file mode 100644 index 0000000..47b8a7d --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tab.tpl @@ -0,0 +1,20 @@ +${gallery} + + + + + + + + + + ${content} + + + + + + + + +
    IDGalleryPositionHeadingDescriptionFile
    \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabentry.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabentry.tpl new file mode 100644 index 0000000..449ad41 --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabentry.tpl @@ -0,0 +1,8 @@ + + ${ID} + ${gallery} + ${position} + ${heading} + ${description} + ./api.php?call=files&cat=${file_cat}&id=${file_id} + \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabopt.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabopt.tpl new file mode 100644 index 0000000..062063e --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabopt.tpl @@ -0,0 +1 @@ +
  • Gallery ${gallery}
  • \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabs.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabs.tpl new file mode 100644 index 0000000..c718641 --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webcraft_gallery_tabs.tpl @@ -0,0 +1,10 @@ +

    Gallery

    +
    +
    + +
    + +
    +
    \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webraft_gallery_gallery.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webraft_gallery_gallery.tpl new file mode 100644 index 0000000..2f3b8ba --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webraft_gallery_gallery.tpl @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/saimod_webraft_gallery_gallery_item.tpl b/friseurteam/sai/saimod_webcraft_gallery/saimod_webraft_gallery_gallery_item.tpl new file mode 100644 index 0000000..8e78282 --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/saimod_webraft_gallery_gallery_item.tpl @@ -0,0 +1,7 @@ +
    + + +
    \ No newline at end of file diff --git a/friseurteam/sai/saimod_webcraft_gallery/sql/saimod_webcraft_gallery.sql b/friseurteam/sai/saimod_webcraft_gallery/sql/saimod_webcraft_gallery.sql new file mode 100644 index 0000000..e1d822a --- /dev/null +++ b/friseurteam/sai/saimod_webcraft_gallery/sql/saimod_webcraft_gallery.sql @@ -0,0 +1,26 @@ +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5000, 42, 0, 0, 'saimod_webcraft_gallery', 'action', NULL); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5001, 42, 2, 5000, 'showgalleryitem', 'gallery', 'UINT0'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5002, 42, 2, 5000, 'showgalleryitem', 'id', 'UINT0'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5005, 42, 2, 5000, 'addgalleryitem', 'gallery', 'UINT0'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5006, 42, 2, 5000, 'addgalleryitem', 'position', 'UINT0'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5007, 42, 2, 5000, 'addgalleryitem', 'heading', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5008, 42, 2, 5000, 'addgalleryitem', 'description', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5009, 42, 2, 5000, 'addgalleryitem', 'file_cat', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5010, 42, 2, 5000, 'addgalleryitem', 'file_id', 'STRING'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5015, 42, 2, 5000, 'delgalleryitem', 'id', 'UINT0'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5020, 42, 2, 5000, 'select_options_id', 'cat', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5021, 42, 3, 5000, 'select_options_id', 'id', 'STRING'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5025, 42, 2, 5000, 'chggalleryitem', 'id', 'UINT0'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5026, 42, 2, 5000, 'chggalleryitem', 'gallery', 'UINT0'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5027, 42, 2, 5000, 'chggalleryitem', 'position', 'UINT0'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5028, 42, 2, 5000, 'chggalleryitem', 'heading', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5029, 42, 2, 5000, 'chggalleryitem', 'description', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5030, 42, 2, 5000, 'chggalleryitem', 'file_cat', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5031, 42, 2, 5000, 'chggalleryitem', 'file_id', 'STRING'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5035, 42, 2, 5000, 'tab', 'name', 'UINT0'); \ No newline at end of file