'1',
'btn_redo' => '1',
'btn_bold' => '1',
'btn_italic' => '1',
'btn_underline' => '0',
'btn_strikethrough' => '0',
'btn_forecolor' => '0',
'btn_backcolor' => '0',
'btn_link' => '0',
'btn_image' => '0',
'btn_blockquote' => '1',
'btn_code' => '1',
'btn_bullist' => '0',
'btn_numlist' => '0',
'btn_table' => '0',
'btn_emoticons' => '1',
'btn_arkemoticons' => '0',
'btn_arkemoticonssk' => '0',
'btn_arkkbabe' => '0',
'btn_preview' => '1',
'wce_lang' => 'русский',
);
add_option('ark_wce', $ark_wce_option,'','no');
}
// Хук вставки в админ меню
add_action('admin_menu', 'ark_wce_add_pages');
// Акция предыдущено хука
function ark_wce_add_pages() {
// Добавляем новое субменю в Options:
add_options_page('ark_commenteditor', 'ARK WYSIWYG Comment Editor', 8, 'ark_wce_ostoptions', 'ark_wce_options_page');
}
// Вывод страницы опций в субменю
function ark_wce_options_page() {
screen_icon('users');
echo '
'.__('Plugin','arkcommenteditor').' ARK WYSIWYG Comment Editor 1.2
';
?>
$_POST['btn_undo'],
'btn_redo' => $_POST['btn_redo'],
'btn_bold' => $_POST['btn_bold'],
'btn_italic' => $_POST['btn_italic'],
'btn_underline' => $_POST['btn_underline'],
'btn_strikethrough' => $_POST['btn_strikethrough'],
'btn_forecolor' => $_POST['btn_forecolor'],
'btn_backcolor' => $_POST['btn_backcolor'],
'btn_link' => $_POST['btn_link'],
'btn_image' => $_POST['btn_image'],
'btn_blockquote' => $_POST['btn_blockquote'],
'btn_code' => $_POST['btn_code'],
'btn_bullist' => $_POST['btn_bullist'],
'btn_numlist' => $_POST['btn_numlist'],
'btn_table' => $_POST['btn_table'],
'btn_emoticons' => $_POST['btn_emoticons'],
'btn_arkemoticons' => $_POST['btn_arkemoticons'],
'btn_arkemoticonssk' => $_POST['btn_arkemoticonssk'],
'btn_arkkbabe' => $_POST['btn_arkkbabe'],
'btn_preview' => $_POST['btn_preview'],
'wce_lang' => $_POST['wce_lang'],
);
update_option('ark_wce', $ark_wce_option);
echo '
'.__('Settings saved.','arkcommenteditor').'
';
} else if ( isset($_POST['reset']) ) {
// При сбросе: удаляем записи опций из БД
delete_option( 'ark_wce' );
ark_wce_init_option();
echo '
' .
__('Settings successfully restored the default.','arkcommenteditor') .
'
';
}
?>
=10) { $bar4 = '","'; $kvobtn = 0;} else { $bar4 = ''; }
if ($result['btn_blockquote'] == 1) { $bar4 = $bar4 . ' blockquote'; $kvobtn++; }
if ($result['btn_code'] == 1) { $bar4 = $bar4 . ' code'; $kvobtn++; $wceplugins = $wceplugins . ', code'; }
if ($bar4!='","' && $bar4!='') { $bar4 = $bar4 . ' | '; }
// Вторая панель
if ($kvobtn >=10) { $bar5 = '","'; $kvobtn = 0;} else { $bar5 = ''; }
if ($result['btn_bullist'] == 1) { $bar5 = $bar5 . ' bullist'; $kvobtn++; }
if ($result['btn_numlist'] == 1) { $bar5 = $bar5 . ' numlist'; $kvobtn++; }
if ($bar5!='","' && $bar5!='') { $bar5 = $bar5 . ' | '; }
if ($kvobtn >=10) { $bar6 = '","'; $kvobtn = 0;} else { $bar6 = ''; }
if ($result['btn_table'] == 1) { $bar6 = $bar6 . ' table'; $kvobtn++; $wceplugins = $wceplugins . ', table'; }
if ($bar6!='","' && $bar6!='') { $bar6 = $bar6 . ' | '; }
$bar7 = '';
if ($result['btn_emoticons'] == 1) { $bar7 = $bar7 . ' emoticons'; $kvobtn++; $wceplugins = $wceplugins . ', emoticons'; }
if ($result['btn_arkemoticons'] == 1) { $bar7 = $bar7 . ' arkemoticons'; $kvobtn++; $wceplugins = $wceplugins . ', arkemoticons';
$wceexplugins = '"arkemoticons" : "'.plugins_url( '/plugins/arkemoticons/plugin.min.js',__FILE__ ) .'"';
}
if ($result['btn_arkemoticonssk'] == 1) { $bar7 = $bar7 . ' arkemoticonssk'; $kvobtn++; $wceplugins = $wceplugins . ', arkemoticonssk';
if ($wceexplugins != '') {$wceexplugins = $wceexplugins . ', ';}
$wceexplugins = $wceexplugins . '"arkemoticonssk" : "'.plugins_url( '/plugins/arkemoticonssk/plugin.min.js',__FILE__ ) .'"';
}
if ($result['btn_arkkbabe'] == 1) { $bar7 = $bar7 . ' arkkbabe'; $kvobtn++; $wceplugins = $wceplugins . ', arkkbabe';
if ($wceexplugins != '') {$wceexplugins = $wceexplugins . ', ';}
$wceexplugins = $wceexplugins . '"arkkbabe" : "'.plugins_url( '/plugins/arkkbabe/plugin.min.js',__FILE__ ) .'"';
}
if ($result['btn_preview'] == 1) { $bar7 = $bar7 . ' preview'; $kvobtn++; $wceplugins = $wceplugins . ', preview'; }
if ($bar7!='') { $bar7 = $bar7 . ' | '; }
// Формируем тулбары
$toolbar = $bar1 . $bar2 . $bar3 . $bar4 . $bar5 . $bar6 . $bar7 ;
$toolbar = '["' . $toolbar . '"]';
//echo $toolbar;
// формируем external_plugins
if ($wceexplugins != '') {
$wceexplugins = 'external_plugins : { ' . $wceexplugins . ' }, ';
}
// Формируем языковые настройки
if ($result['wce_lang']=="english") { $wcelang = '';} else {$wcelang = 'language_url : "'.plugins_url( '/js/ru.js',__FILE__ ) .'",';}
$myeditor = '
';
echo $myeditor;
}
add_action( 'wp_enqueue_scripts', 'graphene_scripts' );
function graphene_scripts() {
wp_enqueue_script('jquery');
}
add_filter( 'comment_reply_link', 'graphene_comment_reply_link' );
function graphene_comment_reply_link($link) {
return str_replace( 'onclick=', 'data-onclick=', $link );
}
add_action( 'wp_head', 'graphene_wp_head' );
function graphene_wp_head() {
?>
true, 'height' => true,'width' => true, 'alt' => true, 'title' => true, );
$allowedtags['table'] = array( 'border' => true, 'style' => array() );
$allowedtags['tbody'] = array('style' => array() );
$allowedtags['tr'] = array('style' => array() );
$allowedtags['td'] = array('style' => array() );
$allowedtags['sub'] = array( );
$allowedtags['sup'] = array();
$allowedtags['pre'] = array('lang' => true, 'line' => true );
$allowedtags['ul'] = array('style' => array());
$allowedtags['ol'] = array('style' => array());
$allowedtags['li'] = array('style' => array());
$allowedtags['span'] = array('class' => true, 'style' => array() );
$allowedtags['noindex'] = array();
$allowedtags['strong'] = array();
$allowedtags['a'] = array('target' => true, 'href' => true, 'title' => true, );
return $string;
}
add_filter('pre_kses', 'ark_pre_kses');
?>