Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Merging dev for version bump
  • Loading branch information
Luc Princen committed Apr 25, 2016
2 parents e0ecc21 + db4b089 commit 212b5ef
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 23 deletions.
30 changes: 22 additions & 8 deletions Assets/js/FieldBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,42 @@


setFieldBlocks();
setFieldPositions();


jQuery( '.form-builder-fields' ).sortable({
placeholder: 'field-dashed',
handle: '.field-preview',
update: function (event, ui) {

var i = 0;
jQuery('.field-block' ).each( function( index, obj ){
setFieldPositions();

}
});

jQuery( this ).find( '.position-input' ).val( i );
});

i++;
});

/**
* Set the position of each field as an incrementing number
*
*/
function setFieldPositions(){

}
});
var i = 0;
jQuery('.field-block' ).each( function( index, obj ){

});
jQuery( this ).find( '.position-input' ).val( i );
i++;

});
}


/**
* Set the field backbone-objects
*
*/
function setFieldBlocks(){

jQuery('.field-block' ).each( function( index, obj ){
Expand Down
Empty file removed Assets/js/libs/Akismet.js
Empty file.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
* Added Tag support in notifications
* Added Address-field validation
* Added the option of overwriting the Notification HTML by template.
* Each field-class can now submit there own html to a notification
* Each field-class can now submit their own html to a notification
* Fixed a bug where confirmation messages weren't being saved.
* Minor bugfixes.

Expand Down
2 changes: 1 addition & 1 deletion Classes/Creators/FieldControls.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function getFields(){


$in_standard = array( 'text', 'textarea', 'email', 'checkbox', 'number', 'checkboxes', 'radio', 'select' );
$in_adv = array( 'file', 'wysiwyg', 'date', 'hidden', 'address' );
$in_adv = array( 'file', 'wysiwyg', 'date', 'password', 'hidden', 'address' );

$in_des = array( 'html', 'break' );

Expand Down
10 changes: 5 additions & 5 deletions Classes/Front/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ public function renderFormTag(){

echo '<form class="'.$this->getClasses().'" id="form_'.$this->id.'"';

//hard refresh settings:
echo ' action="'.$this->returnLink.'"';
echo ' method="'.$this->submitMethod.'"';
echo ' enctype="'.$this->enctype.'"';

//message stickyness
if(
Expand All @@ -280,7 +276,11 @@ public function renderFormTag(){
apply_filters( 'chef_forms_no_ajax', false, $this )
){
echo ' data-no-ajax="true"';


//hard refresh settings:
echo ' action="'.$this->returnLink.'"';
echo ' method="'.$this->submitMethod.'"';
echo ' enctype="'.$this->enctype.'"';
}

echo '>';
Expand Down
14 changes: 7 additions & 7 deletions Classes/Front/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,38 @@ class Notification {
*
* @var string ( email )
*/
private $from_email;
protected $from_email;


/**
* Name to send this from
*
* @var string ( email )
*/
private $from_name;
protected $from_name;


/**
* Subject of the mail
*
* @var string
*/
private $subject;
protected $subject;

/**
* Template file to send
*
* @var string
*/
private $template;
protected $template;


/**
* The eventual message
*
* @var string
*/
private $message;
protected $message;


/**
Expand All @@ -71,7 +71,7 @@ class Notification {
*
* @var array
*/
private $attachments = array();
protected $attachments = array();


/**
Expand Down Expand Up @@ -232,7 +232,7 @@ public function generateDefaultMessage(){
* @param array $properties
* @return array
*/
private function getProperties( $properties ){
protected function getProperties( $properties ){

if( !isset( $properties['title'] ) )
$properties['title'] = 'Bericht website';
Expand Down
29 changes: 28 additions & 1 deletion Classes/Front/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


use Cuisine\Utilities\Session;
use Cuisine\Utilities\User;
use Cuisine\Wrappers\User;

class Tag {

Expand Down Expand Up @@ -220,6 +220,33 @@ public static function userData( $tag ){
*/
public static function userMeta( $tag ){

$originalTag = $tag;

if( User::loggedIn() ){

$metas = get_user_meta( User::getId() );
if( !empty( $metas ) ){
foreach( $metas as $key => $val ){

$value = ( isset( $val[0] ) ? $val[0] : false );
$key = 'usermeta_'.$key;

if( $value )
$tag = str_replace( array( '{{ '. $key .' }}', '{{'.$key.'}}' ), $value, $tag );

}
}

//meta didn't exist; return an empty string:
if( $tag === $originalTag )
$tag = '';

}else{

//user isn't logged in, so return an empty string:
$tag = '';

}

return $tag;

Expand Down

0 comments on commit 212b5ef

Please sign in to comment.