Created by Tivie on 13-07-2015.
3697
function getDefaultOpts(simple) {
  'use strict';

  var defaultOptions = {
    omitExtraWLInCodeBlocks: {
      defaultValue: false,
      describe: 'Omit the default extra whiteline added to code blocks',
      type: 'boolean'
    },
    noHeaderId: {
      defaultValue: false,
      describe: 'Turn on/off generated header id',
      type: 'boolean'
    },
    prefixHeaderId: {
      defaultValue: false,
      describe: 'Specify a prefix to generated header ids',
      type: 'string'
    },
    headerLevelStart: {
      defaultValue: false,
      describe: 'The header blocks level start',
      type: 'integer'
    },
    parseImgDimensions: {
      defaultValue: false,
      describe: 'Turn on/off image dimension parsing',
      type: 'boolean'
    },
    simplifiedAutoLink: {
      defaultValue: false,
      describe: 'Turn on/off GFM autolink style',
      type: 'boolean'
    },
    excludeTrailingPunctuationFromURLs: {
      defaultValue: false,
      describe: 'Excludes trailing punctuation from links generated with autoLinking',
      type: 'boolean'
    },
    literalMidWordUnderscores: {
      defaultValue: false,
      describe: 'Parse midword underscores as literal underscores',
      type: 'boolean'
    },
    strikethrough: {
      defaultValue: false,
      describe: 'Turn on/off strikethrough support',
      type: 'boolean'
    },
    tables: {
      defaultValue: false,
      describe: 'Turn on/off tables support',
      type: 'boolean'
    },
    tablesHeaderId: {
      defaultValue: false,
      describe: 'Add an id to table headers',
      type: 'boolean'
    },
    ghCodeBlocks: {
      defaultValue: true,
      describe: 'Turn on/off GFM fenced code blocks support',
      type: 'boolean'
    },
    tasklists: {
      defaultValue: false,
      describe: 'Turn on/off GFM tasklist support',
      type: 'boolean'
    },
    smoothLivePreview: {
      defaultValue: false,
      describe: 'Prevents weird effects in live previews due to incomplete input',
      type: 'boolean'
    },
    smartIndentationFix: {
      defaultValue: false,
      description: 'Tries to smartly fix indentation in es6 strings',
      type: 'boolean'
    },
    disableForced4SpacesIndentedSublists: {
      defaultValue: false,
      description: 'Disables the requirement of indenting nested sublists by 4 spaces',
      type: 'boolean'
    },
    simpleLineBreaks: {
      defaultValue: false,
      description: 'Parses simple line breaks as <br> (GFM Style)',
      type: 'boolean'
    },
    requireSpaceBeforeHeadingText: {
      defaultValue: false,
      description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
      type: 'boolean'
    }
  };
  if (simple === false) {
    return JSON.parse(JSON.stringify(defaultOptions));
  }
  var ret = {};
  for (var opt in defaultOptions) {
    if (defaultOptions.hasOwnProperty(opt)) {
      ret[opt] = defaultOptions[opt].defaultValue;
    }
  }
  return ret;
}
705745
function () {
		// Create Layout
		this._el.container 				= TL.Dom.create("div", "tl-slide");

		if (this.has.title) {
			this._el.container.className = "tl-slide tl-slide-titleslide";
		}

		if (this.data.unique_id) {
			this._el.container.id 		= this.data.unique_id;
		}
		this._el.scroll_container 		= TL.Dom.create("div", "tl-slide-scrollable-container", this._el.container);
		this._el.content_container		= TL.Dom.create("div", "tl-slide-content-container", this._el.scroll_container);
		this._el.content				= TL.Dom.create("div", "tl-slide-content", this._el.content_container);
		this._el.background				= TL.Dom.create("div", "tl-slide-background", this._el.container);
		// Style Slide Background
		if (this.data.background) {
			if (this.data.background.url) {
		    var media_type = TL.MediaType(this.data.background, true);
		    if(media_type) {
          this._background_media = new media_type.cls(this.data.background, {background: 1});

          this.has.background.image 					= true;
          this._el.container.className 				+= ' tl-full-image-background';
          this.has.background.color_value 		= "#000";
          this._el.background.style.display 	= "block";
        }
			}
			if (this.data.background.color) {
				this.has.background.color 					= true;
				this._el.container.className 				+= ' tl-full-color-background';
				this.has.background.color_value 			= this.data.background.color;
				//this._el.container.style.backgroundColor = this.data.background.color;
				//this._el.background.style.backgroundColor 	= this.data.background.color;
				//this._el.background.style.display 			= "block";
			}
			if (this.data.background.text_background) {
				this._el.container.className 				+= ' tl-text-background';
			}

		}



		// Determine Assets for layout and loading
		if (this.data.media && this.data.media.url && this.data.media.url != "") {
			this.has.media = true;
		}
		if (this.data.text && this.data.text.text) {
			this.has.text = true;
		}
		if (this.data.text && this.data.text.headline) {
			this.has.headline = true;
		}

		// Create Media
		if (this.has.media) {
			// Determine the media type
			this.data.media.mediatype = TL.MediaType(this.data.media);
			this.options.media_name 	= this.data.media.mediatype.name;
			this.options.media_type 	= this.data.media.mediatype.type;
      this.options.autolink 		= this.data.autolink;

			// Create a media object using the matched class name
			this._media = new this.data.media.mediatype.cls(this.data.media, this.options);
		}

		// Create Text
		if (this.has.text || this.has.headline) {
			this._text = new TL.Media.Text(this.data.text, {title:this.has.title,language: this.options.language, autolink: this.data.autolink });
			this._text.addDateText(this.getFormattedDate());
		}



		// Add to DOM
		if (!this.has.text && !this.has.headline && this.has.media) {
			TL.DomUtil.addClass(this._el.container, 'tl-slide-media-only');
			this._media.addTo(this._el.content);
		} else if (this.has.headline && this.has.media && !this.has.text) {
			TL.DomUtil.addClass(this._el.container, 'tl-slide-media-only');
			this._text.addTo(this._el.content);
			this._media.addTo(this._el.content);
		} else if (this.has.text && this.has.media) {
			this._media.addTo(this._el.content);
			this._text.addTo(this._el.content);
		} else if (this.has.text || this.has.headline) {
			TL.DomUtil.addClass(this._el.container, 'tl-slide-text-only');
			this._text.addTo(this._el.content);
		}

		// Fire event that the slide is loaded
		this.onLoaded();

	}
984330
private function writeEndereco(
        $t, $l, $w, $titulo, $nomeDestinatario, $logradouro, $numero1, $complemento, $bairro,
        $cidade, $uf, $cep = null
    )
    {
        // Titulo do bloco: destinatario ou remetente
        $this->pdf->SetFont('', 'B');
        $this->setFillColor(60, 60, 60);
        $this->pdf->SetFontSize(7);
        $this->pdf->SetXY($l + 3, $t);
        $this->t($w, $titulo, 2, '');

        $addressPadding = 5;
        $w = $w - $addressPadding;
        $l = $l + $addressPadding;

        // Nome da pessoa
        $this->pdf->SetFont('', '');
        $this->setFillColor(190, 190, 190);
        $this->pdf->SetX($l);
        $this->multiLines($w, $nomeDestinatario, 'L');

        //Primeria parte do endereco
        $address1 = $logradouro;
        $numero = $numero1;
        if (!$numero || strtolower($numero) == 'sn') {
            $address1 .= ', s/ nº';
        } else {
            $address1 .= ', ' . $numero;
        }
        if ($complemento) {
            $address1 .= ' - ' . $complemento;
        }
        $this->setFillColor(100, 190, 190);
        $this->pdf->SetX($l);
        $this->multiLines($w, $address1, 'L');

        //Segunda parte do endereco
        $this->pdf->SetX($l);
        $this->setFillColor(100, 130, 190);
        $this->multiLines($w, '' . $bairro, 'L');
        $this->setFillColor(100, 30, 210);
        $this->pdf->SetX($l);
        $this->multiLines($w, ($cep ? $cep . ' - ' : '') . $cidade . ' - ' . $uf, 'L');

        return $this->pdf->GetY();
    }
1356909
public function ajouter()
    {
        $newIdPersonne=0;
        $formulaire = new formGenerator();
        if (isset($this->variablesPost['submit'])) {
            $modeAffichage='';
            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']!='') {
                $modeAffichage = $this->variablesGet['modeAffichage'];
            }


            switch ($modeAffichage) {
                case 'nouveauDossier':
                case "modifEvenement":
                    $tabForm = array(
                    'prenom'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'nom'        => array('default'=> '',  'value' => '',  'required'=>true, 'error'=>'', 'type'=>'text'),
                    'description'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'dateNaissance'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'dateDeces'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'metier'    => array('default'=> 'aucune' ,  'value' => '',  'required'=>false , 'error'=>'', 'type'=>'numeric',  'checkExist'=>
                                    array('table'=> 'metier',  'primaryKey'=> 'idMetier')));

                    break;

                default:
                    $tabForm = array(
                    'prenom'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'nom'        => array('default'=> '',  'value' => '',  'required'=>true, 'error'=>'', 'type'=>'text'),
                    'description'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'nouveauMetier'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'dateNaissance'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'dateDeces'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'metier'    => array('default'=> 'aucune' ,  'value' => '',  'required'=>false , 'error'=>'', 'type'=>'numeric',  'checkExist'=>
                                    array('table'=> 'metier',  'primaryKey'=> 'idMetier')));

                    break;
            }
            $erreur = $formulaire->getArrayFromPost($tabForm);

            if (count($erreur) === 0) {
                $prenom = mysql_escape_string($tabForm['prenom']['value']);
                $nom    = mysql_escape_string($tabForm['nom']['value']);
                $description   = isset($_POST['descriptionPerson'])?mysql_escape_string($_POST['descriptionPerson']):mysql_escape_string(htmlspecialchars($tabForm['description']['value']));
                $dateNaissance = $this->date->toBdd($this->date->convertYears($tabForm['dateNaissance']['value']));
                $dateDeces     = $this->date->toBdd($this->date->convertYears($tabForm['dateDeces']['value']));

                /*if (!empty($tabForm['nouveauMetier']['value']))
                {
                    // nouveau metier
                    $nomMetier = mysql_escape_string($tabForm['nouveauMetier']['value']);
                    $sql = "SELECT idMetier FROM metier WHERE nom='".$nomMetier."' LIMIT 1";
                    $rep = $this->connexionBdd->requete($sql);
                    if (mysql_num_rows($rep) === 1)
                    {
                        $res = mysql_fetch_object($rep);
                        $idMetier = $res->idMetier;
                        echo "métier existe";
                    }
                    else
                    {
                        $sql = "INSERT INTO metier (nom) VALUES ('".$nomMetier."')";
                        $this->connexionBdd->requete($sql);
                        $idMetier = mysql_insert_id();
                        echo 'métier existe pas';
                    }
                }
                else if (empty($tabForm['metier']['error']) AND !empty($tabForm['metier']['value']))
                {*/
                    // valeur du select
                    $idMetier      = $tabForm['metier']['value'];
                    //echo 'métier select';
                /*}
                else
                {
                    // choix par défaut
                    $idMetier = 1;
                    echo 'défaut';
                }*/
                $sql ="INSERT INTO personne (prenom,  nom,  dateNaissance,  dateDeces,  description,  idMetier ) VALUES
                    ('".$prenom."', '".$nom."', '".$dateNaissance."', '".$dateDeces."', '".$description."', ".$idMetier.")";


                $this->connexionBdd->requete($sql);

                $newIdPersonne = mysql_insert_id();
            } else {
                $this->erreurs->ajouter($tabForm);
            }
            $this->erreurs->ajouter($tabForm);
        }

        return $newIdPersonne;
    }
60390
function () {
    var tmp_0 = this.get(2,2) * this.get(3,3);
    var tmp_1 = this.get(3,2) * this.get(2,3);
    var tmp_2 = this.get(1,2) * this.get(3,3);
    var tmp_3 = this.get(3,2) * this.get(1,3);
    var tmp_4 = this.get(1,2) * this.get(2,3);
    var tmp_5 = this.get(2,2) * this.get(1,3);
    var tmp_6 = this.get(0,2) * this.get(3,3);
    var tmp_7 = this.get(3,2) * this.get(0,3);
    var tmp_8 = this.get(0,2) * this.get(2,3);
    var tmp_9 = this.get(2,2) * this.get(0,3);
    var tmp_10 = this.get(0,2) * this.get(1,3);
    var tmp_11 = this.get(1,2) * this.get(0,3);
    var tmp_12 = this.get(2,0) * this.get(3,1);
    var tmp_13 = this.get(3,0) * this.get(2,1);
    var tmp_14 = this.get(1,0) * this.get(3,1);
    var tmp_15 = this.get(3,0) * this.get(1,1);
    var tmp_16 = this.get(1,0) * this.get(2,1);
    var tmp_17 = this.get(2,0) * this.get(1,1);
    var tmp_18 = this.get(0,0) * this.get(3,1);
    var tmp_19 = this.get(3,0) * this.get(0,1);
    var tmp_20 = this.get(0,0) * this.get(2,1);
    var tmp_21 = this.get(2,0) * this.get(0,1);
    var tmp_22 = this.get(0,0) * this.get(1,1);
    var tmp_23 = this.get(1,0) * this.get(0,1);

    var t0 = ((tmp_0 * this.get(1,1) + tmp_3 * this.get(2,1) + tmp_4 * this.get(3,1)) -
              (tmp_1 * this.get(1,1) + tmp_2 * this.get(2,1) + tmp_5 * this.get(3,1)));
    var t1 = ((tmp_1 * this.get(0,1) + tmp_6 * this.get(2,1) + tmp_9 * this.get(3,1)) -
              (tmp_0 * this.get(0,1) + tmp_7 * this.get(2,1) + tmp_8 * this.get(3,1)));
    var t2 = ((tmp_2 * this.get(0,1) + tmp_7 * this.get(1,1) + tmp_10 * this.get(3,1)) -
              (tmp_3 * this.get(0,1) + tmp_6 * this.get(1,1) + tmp_11 * this.get(3,1)));
    var t3 = ((tmp_5 * this.get(0,1) + tmp_8 * this.get(1,1) + tmp_11 * this.get(2,1)) -
              (tmp_4 * this.get(0,1) + tmp_9 * this.get(1,1) + tmp_10 * this.get(2,1)));

    var d = 1.0 / (this.get(0,0) * t0 + this.get(1,0) * t1 + this.get(2,0) * t2 + this.get(3,0) * t3);

    var out_00 = d * t0;
    var out_01 = d * t1;
    var out_02 = d * t2;
    var out_03 = d * t3;

    var out_10 = d * ((tmp_1 * this.get(1,0) + tmp_2 * this.get(2,0) + tmp_5 * this.get(3,0)) -
                      (tmp_0 * this.get(1,0) + tmp_3 * this.get(2,0) + tmp_4 * this.get(3,0)));
    var out_11 = d * ((tmp_0 * this.get(0,0) + tmp_7 * this.get(2,0) + tmp_8 * this.get(3,0)) -
                      (tmp_1 * this.get(0,0) + tmp_6 * this.get(2,0) + tmp_9 * this.get(3,0)));
    var out_12 = d * ((tmp_3 * this.get(0,0) + tmp_6 * this.get(1,0) + tmp_11 * this.get(3,0)) -
                      (tmp_2 * this.get(0,0) + tmp_7 * this.get(1,0) + tmp_10 * this.get(3,0)));
    var out_13 = d * ((tmp_4 * this.get(0,0) + tmp_9 * this.get(1,0) + tmp_10 * this.get(2,0)) -
                      (tmp_5 * this.get(0,0) + tmp_8 * this.get(1,0) + tmp_11 * this.get(2,0)));

    var out_20 = d * ((tmp_12 * this.get(1,3) + tmp_15 * this.get(2,3) + tmp_16 * this.get(3,3)) -
                      (tmp_13 * this.get(1,3) + tmp_14 * this.get(2,3) + tmp_17 * this.get(3,3)));
    var out_21 = d * ((tmp_13 * this.get(0,3) + tmp_18 * this.get(2,3) + tmp_21 * this.get(3,3)) -
                      (tmp_12 * this.get(0,3) + tmp_19 * this.get(2,3) + tmp_20 * this.get(3,3)));
    var out_22 = d * ((tmp_14 * this.get(0,3) + tmp_19 * this.get(1,3) + tmp_22 * this.get(3,3)) -
                      (tmp_15 * this.get(0,3) + tmp_18 * this.get(1,3) + tmp_23 * this.get(3,3)));
    var out_23 = d * ((tmp_17 * this.get(0,3) + tmp_20 * this.get(1,3) + tmp_23 * this.get(2,3)) -
                      (tmp_16 * this.get(0,3) + tmp_21 * this.get(1,3) + tmp_22 * this.get(2,3)));
    
    var out_30 = d * ((tmp_14 * this.get(2,2) + tmp_17 * this.get(3,2) + tmp_13 * this.get(1,2)) -
                      (tmp_16 * this.get(3,2) + tmp_12 * this.get(1,2) + tmp_15 * this.get(2,2)));
    var out_31 = d * ((tmp_20 * this.get(3,2) + tmp_12 * this.get(0,2) + tmp_19 * this.get(2,2)) -
                      (tmp_18 * this.get(2,2) + tmp_21 * this.get(3,2) + tmp_13 * this.get(0,2)));
    var out_32 = d * ((tmp_18 * this.get(1,2) + tmp_23 * this.get(3,2) + tmp_15 * this.get(0,2)) -
                      (tmp_22 * this.get(3,2) + tmp_14 * this.get(0,2) + tmp_19 * this.get(1,2)));
    var out_33 = d * ((tmp_22 * this.get(2,2) + tmp_16 * this.get(0,2) + tmp_21 * this.get(1,2)) -
                      (tmp_20 * this.get(1,2) + tmp_23 * this.get(2,2) + tmp_17 * this.get(0,2)));

    this.elements[0*4+0] = out_00;
    this.elements[0*4+1] = out_01;
    this.elements[0*4+2] = out_02;
    this.elements[0*4+3] = out_03;
    this.elements[1*4+0] = out_10;
    this.elements[1*4+1] = out_11;
    this.elements[1*4+2] = out_12;
    this.elements[1*4+3] = out_13;
    this.elements[2*4+0] = out_20;
    this.elements[2*4+1] = out_21;
    this.elements[2*4+2] = out_22;
    this.elements[2*4+3] = out_23;
    this.elements[3*4+0] = out_30;
    this.elements[3*4+1] = out_31;
    this.elements[3*4+2] = out_32;
    this.elements[3*4+3] = out_33;
    return this;
  }
494121
private function writeEndereco (
        $t, $l, $w, $titulo, $nomeDestinatario, $logradouro, $numero1, $complemento, $bairro,
        $cidade, $uf, $cep = null, $destinatario = false
    ) {
        //$this->pdf->SetTextColor(51,51,51);
        if ($destinatario === true) {
            $addressPadding = 5;

            $t = $t-2;
            $this->pdf->SetDrawColor(0,0,0);
            $this->pdf->Line(0, $t, 106.36, $t);

            // Titulo do bloco: destinatario
            $this->pdf->setFillColor(0,0,0);
            $this->pdf->SetDrawColor(0,0,0);
            $this->pdf->Rect(0, $t, 36, 5, 'F');

            $this->pdf->SetFont('', 'B');
            $this->pdf->SetFontSize(11);
            $this->pdf->SetTextColor(255,255,255);
            $this->pdf->SetXY($l + 3, $t);
            $this->t($w, $titulo, 2, '');

            $this->pdf->SetTextColor(0,0,0);

            $this->pdf->Image(realpath(dirname(__FILE__)) . '/logo-correios.png', 84, $t+1, 20, 4);

            // Nome da pessoa
            $this->pdf->SetFont('', '', 11);
            $this->setFillColor(190, 190, 190);
            $this->pdf->SetX($l + $addressPadding);
            $this->multiLines($w, $nomeDestinatario, 'L');

        } else {
            $addressPadding = 2;
            $t = $t -1;
            $this->pdf->SetDrawColor(0,0,0);
            $this->pdf->Line(0, $t, 106.36, $t);

            $t++;

            // Titulo do bloco: destinatario ou remetente
            $this->pdf->SetFont('', 'B');
            $this->setFillColor(60, 60, 60);
            $this->pdf->SetFontSize(10);
            $this->pdf->SetXY(2, $t);
            $this->t($w, $titulo, 2, '');

            // Nome da pessoa
            $this->pdf->SetFont('', '', 10);
            $this->setFillColor(190, 190, 190);
            $this->pdf->SetXY(22, $t);
            $this->multiLines($w, trim($nomeDestinatario), 'L');
        }

        $w = $w - $addressPadding;
        $l = $l + $addressPadding;

        //Primeria parte do endereco
        $address1 = $logradouro;
        $numero = $numero1;
        if (!$numero || strtolower($numero) == 'sn') {
            $address1 .= ', s/ nº';
        } else {
            $address1 .= ', ' . $numero;
        }
        if ($complemento) {
            $complemento = $complemento . ' ';
        }
        $this->setFillColor(100, 190, 190);
        $this->pdf->SetX($l);
        $this->multiLines($w, $address1, 'L');

        //Segunda parte do endereco
        $this->pdf->SetX($l);

        $this->setFillColor(100, 130, 190);
        $this->multiLines($w, $complemento . $bairro, 'L');

        $this->setFillColor(100, 30, 210);
        $this->pdf->SetX($l);
        $this->pdf->SetFont('', 'B');
        $this->t($l, ($cep ? $cep . '  ' : ''), 0, 'L');

        $this->pdf->SetFont('');
        $this->pdf->SetX($l + 20);
        $this->t(15, ucfirst(trim($cidade)) . '/' . strtoupper(trim($uf)), 2, 'L');

        return $this->pdf->GetY();
    }
608872
private function createBrandsTbl()
    {
        Schema::create('tbl_brands', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->text('name');
            $table->tinyInteger('status')->default(1);
            $table->tinyInteger('default')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
        $datetime = Carbon::now();

        DB::table('tbl_brands')->insert([
            'name'       => 'Antares',
            'status'     => 1,
            'default'    => 1,
            'created_at' => $datetime
        ]);
    }
214730
protected function createComponentSocialForm() : Form
    {
        $form = new Form;

        $form->addText('title')
            ->setRequired('Titulek pro sociální sítě je povinný.')
            ->addRule(Form::MIN_LENGTH, 'Minimální délka titulku jsou %d znaky.', 3)
            ->addRule(Form::MAX_LENGTH, 'Maximální délka titulku je %d znaků.', 50);

        $form->addText('description')
            ->setRequired(FALSE)
            ->addRule(Form::MIN_LENGTH, 'Minimální délka popisu jsou %d znaky.', 3)
            ->addRule(Form::MAX_LENGTH, 'Maximální délka popisu je %d znaků.', 50);

        $form->addUpload('image')
            ->setRequired(FALSE)
            ->addRule(Form::IMAGE, 'Obrázek může být pouze JPG or PNG.')
            ->addRule(Form::MIME_TYPE, 'Obrázek musí mít správný mime-type.', ['image/jpeg', 'image/png'])
            ->addRule(Form::MAX_FILE_SIZE, 'Maximální velikost obrázku je 8 MB.', 1024 * 1024 * 8)
            ->addRule(Form::PATTERN, 'Obrázek musí mít koncovku .jpg, .png.', '.*\.(jpg|png)');

        $form->addSubmit('save');


        $onPageSocial = $this->activePage->getSocial();

        if ($onPageSocial)
        {
            $form->setDefaults([
                'title' => $onPageSocial->getTitle(),
                'description' => $onPageSocial->getDescription()
            ]);
        }

        $form->onValidate[] = function (Form $form) { $this->validate($form); };
        $form->onSuccess[] = function (Form $form) { $this->success($form); };

        if (!$this->presenter->user->isAllowed(OnPageAuthorizator::RES_SOCIAL))
        {
            $this->setDisabledForm($form);
        }

        return $form;
    }
653811
function yy_r153(){
    $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor));
    }
308901
public static function createTemporary() {
    $file = File::createTemporary();
    $tempname = $file->getName();
    $file->delete();
    
    $dir = $file->getDirectory()->sub($tempname.'/');
    $dir->make();
    return $dir;
  }
402773
function showText(text, interval, scrIn, complete) {
	var ind = scrIn?-3:0, write = this.write,
	tId = setInterval(timeFunc, interval);
	function timeFunc() { if(ind < 1) { write(164);
		for(var i=0,l=-ind; i<l; i++) write(0);
		write(text.substring(0,4-l));
	} else { var str = text.substr(ind,4); write([164,str]);
		for(var i=0,l=4-str.length; i<l; i++) write(0);
		if(!str.length || (!scrIn && str.length < 4)) {
		if(str.length) write([164,0,0,0,0]); clearTimeout(tId);
		if(typeof complete == "function") complete(); }
	} ind++; } timeFunc(); return tId;
}
372418
public function create()
    {
        $fs = new Filesystem();

        if (!$this->sourceDir) {
            throw new \Exception('O diretório de código fonte "singular.directory.src" da aplicação não foi definido!');
        }

        $migrationDir = $this->getMigrationDir();

        if (!$fs->exists($migrationDir)) {
            throw new \Exception(sprintf('O diretório de migration não existe!'));
        }

        $timestamp = time();

        $aplicacoes = $this->getAplicacoesToMigration();

        if (count($aplicacoes) > 0) {
            $template = file_get_contents(
                __DIR__.DIRECTORY_SEPARATOR."templates".DIRECTORY_SEPARATOR."app_migration.tpl"
            );

            $template = str_replace('$TIMESTAMP',$timestamp, $template);
            $template = str_replace('$APLICACOES', $this->arrayToString($aplicacoes, $timestamp) , $template);

            $dt = new \DateTime('now', new \DateTimeZone('UTC'));
            $date = $dt->format('YmdHis');

            file_put_contents($migrationDir.DIRECTORY_SEPARATOR.$date.'_insere_registros_aplicacoes_'.$timestamp.'.php', $template);
        }

        $modulos = $this->getModulosToMigration();

        if (count($modulos) > 0) {
            $template = file_get_contents(
                __DIR__.DIRECTORY_SEPARATOR."templates".DIRECTORY_SEPARATOR."mod_migration.tpl"
            );

            $template = str_replace('$TIMESTAMP',$timestamp, $template);
            $template = str_replace('$MODULOS', $this->arrayToString($modulos, $timestamp) , $template);

            sleep(1);

            $dt = new \DateTime('now', new \DateTimeZone('UTC'));
            $date = $dt->format('YmdHis');

            file_put_contents($migrationDir.DIRECTORY_SEPARATOR.$date.'_insere_registros_modulos_'.$timestamp.'.php', $template);
        }

        $this->clearMigrations();

        return count($modulos) + count($aplicacoes);
    }
54215
function requestNew()
    {
        $db = new Db;

        //Search from first register with [article.status] 5 and [article.editdate] <= datetime - 24 hours.
        $result = $db->query('SELECT MIN(id)id, (SELECT MAX(id+1) FROM article)nid
                              FROM article
                              WHERE status = 6
                              OR (status = 5 AND editdate <=  STR_TO_DATE(\''.date('Y-m-d H:i:s', time()-86400).'\', \'%Y-%m-%d %H:%i:%s\'))');

        if (isset($result[0])) {
            $this->editdate = date('Y-m-d H:i:s');
            $this->pubdate = $this->editdate;


            //Criando novo registro
            if ($result[0]->get('id') == null) {
                $this->id = $result[0]->get('nid');

                $db->query('INSERT INTO articlecontent
                           SET article = '.$this->id.',
                           	   content = "",
            				   editdate = "'.$this->editdate.'"');

                $db->query('INSERT INTO article
                           SET id = '.$this->id.',
                               status = 5,
                               editdate = \''.$this->editdate.'\'');

            //Atualizando o registro
            } else {
                $this->id = $result[0]->get('id');

                $db->query('UPDATE article
                           SET status = 5,
                               pubdate = \''.$this->pubdate.'\',
            				   editdate = \''.$this->editdate.'\',
            				   rateup = 0,
            				   ratedown = 0,
            				   access = 0,
            				   link = "",
            				   tags = "",
            				   title = "",
            				   media = "{}",
            				   resume = ""
            				   
            			 WHERE id = '.$this->id.'');

                $db->query('UPDATE articlecontent
                           SET content = "",
            				   editdate = \''.$this->editdate.'\'
            			 WHERE article = '.$this->id.'');
            }

                //Make dir clean (delete all files)
                $this->clearDir();
                return $this;
        }

            return false;
    }
986729
function yy_r157(){
    $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor));
    }
1253773
function () {
		//trace(this.data)
		// Create Layout
		this._el.container 				= TL.Dom.create("div", "tl-timeera");
		if (this.data.unique_id) {
			this._el.container.id 		= this.data.unique_id + "-era";
		}

		if (this.data.end_date) {
			this.has_end_date = true;
			this._el.container.className = 'tl-timeera tl-timeera-with-end';
		}

		this._el.content_container		= TL.Dom.create("div", "tl-timeera-content-container", this._el.container);

		this._el.background 			= TL.Dom.create("div", "tl-timeera-background", this._el.content_container);

		this._el.content				= TL.Dom.create("div", "tl-timeera-content", this._el.content_container);

		

		// Text
		this._el.text					= TL.Dom.create("div", "tl-timeera-text", this._el.content);
		this._text						= TL.Dom.create("h2", "tl-headline", this._el.text);
		if (this.data.text.headline && this.data.text.headline != "") {
			this._text.innerHTML		= TL.Util.unlinkify(this.data.text.headline);
		} 



		// Fire event that the slide is loaded
		this.onLoaded();

	}
1088053
function createDirIfIsNotDefined(dirPath, dirName, cb) {
    if (!fs.existsSync(dirPath + '/' + dirName)){
        fs.mkdirSync(dirPath + '/' + dirName);
        console.info(cliStyles.cyan + '\tcreate' + cliStyles.reset + ': ' + dirPath + '/' + dirName);
    }

    cb();
}
565253
def create_widget(self):
        
        d = self.declaration
        self.widget = TextClock(self.get_context(), None, d.style)