Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/ptitsanes/plugins/solidres/customfield/ |
Upload File : |
<?php
/*------------------------------------------------------------------------
Solidres - Hotel booking extension for Joomla
------------------------------------------------------------------------
@Author Solidres Team
@Website http://www.solidres.com
@Copyright Copyright (C) 2013 - 2016 Solidres. All Rights Reserved.
@License GNU General Public License version 3, or later
------------------------------------------------------------------------*/
defined('_JEXEC') or die;
/**
* Solidres Limit Booking
*
* @package Solidres
* @subpackage Customfield
* @since 0.1.0
*/
class PlgSolidresCustomfield extends SRPlugin
{
public function onSolidresSideNavPrepare(&$menuStructure, &$iconMap)
{
$menuStructure['SR_SUBMENU_CUSTOMER']['2.0'] = array(
'SR_SUBMENU_CUSTOM_FIELDS',
'index.php?option=com_solidres&view=customfields&context=com_solidres.customer'
);
if (isset($menuStructure['SR_SUBMENU_RESERVATION']))
{
$menuStructure['SR_SUBMENU_RESERVATION']['4.1'] = array(
'SR_SUBMENU_ROOM_FORM',
'index.php?option=com_solidres&view=customfields&context=com_solidres.room'
);
}
if (isset($menuStructure['SR_SUBMENU_SUBSCRIPTIONS']))
{
$menuStructure['SR_SUBMENU_SUBSCRIPTIONS']['5.0'] = array(
'SR_SUBMENU_CUSTOM_FIELDS',
'index.php?option=com_solidres&view=customfields&context=com_solidres.subscription'
);
}
}
public function onSolidresPluginRegister()
{
JLoader::register('SRCustomFieldHelper', $this->_getAdminPath() . '/helpers/customfield.php');
JLoader::register('SRCustomFieldValue', $this->_getAdminPath() . '/helpers/customfieldvalue.php');
parent::onSolidresPluginRegister();
$option = $this->app->input->get('option');
$task = $this->app->input->get('task');
$document = JFactory::getDocument();
if ($option == 'com_falang'
&& in_array($task, array('translate.edit', 'translate.apply'))
&& $document->getType() == 'html')
{
$document->addScriptDeclaration('Solidres.jQuery(document).ready(function($){
if($("input[name=\'sr_customfields_context_filter_value\']").length){
var origin = $("#original_value_attribs");
var input = $("textarea[name=\'refField_attribs\']");
var data = $.parseJSON($.trim(input.text()));
if(!data){
data = $.parseJSON($.trim(origin.text()));
}
if(data && data.options && data.options.length){
var html = "", option;
for(var i = 0, n = data.options.length; i < n; i++){
option = data.options[i];
html += "<div class=\'sr_field_group\'><input type=\'text\' name=\'options[" + i + "][value]\' placeholder=\'Value\' value=\'" + option.value + "\'/>";
html += "<input type=\'text\' name=\'options[" + i + "][text]\' placeholder=\'Text\' value=\'" + option.text + "\'/></div>";
}
origin.parent().hide();
input.hide().parent().append(html)
.find(".sr_field_group").css({
maxWidth: \'340px\',
padding: \'5px\',
margin: \'5px 0\',
background: \'#f2f2f2\'
}).find("input").css({
display: \'inline-block\',
margin: \'0 3px\'
}).on("change", function(){
var options = [], el;
$(".sr_field_group").each(function(i){
el = $(this).find(">input");
options[i] = {
value: el.eq(0).val(),
text: el.eq(1).val()
};
});
data.options = options;
input.val(JSON.stringify(data));
});
}
}
});');
}
}
}