Development Changes - June 2011

June 28thAdded implementation of plain forms

Agile Toolkit forms are full featured. What if you want to make a plain form? Such as the one to send output to PayPal. Now there is implementation you can use and it's insanely simple and powerful.

If you want to use custom template, pass a 4th argument to add('Form_Plain') and use 4th argument for addInput to specify tag, where input should appear.

Result

 

Code

$form=$page->add('Form_Plain');
$form->setAttr('method','post');
$form->addInput('text','name','John');
$form->addInput('text','surname','Blogs');
$form->addInput('submit','submit','Send');

June 26thStored procedure import extension is now *.sql

Do you know that you can create doc/storedfx/ directory and put source of your stored procedures in there? After each run it will always execute storedfx/*.sql files. It used to be files ending with *.manual, but *.sql makes so much more sense.

June 16thAdded support for logout without redirect

Traditionally calling $api->auth->logout() would destroy login info, issue redirect to index and never return. Now, passing "false" can avoid redirect: logout(false);

June 15thAdded implementation of sha256/salt encryption

Auth classes allow you to call ->usePasswordEncryption(). This change the way how encryptPassword() function works and also how login is validated. Now you can use "sha256/salt" encryption, and also encryptPassword takes second argument, which is a salt.

Result

 

Code


$encryptions
=array('md5','sha1','rot13','sha256/salt');

$form=$page->add('Form');
$form->setFormClass('vertical');
$form->addField('password','password');
$form->addField('line','salt');
$form->addField('dropdown','enc')
  ->
setValueList($encryptions);
$form->addField('text','result')
  ->
setProperty('style','width: 250px');
$form->addSubmit();
if(
$form->isSubmitted()){
    
$auth=$this->add('BasicAuth');
    
$auth->usePasswordEncryption($encryptions[$form->get('enc')]);
    
$form->getElement('result')->js()->val(
        
$auth->encryptPassword($form->get('password'),
          
$form->get('salt'))
        )->
execute();
}

June 15thTrim password field and enable normalize() in general for fields

If you are building custom field, you can now use normalize() function.

function normalize(){
    
$this->set(trim($this->get()));
    
parent::normalize();
}

Additionally password field will automatically normalize itself by trimming

Result

Use Spaces!
 

Code

$form=$page->add('Form');
$form->addField('password','password')
  ->
add('Text',null,'after_field')
  ->
set('<ins>Use Spaces!</ins>');
$form->setFormClass('vertical');
$form->addSubmit();
if(
$form->isSubmitted()){
    
$form->js()->univ()->alert('Length is '.
        
strlen($form->get('password')))
      ->
execute();
}
Older Entries Newer Entries

Development History

All changes to the development version of Agile Toolkit are listed below.

Agile Toolkit Core
  • Release 4.2 NEW!
  • Release 4.1.2
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • Mart 2011
  • February 2011

    • To stay up to date, by following @atk4 on twitter. Use Git / master branch for most recent version.