Skip to content

Instantly share code, notes, and snippets.

@duskohu
duskohu / form
Created July 9, 2013 09:29
Nextras\Forms - DatePicker for twitter bootstrap (http://www.malot.fr/bootstrap-datetimepicker/) add input-append icons style
<?php
$form->addDatePicker('date', 'Date')
->setDefaultValue(new DateTime());
@duskohu
duskohu / BasePresenter.php
Last active December 21, 2015 05:29
Search Form Control for Nette framework
<?php
namespace Nas;
use Nette\Application\UI\Presenter;
use Nette\Application\UI\Form;
abstract class BasePresenter extends Presenter
{
@duskohu
duskohu / parse.php
Created October 16, 2013 12:05
Parse degree before, name, surname and degree after from string.
<?php
$list = array(
'Ing. Peter Jablčko',
'Ondrej koláč',
'Miro Hámor PhD.',
'Ing. Palo Kámor PhD.',
'Ing. Dr. Palo Kamor PhD.',
'Ing. Dr. Palo Kamor PhD. xxx. '
);
<?php
namespace Nas\Templating;
use NasExt\Templating\FilesList;
use NasExt\Templating\IFilesFormatterLogger;
use NasExt\Templating\ITemplateFilesFormatter;
use Nette\Object;
/**
@duskohu
duskohu / confirm.dialog.js
Last active December 29, 2015 00:09
Confirm dialog for Bootstrap 3 - use nette.ajax.js
/**
* Confirm dialog plugin
*
* @copyright Copyright (c) 2012 Jan Červený
* @license BSD
* @link confirmdialog.redsoft.cz
* @version 1.0
*/
(function ($, undefined) {
@duskohu
duskohu / spinner.css
Created November 21, 2013 22:44
Spinner extension for nette.ajax.js
#ajax-spinner {
position: fixed;
width: 32px;
height: 32px;
/* - use if you use bacground image, no ico */
/*background: url('../img/ajax_loader.gif') no-repeat;*/
z-index: 123456;
color: green;
}
@duskohu
duskohu / BaseControl.php
Last active December 29, 2015 02:19
Priklad Inject TestControl extends BaseControl
<?php
namespace App;
use NasExt\Templating\ITemplateFilesFormatter;
use Nette\Application\UI\Control;
use Nette\Templating\ITemplate;
class BaseControl extends Control
{
@duskohu
duskohu / BaseControl.php
Created November 22, 2013 13:30
Priklad No-injectTestControl extends BaseControl
<?php
namespace App;
use NasExt\Templating\ITemplateFilesFormatter;
use Nette\Application\UI\Control;
use Nette\Templating\ITemplate;
class BaseControl extends Control
{
@duskohu
duskohu / BaseFormControl.php
Last active December 29, 2015 10:49
BaseForm
<?php
namespace Nas;
use Kdyby\BootstrapFormRenderer\BootstrapRenderer;
use NasExt\Forms\Controls\RangeSlider;
use NasExt\Templating\ITemplateFilesFormatter;
use Nette\Application\UI\Control;
use Nette\ComponentModel\IContainer;
use Nette\Forms\Controls\SuggestionInput;
@duskohu
duskohu / custom.netteForms.js
Created December 9, 2013 20:57
Custom netteForms.js - change alert messages
/**
* Display error message.
*/
Nette.addError = function (elem, message) {
if (elem.focus) {
elem.focus();
}
if (message) {
var elemPosition = $(elem).position();
var elmHeight = $(elem).outerHeight();