'200px',
'float' => 'left',
), $atts ) );
return "" . $content . "
";
}
public function interview_q( $atts, $content ) {
$question_text_color = get_option('question_text_color', '#000000');
$q_bold = get_option('question_bold', 'normal');
$q_justify = get_option('question_justify');
if ($q_bold){
$q_bold = 'bold';
} else
{
$q_bold = 'normal';
}
if ($q_justify){
$q_justify = 'justify';
}
extract( shortcode_atts ( array(
'width' => '200px',
'float' => 'left',
), $atts ) );
return "" . $content . "
";
}
public function interview_a( $atts, $content ) {
$answer_text_color = get_option('answer_text_color', '#000000');
$a_bold = get_option('answer_bold');
$a_justify = get_option('answer_justify');
if ($a_bold){
$a_bold = 'bold';
} else
{
$a_bold = 'normal';
}
if ($a_justify){
$a_justify = 'justify';
}
extract( shortcode_atts ( array(
'width' => '200px',
'float' => 'left',
), $atts ) );
return "" . $content . "
";
}
public function atwi_plugin_add_options() {
add_options_page('ATWI Interview Options', 'ATWI Interview', 'manage_options', 'atwiinterviewoptions', array(&$this, 'atwi_plugin_options_page'));
}
public function atwi_interview_buttons() {
add_filter( "mce_external_plugins", array(&$this, 'atwi_interview_add_buttons') );
add_filter( 'mce_buttons', array(&$this, 'atwi_interview_register_buttons') );
}
public function atwi_interview_add_buttons( $plugin_array ) {
$plugin_array['atwi_interview'] = $dir = plugins_url( 'js/shortcode.js', __FILE__ );
return $plugin_array;
}
public function atwi_interview_register_buttons( $buttons ) {
array_push( $buttons, 'qabut' );
return $buttons;
}
function atwi_plugin_options_page() {
wp_enqueue_style( 'atwi-style', $plugin_url . 'css/atwi-style.css' );
$opt_name = array(
'qa_index_text_color' => 'qa_index_text_color',
'question_text_color' => 'question_text_color',
'answer_text_color' => 'answer_text_color',
'qa_index_bold' => 'qa_index_bold',
'question_bold' => 'question_bold',
'answer_bold' => 'answer_bold',
'question_justify' => 'question_justify',
'answer_justify' => 'answer_justify',
);
$hidden_field_name = 'atwiinterview_submit_hidden';
$opt_val = array(
'qa_index_text_color' => get_option($opt_name['qa_index_text_color']),
'question_text_color' => get_option($opt_name['question_text_color']),
'answer_text_color' => get_option($opt_name['answer_text_color']),
'qa_index_bold' => get_option($opt_name['qa_index_bold']),
'question_bold' => get_option($opt_name['question_bold']),
'answer_bold' => get_option($opt_name['answer_bold']),
'question_justify' => get_option($opt_name['question_justify']),
'answer_justify' => get_option($opt_name['answer_justify']),
);
if (isset($_POST[$hidden_field_name]) && $_POST[$hidden_field_name] == 'Y') {
$opt_val = array(
'qa_index_text_color' => $_POST[$opt_name['qa_index_text_color']],
'question_text_color' => $_POST[$opt_name['question_text_color']],
'answer_text_color' => $_POST[$opt_name['answer_text_color']],
'qa_index_bold' => $_POST[$opt_name['qa_index_bold']],
'question_bold' => $_POST[$opt_name['question_bold']],
'answer_bold' => $_POST[$opt_name['answer_bold']],
'question_justify' => $_POST[$opt_name['question_justify']],
'answer_justify' => $_POST[$opt_name['answer_justify']],
);
update_option($opt_name['qa_index_text_color'], $opt_val['qa_index_text_color']);
update_option($opt_name['question_text_color'], $opt_val['question_text_color']);
update_option($opt_name['answer_text_color'], $opt_val['answer_text_color']);
update_option($opt_name['qa_index_bold'], $opt_val['qa_index_bold']);
update_option($opt_name['question_bold'], $opt_val['question_bold']);
update_option($opt_name['answer_bold'], $opt_val['answer_bold']);
update_option($opt_name['question_justify'], $opt_val['question_justify']);
update_option($opt_name['answer_justify'], $opt_val['answer_justify']);
?>