Пример #1
0
 public function get($f3)
 {
     $params = $f3->get('PARAMS');
     $lang = $params['lang'];
     $rootNodes = \Services\PageTree::instance($lang, true)->getTree();
     echo json_encode($rootNodes);
 }
Пример #2
0
 public function __construct($page, $lang, $mime = 'text/html')
 {
     $this->lang = $lang;
     $this->page = array_pop($page);
     $this->mime = $mime;
     $this->scope = array();
     $this->scope['pageUrl'] = \Services\PageTree::instance($lang)->getUrl($this->page['id']);
 }
Пример #3
0
 /**
  * @return mixed
  */
 function controller()
 {
     $contents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->title = $contents['title']['texte'];
     $this->subtitle = $contents['subtitle']['texte'];
     $bios = array();
     foreach ($contents['bios']['data'] as $bio) {
         $bios[] = array("portrait" => $bio['data']["portrait"], "name" => $bio['data']['name']['texte'], "title" => $bio['data']['title']['texte'], "bio" => $bio['data']['bio']['texte']);
     }
     $this->bios = $bios;
     $parentContents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->parentLink = $parentContents['title']['texte'];
     $this->parentUrl = \Services\PageTree::instance($this->lang)->getUrl($this->parent['id']);
 }
Пример #4
0
 /**
  * @return mixed
  */
 function controller()
 {
     $ptService = \Services\PageTree::instance($this->lang);
     $contents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->visus = $contents['carousel']['data'];
     $this->logo = $contents['logo'];
     $this->tagline = $contents['tagline']['texte'];
     $tree = $ptService->getTree();
     $firstPage = array_shift($tree);
     while ($firstPage['id'] == $this->page['id']) {
         $firstPage = array_shift($tree);
     }
     $this->firstUrl = $ptService->getUrl($firstPage['id']);
 }
Пример #5
0
 function controller()
 {
     $f3 = \Base::instance();
     $contents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->title = $contents['title']['texte'];
     $this->realisations = array();
     $ptService = \Services\PageTree::instance($this->lang);
     foreach ($this->page['children'] as $child) {
         $childContents = \Services\Contents::instance()->getContentsForPage($child['id'], $this->lang, true);
         $realisation = array('client' => $childContents['client']['texte'], 'thumbnail' => $childContents['thumbnail']);
         $realisation['url'] = $ptService->getUrl($child['id']);
         $this->realisations[] = $realisation;
     }
 }
Пример #6
0
 /**
  * @return mixed
  */
 function controller()
 {
     $ptService = \Services\PageTree::instance($this->lang);
     $contents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->brand = $contents['brand']['texte'];
     $this->address = $contents['address']['texte'];
     $this->facebook = $contents['facebook']['texte'];
     $this->twitter = $contents['twitter']['texte'];
     $this->linkedin = $contents['linkedin']['texte'];
     if ($this->page["children"]) {
         $this->creditsUrl = $ptService->getUrl($this->page['children'][0]["id"]);
         $this->credits = $this->page['children'][0]["title"];
     } else {
         $this->creditsUrl = false;
         $this->credits = false;
     }
 }
Пример #7
0
 /**
  * @return mixed
  */
 function controller()
 {
     $contents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->title = $contents['title']['texte'];
     $this->subtitle = $contents['subtitle']['texte'];
     $this->description = $contents['description']['texte'];
     $this->image = $contents['image'];
     $this->left = $contents['left'];
     $this->right = $contents['right'];
     if ($this->page['children']) {
         $this->nextUrl = \Services\PageTree::instance($this->lang)->getUrl($this->page['children'][0]["id"]);
         $this->next = $this->page['children'][0]['title'];
     } else {
         $this->nextUrl = "";
         $this->next = "";
     }
 }
Пример #8
0
 function controller()
 {
     $f3 = \Base::instance();
     $contents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->title = $contents['title']['texte'];
     $this->description = $contents['description']['texte'];
     $this->expertises = array();
     $this->groups = array_map(function ($group) {
         return $group['texte'];
     }, $contents['groups']['data']);
     $nbGroups = sizeof($this->groups);
     $nbLines = ceil(sizeof($this->page['children']) / $nbGroups);
     $ptService = \Services\PageTree::instance($this->lang);
     foreach ($this->page['children'] as $index => $child) {
         $childContents = \Services\Contents::instance()->getContentsForPage($child['id'], $this->lang, true);
         $expertise = array('title' => $childContents['title']['texte'], 'thumbnail' => $childContents['thumbnail']);
         $expertise['url'] = $ptService->getUrl($child['id']);
         $this->expertises[floor($index / $nbLines) + $index % $nbLines * $nbGroups] = $expertise;
     }
     ksort($this->expertises);
 }
Пример #9
0
 function controller()
 {
     $f3 = \Base::instance();
     $parentContents = \Services\Contents::instance()->getContentsForPage($this->parent["id"], $this->lang, true);
     $this->title = $parentContents['title']['texte'];
     $contents = \Services\Contents::instance()->getContentsForPage($this->page["id"], $this->lang, true);
     $this->expertise = $contents['title']['texte'];
     $this->description = $contents['description']['texte'];
     $this->background = $contents['background'];
     $ptService = \Services\PageTree::instance($this->lang);
     if ($this->number > 0) {
         $this->prevUrl = $ptService->getUrl($this->parent['children'][$this->number - 1]['id']);
     } else {
         $this->prevUrl = false;
     }
     if ($this->number < sizeof($this->parent['children'])) {
         $this->nextUrl = $ptService->getUrl($this->parent['children'][$this->number + 1]['id']);
     } else {
         $this->nextUrl = false;
     }
     $this->realisationsUrl = $ptService->getUrl($this->parent['id']);
 }
Пример #10
0
 function index($f3)
 {
     if ($this->pathSegments && count($this->pathSegments) > 0 && $this->pathSegments[0] == 'preview') {
         array_shift($this->pathSegments);
         $this->ptService = \Services\PageTree::instance($this->lang, true);
     } else {
         $this->ptService = \Services\PageTree::instance($this->lang);
     }
     if ($this->pathSegments) {
         $this->page = $this->ptService->matchPath($this->pathSegments);
     }
     if ($f3->get('AJAX')) {
         $this->setTemplate('ajax.htm');
     } else {
         $menu = $this->ptService->getMenu();
         $f3->set('menu', $menu);
         $supportedLanguages = \Services\LanguageService::instance()->getSupportedLanguages();
         $langUrls = $this->ptService->getLanguageUrls($supportedLanguages);
         $f3->set('langUrls', $langUrls);
     }
     if ($this->page) {
         $this->page($f3);
     } else {
         if (!$this->pathSegments) {
             $this->onePager($f3);
         } else {
             http_response_code(404);
         }
     }
     $f3->set('title', 'Le musc et la plume');
     $f3->set('lang', $this->lang);
     if ($f3->get('VERB') == 'POST') {
         $f3->set('content', 'post.htm');
     } else {
         $f3->set('content', 'index.htm');
     }
 }