Example #1
0
 function render_html()
 {
     if (!__Config::get('MULTILANGUAGE_ENABLED')) {
         return false;
     }
     $iterator = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Language', 'all', array('order' => 'language_order'));
     if ($iterator->count() > 1) {
         $output = '<ul class="' . $this->getAttribute('cssClass') . '" id="' . $this->getId() . '">';
         if ($this->getAttribute('separator') == 'start') {
             $output .= '<li class="separator">|</li>';
         }
         foreach ($iterator as $ar) {
             $url = __Link::addParams(array('language' => $ar->language_code));
             if ($ar->language_id == $this->_application->getLanguageId()) {
                 $output .= '<li class="' . $ar->language_code . '">' . org_glizy_helpers_Link::makeSimpleLink(glz_encodeOutput($ar->language_name), $url, '', 'active') . '</li>';
             } else {
                 $output .= '<li class="' . $ar->language_code . '">' . org_glizy_helpers_Link::makeSimpleLink(glz_encodeOutput($ar->language_name), $url) . '</li>';
             }
         }
         if ($this->getAttribute('separator') == 'end') {
             $output .= '<li>|</li>';
         }
         $output .= '</ul>';
         $this->addOutputCode($output);
     }
 }
Example #2
0
 private function getTemplateDataFromCache($templateData)
 {
     $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
     // $templateProxy->invalidateCache();
     $cache = $templateProxy->getTemplateCache();
     $cssFileName = __Paths::get('CACHE') . md5($this->getClassName() . '_' . $templateData->__id) . '.css';
     $self = $this;
     $templateData = $cache->get($cssFileName, array(), function () use($self, $templateData, $cssFileName) {
         $newTemplateData = new StdClass();
         $newTemplateData->footerLogo = '';
         $self->updateTemplateData($templateData);
         $self->compileCss($templateData, $cssFileName);
         $templateData->footerLogo = @json_decode($templateData->footerLogo);
         if ($templateData->footerLogo && $templateData->footerLogo->id) {
             $image = org_glizy_helpers_Media::getImageById($templateData->footerLogo->id);
             if ($templateData->footerLogoLink) {
                 $image = __Link::formatLink($templateData->footerLogoLink, $templateData->footerLogoTitle, $image);
             }
             $newTemplateData->footerLogo = $image;
         }
         $newTemplateData->css = $templateData->css;
         return $newTemplateData;
     });
     return $templateData;
 }
Example #3
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);
 }
Example #4
0
 protected function renderDeleteButton($key, $row)
 {
     $output = '';
     if ($this->canView && $this->canDelete) {
         $output .= __Link::makeLinkWithIcon('actionsMVC', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'action' => 'deleteDictionary'), __T('GLZ_RECORD_MSG_DELETE'), array('dictionaryId' => $key));
     }
     return $output;
 }
Example #5
0
 protected function renderVisibilityButton($key, $row)
 {
     $output = '';
     if ($this->canView && $this->canEdit) {
         $output .= __Link::makeLinkWithIcon('actionsMVCToggleVisibility', __Config::get($row->isVisible() ? 'glizy.datagrid.action.showCssClass' : 'glizy.datagrid.action.hideCssClass'), array('title' => $row->isVisible() ? __T('Hide') : __T('Show'), 'id' => $key, 'model' => $row->getClassName(false), 'action' => 'togglevisibility'));
     }
     return $output;
 }
Example #6
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);
     }
 }
Example #7
0
 function renderCell($ar)
 {
     $localeService = $this->application->retrieveProxy('movio.modules.ontologybuilder.service.LocaleService');
     $language = $this->application->getEditingLanguage();
     $ar->entity_name = $localeService->getTranslation($language, $ar->entity_name);
     // TODO controllo acl
     $ar->__url__ = __Link::makeLinkWithIcon('actionsMVC', 'icon-pencil icon-white', array('action' => 'edit', 'id' => $ar->getId(), 'title' => __T('GLZ_RECORD_EDIT')));
     $ar->__urlDelete__ = __Link::makeLinkWithIcon('actionsMVC', 'icon-remove icon-white', array('action' => 'delete', 'id' => $ar->getId(), 'title' => __T('GLZ_RECORD_EDIT')), __T('GLZ_RECORD_MSG_DELETE'));
 }
 function renderCell($key, $value, $row)
 {
     $entityId = $key;
     $entityTypeId = str_replace('entity', '', $row->getType());
     $output = __Link::makeLinkWithIcon('actionEntities', 'btn-icon icon-pencil', array('title' => __T('GLZ_RECORD_EDIT'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'edit'));
     $output .= __Link::makeLinkWithIcon('actionEntities', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'delete'), __T('GLZ_RECORD_MSG_DELETE'));
     $output .= __Link::makeLinkWithIcon('actionEntities', $row->isVisible() ? 'icon-eye-open btn-icon' : 'icon-eye-close btn-icon', array('title' => $row->isVisible() ? __T('Hide') : __T('Show'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'togglevisibility'));
     return $output;
 }
Example #9
0
 public function getGraph($entityTypeId, &$visited, &$edges, $firstNode = false)
 {
     if ($visited[$entityTypeId]) {
         return '';
     } else {
         $entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
         $entityProperties = $entityTypeService->getEntityTypeProperties($entityTypeId);
         $graph = '';
         $color = __Config::get('movio.graph.shapeColor');
         $entityTypeName = $entityTypeService->getEntityTypeName($entityTypeId);
         if ($this->getAttribute('generateLinks')) {
             $entityResolver = org_glizy_objectFactory::createObject('movio.modules.ontologybuilder.EntityResolver');
             $ar = $entityResolver->getMenuVisibleEntity($entityTypeId);
             if ($ar) {
                 $url = 'URL="' . $this->makeUrl($ar->id, $ar->title) . '"';
             }
         }
         // se è il nodo da cui inizia la ricerca ricorsiva
         if ($firstNode or empty($url)) {
             $s = $url ? $url . ', ' : '';
             $graph .= '"' . $this->escape($entityTypeName) . '" [' . $s . 'label="<span>' . $this->escape($entityTypeName . ' ' . __Link::makeLinkWithIcon('actionsMVC', 'icon-pencil icon-white', array('action' => 'edit', 'id' => $entityTypeId, 'title' => __T('GLZ_RECORD_EDIT'))) . '<a href="' . __Link::makeURL('actionsMVC', array('action' => 'delete', 'id' => $entityTypeId)) . '" onclick="if (!confirm(&#39;' . __T('GLZ_RECORD_MSG_DELETE') . '&#39;)){return false}"><i class="icon-remove icon-white"></i></a>') . ' </span>"];' . PHP_EOL;
         } else {
             if ($url) {
                 $graph .= '"' . $this->escape($entityTypeName) . '" [' . $url . '];' . PHP_EOL;
             }
         }
         $visited[$entityTypeId] = true;
         foreach ((array) $entityProperties as $entityProperty) {
             if ($entityProperty['entity_properties_target_FK_entity_id']) {
                 $toEntityTypeId = $entityProperty['entity_properties_target_FK_entity_id'];
                 $toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId);
                 $label = __Tp('rel:' . $entityProperty['entity_properties_type']);
                 if (!$edges[$entityTypeName][$toEntityTypeName]) {
                     $edges[$entityTypeName][$toEntityTypeName] = true;
                     $graph .= '"' . $this->escape($entityTypeName) . '" -> "' . $this->escape($toEntityTypeName) . '" [label="' . $this->escape($label) . '"];' . PHP_EOL;
                 }
                 $graph .= $this->getGraph($toEntityTypeId, $visited, $edges);
             }
         }
         $referenceRelations = $entityTypeService->getEntityTypeReferenceRelations($entityTypeId);
         foreach ((array) $referenceRelations as $referenceRelation) {
             if ($referenceRelation['entity_properties_target_FK_entity_id']) {
                 $toEntityTypeId = $referenceRelation['entity_properties_FK_entity_id'];
                 $toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId);
                 $label = __Tp('rel:' . $referenceRelation['entity_properties_type']);
                 if (!$edges[$toEntityTypeName][$entityTypeName]) {
                     $edges[$toEntityTypeName][$entityTypeName] = true;
                     $graph .= '"' . $this->escape($toEntityTypeName) . '" -> "' . $this->escape($entityTypeName) . '" [label="' . $this->escape($label) . '"];' . PHP_EOL;
                 }
                 $graph .= $this->getGraph($toEntityTypeId, $visited, $edges);
             }
         }
         $visited[$entityTypeId] = true;
         return $graph;
     }
 }
Example #10
0
 function execute()
 {
     if (__Request::exists('next')) {
         $pageType = $this->application->getPageType();
         list($moduleName) = explode('.', $pageType);
         __Request::set('mbTable', $moduleName);
         $builder = org_glizy_ObjectFactory::createObject('movio.modules.modulesBuilder.builder.Builder');
         $builder->executeDelete();
         org_glizy_helpers_Navigation::gotoUrl(__Link::makeUrl('link', array('pageId' => 'glizycms_contentsedit')));
     }
 }
 function executeLater_deleteModule($oldState)
 {
     if (strtolower(__Request::get('action', '')) == 'next') {
         $pageType = $this->_parent->_application->getPageType();
         list($moduleName) = explode('.', $pageType);
         __Session::set('mbTable', $moduleName);
         glz_import('movio.modules.modulesBuilder.builder.*', array('Builder.php', 'AbstractCommand.php'));
         $builder = org_glizy_ObjectFactory::createObject('movio.modules.modulesBuilder.builder.Builder');
         $builder->executeDelete();
         glz_import('org.glizy.helpers.Navigation');
         org_glizy_helpers_Navigation::gotoUrl(__Link::makeUrl('link', array('pageId' => 'SiteMap')));
     }
 }
Example #12
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);
 }
Example #13
0
 function execute()
 {
     // TODO controllo dei permessi
     $it = org_glizy_objectFactory::createModelIterator('movio.modules.codes.models.Model');
     $result = array('items' => array());
     foreach ($it as $ar) {
         $id = $ar->getId();
         $item = array('id' => $id, 'description' => $ar->custom_code_mapping_description, 'code' => $ar->custom_code_mapping_code, 'resourceLink' => $ar->custom_code_mapping_link);
         if ($ar->custom_code_mapping_link) {
             $speakingUrlManager = $this->application->retrieveProxy('org.glizycms.speakingUrl.Manager');
             $docs = $speakingUrlManager->searchDocumentsByTerm('', $ar->custom_code_mapping_link);
             $item['resourceLinkLabel'] = $docs[0]['text'];
             $item['downloadQrCode'] = __Link::makeUrl('actionsMVC', array('action' => 'makeQRCode', 'id' => $id));
         }
         $result['items'][] = $item;
     }
     return $result;
 }
 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')));
 }
Example #15
0
 function run(&$parent, $params)
 {
     $application = org_glizy_ObjectValues::get('org.glizy', 'application');
     $languageId = $application->getLanguageId();
     $language = $application->getLanguage();
     $it = org_glizy_objectFactory::createModelIterator('movio.search.models.Content');
     $it->load('getVisibleEntities', array(':words' => $params, ':language' => $languageId));
     foreach ($it as $ar) {
         //$ar->dump();
         $result = $parent->getResultStructure();
         $result['title'] = $ar->title;
         $result['description'] = $ar->description;
         if ($ar->keyInDataExists('url') && $ar->url) {
             $url = org_glizy_helpers_Html::renderTag('a', array('href' => $language . '/' . $ar->url), true, $ar->title);
         } else {
             $url = __Link::makeLink('link', array('pageId' => $ar->pageId, 'title' => $ar->title));
         }
         $result['__url__'] = $url;
         $parent->addResult($result);
     }
 }
Example #16
0
 function render_html()
 {
     if ($this->getAttribute('addWrapDiv')) {
         $output = '<div id="' . $this->getId() . '"><ul ' . (!is_null($this->getAttribute('cssClass')) ? ' class="' . $this->getAttribute('cssClass') . '"' : '') . '>';
     } else {
         $output = '<ul id="' . $this->getId() . '"' . (!is_null($this->getAttribute('cssClass')) ? ' class="' . $this->getAttribute('cssClass') . '"' : '') . '>';
     }
     $controller = $this->_parent;
     $queryString = $this->getAttribute('addQueryString') ? '?' . __Request::get('__back__url__') : '';
     foreach ($controller->childComponents as $c) {
         if (is_a($c, 'org_glizy_mvc_components_State')) {
             $label = $c->getAttribute('label');
             $draw = $c->getAttribute('draw');
             $aclResult = $this->evalueteAcl($c->getAttribute('acl'));
             $cssClass = trim($c->getAttribute('cssClassTab') . ($c->isCurrentState() ? ' ' . $this->getAttribute('cssClassCurrent') : ''));
             if ($cssClass) {
                 $cssClass = ' class="' . $cssClass . '"';
             }
             $id = $c->getId();
             if ($draw && !empty($label) && $aclResult) {
                 if (!empty($cssClass) && !$this->getAttribute('forceLink')) {
                     $output .= '<li' . $cssClass . '>' . $label . '</li>';
                 } else {
                     $url = $c->getAttribute('url');
                     if (is_null($url)) {
                         $url = __Link::makeUrl($this->getAttribute('routeUrl'), array('title' => $label, 'action' => $c->getStateAction()));
                     } else {
                         $url = __Link::makeUrl($url);
                     }
                     $output .= '<li' . $cssClass . '><a id="' . $id . '" href="' . $url . $queryString . '"' . $cssClass . '>' . $label . '</a></li>';
                 }
             }
         }
     }
     $output .= '</ul>';
     if ($this->getAttribute('addWrapDiv')) {
         $output .= '</div>';
     }
     $this->addOutputCode($output);
 }
Example #17
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;
 }
Example #18
0
 function render_html()
 {
     if ($this->getAttribute('addWrapDiv')) {
         $output = '<div id="' . $this->getId() . '" class="clearfix"><ul ' . (!is_null($this->getAttribute('cssClass')) ? ' class="' . $this->getAttribute('cssClass') . '"' : '') . '>';
     } else {
         $output .= '<ul id="' . $this->getId() . '"' . (!is_null($this->getAttribute('cssClass')) ? ' class="' . $this->getAttribute('cssClass') . '"' : '') . '>';
     }
     for ($i = 0; $i < count($this->childComponents); $i++) {
         $label = $this->childComponents[$i]->getAttribute('label');
         $states = $this->childComponents[$i]->getStatesArray();
         $draw = $this->childComponents[$i]->getAttribute('draw');
         $cssClass = in_array($this->getState(), $states) ? ' class="active"' : '';
         $id = $this->childComponents[$i]->getId();
         if ($draw) {
             if (!empty($cssClass) && !$this->getAttribute('forceLink')) {
                 $output .= '<li' . $cssClass . '>' . $label . '</li>';
             } else {
                 $url = $this->childComponents[$i]->getAttribute('url');
                 if (is_null($url)) {
                     $url = $this->childComponents[$i]->getAttribute('routeUrl');
                     if (!is_null($url)) {
                         $url = __Link::makeUrl($url);
                     }
                 }
                 if (is_null($url)) {
                     $url = $this->changeStateUrl($states[0], true);
                 }
                 $output .= '<li' . $cssClass . '><a id="' . $id . '" href="' . $url . '">' . $label . '</a></li>';
             }
         }
     }
     $output .= '</ul>';
     if ($this->getAttribute('addWrapDiv')) {
         $output .= '</div>';
     }
     $this->addOutputCode($output);
 }
Example #19
0
 function run(&$parent, $params)
 {
     $application = org_glizy_ObjectValues::get('org.glizy', 'application');
     $languageId = $application->getLanguageId();
     $language = $application->getLanguage();
     $it = org_glizy_objectFactory::createModelIterator('movio.search.models.Entity');
     $it->load('getVisibleEntities', array(':words' => $params, ':language' => $languageId));
     foreach ($it as $ar) {
         //$ar->dump();
         $application = org_glizy_ObjectValues::get('org.glizy', 'application');
         $entityTypeService = $application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
         $descriptionAttribute = $entityTypeService->getDescriptionAttribute($ar->entityTypeId);
         $result = $parent->getResultStructure();
         $result['title'] = $ar->title;
         $result['description'] = $descriptionAttribute && $ar->keyInDataExists($descriptionAttribute) ? $ar->{$descriptionAttribute} : '';
         if ($ar->keyInDataExists('url') && $ar->url) {
             $url = org_glizy_helpers_Html::renderTag('a', array('href' => $language . '/' . $ar->url), true, $ar->title);
         } else {
             $url = __Link::makeLink('showEntityDetail', $ar->getValuesAsArray());
         }
         $result['__url__'] = $url;
         $parent->addResult($result);
     }
 }
Example #20
0
 function changeAction($action)
 {
     $url = __Link::makeUrl('linkChangeAction', array('action' => $action));
     org_glizy_helpers_Navigation::gotoUrl($url);
 }
Example #21
0
    public function render()
    {
        if (is_object($this->_content) && $this->_content->image && $this->_content->hotspots) {
            $media = org_glizycms_mediaArchive_MediaManager::getMediaById($this->_content->image);
            $speakingUrlManager = $this->_application->retrieveProxy('org.glizycms.speakingUrl.Manager');
            if (is_object($media)) {
                $id = $this->getId();
                $imageInfo = $media->getImageInfo();
                $width = $imageInfo['width'];
                $height = $imageInfo['height'];
                $attributes = array();
                $attributes['src'] = $media->getFileName(true);
                $attributes['width'] = $imageInfo['width'];
                $attributes['height'] = $imageInfo['height'];
                $attributes['alt'] = $media->title;
                $attributes['title'] = $media->title;
                $image = '<img ' . $this->_renderAttributes($attributes) . ' />';
                $hotspots = '';
                foreach ($this->_content->hotspots as $h) {
                    $attributes = array();
                    $attributes['id'] = $id . '-' . $h->id;
                    $attributes['class'] = 'movio-hotspot' . ($h->form == 'circle' ? '-circle' : '');
                    $attributes['style'] = 'display: block; top: ' . $h->top . 'px; left: ' . $h->left . 'px; height: ' . $h->height . 'px; width: ' . $h->width . 'px;';
                    if ($h->description) {
                        $attributes['data-tooltip'] = glz_encodeOutput($h->description);
                    }
                    $link = '';
                    if ($h->type = 'linkEx' && $h->src) {
                        $link = __Link::formatLink($h->src);
                    } else {
                        if ($h->type = 'link' && $h->srcInt) {
                            $link = __Link::formatInternalLink($speakingUrlManager->makeUrl($h->srcInt));
                        }
                    }
                    if ($link) {
                        $link = str_replace('<a ', '<a style="text-indent: -9999px; height: ' . $h->height . 'px; width: ' . $h->width . 'px; display: block;"', $link);
                    }
                    // <a target="_blank" style="height: 148px; width: 186px; display: block;" href="www.google.com" class="hotspot-circle"></a>
                    $hotspots .= '<div ' . $this->_renderAttributes($attributes) . '>' . $link . '</div>';
                }
                $css = trim('movio-hotspotContainer ' . $this->getAttribute('cssClass'));
                $output = <<<EOD
<div id="{$id}" class="{$css}">
    {$image}
    <div class="movio-imageHotspot-scale">
    {$hotspots}
    </div>
</div>
<script src="static/jquery/jquery-transform/jquery.transform2d.js"></script>
<script>
jQuery( function(){
    \$('div.movio-hotspotContainer').find('div[data-tooltip!=""]').qtip({
        content: {
            attr: 'data-tooltip'
        },
        position: {
                    my: 'bottom left',
                    at: 'bottom left',
                    target: 'mouse'
                },
        style: {
            classes: 'qtip-bootstrap'
        }
    });
    var img = \$('div.movio-hotspotContainer img').first();
    var scale = img.width() / parseInt(img.attr('width'));
    \$('.movio-imageHotspot-scale').css('transform', 'scale('+scale+','+scale+')');
});
</script>
EOD;
                $this->addOutputCode($output);
                $this->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery.qtip/jquery.qtip.min.js'), 'head');
                $this->addOutputCode(org_glizy_helpers_CSS::linkStaticCSSfile('jquery/jquery.qtip/jquery.qtip.min.css'), 'head');
            }
        }
    }
Example #22
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')));
 }
Example #23
0
 private function renderTemplateHeader($view, $templateData)
 {
     $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $view->_application->getLanguage(), ''));
     $view->addOutputCode($siteProp['title'], 'title1');
     $view->addOutputCode($siteProp['subtitle'], 'title2');
     /*
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title1), 'title1');
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title2), 'title2');
     */
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title3), 'title3');
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title4), 'title4');
     $templateData->footerLogo = @json_decode($templateData->footerLogo);
     if ($templateData->footerLogo && $templateData->footerLogo->id) {
         $image = org_glizy_helpers_Media::getImageById($templateData->footerLogo->id);
         if ($templateData->footerLogoLink) {
             $image = __Link::formatLink($templateData->footerLogoLink, $templateData->footerLogoTitle, $image);
         }
         $view->addOutputCode($image, 'logoFooter');
     }
     $view->addOutputCode(org_glizy_helpers_CSS::CSScode($templateData->customCss), 'head');
 }
Example #24
0
    function render()
    {
        if (!$this->iterator) {
            $this->addOutputCode('<p>' . $this->getAttribute('emptySearchLabel') . '</p>');
            return;
        }
        // legge le colonne da visualizzare dai figli
        // NOTA: le colonne sono gi� state lette sul process
        // ma vengono rilette perch� pu� essere variata la visibilit�
        $this->_columns = array();
        for ($i = 0; $i < count($this->childComponents); $i++) {
            $this->_columns[] = $this->childComponents[$i]->getProperties();
        }
        $addJsCode = false;
        $output = '';
        if ($this->_totalRecord > 0) {
            $class = $this->getAttribute('tableCssClass') != '' ? ' class="' . $this->getAttribute('tableCssClass') . '"' : '';
            $output .= '<table id="' . $this->getId() . '"' . $class . '>';
            if ($this->getAttribute('label') != '') {
                $output .= '<caption>' . $this->getAttribute('label') . '</caption>';
            }
            if ($this->getAttribute('drawHeader')) {
                // disegna le colonne
                $output .= '<thead>';
                $output .= '<tr>';
                //foreach ($this->_columns as $v)
                for ($i = 0; $i < count($this->_columns); $i++) {
                    $v = $this->_columns[$i];
                    if ($v['visible'] === true) {
                        $cssClass = !empty($v['cssClass']) ? ' class="' . $v['cssClass'] . '"' : '';
                        $id = !empty($v['id']) ? ' id="' . $v['id'] . '"' : '';
                        $width = !empty($v['width']) ? ' style="width: ' . $v['width'] . 'px;"' : '';
                        if (!empty($v['renderCell'])) {
                            $renderCell =& org_glizy_ObjectFactory::createObject($v['renderCell'], $this->_application);
                            if (method_exists($renderCell, 'getHeader')) {
                                $v['headerText'] = $renderCell->getHeader($v['headerText']);
                            }
                            unset($renderCell);
                        }
                        if (!empty($v['command'])) {
                            $output .= '<th' . $id . $cssClass . $width . '>';
                            if ($v['command'] == 'publish') {
                                $output .= '<input name="publishAll" value="" type="checkbox" class="js-selectall" />';
                            }
                            $output .= '</th>';
                        } else {
                            if (!$this->getAttribute('skipOrder') && $v['orderable']) {
                                $addJsCode = true;
                                $headerId = 'orderBy_' . $i;
                                $headerClass = 'DataGridHeader';
                                $headerImage = '';
                                if ($i == $this->_orderBy) {
                                    $headerId .= '_' . ($this->_orderDirection == 'ASC' ? 'DESC' : 'ASC');
                                    $headerImage = $this->_orderDirection == 'ASC' ? '<span class="ui-icon ui-icon-triangle-1-s"></span>' : '<span class="ui-icon ui-icon-triangle-1-n"></span>';
                                } else {
                                    $headerId .= '_' . $this->_orderDirection;
                                }
                                $output .= '<th' . $id . $cssClass . $width . '><a href="#" id="' . $headerId . '" class="' . $headerClass . '">' . $v['headerText'] . '</a>' . $headerImage . '</th>';
                            } else {
                                $output .= '<th' . $cssClass . $width . '>' . $v['headerText'] . '</th>';
                            }
                        }
                    }
                }
                $output .= '</tr>';
                $output .= '</thead>';
            }
            if (!$this->getAttribute('hideTotals')) {
                $output .= '<tfoot>';
                $output .= '<tr><td style="text-align: right;" colspan="' . count($this->_columns) . '">' . __T('GLZ_TOTAL_RECORDS') . ' ' . $this->_totalRecord . '</td></tr>';
                $output .= '</tfoot>';
            }
            $output .= '<tbody>';
            $key = 0;
            $tempCssClass = $this->_cssClass;
            $rowCellClass = $this->getAttribute('renderRow');
            if (!empty($rowCellClass)) {
                $rowCellClass =& org_glizy_ObjectFactory::createObject($rowCellClass, $this->_application);
            }
            foreach ($this->iterator as $ar) {
                $v = $ar->getValuesAsArray(true);
                $rowOutput = '';
                foreach ($this->_columns as $vv) {
                    if ($vv['key']) {
                        $key = $v[$vv['columnName']];
                    }
                    if ($vv['visible'] === false) {
                        continue;
                    }
                    $tempOutput = '';
                    $cssClass = '';
                    if (!empty($vv['renderCell'])) {
                        $renderCell =& org_glizy_ObjectFactory::createObject($vv['renderCell'], $this->_application);
                        if (is_object($renderCell)) {
                            $tempOutput .= $renderCell->renderCell($key, isset($v[$vv['columnName']]) ? $v[$vv['columnName']] : '', $ar, $vv['columnName']);
                            $cssClass = !empty($vv['cssClass']) ? $vv['cssClass'] : '';
                            if (method_exists($renderCell, 'getCssClass')) {
                                $cssClass = $renderCell->getCssClass($key, isset($v[$vv['columnName']]) ? $v[$vv['columnName']] : '', $v);
                            }
                        }
                    } else {
                        if (!empty($vv['command'])) {
                            $addJsCode = true;
                            if (strtolower($this->_application->getPageId()) == 'usergroups') {
                                if ($vv['command'] == 'delete' && $v['usergroup_backEndAccess']) {
                                    continue;
                                }
                            }
                            switch ($vv['command']) {
                                case 'edit':
                                    if ($this->_user->acl($vv['aclService'], $vv['command'])) {
                                        if (!is_null($this->_versionFieldName)) {
                                            if ($this->_user->acl($vv['aclService'], $vv['command'])) {
                                                $icon = org_glizy_Assets::get('ICON_EDIT');
                                                $ar =& $this->_dataProvider->getNewObject();
                                                $joinFields = $ar->getJoinFields();
                                                $result = $ar->find(array($joinFields['detailTable'] => $key, $this->_versionFieldName => 'PUBLISHED'));
                                                //$result = $ar->find(array($joinFields['detailTable'] => $key, $this->_versionFieldName => 'PUBLISHED', $this->_languageFieldName => $this->_application->getEditingLanguageId()));
                                            } else {
                                                $icon = org_glizy_Assets::get('ICON_EDITDRAFT');
                                                $result = true;
                                            }
                                            if ($result) {
                                                $tempOutput .= '<img title="' . org_glizy_locale_Locale::get('GLZ_RECORD_EDIT') . '" id="edit_' . $key . '" class="DataGridCommand" src="' . $icon . '" width="16" height="16" border="0" />';
                                            } else {
                                                $tempOutput .= '<img id="" class="DataGridCommand" src="' . org_glizy_Assets::get('ICON_EDIT_OFF') . '" width="16" height="16" border="0" />';
                                            }
                                        } else {
                                            $tempOutput .= '<img title="' . org_glizy_locale_Locale::get('GLZ_RECORD_EDIT') . '" id="edit_' . $key . '" class="DataGridCommand" src="' . org_glizy_Assets::get('ICON_EDIT') . '" width="16" height="16" border="0" />';
                                        }
                                    }
                                    break;
                                case 'editDraft':
                                    if (!is_null($this->_versionFieldName) && $this->_user->acl($vv['aclService'], $vv['command'])) {
                                        $ar =& $this->_dataProvider->getNewObject();
                                        $joinFields = $ar->getJoinFields();
                                        $result = $ar->find(array($joinFields['detailTable'] => $key, $this->_versionFieldName => 'DRAFT'));
                                        //$result = $ar->find(array($joinFields['detailTable'] => $key, $this->_versionFieldName => 'DRAFT', $this->_languageFieldName => $this->_application->getEditingLanguageId()));
                                        if ($result) {
                                            $tempOutput .= '<img title="' . org_glizy_locale_Locale::get('GLZ_RECORD_EDIT') . '" id="editDraft_' . $key . '" class="DataGridCommand" src="' . org_glizy_Assets::get('ICON_EDITDRAFT') . '" width="16" height="16" border="0" />';
                                        } else {
                                            $tempOutput .= '<img id="" class="DataGridCommand" src="' . org_glizy_Assets::get('ICON_EDITDRAFT_OFF') . '" width="16" height="16" border="0" />';
                                        }
                                    }
                                    break;
                                case 'preview':
                                    $tempOutput .= '<img title="' . org_glizy_locale_Locale::get('GLZ_RECORD_PREVIEW') . '" id="preview_' . $key . '" class="DataGridCommand" src="' . org_glizy_Assets::get('ICON_PREVIEW') . '" width="16" height="16" border="0" />';
                                    break;
                                case 'delete':
                                    if ($this->_user->acl($vv['aclService'], $vv['command'])) {
                                        $tempOutput .= '<img title="' . org_glizy_locale_Locale::get('GLZ_RECORD_DELETE') . '" id="delete_' . $key . '" class="DataGridCommand" src="' . org_glizy_Assets::get('ICON_DELETE') . '" width="16" height="16" border="0" />';
                                    }
                                    break;
                                case 'publish':
                                    if ($this->_user->acl($vv['aclService'], $vv['command'])) {
                                        $tempOutput .= '<input name="publish[]" value="' . $key . '" type="checkbox">';
                                    }
                                    break;
                            }
                        } else {
                            if (!is_null($this->_languageFieldName) && $v[$this->_languageFieldName] != $this->_application->getEditingLanguageId()) {
                                $tempOutput .= '<em>' . $v[$vv['columnName']] . '</em>';
                            } else {
                                $tempOutput .= $v[$vv['columnName']];
                            }
                        }
                    }
                    $cssClass = !empty($cssClass) ? ' class="' . $cssClass . '"' : '';
                    $rowOutput .= '<td style="text-align: ' . $vv['align'] . ';"' . $cssClass . '>' . $tempOutput . '</td>';
                }
                if (!count($tempCssClass)) {
                    $tempCssClass = $this->_cssClass;
                }
                $cssClass = array_shift($tempCssClass);
                if (!empty($rowCellClass)) {
                    $output .= $rowCellClass->renderRow($v, $cssClass);
                } else {
                    $output .= '<tr class="' . $cssClass . '" id="row_' . $key . '">';
                }
                $output .= $rowOutput . '</tr>';
            }
            $output .= '</tbody>';
            $output .= '</table>';
        } else {
            $emptyLabel = $this->getAttribute('emptyLabel');
            if (!empty($emptyLabel)) {
                $output .= '<p class="datagridEmpty">' . $emptyLabel . '</p>';
            }
        }
        $this->addOutputCode($output);
        if (!$addJsCode) {
            return;
        }
        $jsId = $this->getId();
        $jsMessage = org_glizy_locale_Locale::get('GLZ_RECORD_MSG_DELETE');
        // TODO
        // controllare che il valore di controller sia settato
        $controllerClass =& $this->getAttribute('controller');
        if (is_object($controllerClass)) {
            $jsStateUrl = $controllerClass->changeStateUrl();
            $jsStateUrl = str_replace(__Link::makeUrl('link', array('pageId' => $this->_application->getPageId())) . '?', '', $jsStateUrl);
            $jsStateUrl = __Link::removeParams(array($controllerClass->getId() . '_recordId'), $jsStateUrl);
            $jsCurrentStateUrl = $controllerClass->changeStateUrl($controllerClass->getState());
            $controllerId = $controllerClass->getid();
        } else {
            $jsStateUrl = __Link::removeParams(array($jsId . '_orderBy', $jsId . '_orderDirection'));
            $jsCurrentStateUrl = $jsStateUrl;
            $controllerId = '';
        }
        $output = '';
        $output = <<<EOD
<script language="JavaScript" type="text/JavaScript">
jQuery(document).ready(function() {
    jQuery('#{$jsId} input.js-selectall').change(function(){
        var checked = this.checked;
        \$(this).closest('table').find("input[name='publish[]']").each(function(i, el){
            el.checked = checked;
        })
    });

    jQuery(['#{$jsId} .DataGridCommand', '#{$jsId} .DataGridHeader']).each(function(index,element)
    {
        jQuery( element ).css( {cursor: 'pointer'} );
        jQuery( element ).click( function()
        {
            var command = this.id.split('_');
            var loc = "{$jsStateUrl}"+command[0]+"&{$controllerId}_recordId="+command[1];
            switch (command[0])
            {
                case 'delete':
                    this.parentNode.parentNode.oldClass2    = this.parentNode.parentNode.oldClass;
                    this.parentNode.parentNode.className2    = this.parentNode.parentNode.className;
                    this.parentNode.parentNode.className    = "ruled";
                    this.parentNode.parentNode.oldClass        = "ruled";

                    if (confirm("{$jsMessage}"))
                    {
                        location.href = loc;
                    }

                    this.parentNode.parentNode.oldClass    = this.parentNode.parentNode.oldClass2;
                    this.parentNode.parentNode.className = this.parentNode.parentNode.oldClass2;
                    break;
                case 'orderBy':
                    loc = "{$jsCurrentStateUrl}&{$jsId}_orderBy="+command[1]+"&{$jsId}_orderDirection="+command[2];
                    location.href = loc;

                default:
                    location.href = loc;
                    break;

            }
        });
    });
});
</script>
EOD;
        if (!empty($output)) {
            $this->addOutputCode($output);
        }
    }
Example #25
0
 function render()
 {
     $this->applyOutputFilters('pre', $this->_content);
     $output = '';
     $attributes = array();
     $attributes['id'] = $this->getId();
     // $attributes['name'] 		= $this->getAttribute('name') != '' ? $this->getAttribute('name') : $this->getOriginalId();
     $attributes['name'] = $this->getOriginalId();
     $attributes['disabled'] = $this->getAttribute('disabled') ? 'disabled' : '';
     $attributes['class'] = $this->getAttribute('cssClass');
     $attributes['type'] = $this->getAttribute('type');
     $attributes['onclick'] = $this->getAttribute('onclick');
     $routeUrl = $this->getAttribute('routeUrl');
     if ($routeUrl != '') {
         $attributes['onclick'] = 'location.href=\'' . __Link::makeUrl($routeUrl) . '\'';
         if (!is_null($this->getAttribute('confirmMessage'))) {
             $attributes['onclick'] = 'if (confirm(\'' . $this->getAttribute('confirmMessage') . '\')) ' . $attributes['onclick'] . '; else return false;';
         }
     }
     $url = $this->getAttribute('url');
     if ($url != '') {
         $attributes['onclick'] = 'location.href=\'' . $url . '\'';
     }
     $targetForm = $this->getAttribute('target');
     if (!is_null($targetForm)) {
         $this->addTranslateInfo($targetForm->getCommadFieldName(), $this->getAttribute('label'), $this->getAttribute('value'));
     } else {
         $this->addTranslateInfo($this->getAttribute('name'), $this->getAttribute('label'), $this->getAttribute('value'));
     }
     if ($this->getAttribute('tag') == 'input') {
         $attributes['value'] = glz_encodeOutput($this->getAttribute('label'));
         $output .= '<input ' . $this->_renderAttributes($attributes) . ' />';
     } else {
         $attributes['value'] = glz_encodeOutput($this->getAttribute('value'));
         if (strpos($attributes['value'], 'route:') === 0) {
             $attributes['value'] = __Link::makeUrl(str_replace('route:', '', $attributes['value']));
         }
         $output .= '<button ' . $this->_renderAttributes($attributes) . '>' . $this->getAttributeString('label') . '</button>';
     }
     $this->addOutputCode($output);
 }
Example #26
0
    function render_html_onStart()
    {
        $tabId = $this->getId();
        $dropdownMenu = '';
        $output .= '<ul id="' . $tabId . '" class="' . $this->getAttribute('cssClass') . '">';
        for ($i = 0; $i < count($this->childComponents); $i++) {
            $visible = $this->childComponents[$i]->getAttribute('visible');
            if (!$visible) {
                continue;
            }
            $label = $this->childComponents[$i]->getAttribute('label');
            $routeUrl = $this->childComponents[$i]->getAttribute('routeUrl');
            $cssClassTab = $this->childComponents[$i]->getAttribute('cssClassTab');
            if ($this->childComponents[$i]->getAttribute('disabled')) {
                $cssClassTab .= ' disabled';
            }
            $id = $this->childComponents[$i]->getId();
            $dropdown = $this->childComponents[$i]->getAttribute('dropdown');
            if (!$dropdown) {
                $cssClassTab = $cssClassTab ? ' class="' . trim($cssClassTab) . '"' : $cssClassTab;
                if (!$routeUrl) {
                    $output .= '<li' . $cssClassTab . '><a href="#' . $id . '" data-target="#' . $id . '" data-toggle="tab">' . $label . '</a></li>';
                } else {
                    $output .= '<li' . $cssClassTab . '><a href="' . __Link::makeUrl($routeUrl) . '">' . $label . '</a></li>';
                }
            } else {
                if ($dropdown && !$dropdownMenu) {
                    $output .= '<li class="dropdown"><a href="noTranslate:#" data-toggle="dropdown" class="tab-dropdown dropdown-toggle"><span class="js-label">' . $label . '</span><span class="caret"></span></a><ul class="dropdown-menu">##dropdown##</ul></li>';
                    $dropdownMenu .= '<li><a href="#' . $id . '" data-target="#' . $id . '" data-toggle="tab">' . $label . '</a></li>';
                } else {
                    if ($dropdown && $dropdownMenu) {
                        $dropdownMenu .= '<li><a href="#' . $id . '" data-target="#' . $id . '" data-toggle="tab">' . $label . '</a></li>';
                    }
                }
            }
        }
        if ($dropdownMenu) {
            $output = str_replace('##dropdown##', $dropdownMenu, $output);
            if ($this->getAttribute('showNav')) {
                $output .= '<li class="tab-navigation"><a href="#" data-toggle="tab-prev" class="btn"><span class="fa fa-angle-double-left"></span></a></li>';
                $output .= '<li class="tab-navigation"><a href="#" data-toggle="tab-next" class="btn"><span class="fa fa-angle-double-right"></span></a></li>';
            }
        }
        $output .= '</ul>' . '<div id="' . $tabId . '_content" class="' . $this->getAttribute('paneCssClass') . '">';
        $output .= <<<EOD
<script>
jQuery(function(){
\tvar navInPanel = function(dir) {
\t\tvar activePanel = \$('#{$tabId}_content div[class="tab-pane active"]');
\t\tif (activePanel.length) {
\t\t\tvar id;
\t\t\tif (dir>0) {
\t\t\t\tid = activePanel.next().attr('id');
\t\t\t} else {
\t\t\t\tid = activePanel.prev().attr('id');
\t\t\t}
\t\t\tif (id) {
\t\t\t\t\$('#{$tabId} a[data-target="#'+id+'"]').tab('show');
\t\t\t}
\t\t}
\t}

\tvar updateNav = function() {
\t\tvar activePanel = \$('#{$tabId}_content div[class="tab-pane active"]');
\t\t\$('#{$tabId} a[data-toggle="tab-prev"]').toggleClass('disabled', !activePanel.prev().hasClass('tab-pane'));
\t\t\$('#{$tabId} a[data-toggle="tab-next"]').toggleClass('disabled', !activePanel.next().hasClass('tab-pane'));
\t}

\t\$('#{$tabId} a[data-toggle="tab"]').click(function (e) {
    \te.preventDefault();
\t\tif (\$(this).parent().hasClass('disabled') || \$(this).parent().hasClass('fake-active')) {
\t\t\treturn false;
\t\t}
    \t\$(this).tab('show');
    }).on('shown.bs.tab', function (e) {
\t\tvar target = \$(e.target);
\t\tvar dropdown = target.closest('ul.dropdown-menu').prev();
\t\tif (dropdown.length) {
\t\t\tdropdown.find('span.js-label').html(target.html());
\t\t}
\t\tupdateNav();
\t});


\t\$('#{$tabId} a[data-toggle="tab-prev"]').click(function (e) {
\t\te.preventDefault();
\t\t\$(this).blur();
\t\tnavInPanel(-1);
\t});
\t\$('#{$tabId} a[data-toggle="tab-next"]').click(function (e) {
\t\te.preventDefault();
\t\t\$(this).blur();
\t\tnavInPanel(1);
\t});

\tvar aFirst = \$('#{$tabId} a').first();
\tif (aFirst.data('toggle')==='dropdown') {
\t\taFirst.parent().find('ul a').first().tab('show');
\t} else {
\t\taFirst.tab('show');
\t}
});
</script>
EOD;
        $this->addOutputCode($output);
    }
Example #27
0
 function _readPageId()
 {
     $this->log("readPageId", GLZ_LOG_SYSTEM);
     // legge il pageId della pagina da visualizzare
     $this->_pageId = org_glizy_Request::get('pageId', NULL);
     if (empty($this->_pageId)) {
         $this->_pageId = org_glizy_Config::get('REMEMBER_PAGEID') ? org_glizy_Session::get('glizy.pageId', org_glizy_Config::get('START_PAGE')) : org_glizy_Config::get('START_PAGE');
     }
     if (org_glizy_Config::get('REMEMBER_PAGEID')) {
         org_glizy_Session::set('glizy.pageId', $this->_pageId);
     }
     if (!is_numeric($this->_pageId) && $this->getClassName() == 'org_glizycms_core_application_application') {
         $this->siteMapMenu =& $this->siteMap->getMenuByPageType($this->_pageId);
         $this->_pageId = $this->siteMapMenu->id;
     } else {
         $this->siteMapMenu =& $this->siteMap->getNodeById($this->_pageId);
     }
     if (!is_object($this->siteMapMenu) || !$this->siteMapMenu->isVisible) {
         $report = array();
         $report['Request'] = var_export(__Request::getAllAsArray(), true);
         $report['_SERVER'] = var_export($_SERVER, true);
         $this->log($report, GLZ_LOG_SYSTEM, 'glizy.404');
         if (!$this->getCurrentUser()->acl($this->siteMapMenu->id, "visible")) {
             org_glizy_helpers_Navigation::gotoUrl(__Link::makeUrl('link', array('pageId' => __Config::get('START_PAGE'))));
         }
         $error404Page = __Config::get('ERROR_404');
         if (!empty($error404Page)) {
             org_glizy_helpers_Navigation::gotoUrl(__Link::makeUrl('link', array('pageId' => $error404Page)));
         }
         new org_glizy_Exception(__T('GLZ_ERR_404') . '</br>' . __Request::get('pageId'), GLZ_E_404);
     }
     if (!empty($this->siteMapMenu->select)) {
         if ($this->siteMapMenu->select == '*') {
             $menu = $this->siteMapMenu->firstChild(true);
         } else {
             $menu = $this->siteMap->getNodeById($this->siteMapMenu->select);
         }
         org_glizy_helpers_Navigation::gotoUrl(__Link::makeUrl('link', array('pageId' => $menu->id)));
     }
 }
Example #28
0
 function changeAction($action)
 {
     $url = __Link::makeUrl('linkChangeAction', array('action' => $action));
     $url = str_replace("ajax", "index", $url);
     return $url;
 }
Example #29
0
    /**
     * Render
     *
     * @return	void
     * @access	public
     */
    function render()
    {
        // TODO tradurre le label
        $output = '';
        $output .= '<table id="' . $this->getId() . '" class="js-modulesManager ' . $this->getAttribute('cssClass') . '">';
        if ($this->getAttribute('label') != '') {
            $output .= '<caption>' . $this->getAttribute('label') . '</caption>';
        }
        // disegna le colonne
        $output .= '<thead>';
        $output .= '<tr>';
        $output .= '<th class="name">Plugin</th>';
        $output .= '<th>Descrizione</th>';
        $output .= '<th class="actions"></th>';
        $output .= '</tr>';
        $output .= '<tfoot><tr><td colspan="3"></td></tr></tfoot>';
        $output .= '<tbody>';
        $origCssClass = explode(',', $this->getAttribute('cssClass'));
        $tempCssClass = array();
        $modulesState = org_glizy_Modules::getModulesState();
        $modules = org_glizy_Modules::getModules();
        $this->sort($modules);
        foreach ($modules as $m) {
            // $moduleDescription = org_glizy_ObjectFactory::createObject( 'org.glizy.ModuleDescription', $m );
            // if ( !empty( $m->pageType ) ) continue;
            $isEnabled = !isset($modulesState[$m->id]) || $modulesState[$m->id];
            if (!count($tempCssClass)) {
                $tempCssClass = $origCssClass;
            }
            $cssClass = array_shift($tempCssClass);
            $cssClass .= ' ' . ($isEnabled ? 'enabled' : 'disabled');
            $output .= '<tr class="' . $cssClass . '">' . '<td class="name">' . __T($m->name) . '</td>' . '<td>' . '<p class="description">' . $m->description . '</p>' . '<p class="info">Versione ' . $m->version . ' | ' . __Link::makeLink2(null, array('label' => $m->author, 'title' => 'Visita il sito dell\'autore', 'url' => $m->authorUrl, 'rel' => 'external')) . ' | ' . __Link::makeLink2(null, array('label' => 'Visita il sito del plugin', 'url' => $m->pluginUrl, 'rel' => 'external')) . '</p>' . '</td>' . '<td class="actions">' . (!$isEnabled ? '<a href="" data-action="enable" data-id="' . $m->id . '" class="js-modulesManagerAction action">abilita</a>' : '') . ($isEnabled ? '<a href="" data-action="disable" data-id="' . $m->id . '" class="js-modulesManagerAction action">disabilita</a>' : '') . ' ' . ($m->canDuplicated ? '<a href="' . __Routing::makeUrl('glizycmsModuleManagerDuplicate', array('pageId' => $this->pageId, 'id' => $m->id)) . '" class="action">duplica</a>' : '') . '</td>' . '</tr>';
        }
        $output .= '</tbody>';
        $output .= '</table>';
        $output .= <<<EOD
<script type="text/javascript">
jQuery(document).ready(function() {

\t\$("table.js-modulesManager a.js-modulesManagerAction ").click( function( e ){
\t\te.stopPropagation();
\t\tif ( jQuery( this ).data( "action" ) == "uninstall" )
\t\t{
\t\t\tif ( !confirm( "Sei sicuro di voler rimuovere il plugin?") )
\t\t\t{
\t\t\t\treturn false;
\t\t\t}
\t\t}

\t\t// jQuery.modal('<div></div>', {
\t\t// \tclose: false,
\t\t// \toverlayCss:{
\t\t// \t\tbackgroundColor:"#000"
\t\t// \t},
\t\t// \toverlayClose: false
\t\t// });

\t\tjQuery.ajax( { url: Glizy.ajaxUrl+jQuery( this ).data( "action" ),
\t\t\t\t\ttype: 'POST',
\t\t\t\t\tdata: { id: jQuery( this ).data( "id" ) },
\t\t\t\t\tsuccess: function( response, r, a ) {
\t\t\t\t\t\tlocation.reload();
\t\t\t\t\t}});
\t\treturn false;
\t});

});
</script>
EOD;
        $this->addOutputCode($output);
    }
Example #30
0
 public function fixTemplateData(&$templateData, &$newTemplateData)
 {
     $templateData->footerLogo = @json_decode($templateData->footerLogo);
     if ($templateData->footerLogo && $templateData->footerLogo->id) {
         $image = org_glizy_helpers_Media::getImageById($templateData->footerLogo->id);
         if ($templateData->footerLogoLink) {
             $image = __Link::formatLink($templateData->footerLogoLink, $templateData->footerLogoTitle, $image);
         }
         $newTemplateData->footerLogo = $image;
     }
 }