File manager - Edit - /home/jardides/www/Jardi-design/old/administrator/components/com_templateck/views/template/tmpl/ajaxresponsive.php
Back
<?php /** * @name Template Creator CK 3 * @package com_templateck * @copyright Copyright (C) 2013. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); $input = new JInput(); $resolutions = array('1', '2', '3', '4', '5'); $blocs = $input->get('blocs', '', 'html'); $blocs = str_replace("|di|", "#", $blocs); $blocs = json_decode($blocs); $templateid = $input->get('templateid', ''); $htmlcode_responsive = $input->get('htmlcode_responsive', '', 'html'); $isFluid = (isset($blocs[0]->blocwrapperfluid) && $blocs[0]->blocwrapperfluid == 'fluid') ? true : false; // load the custom css code //$db = JFactory::getDbo(); //$query = ' SELECT htmlcode_responsive FROM #__templateck_templates' . // ' WHERE id = ' . (int) $templateid; //$db->setQuery($query); //$customcodes = $db->loadResult(); //$customcodes = str_replace('|qq|', '"', $customcodes); // split the data and store into customcss preg_match_all('/\[resolution(.*?)\]=\[(.*?)\]/mis', $htmlcode_responsive, $customcss); ?> <div class="ckpopupoverlay"></div> <div class="ckpopupheader"> <div class="ckpopuplogo"></div> <div class="ckpopuptitle"><?php echo JText::_('CK_EDIT_RESPONSIVE'); ?></div> <div style="float:right;"> <div class="ckclose ckcancel" onclick="$ck('#popup_editionck').empty().hide();"><?php echo JText::_('CK_CANCEL'); ?></div> <div class="ckclose cksave" onclick="saveResponsivePopup();"><?php echo JText::_('CK_VALIDATE'); ?></div> </div> <div class="clr"></div> </div> <div id="elementscontainer"> <table> <tr> <td style="vertical-align:top;"> <div class="layoutinfos"> <div class="layoutinfostitle"><?php echo JText::_('CK_RESPONSIVE_INFOS'); ?></div> <div class="layoutinfosdesc"><?php echo JText::_('CK_RESPONSIVE_DESC'); ?></div> </div> </td> <td style="vertical-align:top;"> <div class="ckproperty" id="tab_responsive"> <div class="ckoption"> <span><?php echo JText::_('CK_RESPONSIVE_RANGE'); ?></span> <span><img src="<?php echo $this->imagespath; ?>ipod.png" width="15" height="15" /></span> <span> <select class="inputbox" type="list" name="responsiverange" id="responsiverange" value="" style="width:105px;" onchange="" > <option value="between"><?php echo JText::_('CK_RESPONSIVE_BETWEEN'); ?></option> <option value="reducing"><?php echo JText::_('CK_RESPONSIVE_REDUCING'); ?></option> </select> </span> <span class="ckoption-desc"><?php echo JText::_('CK_RESPONSIVE_RANGE_DESC'); ?></span> </div> <?php if (! $isFluid) { ?> <div class="ckoption"> <span><?php echo JText::_('CK_RESPONSIVE_MINI_VALUE'); ?></span> <span><img src="<?php echo $this->imagespath; ?>width.png" width="15" height="15" /></span> <span> <input type="text" placeholder="292" class="inputbox" name="responsiveminivalue" id="responsiveminivalue" value="" style="width:100px;" /> </span> <span class="ckoption-desc"><?php echo JText::_('CK_RESPONSIVE_MINI_VALUE_DESC'); ?></span> </div> <?php } ?> </div> <?php $i = 0; foreach ($resolutions as $resolution) { ?> <div id="ckresponsive<?php echo $resolution; ?>" class="blocresolution"> <div class="resolution-title"><?php echo JText::_('CK_RESPONSIVE' . $resolution); ?></div> <?php if ($i < 4) { ?> <div class="resolution-value"><?php echo JText::_('CK_RESPONSIVE_VALUE'); ?> <input type="text" class="inputbox" name="responsivevalue<?php echo $i ?>" id="responsivevalue<?php echo $i ?>" onchange="checkreponsivevalues(this)"/> px</div> <?php } ?> <?php foreach ($blocs as $block) { switch ($block->class) { case (stristr($block->class, 'mainbanner') != ''): $cktype = 'mainbanner'; break; case (stristr($block->class, 'flexiblemodules') != ''): $cktype = 'flexiblemodules'; break; case (stristr($block->class, 'maincontent') != ''): $cktype = 'maincontent'; break; case (stristr($block->class, 'singlemodule') != ''): $cktype = 'singlemodule'; break; case (stristr($block->class, 'custombloc') != ''): $cktype = 'custombloc'; break; case (stristr($block->class, 'horiznav') != ''): $cktype = 'horiznav'; break; case (stristr($block->class, 'ckrow') != ''): $cktype = 'row'; break; case (stristr($block->class, 'logobloc') != ''): $cktype = 'logo'; break; default : $cktype = 'singlemodule'; break; } $val = 'ckresponsive' . $resolution; $ckid = $block->ckid; if ($block->ckid AND ( stristr($block->class, 'mainbanner') OR stristr($block->class, 'flexiblemodules') OR stristr($block->class, 'maincontent') OR stristr($block->class, 'singlemodule') OR stristr($block->class, 'custombloc') OR stristr($block->class, 'horiznav') OR stristr($block->class, 'ckrow') OR stristr($block->class, 'logobloc') OR stristr($block->class, 'module') )) { $ckmobile = isset($block->$val) ? $block->$val : (($val == 'ckresponsive1' || $val == 'ckresponsive2') ? 'mobile_notaligned' : 'mobile_default'); if ($cktype == 'row') { echo '<div class="responsiverow">'; echo '<div class="responsiverow_info">' . JText::_('CK_ROW_CONTAINS') . ' : <br /><b>'; $children = array(); foreach ($block->children as $j => $child) { $children[] = '<span onmouseover="highlightchild(\'' . $child . '\')" onmouseleave="unhighlightchild(\'' . $child . '\')">' . $child . '</span>'; } echo implode(', ', $children) . '</b></div>'; } echo '<div class="responsive ' . $block->class . '"' . ' ckid="' . $block->ckid . '"' . ' ckmobile="' . $ckmobile . '" onclick="changeResponsive(this, \'' . $cktype . '\')">' . $block->ckid . '</div>'; if ($cktype == 'row') { echo '</div>'; } } } $code = ''; if (isset($customcss[2][$i])) { $code = $customcss[2][$i]; $code = str_replace('|bbe|', ']', $code); $code = str_replace('|qq|', '"', $code); } ?> <div> <div class="responsiveCustomcodelabel" title="<?php echo JText::_('CK_CUSTOMCSS_RESPONSIVE_DESC'); ?>"><?php echo JText::_('CK_CUSTOMCSS'); ?></div> <textarea class="responsiveCustomcode" data-resolution="<?php echo $resolution ?>"><?php echo $code; ?></textarea> </div> </div> <?php $i++; } ?> </td> </tr> </table> </div> <script> function changeResponsive(el, type) { el = $ck(el); var ckmobile = el.attr('ckmobile'); switch (type) { case 'mainbanner': responsivechoice = new Array("mobile_default", "mobile_notaligned", "mobile_hide", "mobile_hamburger"); break; case 'flexiblemodules': responsivechoice = new Array("mobile_default", "mobile_hide", "mobile_alignhalf", "mobile_notaligned"); break; case 'maincontent': responsivechoice = new Array("mobile_default", "mobile_lefttop", "mobile_lefthidden", "mobile_rightbottom", "mobile_righthidden", "mobile_notaligned"); break; case 'singlemodule': responsivechoice = new Array("mobile_default", "mobile_hide"); break; case 'custombloc': responsivechoice = new Array("mobile_default", "mobile_hide"); break; case 'horiznav': responsivechoice = new Array("mobile_default", "mobile_hide", "mobile_alignhalf", "mobile_notaligned", "mobile_hamburger"); break; case 'row': responsivechoice = new Array("mobile_default", "mobile_hide", "mobile_notaligned"); break; case 'logo': responsivechoice = new Array("mobile_default", "mobile_hide"); break; default: break; } var index = ($ck.inArray(ckmobile, responsivechoice) + 1 < responsivechoice.length) ? $ck.inArray(ckmobile, responsivechoice) + 1 : 0; el.attr('ckmobile', responsivechoice[index]); } function highlightchild(tag) { $ck('.blocresolution .responsive[ckid="' + tag + '"]').css('background-color', '#999'); } function unhighlightchild(tag) { $ck('.blocresolution .responsive[ckid="' + tag + '"]').css('background-color', ''); } function checkreponsivevalues(field) { var defaultvalues = '524,758,950,1024'; defaultvalues = defaultvalues.split(','); var values = new Array(); $ck('.blocresolution .resolution-value input').each(function() { values.push(this.value); }); var i = $ck('.blocresolution .resolution-value input').index($ck(field)); // $ck('.blocresolution .resolution-value input').each(function(i) { $valCur = parseInt(field.value); // $valCur = parseInt(this.value); $valPrev = values[i-1] ? parseInt(values[i-1]) : 0; $valNext = parseInt(values[i+1]); // check if not under the previous value if ( ($valPrev && $valPrev >= $valCur) || ($valNext && $valNext <= $valCur) ) { alert('<?php echo JText::_('CK_RESPONSIVE_VALUE_SHALL_BE_BETWEEN') ?> ' + $valPrev + ' & ' + ($valNext ? $valNext : ' Infinity') ); field.value = $ck(field).attr('data-value'); } // }); } </script>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings