Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
53 changes: 53 additions & 0 deletions library.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,59 @@ 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;
?>
<tr valign="top">
<th scope="row"><label for="<?php echo $this->id; ?>"><?php echo esc_html( $this->name . ':' ); ?></label></th>
<?php $commentWidth = 1; ?>

<td rowspan="2">
<?php wp_editor( $this->sanitize( $stdText ), esc_attr( $this->id ) , $settings = array('wpautop' => true) ); ?>
</td>
</tr>
<tr valign="top">
<td colspan="<?php echo absint( $commentWidth ); ?>">
<label for="<?php echo $this->id; ?>">
<small><?php echo $this->desc ?></small>
</label>
</td>
</tr>
<tr valign="top">
<td colspan="2"><hr /></td>
</tr>
<?php
}

function sanitize( $value ) {
return wp_kses_post( $value );
}


function get() {
$value = get_option( $this->id );
if ( empty( $value ) )
return $this->std;
return $this->sanitize( $value );
}
}

class CheezCapImportData {
var $dict = array();
}