Skip to content

Commit

Permalink
symfony 4 compatibility changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-computerrock committed Dec 6, 2019
1 parent 1ebf789 commit 5863b6b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 37 deletions.
13 changes: 8 additions & 5 deletions Admin/ORMTranslationAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Doctrine\ORM\QueryBuilder;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQuery;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class ORMTranslationAdmin extends TranslationAdmin
{
Expand Down Expand Up @@ -48,7 +51,7 @@ function ($domain) use (&$domains) {
'multiple' => true,
'expanded' => false
),
'field_type' => 'choice',
'field_type' => ChoiceType::class,
)
)
->add(
Expand Down Expand Up @@ -79,7 +82,7 @@ function ($domain) use (&$domains) {
'required' => true,
'value' => $this->getNonTranslatedOnly(),
),
'field_type' => 'checkbox',
'field_type' => CheckboxType::class,
)
)
->add('key', 'doctrine_orm_string')
Expand All @@ -92,10 +95,10 @@ function ($domain) use (&$domains) {
'required' => true,
'multiple' => false,
'expanded' => false,
'empty_value' => 'all',
'placeholder' => 'all',
'empty_data' => 'all'
),
'field_type' => 'choice',
'field_type' => ChoiceType::class,
)
)
->add(
Expand All @@ -114,7 +117,7 @@ function ($domain) use (&$domains) {
'%' . $options['value'] . '%'
);
},
'field_type' => 'text',
'field_type' => TextType::class,
'label' => 'content',
)
);
Expand Down
5 changes: 3 additions & 2 deletions Admin/TranslationAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Admin\Admin;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;

abstract class TranslationAdmin extends Admin
{
Expand Down Expand Up @@ -214,8 +215,8 @@ protected function configureFormFields(FormMapper $form)
}

$form
->add('key', 'text')
->add('domain', 'text');
->add('key', TextType::class)
->add('domain', TextType::class);
}

/**
Expand Down
58 changes: 29 additions & 29 deletions Resources/public/bootstrap-editable/js/bootstrap-editable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*! X-editable - v1.4.6
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */

/*! X-editable - v1.4.6
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */

/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Expand Down Expand Up @@ -621,7 +621,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
//error class attached to editable-error-block
$.fn.editableform.errorBlockClass = 'editable-error';
}(window.jQuery));


/**
* EditableForm utilites
*/
Expand Down Expand Up @@ -871,7 +871,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.

};
}(window.jQuery));


/**
Attaches stand-alone container with editable-form to HTML element. Element is used only for positioning, value is not stored anywhere.<br>
This method applied internally in <code>$().editable()</code>. You should subscribe on it's events (save / cancel) to get profit of it.<br>
Expand Down Expand Up @@ -1386,7 +1386,7 @@ Applied as jQuery method.
};

}(window.jQuery));


/**
* Editable Inline
* ---------------------
Expand Down Expand Up @@ -1440,7 +1440,7 @@ Applied as jQuery method.
}
});

}(window.jQuery));
}(window.jQuery));
/**
Makes editable any HTML element on the page. Applied as jQuery method.
Expand Down Expand Up @@ -2253,7 +2253,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
};

}(window.jQuery));


/**
AbstractInput - base class for all editable inputs.
It defines interface to be implemented by any input type.
Expand Down Expand Up @@ -2461,7 +2461,7 @@ To create your own input you can inherit from this class.
$.extend($.fn.editabletypes, {abstractinput: AbstractInput});

}(window.jQuery));


/**
List - abstract class for inputs that have source option loaded from js array or via ajax
Expand Down Expand Up @@ -2783,7 +2783,7 @@ List - abstract class for inputs that have source option loaded from js array or
$.fn.editabletypes.list = List;

}(window.jQuery));


/**
Text input
Expand Down Expand Up @@ -2918,7 +2918,7 @@ $(function(){
$.fn.editabletypes.text = Text;

}(window.jQuery));


/**
Textarea input
Expand Down Expand Up @@ -3030,7 +3030,7 @@ $(function(){
$.fn.editabletypes.textarea = Textarea;

}(window.jQuery));


/**
Select (dropdown)
Expand Down Expand Up @@ -3126,7 +3126,7 @@ $(function(){
$.fn.editabletypes.select = Select;

}(window.jQuery));


/**
List of checkboxes.
Internally value stored as javascript array of values.
Expand Down Expand Up @@ -3279,7 +3279,7 @@ $(function(){
$.fn.editabletypes.checklist = Checklist;

}(window.jQuery));


/**
HTML5 input types.
Following types are supported:
Expand Down Expand Up @@ -3498,7 +3498,7 @@ Time
});
$.fn.editabletypes.time = Time;
}(window.jQuery));


/**
Select2 input. Based on amazing work of Igor Vaynberg https://github.com/ivaynberg/select2.
Please see [original select2 docs](http://ivaynberg.github.com/select2) for detailed description and options.
Expand Down Expand Up @@ -3823,7 +3823,7 @@ $(function(){
$.fn.editabletypes.select2 = Constructor;

}(window.jQuery));


/**
* Combodate - 1.0.4
* Dropdown date and time picker.
Expand Down Expand Up @@ -4276,7 +4276,7 @@ $(function(){
roundTime: true //whether to round minutes and seconds if step > 1
};

}(window.jQuery));
}(window.jQuery));
/**
Combodate input - dropdown date and time picker.
Based on [combodate](http://vitalets.github.com/combodate) plugin (included). To use it you should manually include [momentjs](http://momentjs.com).
Expand Down Expand Up @@ -4466,7 +4466,7 @@ $(function(){
$.fn.editabletypes.combodate = Constructor;

}(window.jQuery));


/*
Editableform based on Twitter Bootstrap
*/
Expand All @@ -4481,14 +4481,14 @@ Editableform based on Twitter Bootstrap
});

//buttons
$.fn.editableform.buttons = '<button type="submit" class="btn btn-primary editable-submit"><i class="icon-ok icon-white"></i></button>'+
'<button type="button" class="btn editable-cancel"><i class="icon-remove"></i></button>';
$.fn.editableform.buttons = '<button type="submit" class="btn btn-primary editable-submit"><i class="glyphicon-ok icon-white"></i></button>'+
'<button type="button" class="btn editable-cancel"><i class="glyphicon-remove"></i></button>';

//error classes
$.fn.editableform.errorGroupClass = 'error';
$.fn.editableform.errorBlockClass = null;

}(window.jQuery));
}(window.jQuery));
/**
* Editable Popover
* ---------------------
Expand Down Expand Up @@ -4668,7 +4668,7 @@ Editableform based on Twitter Bootstrap
});

}(window.jQuery));


/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
Expand Down Expand Up @@ -5923,7 +5923,7 @@ Editableform based on Twitter Bootstrap
});

}( window.jQuery ));


/**
Bootstrap-datepicker.
Description and examples: https://github.com/eternicode/bootstrap-datepicker.
Expand Down Expand Up @@ -6153,7 +6153,7 @@ $(function(){
$.fn.editabletypes.date = Date;

}(window.jQuery));


/**
Bootstrap datefield input - modification for inline mode.
Shows normal <input type="text"> and binds popup datepicker.
Expand Down Expand Up @@ -6234,7 +6234,7 @@ Automatically shown in inline mode.

$.fn.editabletypes.datefield = DateField;

}(window.jQuery));
}(window.jQuery));
/**
Bootstrap-datetimepicker.
Based on [smalot bootstrap-datetimepicker plugin](https://github.com/smalot/bootstrap-datetimepicker).
Expand Down Expand Up @@ -6478,7 +6478,7 @@ $(function(){

$.fn.editabletypes.datetime = DateTime;

}(window.jQuery));
}(window.jQuery));
/**
Bootstrap datetimefield input - datetime input for inline mode.
Shows normal <input type="text"> and binds popup datetimepicker.
Expand Down Expand Up @@ -6555,7 +6555,7 @@ Automatically shown in inline mode.

$.fn.editabletypes.datetimefield = DateTimeField;

}(window.jQuery));
}(window.jQuery));
/**
Typeahead input (bootstrap only). Based on Twitter Bootstrap [typeahead](http://twitter.github.com/bootstrap/javascript.html#typeahead).
Depending on `source` format typeahead operates in two modes:
Expand Down

Large diffs are not rendered by default.

0 comments on commit 5863b6b

Please sign in to comment.