File manager - Edit - /home/jardides/www/Jardi-design/plugins/pagebuilderck/testimonials/layouts/edit_testimonials.php
Back
<?php /** * @name Page Builder CK * @package com_pagebuilderck * @copyright Copyright (C) 2015. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr */ defined('_JEXEC') or die; ?> <div id="elementscontainer"> <div class="menulink" tab="tab_items"><?php echo JText::_('PLG_PAGEBUILDERCK_TESTIMONIALS_EDITION'); ?></div> <div class="tab menustyles ckproperty" id="tab_items"> <div class="tab_fullscreen" style="background:#fff;"> <div id="items_edition_list"> </div> <div onclick="ckAddNewListItem()" class="item_add btn btn-small btn-info"><?php echo JText::_('CK_ADD_NEW_ITEM'); ?></div> <div class="clr"></div> </div> <div class="ckoption"> <div style="text-align:left;clear:both;"> <div style="width:150px;float:left;text-align:left;margin:5px 5px 0 0;line-height: 15px;"><?php echo JText::_('CK_AUTOPLAY'); ?></div><div style="float:left;text-align:right;margin:5px 5px 0 0;"><img src="<?php echo $this->imagespath; ?>control_play.png" width="15" height="15" align="top" /></div> <div style="float:left;text-align:left;margin-left:3px;"> <select class="inputboxfake ckattrib" type="list" value="" name="autoplay" id="autoplay" style="width: 70px;float:right; margin-right:4px;" onchange="ckSetAttrib(this)"> <option value="0"><?php echo JText::_('JNO'); ?></option> <option value="1"><?php echo JText::_('JYES'); ?></option> </select> </div> </div> <div style="text-align:left;clear:both;"> <div style="width:150px;float:left;text-align:left;margin:5px 5px 0 0;line-height: 15px;"><?php echo JText::_('CK_PAUSE_HOVER'); ?></div><div style="float:left;text-align:right;margin:5px 5px 0 0;"><img src="<?php echo $this->imagespath; ?>control_pause.png" width="15" height="15" align="top" /></div> <div style="float:left;text-align:left;margin-left:3px;"> <select class="inputboxfake ckattrib" type="list" value="" name="pausehover" id="pausehover" style="width: 70px;float:right; margin-right:4px;" onchange="ckSetAttrib(this)"> <option value="0"><?php echo JText::_('JNO'); ?></option> <option value="1"><?php echo JText::_('JYES'); ?></option> </select> </div> </div> <div style="text-align:left;clear:both;"> <div style="width:150px;float:left;text-align:left;margin:5px 5px 0 0;line-height: 15px;"><?php echo JText::_('CK_DURATION'); ?></div><div style="float:left;text-align:right;margin:5px 5px 0 0;"><img src="<?php echo $this->imagespath; ?>hourglass.png" width="15" height="15" align="top" /></div> <div style="float:left;text-align:left;margin-left:3px;"> <input class="inputboxfake ckattrib" type="text" value="" name="time" id="time" style="width: 70px;float:right; margin-right:4px;" onchange="ckSetAttrib(this)" /> </div> <span> ms</span> </div> <div class="clr"></div> </div> </div> <div class="menulink" tab="tab_blocstyles"><?php echo JText::_('CK_STYLES'); ?></div> <div class="tab menustyles ckproperty" id="tab_blocstyles"> <?php echo $this->menustyles->createBlocStyles('bloc', 'testimonials', '') ?> </div> </div> <script language="javascript" type="text/javascript"> function ckLoadEditionPopup() { var focus = $ck('.editfocus'); // $ck('#previewarea .ckstyle').html(focus.find('.ckstyle').html()); // $ck('#previewarea .pbck_testimonier').html(focus.find('.pbck_testimonials.inner, .pbck_testimonier').html()); $ck('.editfocus .pbck_testimonier .pbck_testimonial').each(function(i, el) { var authorInfos = {"name" : $ck('.pbck_testimonial_author_name', el).text(), "status" : $ck('.pbck_testimonial_author_status', el).text(), "url_text" : $ck('.pbck_testimonial_author_url', el).text(), "url_href" : $ck('.pbck_testimonial_author_url > a', el).attr('href')}; var iconLinkTarget = $ck('.pbck_testimonial_author_url > a', el).attr('target') ? $ck('.pbck_testimonial_author_url > a', el).attr('target') : ''; var itemedition = ckCreateEditTestimonialItem(i, $ck('#items_edition_list'), ckContentToEditor($ck('.pbck_testimonial_text', el).html()), $ck('.pbck_testimonial_img', el), authorInfos, iconLinkTarget); ckMakeEditItemAccordion(itemedition); }); $ck('#items_edition_list .item_content_edition').each(function() { ckLoadEditorOnTheFly($ck(this).attr('id')); }); // init the slider // document.getElementById('<?php echo $id; ?>_preview_pbck_testimonials').pbcktestimonials = jQuery('#<?php echo $id; ?>_preview_pbck_testimonials').PBCK_testimonials(); $ck('.ckattrib').each(function() { ckGetAttrib(this); }); ckMakeEditItemsSortable(); ckFillEditionPopup(focus.attr('id')); } function ckBeforeSaveEditionPopup() { var focus = $ck('.editfocus'); ckUpdatePreviewArea(); // $ck('.item_content_edition').each(function() { // ckRemoveEditorOnTheFly($ck(this).attr('id')); // }); // focus.find('.pbck_testimonials.inner, .pbck_testimonier').html($ck('#previewarea .pbck_testimonier').html()); // focus.find('.ckstyle').html($ck('#previewareabloc .ckstyle').html()); // ckSaveEditionPopup(focus.attr('id')); // ckCloseEditionPopup(); } function ckSaveInlineEditionPopup() { ckBeforeSaveEditionPopup(); } /* * Method automatically called in ckCloseEditionPopup() if exists (needed if you are using an editor !!) */ function ckBeforeCloseEditionPopup() { $ck('.item_content_edition').each(function() { ckRemoveEditorOnTheFly($ck(this).attr('id')); }); } function ckUpdatePreviewArea() { $ck('#items_edition_list .item_edition').each(function(i, el) { // update the edition item image source with the input value $ck('.item_image img', el).attr('src', PAGEBUILDERCK.URIROOT+'/'+getImgPathFromImgSrc($ck('.item_imageurl_edition', el).val())); // update the testimonials author infos $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_author_name').text($ck('.item_author_name_edition',el).val()); $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_author_status').text($ck('.item_author_status_edition',el).val()); $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_author_url > a').text($ck('.item_author_url_text_edition',el).val()); $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_author_url > a').attr('href', $ck('.item_author_url_href_edition',el).val()); if ($ck('.item_author_url_target_edition',el).val()) { $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_author_url > a').attr('target', $ck('.item_author_url_target_edition',el).val()); } else { $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_author_url > a').removeAttr('target'); } // update the testimonials content ckSaveEditorOnTheFly($ck('.item_content_edition', el).attr('id')); var content = $ck('.item_content_edition', el).val(); content = ckEditorToContent(content); $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_text').html(content); // update the testimonials image source and image alt tag $ck('.editfocus .pbck_wrap .pbck_testimonial').eq(i).find('.pbck_testimonial_img').attr('src', $ck('.item_image img', el).attr('src')).attr('alt', $ck('.item_author_name_edition',el).val()); }); } function ckCreateEditTestimonialItem(i, itemlist, itemcontent, itemimg, authorInfos, iconLinkTarget) { // authorInfos["name"] // var authorInfos = {"name" : $ck('.pbck_testimonial_author_name', el).text(), "status" : $ck('.pbck_testimonial_author_status', el).text(), "url_text" : $ck('.pbck_testimonial_author_url', el).text(), "url_href" : $ck('.pbck_testimonial_author_url', el).attr('href')}; var itemedition = $ck('<div class="item_edition clearfix" data_index="'+i+'">' +'<div class="item_move"></div>' +'<div class="item_image">' +'<a class="item_image_selection" href="javascript:void(0)" onclick="ckCallImageManagerPopup(\'item_imageurl_'+i+'\')" >' +'<img src="'+itemimg.attr('src')+'" />' +'</a>' +'</div>' +'<div class="item_imageurl"><label for="item_imageurl_'+i+'">'+Joomla.JText._('CK_IMAGE_URL','Image url')+'</label><input type="text" id="item_imageurl_'+i+'" name="item_imageurl_'+i+'" class="item_imageurl_edition" value="'+getImgPathFromImgSrc(itemimg.attr('src'))+'" style="width: 400px;" onchange="ckUpdatePreviewArea()"/></div>' +'<div class="item_author_name"><label for="author_name_'+i+'">'+Joomla.JText._('CK_AUTHOR_NAME','Name')+'</label><input type="text" id="author_name_'+i+'" name="author_name_'+i+'" class="item_author_name_edition" value="'+authorInfos["name"]+'" style="width: 400px;" onchange="ckUpdatePreviewArea()"/></div>' +'<div class="item_author_status"><label for="author_status_'+i+'">'+Joomla.JText._('CK_AUTHOR_STATUS','Status')+'</label><input type="text" id="author_status_'+i+'" name="author_status_'+i+'" class="item_author_status_edition" value="'+authorInfos["status"]+'" style="width: 400px;" onchange="ckUpdatePreviewArea()"/></div>' +'<div class="item_author_url_text"><label for="author_url_text_'+i+'">'+Joomla.JText._('CK_AUTHOR_URL_TEXT','Url text')+'</label><input type="text" id="author_url_text_'+i+'" name="author_url_text_'+i+'" class="item_author_url_text_edition" value="'+authorInfos["url_text"]+'" style="width: 400px;" onchange="ckUpdatePreviewArea()"/></div>' +'<div class="item_author_url_href"><label for="author_url_href_'+i+'">'+Joomla.JText._('CK_AUTHOR_URL_LINK','Url link')+'</label><input type="text" id="author_url_href_'+i+'" name="author_url_href_'+i+'" class="item_author_url_href_edition" value="'+authorInfos["url_href"]+'" style="width: 400px;" onchange="ckUpdatePreviewArea()"/></div>' +'<div class="item_author_url_target"><label for="author_url_target_'+i+'">'+Joomla.JText._('CK_AUTHOR_TARGET_LINK','Target link')+'</label><input type="text" id="author_url_target_'+i+'" name="author_url_target_'+i+'" class="item_author_url_target_edition" value="'+iconLinkTarget+'" style="width: 400px;" placeholder="" onchange="ckUpdatePreviewArea()"/></div>' +'<div class="item_toggler">'+Joomla.JText._('CK_CLICK_TO_EDIT_CONTENT','Click to edit the content')+'</div>' +'<div class="item_content"><textarea id="item_content_'+i+'" name="item_title_'+i+'" class="item_content_edition" onchange="ckUpdatePreviewArea()">'+itemcontent+'</textarea></div>' +'<br />' +'<div class="item_delete btn-small btn btn-danger" onclick="ckDeleteEditItem($ck(this).parent())">'+Joomla.JText._('CK_DELETE','Delete')+'</div>' // +' <div class="item_setdefault btn-small btn" onclick="ckSetDefaultEditItem($ck(this).parent())"><span class="icon icon-star"></span>'+Joomla.JText._('CK_SET_DEFAULT','Set as default')+'</div>' +'</div>'); itemlist.append(itemedition); return itemedition; } function selectimagefile(file, id) { $ck('#'+id).val(file).trigger('change'); } function ckAddNewListItem() { // add the element in the testimonials var index = $ck('#items_edition_list .item_edition').length; ckAddNewTestimonialsItem(); ckTestimonierReset(); // add the element in the list for the interface var authorInfos = {"name" : "James", "status" : "Technician", "url_text" : "Joomlack", "url_href" : "https://www.joomlack.fr"}; var itemedition = ckCreateEditTestimonialItem(index, $ck('#items_edition_list'), 'Lorem Ipsum', $ck('<img src="'+PAGEBUILDERCK_MEDIA_URI+'/images/photo.png" />'), authorInfos ) ckMakeEditItemAccordion(itemedition); ckLoadEditorOnTheFly('item_content_' + index); ckUpdatePreviewArea(); } function ckAddNewTestimonialsItem() { var lastitem = $ck('.editfocus .pbck_wrap > .pbck_wrapinner .pbck_testimonial').last(); var item = lastitem.clone(); $ck('.editfocus .pbck_wrap > .pbck_wrapinner').append(item); return item; } function ckTestimonierReset() { var slider = $ck('.editfocus .pbck_testimonier'); slider.find('.pbck_wrapinner') .width((slider.find('.pbck_testimonial').length*100)+'%') .css('marginLeft', '0'); slider.find('.pbck_testimonial').width((100/slider.find('.pbck_testimonial').length)+'%'); } //function ckGetNewTestimonialsItem(index) { // var item = '<article class="pbck_testimonial">' // +'<div class="pbck_testimonial_caption" data-index="'+index+'">' // +'<div class="pbck_testimonial_title">Lorem Ipsum</div>' // +'<br />' // +'<div class="pbck_testimonial_text">Dolor sit amet ...</div>' // +'</div>' // +'<img class="pbck_testimonial_img" src="'+PAGEBUILDERCK.URIROOT+'/plugins/pagebuilderck/testimonials/assets/images/images.png"> ' // +'</article>'; // return item; //} function ckGetNewTestimonialsPagination(index) { var item = '<input name="pbck_testimonials" id="pbck_testimonial'+index+'" type="radio">'; return item; } function ckGetNewTestimonialsControl(index) { var item = '<label for="" onclick="pbck_testimonials_show(this)" class="pbck_testimonials_control"></label>'; return item; } function ckBeforeDeleteEditItem(item) { var index_item = item.index('.item_edition'); ckRemoveEditorOnTheFly(item.find('.item_content_edition').attr('id')); $ck('.editfocus .pbck_testimonial').eq(index_item).remove(); ckTestimonierReset(); } function ckMakeEditItemsSortable() { $ck( "#items_edition_list" ).sortable({ items: ".item_edition", helper: "clone", handle: ".item_move", forcePlaceholderSize: true, tolerance: "pointer", placeholder: "placeholderck", start: function(e, ui){ $ck(this).find('.item_content_edition').each(function(){ if (tinymce.get($ck(this).attr('id'))) { ckRemoveEditorOnTheFly($ck(this).attr('id')); } }); }, stop: function( event, ui ) { $ck(this).find('.item_content_edition:not(.ui-sortable-helper)').each(function(){ ckLoadEditorOnTheFly($ck(this).attr('id')); }); ckUpdatePreviewArea(); }, }); } function ckSetAttrib(field) { var item = $ck('.editfocus .pbck_testimonials'); item.attr('data-' + field.id, field.value); } function ckGetAttrib(field) { var item = $ck('.editfocus .pbck_testimonials'); if (item.attr('data-' + field.id)) $ck(field).val(item.attr('data-' + field.id)); } </script> <style type="text/css"> .item_image { float: left; box-shadow: #888 0 0 10px; margin: 0 10px 0 0; cursor: pointer; border: 5px solid #fff; } .item_image:hover { border-color: rgba(82, 168, 236, 0.8); } .item_image img { width: 150px; height: 150px; } .item_edition .item_toggler { display: inline-block; } #items_edition_list label { display: inline-block; width: 180px; } </style>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings