Exemple #1
0
 /**
  * Render
  *
  * @return	string
  * @access	public
  */
 function render($outputMode = NULL, $skipChilds = false)
 {
     $this->_application->_rootComponent->addOutputCode(org_glizy_helpers_JS::JScode('if ( typeof(Glizy) == "undefined" ) Glizy = {}; Glizy.baseUrl ="' . GLZ_HOST . '"; Glizy.ajaxUrl = "ajax.php?pageId=' . $this->_application->getPageId() . '&ajaxTarget=' . $this->getId() . '&action=";'), 'head');
     $t = '';
     $this->applyOutputFilters('pre', $t);
     $this->renderChilds($outputMode);
     return $this->_render();
 }
Exemple #2
0
    /**
     * Render
     *
     * @return	void
     * @access	public
     */
    function render_html()
    {
        $folder = $this->getAttribute('folder');
        $src = $this->getAttribute('src');
        $type = $this->getAttribute('type');
        $language = $this->_application->getLanguage();
        $language2 = $language . '-' . strtoupper($language);
        $src = str_replace(array('##LANG##', '##LANG2##'), array($language, $language2), $src);
        if ($folder) {
            if (!org_glizy_ObjectValues::get('org.glizy.JS', 'run', false)) {
                org_glizy_ObjectValues::set('org.glizy.JS', 'run', true);
                $pageType = $this->_application->getPageType();
                $state = __Request::get('action', '');
                $params = __Request::getAllAsArray();
                unset($params['__params__']);
                unset($params['__routingName__']);
                unset($params['__routingPattern__']);
                unset($params['__url__']);
                unset($params['__back__url__']);
                $params = json_encode($params);
                $jsCode = <<<EOD
var GlizyApp = {};
GlizyApp.pages = {};
jQuery( function(){
\tif ( typeof( GlizyApp.pages[ '{$pageType}' ] ) != 'undefined' )
\t{
\t\tGlizyApp.pages[ '{$pageType}' ]( '{$state}', {$params} );
\t}
})
EOD;
                $this->addOutputCode(org_glizy_helpers_JS::JScode($jsCode), 'head');
            }
            // include tutta una cartella
            $jsFileName = $this->includeFolder($folder);
            if ($this->getAttribute('inline')) {
                $js = file_get_contents($jsFileName);
                if (strpos($js, '<script') !== false) {
                    $this->addOutputCode($js);
                } else {
                    $this->addOutputCode(org_glizy_helpers_JS::JScode($js, $type));
                }
            } else {
                $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jsFileName . (__Config::get('DEBUG') ? '?' . microtime(true) : ''), null, $type));
            }
        } else {
            if ($src) {
                $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($src, null, $type));
            } else {
                $this->addOutputCode(org_glizy_helpers_JS::JScode($this->replaceLocale($this->getText()), $type));
            }
        }
    }
Exemple #3
0
    function render_html()
    {
        parent::render_html();
        if (!$this->getAttribute('readOnly')) {
            $id = $this->getId();
            $format = $this->getAttribute('showTime') ? 'GlizyLocale.datetime.format' : 'GlizyLocale.date.format';
            $minView = $this->getAttribute('showTime') ? '' : 'minView: \'month\',';
            $jsCode = <<<EOD
\$(function () {
\t\$("#{$id}").datetimepicker({
            language: 'it',
            format: {$format},
            {$minView}
            autoclose: true,
            todayHighlight: true
        });
});
EOD;
            $this->_parent->addOutputCode(org_glizy_helpers_JS::JScode($jsCode));
        }
    }
Exemple #4
0
    public function render_html_onEnd($value = '')
    {
        parent::render_html_onEnd();
        $corePath = __Paths::get('CORE');
        $jQueryPath = $corePath . 'classes/org/glizycms/js/jquery/';
        $languageCode = $this->_application->getLanguage();
        $language = $languageCode . '-' . strtoupper($languageCode);
        if ($this->getAttribute('newCode')) {
            $formEditPath = $corePath . 'classes/org/glizycms/js/formEdit2/';
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/underscore/underscore-min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEdit.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditStandard.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCheckbox.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditRepeat.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDate.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDateTime.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.it.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-datetimepicker-master/css/datetimepicker.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditColorPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-colorpicker/js/bootstrap-colorpicker.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-colorpicker/css/bootstrap-colorpicker.min.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditGUID.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectFrom.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'select2/select2.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'select2/select2.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditTINYMCE.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditMediaPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditFile.js'));
            //$this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $jQueryPath.'fineuploader.jquery/jquery.fineuploader.js' ) );
            //$this->addOutputCode( org_glizy_helpers_CSS::linkCSSfile( $jQueryPath.'fineuploader.jquery/fineuploader.css' ) );
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.validVal-packed.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPermission.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPhotoGalleryCategory.js'));
            // $this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $formEditPath.'GlizyFormEditGoogleMaps.js' ) );
            // $this->addOutputCode(org_glizy_helpers_JS::linkJSfile( 'http://maps.google.com/maps/api/js?sensor=false' ));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCmsPagePicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectPageType.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditUrl.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditModalPage.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/glizy-locale/' . $language . '.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.default.css'));
            $id = $this->getId();
            $mediaPicker = $this->getMediaPickerUrl();
            $AJAXAtion = $this->getAttribute('controllerName') ? $this->getAjaxUrl() : '';
            $customValidation = $this->getAttribute('customValidation');
            if ($customValidation) {
                $customValidation = 'customValidation: "' . $customValidation . '",';
            }
            $tinyMceUrls = json_encode($this->getTinyMceUrls());
            $jsCode = <<<EOD
jQuery(function(){
    if ( Glizy.tinyMCE_options )
    {
        Glizy.tinyMCE_options.urls = {$tinyMceUrls};
    }

    var myFormEdit = Glizy.oop.create("glizy.FormEdit", '{$id}', {
        AJAXAction: "{$AJAXAtion}",
        mediaPicker: {$mediaPicker},
        formData: {$this->data},
        {$customValidation}
        lang: GlizyLocale.FormEdit
    });
});
EOD;
        } else {
            $formEditPath = $corePath . 'classes/org/glizycms/js/formEdit/';
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/underscore/underscore-min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEdit.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditTINYMCE.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditFile.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditMediaPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditGoogleMaps.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditGUID.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditColorPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditValuesPreset.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDate.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDatetime.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.it.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-datetimepicker-master/css/datetimepicker.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-colorpicker/js/bootstrap-colorpicker.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-colorpicker/css/bootstrap-colorpicker.min.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/glizy-locale/' . $language . '.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'dropzone/dropzone.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'dropzone/css/basic2.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.validVal-packed.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCmsPagePicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectFrom.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'select2/select2.min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPermission.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'select2/select2.css'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.default.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCheckbox.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile('http://maps.google.com/maps/api/js?sensor=false'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectPageType.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPhotoGalleryCategory.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditImageHotspot.js'));
            // $this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $formEditPath.'GlizyFormEditTreeSelect.js' ) );
            // $this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $jQueryPath.'fancytree/jquery.fancytree-all.min.js' ) );
            // $this->addOutputCode( org_glizy_helpers_CSS::linkCSSfile( $jQueryPath.'fancytree/skin-win7/ui.fancytree.min.css' ) );
            $id = $this->getId();
            $mediaPicker = $this->getMediaPickerUrl();
            $AJAXAtion = $this->getAttribute('controllerName') ? $this->getAjaxUrl() : '';
            $customValidation = $this->getAttribute('customValidation');
            if ($customValidation) {
                $customValidation = 'customValidation: "' . $customValidation . '",';
            }
            $tinyMceUrls = json_encode($this->getTinyMceUrls());
            $jsCode = <<<EOD
jQuery(function(){
    if ( Glizy.tinyMCE_options )
    {
        Glizy.tinyMCE_options.urls = {$tinyMceUrls};
    }

    var ajaxUrl = "{$AJAXAtion}";
    jQuery( "#{$id}" ).GlizyFormEdit({
        AJAXAction: ajaxUrl ? ajaxUrl : Glizy.ajaxUrl,
        mediaPicker: {$mediaPicker},
        formData: {$this->data},
        {$customValidation}
        lang: GlizyLocale.FormEdit
    });
});
EOD;
        }
        $this->addOutputCode(org_glizy_helpers_JS::JScode($jsCode));
    }
    function render()
    {
        $onlyFolder = __Request::get('onlyFolder');
        $onlyFirstLevel = __Request::get('onlyFirstLevel');
        $customPath = __Request::get('customPath');
        $enableDownload = __Request::get('enableDownload');
        // TODO localizzare l'interfaccia
        $this->_application->_rootComponent->addOutputCode(org_glizy_helpers_JS::JScode('if ( typeof(Glizy) == "undefined" ) Glizy = {}; Glizy.baseUrl ="' . GLZ_HOST . '"; Glizy.ajaxUrl = "ajax.php?pageId=' . $this->_application->getPageId() . '&ajaxTarget=' . $this->getId() . '&onlyFolder=' . $onlyFolder . '&customPath=' . $customPath . '&enableDownload=' . $enableDownload . '&command=";'), 'head');
        $showCopy = $this->getAttribute('copyCheckbox') && !$onlyFolder ? 'true' : 'false';
        $showFolderSelection = $onlyFolder ? 'true' : 'false';
        $showOnlyFirstLevel = $onlyFirstLevel ? 'true' : 'false';
        $output = <<<EOD
<div id="storageBrowser"></div>
<script type="text/javascript">
jQuery(document).ready(function() {
    var currentFolder = '';

    function redraw( data )
    {
        var html = '';
        if ({$showCopy}) {
            html += '<input name="copyToCMS" id="copyToCMS" type="checkbox" class="pull-left"/>';
            html += '<label for="copyToCMS" class="pull-left">Copia il file nell\\'archivio del CMS</label></br></br>';
        }

        html += '<h4>Posizione: root/'+ currentFolder+'</h4>';
        html += '<table id="dataGrid" class="storageBrowser table table-bordered table-striped">';
        html += '<thead><tr>';
        html += '<th class="icon"></th>';
        html += '<th class="filename">Nome file</th>';
        html += '<th class="size">Dimensione</th>';
        html += '<th class="date">Ultima modifica</th>';
        html += '</tr></thead>';

        var htmlDirs = '';
        var htmlFiles = '';
        jQuery( data ).each( function( index, value ){
            var rowCss = index % 2 ? 'odd' : 'even';
            if ( value.type == "dir" )
            {
                htmlDirs += '<tr class="'+rowCss+'" data-path="'+value.path+'" data-type="folder"><td class="icon folder"></td>';
                htmlDirs += '<td class="filename">'+value.name+'</td>';
                htmlDirs += '<td class="size"></td>';
                htmlDirs += '<td class="date"></td>';
                htmlDirs += '</tr>';
            }
            else
            {
                htmlFiles += '<tr class="'+rowCss+'" data-path="'+value.path+'" data-type="file"><td class="icon '+value.icon+'"></td>';
                htmlFiles += '<td class="filename">'+value.name+'</td>';
                htmlFiles += '<td class="size">'+value.size+'</td>';
                htmlFiles += '<td class="date">'+value.date+'</td>';
                htmlFiles += '</tr>';
            }
        });

        html += '<tbody>'+htmlDirs+htmlFiles+'</tbody></table>';

        if ({$showFolderSelection} && !{$showOnlyFirstLevel} ) {
            html += '<input value="Seleziona cartella" name="selectFolder" id="selectFolder" type="button" class="btn"/>';
        }
        
        jQuery('#storageBrowser').html( html );
    }

    function loadFolder() {
        jQuery.ajax({
                 type: "POST",
                 url: Glizy.ajaxUrl + "read",
                 dataType: "json",
                 data: {path: currentFolder},
                 success: function (data) {
                         // console.log( data );
                         redraw( data );
                     }
                });
    }

    jQuery( document ).on( 'click', '#storageBrowser tbody tr', function( ){
        if ( jQuery( this ).data( 'type' ) == 'folder' )
        {
            currentFolder = jQuery( this ).data( 'path' );
            if ({$showOnlyFirstLevel}) {
                parent.custom_storageBrowserSelect(currentFolder);
            } else {
                loadFolder();
            }
        }
        else
        {
            parent.custom_storageBrowserSelect( jQuery( this ).data( 'path' ) );
        }
    })

    jQuery( document ).on('change', '#copyToCMS', function () {
        parent.setCopyToCMS( jQuery( this ).attr('checked') );
    });
    
    jQuery(document).on( 'click', '#selectFolder', function( ){
        parent.custom_storageBrowserSelect( currentFolder );
    })

    jQuery( document ).on( 'hover', '#storageBrowser tbody tr', function( ){
        jQuery( this ).addClass( 'ruled' );
    }).on( 'mouseout', function( ){
        jQuery( this ).removeClass( 'ruled' );
    })

    loadFolder();
});
</script>
EOD;
        $this->addOutputCode($output);
    }
Exemple #6
0
    private function addTinyMCE($attachToElement)
    {
        if ($this->getAttribute('htmlEditor') === true) {
            $rootComponent =& $this->getRootComponent();
            if (!org_glizy_ObjectValues::get('org.glizy.JS.TinyMCE', 'add', false)) {
                org_glizy_ObjectValues::set('org.glizy.JS.TinyMCE', 'add', true);
                $rootComponent->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('tiny_mce.js?v=' . GLZ_CORE_VERSION, 'tiny_mce/', false), 'head');
                $rootComponent->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('Glizy_tiny_mce.js?v=' . GLZ_CORE_VERSION), 'head', true);
                $jsCode = 'Glizy.tinyCSS = "' . __Config::get('TINY_MCE_CSS') . '";';
                $jsCode .= 'Glizy.tinyMCE_plugins = "' . __Config::get('TINY_MCE_DEF_PLUGINS') . '";';
                $jsCode .= 'Glizy.tinyMCE_btn1 = "' . __Config::get('TINY_MCE_BUTTONS1') . '";';
                $jsCode .= 'Glizy.tinyMCE_btn2 = "' . __Config::get('TINY_MCE_BUTTONS2') . '";';
                $jsCode .= 'Glizy.tinyMCE_btn3 = "' . __Config::get('TINY_MCE_BUTTONS3') . '";';
                if (__Config::get('TINY_MCE_PLUGINS') != '') {
                    $jsCode .= 'Glizy.tinyMCE_plugins .= ",' . __Config::get('TINY_MCE_PLUGINS') . '";';
                }
                $rootComponent->addOutputCode(org_glizy_helpers_JS::JScode($jsCode), 'head');
            }
            if (!is_null($this->getAttribute('adm:tinyMCEplugin'))) {
                $pluginsNames = explode(',', $this->getAttribute('adm:tinyMCEplugin'));
                $pluginsPaths = array();
                for ($i = 0; $i < count($pluginsNames); $i++) {
                    $pos = strrpos($pluginsNames[$i], "/");
                    if ($pos !== false) {
                        $pluginsPaths[] = '../../../../../../' . $pluginsNames[$i];
                        $pluginsNames[$i] = substr($pluginsNames[$i], $pos + 1);
                    } else {
                        $pluginsPaths[] = $pluginsNames[$i];
                    }
                }
                if (count($pluginsPaths)) {
                    $jsCode = 'Glizy.tinyMCE_plugins += ",' . implode(',', $pluginsPaths) . '";';
                    $jsCode .= 'Glizy.tinyMCE_pluginsNames += ",' . implode(',', $pluginsNames) . '";';
                    $rootComponent->addOutputCode(org_glizy_helpers_JS::JScode($jsCode), 'head');
                }
            }
            if ($attachToElement) {
                $id = $this->getId();
                $jsCode = <<<EOD
jQuery(function(){
\tvar options = Glizy.tinyMCE_options;
\toptions.mode = "exact";
\toptions.elements = '{$id}';
\ttinyMCE.init( options );
});
EOD;
                //$this->addOutputCode(org_glizy_helpers_JS::JScode( $jsCode ));
            }
        }
    }
Exemple #7
0
 protected function loadSiteProperties()
 {
     $menu = $this->_application->getCurrentMenu();
     $siteProp = $this->_application->getSiteProperty();
     $title = org_glizy_ObjectValues::get('org.glizy.og', 'title', $menu->title);
     $description = org_glizy_ObjectValues::get('org.glizy.og', 'description', $menu->description);
     $keywords = org_glizy_ObjectValues::get('org.glizy.og', 'keywords', $menu->keywords);
     $this->addOutputCode($title . ' - ' . $siteProp['title'], 'docTitle');
     $this->addOutputCode($title . ' - ' . $siteProp['title'], 'doctitle');
     // NOTE: per compatibilità
     $this->addOutputCode($title, 'metadata_title');
     $this->addOutputCode($description, 'metadata_description');
     $this->addOutputCode($keywords, 'metadata_keywords');
     $this->addOutputCode($siteProp['copyright'], 'copyright');
     $this->addOutputCode($siteProp['address'], 'address');
     $slideShowSpeed = ((int) $siteProp['slideShow'] ?: 5) * 1000;
     $this->addOutputCode(org_glizy_helpers_JS::JScode('if (typeof(Glizy)!=\'object\') Glizy = {}; Glizy.slideShowSpeed = ' . $slideShowSpeed . ';'), 'head');
     $reg = __T(strlen($menu->creationDate) <= 10 || preg_match('/00:00:00|12:00:00 AM/', $menu->creationDate) ? 'GLZ_DATE_FORMAT' : 'GLZ_DATETIME_FORMAT');
     $updateText = org_glizy_locale_Locale::get('MW_FOOTER', glz_defaultDate2locale($reg, $menu->creationDate), glz_defaultDate2locale($reg, $menu->modificationDate));
     $this->addOutputCode($updateText, 'docUpdate');
 }
Exemple #8
0
 /**
  * Render
  *
  * @return	void
  * @access	public
  */
 function render($outputMode = NULL, $skipChilds = false)
 {
     $this->_application->_rootComponent->addOutputCode(org_glizy_helpers_JS::JScode('if (typeof(Glizy)!=\'object\') Glizy = {}; Glizy.baseUrl ="' . GLZ_HOST . '"; Glizy.ajaxUrl = "ajax.php?pageId=' . $this->_application->getPageId() . '&ajaxTarget=' . $this->getId() . '&action=";'), 'head');
     return parent::render($outputMode, $skipChilds);
 }
Exemple #9
0
 /**
  * @param string $formName
  */
 function addValidateJsCode($formName = null)
 {
     if (!__Config::get('GLIZY_ADD_VALIDATE_JS')) {
         return;
     }
     if (!org_glizy_ObjectValues::get('org.glizy.JS.Validate', 'add', false) && __Config::get('GLIZY_ADD_JS_LIB')) {
         // Validate
         org_glizy_ObjectValues::set('org.glizy.JS.Validate', 'add', true);
         $this->addJSLibCore();
         if (file_exists(org_glizy_Paths::get('STATIC_DIR') . 'jquery/jquery.validationEngine/jquery.validationEngine-' . $this->getLanguage() . '.js')) {
             $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery.validationEngine/jquery.validationEngine-' . $this->getLanguage() . '.js'), 'head');
         } else {
             $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery.validationEngine/jquery.validationEngine-en.js'), 'head');
         }
         $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery.validationEngine/jquery.validationEngine.js'), 'head');
         $this->_rootComponent->addOutputCode(org_glizy_helpers_CSS::linkStaticCSSfile('jquery/jquery.validationEngine/validationEngine.jquery.css'), 'head');
     }
     if (!is_null($formName) && __Config::get('GLIZY_ADD_JS_LIB')) {
         $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::JScode('jQuery(document).ready(function() { $("#' . $formName . '").validationEngine( "attach", { validationEventTrigger: "none", scroll: false, showAllErrors: false } ); });'), 'head');
         //                $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::JScode( '$(document).ready(function() { $("#'.$formName.'").validationEngine(); });' ), 'head');
     }
 }