private function assign_editor(Template $template) { $editor = $this->formatter->get_editor(); $editor->set_identifier($this->get_html_id()); $template->put_all(array('C_EDITOR_ENABLED' => true, 'EDITOR' => $editor->display(), 'VALUE' => $this->get_raw_value(), 'PREVIEW_BUTTON' => $this->get_preview_button_code())); }
foreach ($cats as $key => $value) { $current_cat .= $_WIKI_CATS[$value]['name'] . ($i < $nbr_cats ? ' / ' : ''); $i++; } if ($article_infos['id_cat'] > 0) { $current_cat .= ($nbr_cats > 0 ? ' / ' : '') . $_WIKI_CATS[$article_infos['id_cat']]['name']; } else { $current_cat = $LANG['wiki_no_selected_cat']; } $Template->assign_block_vars('remove', array('L_TITLE' => sprintf($LANG['wiki_remove_this_cat'], $article_infos['title']), 'L_REMOVE_ALL_CONTENTS' => $LANG['wiki_remove_all_contents'], 'L_MOVE_ALL_CONTENTS' => $LANG['wiki_move_all_contents'], 'ID_ARTICLE' => $del_article, 'CATS' => $cat_list, 'CURRENT_CAT' => $current_cat, 'SELECTED_CAT' => $article_infos['id_cat'], 'CAT_0' => $article_infos['id_cat'] == 0 ? 'wiki_selected_cat' : '', 'ID_CAT' => $article_infos['id_cat'])); $error = retrieve(GET, 'error', ''); if ($error == 'e_cat_contains_cat') { $errstr = $LANG['wiki_cat_contains_cat']; } elseif ($error == 'e_not_a_cat') { $errstr = $LANG['wiki_not_a_cat']; } else { $errstr = ''; } if (!empty($errstr)) { $Errorh->handler($errstr, E_USER_WARNING); } } } else { redirect(HOST . DIR . '/wiki/' . url('wiki.php')); } $content_editor = new ContentFormattingFactory(BBCODE_LANGUAGE); $editor = $content_editor->get_editor(); $editor->set_identifier('contents'); $Template->assign_vars(array('KERNEL_EDITOR' => $editor->display(), 'EXPLAIN_WIKI_GROUPS' => $LANG['explain_wiki_groups'], 'L_SUBMIT' => $LANG['submit'], 'L_RESET' => $LANG['reset'], 'L_PREVIEW' => $LANG['preview'], 'L_DEFINED_STATUS' => $LANG['wiki_defined_status'], 'L_UNDEFINED_STATUS' => $LANG['wiki_undefined_status'], 'L_STATUS' => $LANG['wiki_status_explain'], 'L_CURRENT_STATUS' => $LANG['wiki_current_status'], 'L_CURRENT_CAT' => $LANG['wiki_current_cat'], 'L_SELECT_CAT' => $LANG['wiki_change_cat'], 'L_DO_NOT_SELECT_ANY_CAT' => $LANG['wiki_do_not_select_any_cat'], 'L_NEW_TITLE' => $LANG['wiki_new_article_title'], 'L_ALERT_TEXT' => $LANG['require_text'], 'L_ALERT_TITLE' => $LANG['require_title'], 'L_EXPLAIN_REMOVE_CAT' => $LANG['wiki_explain_remove_cat'], 'L_FUTURE_CAT' => $LANG['wiki_future_cat'], 'L_ALERT_REMOVING_CAT' => str_replace('\'', '\\\'', $LANG['wiki_alert_removing_cat']), 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none'], 'L_CREATE_ARTICLE' => $LANG['wiki_auth_create_article'], 'L_CREATE_CAT' => $LANG['wiki_auth_create_cat'], 'L_RESTORE_ARCHIVE' => $LANG['wiki_auth_restore_archive'], 'L_DELETE_ARCHIVE' => $LANG['wiki_auth_delete_archive'], 'L_EDIT' => $LANG['wiki_auth_edit'], 'L_DELETE' => $LANG['wiki_auth_delete'], 'L_RENAME' => $LANG['wiki_auth_rename'], 'L_REDIRECT' => $LANG['wiki_auth_redirect'], 'L_MOVE' => $LANG['wiki_auth_move'], 'L_STATUS' => $LANG['wiki_auth_status'], 'L_COM' => $LANG['wiki_auth_com'])); $Template->pparse('wiki_properties'); require_once '../kernel/footer.php';
function display_editor($field = 'contents', $forbidden_tags = array()) { $content_editor = new ContentFormattingFactory(); $editor = $content_editor->get_editor(); if (!empty($forbidden_tags) && is_array($forbidden_tags)) { $editor->set_forbidden_tags($forbidden_tags); } $editor->set_identifier($field); return $editor->display(); }