input; // No access if not global SuperUser if (!JFactory::getUser()->authorise('core.admin')) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); } if ($this->type == 'image') { JHtml::_('script', 'system/jquery.Jcrop.min.js', array('version' => 'auto', 'relative' => true)); JHtml::_('stylesheet', 'system/jquery.Jcrop.min.css', array('version' => 'auto', 'relative' => true)); } JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function($){ // Hide all the folder when the page loads $('.folder ul, .component-folder ul, .layout-folder ul').hide(); // Display the tree after loading $('.directory-tree').removeClass('directory-tree'); // Show all the lists in the path of an open file $('.show > ul').show(); // Stop the default action of anchor tag on a click event $('.folder-url, .component-folder-url, .layout-folder-url').click(function(event){ event.preventDefault(); }); // Prevent the click event from proliferating $('.file, .component-file-url').bind('click',function(e){ e.stopPropagation(); }); // Toggle the child indented list on a click event $('.folder, .component-folder, .layout-folder').bind('click',function(e){ $(this).children('ul').toggle(); e.stopPropagation(); }); // New file tree $('#fileModal .folder-url').bind('click',function(e){ $('.folder-url').removeClass('selected'); e.stopPropagation(); $('#fileModal input.address').val($(this).attr('data-id')); $(this).addClass('selected'); }); // Folder manager tree $('#folderModal .folder-url').bind('click',function(e){ $('.folder-url').removeClass('selected'); e.stopPropagation(); $('#folderModal input.address').val($(this).attr('data-id')); $(this).addClass('selected'); }); var containerDiv = document.querySelector('.span3.tree-holder'), treeContainer = containerDiv.querySelector('.nav.nav-list'), liEls = treeContainer.querySelectorAll('.folder.show'), filePathEl = document.querySelector('p.lead.hidden.path'); if(filePathEl) var filePathTmp = document.querySelector('p.lead.hidden.path').innerText; if(filePathTmp && filePathTmp.charAt( 0 ) === '/' ) { filePathTmp = filePathTmp.slice( 1 ); filePathTmp = filePathTmp.split('/'); filePathTmp = filePathTmp[filePathTmp.length - 1]; var re = new RegExp( filePathTmp ); for (var i = 0, l = liEls.length; i < l; i++) { liEls[i].querySelector('a').classList.add('active'); if (i === liEls.length - 1) { var parentUl = liEls[i].querySelector('ul'), allLi = parentUl.querySelectorAll('li'); for (var i = 0, l = allLi.length; i < l; i++) { aEl = allLi[i].querySelector('a'), spanEl = aEl.querySelector('span'); if (spanEl && re.test(spanEl.innerText)) { aEl.classList.add('active'); } } } } } });"); if ($this->type == 'image') { JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function($) { var jcrop_api; // Configuration for image cropping $('#image-crop').Jcrop({ onChange: showCoords, onSelect: showCoords, onRelease: clearCoords, trueSize: [" . $this->image['width'] . ',' . $this->image['height'] . "] },function(){ jcrop_api = this; }); // Function for calculating the crop coordinates function showCoords(c) { $('#x').val(c.x); $('#y').val(c.y); $('#w').val(c.w); $('#h').val(c.h); }; // Function for clearing the coordinates function clearCoords() { $('#adminForm input').val(''); }; });"); } JFactory::getDocument()->addStyleDeclaration(' /* Styles for modals */ .selected{ background: #08c; color: #fff; } .selected:hover{ background: #08c !important; color: #fff; } .modal-body .column-left { float: left; max-height: 70vh; overflow-y: auto; } .modal-body .column-right { float: right; } @media (max-width: 767px) { .modal-body .column-right { float: left; } } #deleteFolder{ margin: 0; } #image-crop{ max-width: 100% !important; width: auto; height: auto; } .directory-tree{ display: none; } .tree-holder{ overflow-x: auto; } '); if ($this->type == 'font') { JFactory::getDocument()->addStyleDeclaration( "/* Styles for font preview */ @font-face { font-family: previewFont; src: url('" . $this->font['address'] . "') } .font-preview{ font-family: previewFont !important; }" ); } ?> 'editor')); ?>
source->filename, $this->template->element); ?>
type == 'image') : ?>image['path'], $this->template->element); ?>
type == 'font') : ?>font['rel_path'], $this->template->element); ?>