当前位置: 首页>>代码示例>>PHP>>正文


PHP CKEditor::CreatePanelPreviewHtml方法代码示例

本文整理汇总了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;
}
开发者ID:Blu2z,项目名称:implsk,代码行数:99,代码来源:function.inc.php


注:本文中的CKEditor::CreatePanelPreviewHtml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。