From cc55c80ad11ae12c0542ae2b6c3a293ab8319098 Mon Sep 17 00:00:00 2001 From: Peter Tasker Date: Thu, 26 Jul 2012 14:28:30 -0400 Subject: [PATCH 1/2] Fixed a missing ( in the config-sample.php file and added the CheezCapRichTextOption class --- config-sample.php | 2 +- library.php | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/config-sample.php b/config-sample.php index c73a3d4..6712dab 100644 --- a/config-sample.php +++ b/config-sample.php @@ -13,7 +13,7 @@ $number_entries_labels = array( '== Select a Number ==' ); $multiple_checkboxes = array( '', 'one', 'two', 'three' ); -$multiple_checkboxes_labels = array '', 'One', 'Two', 'Three' ); +$multiple_checkboxes_labels = array ('', 'One', 'Two', 'Three' ); $cap = new CheezCap( array( new CheezCapGroup( 'First Group', 'firstGroup', diff --git a/library.php b/library.php index 1f5021d..cadc8f2 100644 --- a/library.php +++ b/library.php @@ -269,6 +269,62 @@ function write_html() { } } +class CheezCapRichTextOption extends CheezCapTextOption { + var $useTextArea; + + function __construct( $_name, $_desc, $_id, $_std = '', $_useTextArea = false ) { + parent::__construct( $_name, $_desc, $_id, $_std ); + $this->useTextArea = true; + } + + function save( $value ) { + parent::save( $value ); + } + + function write_html() { + $stdText = $this->std; + + $stdTextOption = get_option( $this->id ); + if ( ! empty( $stdTextOption ) ) + $stdText = $stdTextOption; + + ?> + + + + + + + sanitize( $stdText ), esc_attr( $this->id ) , $settings = array('wpautop' => true) ); ?> + + + + + + + + +
+ + id ); + if ( empty( $value ) ) + return $this->std; + return $this->sanitize( $value ); + } +} + class CheezCapImportData { var $dict = array(); } + From 399bbdd9775774ba2205614406f24aa9fcef701a Mon Sep 17 00:00:00 2001 From: Peter Tasker Date: Thu, 26 Jul 2012 14:29:50 -0400 Subject: [PATCH 2/2] Formatting fixes --- library.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/library.php b/library.php index cadc8f2..ff106ef 100644 --- a/library.php +++ b/library.php @@ -283,13 +283,10 @@ function save( $value ) { function write_html() { $stdText = $this->std; - $stdTextOption = get_option( $this->id ); if ( ! empty( $stdTextOption ) ) $stdText = $stdTextOption; - ?> -