/** * 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); } } }
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(); } }
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); }
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() { $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); }