Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -45,6 +45,7 @@ class _Acronym extends \IPS\Patterns\ActiveRecord
|
||||
/**
|
||||
* Display Form
|
||||
*
|
||||
* @param static|NULL $acronym Acronym we are currently editing
|
||||
* @return \IPS\Helpers\Form
|
||||
*/
|
||||
public static function form( $acronym )
|
||||
@@ -52,10 +53,12 @@ class _Acronym extends \IPS\Patterns\ActiveRecord
|
||||
/* Build form */
|
||||
$form = new \IPS\Helpers\Form();
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'acronym_a_short', ( $acronym ) ? $acronym->a_short : NULL, TRUE ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'acronym_a_long', ( $acronym ) ? $acronym->a_long : NULL, TRUE ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'acronym_a_casesensitive', ( $acronym ) ? $acronym->a_casesensitive : NULL, FALSE, array(), NULL, NULL, NULL, 'acronym_a_casesensitive' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'word_a_type', ( $acronym ) ? $acronym->a_type : 'acronym', FALSE, array( 'options' => array( 'acronym' => 'word_type_acronym', 'link' => 'word_type_link' ), 'toggles' => array( 'acronym' => array( 'word_a_long' ), 'link' => array( 'word_a_url' ) ) ), NULL, NULL, NULL, 'word_a_type' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'word_a_short', ( $acronym ) ? $acronym->a_short : NULL, TRUE ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'word_a_long', ( $acronym ) ? $acronym->a_long : NULL, TRUE, array(), NULL, NULL, NULL, 'word_a_long' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Url( 'word_a_url', ( $acronym ) ? $acronym->a_long : NULL, TRUE, array(), NULL, NULL, NULL, 'word_a_url' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'word_a_casesensitive', ( $acronym ) ? $acronym->a_casesensitive : NULL, FALSE, array(), NULL, NULL, NULL, 'word_a_casesensitive' ) );
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
@@ -63,6 +66,7 @@ class _Acronym extends \IPS\Patterns\ActiveRecord
|
||||
* Create from form
|
||||
*
|
||||
* @param array $values Values from form
|
||||
* @param static $current The acronym we are currently editing
|
||||
* @return \IPS\core\Acronym
|
||||
*/
|
||||
public static function createFromForm( $values, $current )
|
||||
@@ -76,9 +80,10 @@ class _Acronym extends \IPS\Patterns\ActiveRecord
|
||||
$obj = new static;
|
||||
}
|
||||
|
||||
$obj->a_short = $values['acronym_a_short'];
|
||||
$obj->a_long = $values['acronym_a_long'];
|
||||
$obj->a_casesensitive = $values['acronym_a_casesensitive'];
|
||||
$obj->a_type = $values['word_a_type'];
|
||||
$obj->a_short = $values['word_a_short'];
|
||||
$obj->a_long = ( $values['word_a_type'] == 'acronym' ) ? $values['word_a_long'] : $values['word_a_url'];
|
||||
$obj->a_casesensitive = $values['word_a_casesensitive'];
|
||||
|
||||
$obj->save();
|
||||
|
||||
|
||||
Reference in new issue
Block a user