示例#1
0
 function process_ajax()
 {
     $c = $this->getRootComponent();
     $c->process();
     $content = $this->stripIdFromContent(parent::getContent());
     $timeline = array('date' => array(), 'type' => 'default');
     $num = count($content['records']);
     if ($this->type == 'chronologic') {
         for ($i = 0; $i < $num; $i++) {
             $term = $content['records'][$i]['term'];
             $temp = array('headline' => '', 'text' => '', 'asset' => array('media' => '', 'caption' => '', 'credit' => ''));
             $temp['headline'] = $term->term;
             if ($term->dateFrom) {
                 $temp['startDate'] = $this->formatDate($term->dateFrom);
             }
             if ($term->dateTo) {
                 $temp['endDate'] = $this->formatDate($term->dateTo);
             }
             $temp['text'] = '';
             foreach ($content['records'][$i]['taggedDocuments'] as $doc) {
                 $temp['text'] = __Link::makeSimpleLink($doc['title'], $doc['url']) . '<br/>';
             }
             $timeline['date'][] = $temp;
         }
     }
     return array('timeline' => $timeline);
 }
示例#2
0
 function render_html()
 {
     if ($this->_application->getCurrentMenu()->printPdf && !org_glizy_ObjectValues::get('org.glizy.application', 'pdfMode')) {
         $url = GLZ_HOST . "/index.php?" . __Request::get('__url__') . "&printPdf=1";
         $output = __Link::makeSimpleLink($this->getAttribute('label'), $url, '', 'printPdf');
         $this->addOutputCode($output);
     }
 }
示例#3
0
 private function makeUrlFromId($id, $fullLink = false)
 {
     $siteMap = $this->application->getSiteMap();
     $menu = $siteMap->getNodeById($id);
     if ($menu && $menu->isVisible) {
         $menuUrl = $menu->url;
         $menuTitle = $menu->title;
         $url = $menuUrl ? GLZ_HOST . '/' . $menuUrl : __Link::makeUrl('link', array('pageId' => $id, 'title' => $menuTitle));
         return $fullLink ? __Link::makeSimpleLink($menuTitle, $url) : $url;
     }
     // the menu isn't found or isn't visible in this language
     // redirect to home
     return $this->makeUrlFromId(__Config::get('START_PAGE'), $fullLink);
 }
 private function makeUrlFromId($id, $fullLink = false)
 {
     $ar = org_glizy_objectFactory::createModel($this->model);
     if ($ar->load($this->getIdFromLink($id))) {
         $siteMap = $this->application->getSiteMap();
         $menu = $siteMap->getMenuByPageType($this->pageType);
         if ($ar->document_detail_isVisible && $ar->document_detail_translated && $menu && $menu->isVisible) {
             if ($ar->keyInDataExists('url') && $ar->url) {
                 $language = $this->application->getLanguage();
                 $url = GLZ_HOST . '/' . $language . '/' . $ar->url;
             } else {
                 $url = __Link::makeUrl('movio_news', array('document_id' => $id, 'title' => $ar->title));
             }
             return $fullLink ? __Link::makeSimpleLink($ar->title, $url) : $url;
         }
     }
     // document not found, isn't visible or isn't traslated
     // go to entity page or home
     $speakingUrlManager = $this->application->retrieveProxy('org.glizycms.speakingUrl.Manager');
     return $fullLink ? '' : $speakingUrlManager->makeUrl('internal:' . ($menu ? $menu->id : __Config::get('START_PAGE')));
 }
示例#5
0
 function process()
 {
     parent::process();
     $it = $this->_content->records;
     $siteProp = $this->_application->getSiteProperty();
     $map = array();
     $map['title'] = $this->_content->title;
     $map['total'] = $this->_content->total;
     $map['style'] = 'width: 100%; height: 600px';
     $map['geo'] = '';
     $map['text'] = '';
     $map['pathEnable'] = '0';
     $map['markers'] = array();
     $map['jsSrc'] = 'https://maps.googleapis.com/maps/api/js' . (isset($siteProp['googleMapsApiKey']) ? '?key=' . $siteProp['googleMapsApiKey'] : '');
     $imageWidth = __Config::get('IMG_LIST_WIDTH');
     $imageHeight = __Config::get('IMG_LIST_HEIGHT');
     foreach ($it as $ar) {
         $image = '';
         $images = org_glizy_helpers_Convert::formEditObjectToStdObject($ar->images);
         if (count($images)) {
             $media = json_decode($images[0]->image);
             if ($media && @$media->id) {
                 $image = '<img src="' . GLZ_HOST . '/getImage.php?w=' . $imageWidth . '&h=' . $imageHeight . '&id=' . $media->id . '">';
             }
         }
         $localtions = org_glizy_helpers_Convert::formEditObjectToStdObject($ar->locations);
         foreach ($localtions as $l) {
             $geo = explode(',', $l->coordinates);
             $map['markers'][] = array('lat' => $geo[0], 'long' => $geo[1], 'zoom' => $geo[2], 'title' => $l->locationDescription != $ar->title ? $ar->title . ' - ' . $l->locationDescription : $l->locationDescription, 'text' => $l->location, 'image' => $image, 'link' => __Link::makeSimpleLink(__T('Read'), $ar->__url__));
         }
     }
     if (count($map['markers'])) {
         $map['markers'] = json_encode($map['markers']);
         $map['geo'] = json_encode($map['markers'][0]);
         $map['text'] = $map['markers'][0]->title;
     }
     $this->_content = $map;
 }
示例#6
0
 private function makeUrlFromId($id, $fullLink = false)
 {
     $ar = org_glizy_objectFactory::createModel('movio.modules.ontologybuilder.models.EntityDocument');
     if ($ar->load($this->getIdFromLink($id))) {
         $entityTypeId = $this->getEntityTypeId($ar->document_type);
         $menu = $this->getPage($entityTypeId);
         if ($ar->document_detail_isVisible && $ar->document_detail_translated && $menu) {
             // if the document is visible and is traslated and the entity page exists
             if ($ar->keyInDataExists('url') && $ar->url) {
                 $language = $this->application->getLanguage();
                 $url = GLZ_HOST . '/' . $language . '/' . $ar->url;
             } else {
                 $url = __Link::makeUrl('showEntityDetail', array('pageId' => $menu->id, 'entityTypeId' => $entityTypeId, 'document_id' => $id, 'title' => $ar->title));
             }
             return $fullLink ? __Link::makeSimpleLink($ar->title, $url) : $url;
         }
     }
     // document not found, isn't visible or isn't traslated
     // go to entity page or home
     $speakingUrlManager = $this->application->retrieveProxy('org.glizycms.speakingUrl.Manager');
     return $speakingUrlManager->makeUrl('internal:' . ($menu ? $menu->id : __Config::get('START_PAGE')));
 }