本文整理汇总了PHP中CKEditor::CreatePanelPreviewHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP CKEditor::CreatePanelPreviewHtml方法的具体用法?PHP CKEditor::CreatePanelPreviewHtml怎么用?PHP CKEditor::CreatePanelPreviewHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKEditor
的用法示例。
在下文中一共展示了CKEditor::CreatePanelPreviewHtml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PanelForm
/**
* Вывод формы добавления/редактирования панели
*
* @param null|int $id
* @return bool
*/
function PanelForm($id = null)
{
global $db, $nc_core, $UI_CONFIG;
global $toolbars;
$panelName = null;
if ($id !== null) {
$id = (int) $id;
$sql = "SELECT `Wysiwyg_Panel_ID`, `Name`, `Toolbars` FROM `Wysiwyg_Panel` " . "WHERE `Wysiwyg_Panel_ID` = {$id}";
$panel = $db->get_row($sql, ARRAY_A);
if (!$panel) {
return false;
}
$panelName = $panel['Name'];
$panel['Toolbars'] = (array) @unserialize($panel['Toolbars']);
} else {
$panel = array('Name' => '', 'Toolbars' => array());
}
$post = $nc_core->input->fetch_post();
if (isset($post['Name'])) {
$panel['Name'] = $post['Name'];
if (!isset($post['Toolbars'])) {
$post['Toolbars'] = array();
$panel['Toolbars'] = array();
}
}
foreach ($toolbars as $toolbar => $title) {
if (isset($post['Toolbars']) && isset($post['Toolbars'][$toolbar])) {
$panel['Toolbars'][$toolbar] = true;
}
if (!isset($panel['Toolbars'][$toolbar])) {
$panel['Toolbars'][$toolbar] = false;
}
}
?>
<form action="index.php" method="post">
<table>
<tr>
<td>
<?php
echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_PANEL_NAME;
?>
:<br>
<input type="text" name="Name" value="<?php
echo $panel['Name'];
?>
" size="70"/><br><br>
</td>
</tr>
<tr>
<td>
<?php
echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_TOOLBARS_SETTINGS;
?>
:<br>
<?php
foreach ($toolbars as $toolbar => $title) {
?>
<?php
echo nc_admin_checkbox_simple('Toolbars[' . $toolbar . ']', 1, $title, $panel['Toolbars'][$toolbar]);
?>
<br>
<?php
}
?>
</td>
</tr>
</table>
<?php
echo $nc_core->token->get_input();
?>
<input type="hidden" name="phase" value="6"/>
<?php
if ($id) {
?>
<input type="hidden" name="Wysiwyg_Panel_ID" value="<?php
echo $id;
?>
"/>
<?php
}
?>
</form>
<legend><?php
echo NETCAT_WYSIWYG_CKEDITOR_SETTINGS_FIELD_PANEL_PREVIEW;
?>
:<br></legend>
<?php
$ckeditor = new CKEditor();
echo $ckeditor->CreatePanelPreviewHtml();
$UI_CONFIG = new ui_config_wysiwyg($id ? $panelName : NETCAT_WYSIWYG_CKEDITOR_SETTINGS_TITLE_ADD_FORM, $id ? '#wysiwyg.ckeditor.panels.edit(' . $id . ')' : '#wysiwyg.ckeditor.panels.add', 'ckeditor-tab', 'ckeditor-panels');
$UI_CONFIG->actionButtons = array(array("id" => "submit", "caption" => $id ? NETCAT_WYSIWYG_CKEDITOR_SETTINGS_BUTTON_EDIT_PANEL : NETCAT_WYSIWYG_CKEDITOR_SETTINGS_BUTTON_ADD_PANEL, "action" => "mainView.submitIframeForm()"), array("id" => "cancel", "caption" => NETCAT_WYSIWYG_CKEDITOR_SETTINGS_BUTTON_CANCEL, "location" => "wysiwyg.ckeditor.panels", "align" => "left"));
return true;
}