Exemplo n.º 1
0
 /**
  * Render
  *
  * @return	void
  * @access	public
  */
 function render_html()
 {
     $folder = $this->getAttribute('folder');
     $src = $this->getAttribute('src');
     $region = $this->getAttribute('editableRegion');
     if ($folder) {
         // include tutta una cartella
         $cssFileName = $this->includeFolder($folder);
         if ($this->getAttribute('inline')) {
             $css = file_get_contents($cssFileName);
             if (strpos($css, '<style') !== false) {
                 $this->addOutputCode($css, $region);
             } else {
                 $this->addOutputCode(org_glizy_helpers_CSS::CSScode($css), $region);
             }
         } else {
             $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($cssFileName), $region);
         }
     } else {
         if (!is_null($src)) {
             $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($this->getAttribute('src')), $region);
         } else {
             $this->addOutputCode(org_glizy_helpers_CSS::CSScode($this->getText()), $region);
         }
     }
 }
Exemplo n.º 2
0
 public function render_html_onStart()
 {
     if ($this->getAttribute('mode') == 'container') {
         $this->addOutputCode('<iframe id="js-glizycmsPageEdit" src="" data-emptysrc="' . $this->emptySrc . '" data-editsrc="' . $this->editSrc . '"></iframe>');
         $corePath = __Paths::get('CORE');
         $jQueryPath = $corePath . 'classes/org/glizycms/js/jquery/';
         $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'));
     } else {
         $this->addOutputCode('<div id="message-box"></div>');
         parent::render_html_onStart();
     }
 }
Exemplo n.º 3
0
    public function render_html_onStart()
    {
        // TODO localizzare il javascript
        $this->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('jquery-simplemodal/jquery.simplemodal.1.4.1.min.js'));
        $this->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('progressBar/progressBar.js'));
        $this->addOutputCode(org_glizy_helpers_CSS::linkCoreCSSfile2('progressBar/progressBar.css'), 'head');
        $this->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('formWithAjaxSteps.js?v=' . GLZ_CORE_VERSION));
        parent::render_html_onStart();
        $ajaxUrl = $this->getAttribute('controllerName') ? $this->getAjaxUrl() : '';
        $output = <<<EOD
<div id="progress_bar" class="js-glizycms-FormEditWithAjaxSteps ui-progress-bar ui-container" data-ajaxurl="{$ajaxUrl}">
  <div class="ui-progress" style="width: 0%;">
    <span class="ui-label" style="display:none;"><b class="value">0%</b></span>
  </div>
</div>
EOD;
        $this->addOutputCode($output);
    }
Exemplo n.º 4
0
    function render()
    {
        $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile(__Paths::get('APPLICATION_CLASSES') . 'movio/modules/publishApp/static/progressBar.css'), 'head');
        $output = <<<EOD
<script type="text/javascript">
\$(function() {
  var state = 'progress';

  (function (\$) {
  \t\$.fn.animateProgress = function (progress, callback) {
\t\t\tjQuery.fx.off = false;
\t\t\t//var myduration = (progress - old_progress) * 1000 * (durata_totale_stimata / 100);
\t\t\told_progress = progress;
\t\t\treturn this.each(function () {
\t\t\t\t\$(this).animate({
\t\t\t\t\twidth: String(progress) + '%'
\t\t\t\t}, {
\t\t\t\t\t//duration: myduration,

\t\t\t\t\teasing: 'swing',

\t\t\t\t\tstep: function (progress) {
\t\t\t\t\t\tif (state === 'progress') {

\t\t\t\t\t\t\tjQuery.fx.off = false;

\t\t\t\t\t\t\tvar labelEl = \$('.ui-label', this),
\t\t\t\t\t\t\t\tvalueEl = \$('.value', labelEl);

\t\t\t\t\t\t\tif (Math.ceil(progress) < 20) {
\t\t\t\t\t\t\t\tlabelEl.hide();
\t\t\t\t\t\t\t} else {
\t\t\t\t\t\t\t\tif (labelEl.is(":hidden")) {
\t\t\t\t\t\t\t\t\tlabelEl.fadeIn();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t}

\t\t\t  \t\tvalueEl.text(Math.ceil(progress) + '%');
            }
\t\t\t\t\t},

\t\t\t\t\tcomplete: function (scope, i, elem) {
\t\t\t\t\t\tif (callback) {
\t\t\t\t\t\t\tscope = 0;
\t\t\t\t\t\t\tcallback.call(this, i, elem);
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t});
\t\t\t});
\t\t};
\t}(jQuery));


\tvar resetProgressBar = function () {
\t\tjQuery.fx.off = true;
\t\t\$('#progress_bar .ui-progress').width("0%");
\t\t\$('#progress_bar .ui-label').hide();
\t};

  resetProgressBar();
});
</script>
EOD;
        $output .= '<div id="progress_bar" class="ui-progress-bar ui-container">
                  <div class="ui-progress" style="width: 0%;">
                  <span class="ui-label" style="display:none;"><b class="value">0%</b></span>
		              </div></div>';
        $this->addOutputCode($output);
    }
Exemplo n.º 5
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');
 }
Exemplo n.º 6
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));
    }
Exemplo n.º 7
0
    function render()
    {
        $id = $this->getAttribute('id');
        $pageId = $this->getAttribute('pageId');
        $onlyFolder = $this->getAttribute('onlyFolder');
        $onlyFirstLevel = $this->getAttribute('onlyFirstLevel');
        $customPath = $this->getAttribute('customPath');
        $this->_application->_rootComponent->addOutputCode(org_glizy_helpers_CSS::linkCSSfile(__Paths::get('APPLICATION_TEMPLATE') . 'css/customStorageBrowser.css'), 'head');
        $storageBrowserUrl = 'index.php?pageId=' . $pageId . '&onlyFolder=' . $onlyFolder . '&onlyFirstLevel=' . $onlyFirstLevel . '&customPath=' . $customPath;
        $title = $this->getAttribute('title');
        $output = <<<EOD
<script type="text/javascript">
jQuery(document).ready(function() {
\tjQuery("#modalDiv").dialog({
\t\t\t\tmodal: true,
\t\t\t\tautoOpen: false,
\t\t\t\tdraggable: true,
\t\t\t\tresizeable: true,
\t\t\t\ttitle: '{$title}'
\t\t\t    });

  function openFilePicker() {
    var w = Math.min( jQuery( window ).width() - 50, 900 );
\t\tvar h = jQuery( window ).height() - 50;

\t\t\$("#modalDiv").dialog("option", { height: h, width: w } );
\t\t\$("#modalDiv").dialog("open" );
\t\tif ( \$("#modalIFrame").attr('src') == "" )
\t\t{
\t\t\t\$("#modalIFrame").attr('src', '{$storageBrowserUrl}');
\t\t}
\t}
    jQuery( "#{$id}" ).click(openFilePicker);
\tjQuery( "#mediaFilePicker" ).click(openFilePicker);
});

function custom_storageBrowserSelect( path )
{
\tjQuery( "#{$id}" ).val( path ).trigger('change');
\t\$("#modalDiv").dialog("close");

\tif ( window.filePicker )
\t{
\t\twindow.filePicker( path );
\t}
}

function setCopyToCMS( value )
{
    jQuery( "#copyToCMS" ).val( value ? 'true' : 'false' );
}
</script>
EOD;
        $required = $this->getAttribute('required') == 'true' ? 'required' : '';
        $output .= '<div class="control-group">';
        $output .= '  <label for="argumentId" class="control-label ' . $required . '">' . $this->getAttribute('label') . '</label>';
        $output .= '  <div class="controls">';
        $output .= '    <input type="hidden" name="copyToCMS" id="copyToCMS" value="false"/>';
        $output .= '    <input type="text" name="' . $id . '" id="' . $id . '" value="" readonly="true" class="span6 ' . $required . '"/>';
        $output .= '    <input id="mediaFilePicker" type="button" value="Seleziona" class="btn"/>';
        $output .= '  </div>';
        $output .= '</div>';
        $output .= '<div id="modalDiv" style="display: none; margin: 0; padding: 0; overflow: hidden;"><iframe src="" id="modalIFrame" width="100%" height="100%" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="auto" title="Seleziona Media"></iframe></div>';
        $this->addOutputCode($output);
    }
Exemplo n.º 8
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');
            }
        }
    }
Exemplo n.º 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');
     }
 }