/** * Displayes xoopsCode buttons and target textarea to which xoopscodes are inserted * * @param string $textarea_id a unique id of the target textarea * @param int $cols * @param int $rows * @param null $suffix */ function xoopsCodeTarea($textarea_id, $cols = 60, $rows = 15, $suffix = null) { xoops_load('XoopsFormDhtmlTextArea'); $hiddenText = isset($suffix) ? 'xoopsHiddenText' . trim($suffix) : 'xoopsHiddenText'; $content = isset($GLOBALS[$textarea_id]) ? $GLOBALS[$textarea_id] : ''; $text_editor = new XoopsFormDhtmlTextArea('', $textarea_id, $content, $rows, $cols, $hiddenText); $text_editor->htmlEditor = null; $text_editor->smilies = false; echo $text_editor->render(); }
/** * @public */ public static function renderBBCode(&$html, $params) { if (!XC_CLASS_EXISTS('xoopsformelement')) { require_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; } $form = new XoopsFormDhtmlTextArea($params['name'], $params['name'], $params['value'], $params['rows'], $params['cols']); $form->setId($params['id']); if ($params['class'] != null) { $form->setClass($params['class']); } $html = $form->render(); }
function smarty_function_xoopsdhtmltarea($params, &$smarty) { if (!class_exists('xoopsformelement')) { require_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; } $form = null; if (isset($params['name'])) { $name = trim($params['name']); $rows = isset($params['rows']) ? intval($params['rows']) : 5; $cols = isset($params['cols']) ? intval($params['cols']) : 50; $value = isset($params['value']) ? trim($params['value']) : ""; $form = new XoopsFormDhtmlTextArea($name, $name, $value, $rows, $cols); print $form->render(); } }
function smarty_function_xoopsdhtmltarea($params, &$smarty) { if (!class_exists('xoopsformelement')) { require_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; } $form = null; if (!empty($params['name'])) { $name = trim($params['name']); $rows = isset($params['rows']) ? intval($params['rows']) : 5; $cols = isset($params['cols']) ? intval($params['cols']) : 50; $value = isset($params['value']) ? $params['value'] : ""; $form = new XoopsFormDhtmlTextArea($name, $name, $value, $rows, $cols); $rendered = $form->render(); print '<div id="' . $name . '_bbcode_buttons_pre" style="' . @$params['pre_style'] . '">' . str_replace(array('<textarea', '</textarea><br />'), array('</div><textarea', '</textarea><div id="' . $name . '_bbcode_buttons_post" style="' . @$params['post_style'] . '">'), $rendered) . '</div>'; } }
function form_edit($bid, $mode = 'edit') { $bid = intval($bid); //HACK by domifara $block = new XoopsBlock($bid); if (!$block->getVar('bid')) { // new defaults $bid = 0; $mode = 'new'; $block->setVar('mid', 0); $block->setVar('block_type', 'C'); } switch ($mode) { case 'clone': $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM; $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE; $next_op = 'clone_ok'; // breadcrumbs $breadcrumbsObj =& AltsysBreadcrumbs::getInstance(); $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_CLONEFORM); break; case 'new': $form_title = _MD_A_MYBLOCKSADMIN_NEWFORM; $button_value = _MD_A_MYBLOCKSADMIN_BTN_NEW; $next_op = 'new_ok'; // breadcrumbs $breadcrumbsObj =& AltsysBreadcrumbs::getInstance(); $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_NEWFORM); break; case 'edit': default: $form_title = _MD_A_MYBLOCKSADMIN_EDITFORM; $button_value = _MD_A_MYBLOCKSADMIN_BTN_EDIT; $next_op = 'edit_ok'; // breadcrumbs $breadcrumbsObj =& AltsysBreadcrumbs::getInstance(); $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_EDITFORM); break; } $is_custom = in_array($block->getVar('block_type'), array('C', 'E')) ? true : false; $block_template = $block->getVar('template', 'n'); $block_template_tplset = ''; if (!$is_custom && $block_template) { // find template of the block $tplfile_handler =& xoops_gethandler('tplfile'); $found_templates = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', null, null, $block_template); $block_template_tplset = count($found_templates) > 0 ? $GLOBALS['xoopsConfig']['template_set'] : 'default'; } //HACK by domifara /* if ( !($block->getVar('c_type')) ){ $block->setVar('c_type','S'); } */ $block_data = $this->preview_request + array('bid' => $bid, 'name' => $block->getVar('name', 'n'), 'title' => $block->getVar('title', 'n'), 'weight' => intval($block->getVar('weight')), 'bcachetime' => intval($block->getVar('bcachetime')), 'side' => intval($block->getVar('side')), 'visible' => intval($block->getVar('visible')), 'template' => $block_template, 'template_tplset' => $block_template_tplset, 'options' => $block->getVar('options'), 'content' => $block->getVar('content', 'n'), 'is_custom' => $is_custom, 'type' => $block->getVar('block_type'), 'ctype' => $block->getVar('c_type')); $block4assign = array('name_raw' => $block_data['name'], 'title_raw' => $block_data['title'], 'content_raw' => $block_data['content'], 'cell_position' => $this->renderCell4BlockPosition($block_data), 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data), 'cell_group_perm' => $this->renderCell4BlockReadGroupPerm($block_data), 'cell_options' => $this->renderCell4BlockOptions($block_data), 'content_preview' => $this->previewContent($block_data)) + $block_data; // display require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; $tpl = new D3Tpl(); //dhtml include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; if ($block_data['ctype'] == 'H' || empty($block_data['ctype'])) { $editor_configs = array(); $editor_configs["name"] = "content_block"; $editor_configs["value"] = $block_data['content']; $editor_configs["rows"] = 20; $editor_configs["cols"] = 100; $editor_configs["width"] = "100%"; $editor_configs["height"] = "400px"; $editor_configs["editor"] = xoops_getModuleOption('blocks_editor', 'system'); $form = new XoopsFormEditor('', "textarea_content", $editor_configs); $rendered = $form->render(); $tpl->assign('altsys_x25_dhtmltextarea', $rendered); } else { $form = new XoopsFormDhtmlTextArea('', 'textarea_content', $block_data['content'], 80, 20); $rendered = $form->render(); $rendered = '<div id="textarea_content_bbcode_buttons_pre" style="display:block;">' . str_replace(array('<textarea', '</textarea><br />'), array('</div><textarea', '</textarea><div id="textarea_content_bbcode_buttons_post" style="display:block;">'), $rendered) . '</div>'; $tpl->assign('altsys_x25_dhtmltextarea', $rendered); } $tpl->assign(array('target_dirname' => $this->target_dirname, 'target_mname' => $this->target_mname, 'language' => $this->lang, 'cachetime_options' => $this->cachetime_options, 'ctype_options' => $this->ctype_options, 'block' => $block4assign, 'op' => $next_op, 'form_title' => $form_title, 'submit_button' => $button_value, 'common_fck_installed' => file_exists(XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.js'), 'gticket_hidden' => $GLOBALS['xoopsGTicket']->getTicketHtml(__LINE__, 1800, 'myblocksadmin'))); //HACK by domifara $tpl->display('db:altsys_main_myblocksadmin_edit_4x25.html'); return; }
/** * Prepare HTML for output * * @return string HTML */ function render() { // include files include_once XOOPS_ROOT_PATH . '' . $this->getUrl() . '/include/functions.inc.php'; include_once getLanguage($this->getUrl()); static $koivi_js_loaded = false; static $koivi_tabletools_loaded = false; $url = XOOPS_URL . '' . $this->getUrl(); $skinUrl = $url . '/skins/' . $this->getSkin(); $isie = checkBrowser(); $toggleMode = false; $themeCss = false; $colorPalette = false; $extraDivs = ''; // show dhtml textarea for non compatible browsers if (!checkBrowser(false)) { $textarea = new XoopsFormDhtmlTextArea($this->getCaption(), $this->getName(), $this->getValue(), 15, 60, ''); return $textarea->render(); } if (!$koivi_js_loaded) { $form = '<script language="JavaScript" type="text/javascript" src="' . $url . '/include/js/cntextmenu.js"></script>'; $form .= '<script language="JavaScript" type="text/javascript" src="' . $url . '/include/js/editor.js"></script>'; $form .= '<script language="JavaScript" type="text/javascript" src="' . $url . '/include/js/xhtml.js"></script>'; $koivi_js_loaded = true; } else { $form = ''; } if (in_array('createtable', $this->getOptions()) && $koivi_tabletools_loaded == false) { $form .= '<script language="JavaScript" type="text/javascript" src="' . $url . '/include/js/table_tools.js"></script>'; $koivi_tabletools_loaded = true; } $form .= '<link href="' . $skinUrl . '/' . $this->getSkin() . '.css" rel="Stylesheet" type="text/css" /> <div id="alleditor' . $this->getName() . '" style="width:' . $this->getWidth() . ';border:1px solid silver;"> <div id="toolbar' . $this->getName() . '" class="' . $this->getSkin() . 'toolbarBackCell">'; if (in_array('floating', $this->getOptions())) { $form .= ' <div class="' . $this->getSkin() . 'editorStatus"> <img alt="" src="' . $skinUrl . '/minimize.gif" onclick="XK_hideToolbar(\'' . $this->getName() . '\',\'' . $skinUrl . '\')" /> <img id="floatButton' . $this->getName() . '" alt="' . _XK_FLOAT . '" title="' . _XK_FLOAT . '" src="' . $skinUrl . '/floating.gif" onclick="XK_floatingToolbar(\'' . $this->getName() . '\',\'' . $this->getSkin() . '\')"/> <img id="maximizeButton' . $this->getName() . '" alt="' . _XK_FLOAT . '" title="' . _XK_FLOAT . '" src="' . $skinUrl . '/fullscreen.gif" onclick="XK_maximizeEditor(\'' . $this->getName() . '\')"/> </div>'; } $form .= '<div id="buttons' . $this->getName() . '" class="' . $this->getSkin() . 'toolBar">'; foreach ($this->getOptions() as $tool) { switch (strtolower($tool)) { case "bold": $form .= '<img alt="' . _XK_BOLD . '" title="' . _XK_BOLD . '" src="' . $skinUrl . '/bold.gif" onmousedown="XK_doTextFormat(\'bold\',\'\',\'' . $this->getName() . '\')" />'; break; case "cellalign": $form .= '<img alt="' . _XK_CELLALIGN . '" title="' . _XK_CELLALIGN . '" src="' . $skinUrl . '/cellalign.gif"/>'; $form .= '<img alt="' . _XK_CELLALIGN . '" title="' . _XK_CELLALIGN . '" id="cellpropbutton' . $this->getName() . '" src="' . $skinUrl . '/popup.gif" onclick="XK_useTableDivs(\'' . $this->getName() . '\',\'align\')"/>'; $extraDivs .= $this->_renderCellAlign(); break; case "cellborders": $form .= '<img alt="' . _XK_CELLPROPS . '" title="' . _XK_CELLPROPS . '" src="' . $skinUrl . '/cellborders.gif" onmousedown="XK_TTools(\'' . $this->getName() . '\',\'' . $url . '/dialogs.php?id=' . $this->getName() . '&dialog=cellProps&skin=' . $this->getSkin() . '&url=' . $this->getUrl() . '\',\'table\',400,260)"/>'; $form .= '<img alt="' . _XK_CELLALIGN . '" title="' . _XK_CELLALIGN . '" id="cbbutton' . $this->getName() . '" src="' . $skinUrl . '/popup.gif" onclick="XK_useTableDivs(\'' . $this->getName() . '\',\'borders\')"/>'; $extraDivs .= $this->_renderCellBorders(); break; case "cellcolor": $form .= '<img alt="' . _XK_FORECOLOR . '" id="cellcolor' . $this->getName() . '" title="' . _XK_FORECOLOR . '" src="' . $skinUrl . '/cellcolor.gif" onclick="XK_color(\'' . $this->getName() . '\',\'cellcolor\',\'cellcolor\')"/>'; $colorPalette = true; break; case "code": $form .= '<img alt="' . _XK_CODE . '" title="' . _XK_CODE . '" src="' . $skinUrl . '/code.gif" onmousedown="XK_doTextFormat(\'Code\',\'\',\'' . $this->getName() . '\')"/>'; break; case "copy": $form .= '<img alt="' . _XK_COPY . '" title="' . _XK_COPY . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'copy\',\'\',\'' . $this->getName() . '\')"/>'; break; case "createlink": $form .= '<img alt="' . _XK_CREATELINK . '" title="' . _XK_CREATELINK . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'createlink\',\'\',\'' . $this->getName() . '\')"/>'; break; case "createtable": $form .= '<img alt="' . _XK_INSERTTABLE . '" title="' . _XK_INSERTTABLE . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_openPopup(\'' . $url . '/dialogs.php?id=' . $this->getName() . '&dialog=table&url=' . $this->getUrl() . '\',\'table\',400,290)"/>'; $form .= '<img alt="' . _XK_CREATEQUICKTABLE . '" id="tablebutton' . $this->getName() . '" title="' . _XK_CREATEQUICKTABLE . '" src="' . $skinUrl . '/popup.gif" onclick="XK_showHideDiv(\'' . $this->getName() . '\',\'tablebutton\',\'tablepicker\')"/>'; $extraDivs .= $this->_renderQuickTable(); break; case "cut": $form .= '<img alt="' . _XK_CUT . '" title="' . _XK_CUT . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'cut\',\'\',\'' . $this->getName() . '\')"/>'; break; case "fontname": $form .= '<select id="fontname' . $this->getName() . '" class="' . $this->getSkin() . 'selectInput" onchange="XK_doTextFormat(\'fontname\',this.options[this.selectedIndex].value,\'' . $this->getName() . '\')"><option value="">' . _XK_FONT . '</option>'; foreach ($this->getFonts() as $fontname => $font) { $form .= '<option value="' . $font . '">' . $fontname . '</option>'; } $form .= '</select>'; break; case "fontsize": $form .= ' <select id="fontsize' . $this->getName() . '" class="' . $this->getSkin() . 'selectInput" onchange="XK_doTextFormat(\'fontsize\',this.options[this.selectedIndex].value,\'' . $this->getName() . '\')""> <option value="">' . _XK_FONT_SIZE . '</option> <option value="-2">' . _XK_FONT_XSMALL . '</option> <option value="-1">' . _XK_FONT_SMALL . '</option> <option value="+0">' . _XK_FONT_MEDIUM . '</option> <option value="+1">' . _XK_FONT_LARGE . '</option> <option value="+2">' . _XK_FONT_XLARGE . '</option> <option value="+4">' . _XK_FONT_XXLARGE . '</option> </select>'; break; case "forecolor": $form .= '<img alt="' . _XK_FORECOLOR . '" id="forecolor' . $this->getName() . '" title="' . _XK_FORECOLOR . '" src="' . $skinUrl . '/forecolor.gif" onclick="XK_color(\'' . $this->getName() . '\',\'forecolor\',\'forecolor\')"/>'; $colorPalette = true; break; case "formatblock": $form .= ' <select id="formatblock' . $this->getName() . '" class="' . $this->getSkin() . 'selectInput" onchange="XK_doTextFormat(\'formatblock\',this.options[this.selectedIndex].value,\'' . $this->getName() . '\')"> <option value="">' . _XK_FONT_FORMAT . '</option> <option value="<p>">' . _XK_FONT_NONE . '</option> <option value="<h1>">' . _XK_FONT_HEADING1 . '</option> <option value="<h2>">' . _XK_FONT_HEADING2 . '</option> <option value="<h3>">' . _XK_FONT_HEADING3 . '</option> <option value="<h4>">' . _XK_FONT_HEADING4 . '</option> <option value="<h5>">' . _XK_FONT_HEADING5 . '</option> <option value="<h6>">' . _XK_FONT_HEADING6 . '</option> <option value="<p>">' . _XK_FONT_PARAGRAPH . '</option> <option value="<pre>">' . _XK_FONT_FORMATTED . '</option> <option value="<address>">' . _XK_FONT_ADDRESS . '</option> </select>'; break; case "hilitecolor": $form .= '<img alt="' . _XK_HILITECOLOR . '" id="hilitecolor' . $this->getName() . '" title="' . _XK_HILITECOLOR . '" src="' . $skinUrl . '/hilitecolor.gif" onclick="XK_color(\'' . $this->getName() . '\',\'hilitecolor\',\'hilitecolor\')"/>'; $colorPalette = true; break; case "imagemanager": $form .= '<img alt="' . _XK_INSERTIMAGEM . '" title="' . _XK_INSERTIMAGEM . '" onmouseover="style.cursor=\'hand\'" onmousedown="javascript:openWithSelfMain(\'' . XOOPS_URL . '/imagemanager.php?target=' . $this->getName() . '\',\'imgmanager\',400,430);" src="' . $skinUrl . '/imagemanager.gif"/>'; break; case "imageproperties": $form .= '<img alt="' . _XK_EDITIMAGE . '" title="' . _XK_EDITIMAGE . '" src="' . $skinUrl . '/imageprops.gif" onmousedown="XK_openPopup(\'' . $url . '/dialogs.php?id=' . $this->getName() . '&dialog=imageProps&url=' . $this->getUrl() . '&skin=' . $this->getSkin() . '\',\'table\',400,260)"/>'; break; case "indent": $form .= '<img alt="' . _XK_INDENT . '" title="' . _XK_INDENT . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'indent\',\'\',\'' . $this->getName() . '\')"/>'; break; case "inserthorizontalrule": $form .= '<img alt="' . _XK_INSERTHORIZONTALRULE . '" title="' . _XK_INSERTHORIZONTALRULE . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'inserthorizontalrule\',\'\',\'' . $this->getName() . '\')"/>'; break; case 'insertanchor': $form .= '<img alt="' . _XK_INSERTANCHOR . '" title="' . _XK_INSERTANCHOR . '" src="' . $skinUrl . '/insertanchor.gif" onmousedown="XK_insertAnchor(\'' . $this->getName() . '\')"/>'; break; case "insertdate": $form .= '<img alt="' . _XK_INSERTDATE . '" title="' . _XK_INSERTDATE . '" src="' . $skinUrl . '/insertdate.gif" onmousedown="XK_insertDate(\'' . $this->getName() . '\')"/>'; break; case "insertimage": $form .= '<img alt="' . _XK_INSERTIMAGE . '" title="' . _XK_INSERTIMAGE . '" src="' . $skinUrl . '/insertimage.gif" onmousedown="XK_doTextFormat(\'insertimage\',\'\',\'' . $this->getName() . '\')"/>'; break; case "insertorderedlist": $form .= '<img alt="' . _XK_INSERTORDEREDLIST . '" title="' . _XK_INSERTORDEREDLIST . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'insertorderedlist\',\'\',\'' . $this->getName() . '\')"/>'; break; case "insertunorderedlist": $form .= '<img alt="' . _XK_INSERTUNORDEREDLIST . '" title="' . _XK_INSERTUNORDEREDLIST . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'insertunorderedlist\',\'\',\'' . $this->getName() . '\')"/>'; break; case "insertsymbols": $form .= $this->_renderInsertSymbols(); break; case "italic": $form .= '<img alt="' . _XK_ITALIC . '" title="' . _XK_ITALIC . '" src="' . $skinUrl . '/italic.gif" onmousedown="XK_doTextFormat(\'italic\',\'\',\'' . $this->getName() . '\')"/>'; break; case "justifycenter": $form .= '<img alt="' . _XK_JUSTIFYCENTER . '" title="' . _XK_JUSTIFYCENTER . '" src="' . $skinUrl . '/justifycenter.gif" onmousedown="XK_doTextFormat(\'justifycenter\',\'\',\'' . $this->getName() . '\')"/>'; break; case "justifyfull": $form .= '<img alt="' . _XK_JUSTIFYFULL . '" title="' . _XK_JUSTIFYFULL . '" src="' . $skinUrl . '/justifyfull.gif" onmousedown="XK_doTextFormat(\'justifyfull\',\'\',\'' . $this->getName() . '\')"/>'; break; case "justifyleft": $form .= '<img alt="' . _XK_JUSTIFYLEFT . '" title="' . _XK_JUSTIFYLEFT . '" src="' . $skinUrl . '/justifyleft.gif" onmousedown="XK_doTextFormat(\'justifyleft\',\'\',\'' . $this->getName() . '\')"/>'; break; case "justifyright": $form .= '<img alt="' . _XK_JUSTIFYRIGHT . '" title="' . _XK_JUSTIFYRIGHT . '" src="' . $skinUrl . '/justifyright.gif" onmousedown="XK_doTextFormat(\'justifyright\',\'\',\'' . $this->getName() . '\')"/>'; break; case "ltr": $form .= '<img alt="' . _XK_LEFTTORIGHT . '" title="' . _XK_LEFTTORIGHT . '" src="' . $skinUrl . '/ltr.gif" onmousedown="XK_textDirection(\'ltr\',\'' . $this->getName() . '\')"/>'; break; case "newline": $form .= '<br />'; break; case 'newparagraph': if ($isie) { $form .= '<input class="' . $this->getSkin() . 'checkbox" type="checkbox" alt="' . _XK_NEWPARAGRAPH . '" title="' . _XK_NEWPARAGRAPH . '" id="ptagenabled' . $this->getName() . '" onclick="XK_destroyPTag(\'' . $this->getName() . '\')">'; } break; case "outdent": $form .= '<img alt="' . _XK_OUTDENT . '" title="' . _XK_OUTDENT . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'outdent\',\'\',\'' . $this->getName() . '\')"/>'; break; case "paste": $form .= '<img alt="' . _XK_PASTE . '" title="' . _XK_PASTE . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'paste\',null,\'' . $this->getName() . '\')"/>'; break; case "pastespecial": $form .= '<img alt="' . _XK_PASTESPECIAL . '" title="' . _XK_PASTESPECIAL . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="document.getElementById(\'iframe' . $this->getName() . '\').contentWindow.focus();openWithSelfMain(\'' . $url . '/dialogs.php?id=' . $this->getName() . '&skin=' . $this->getSkin() . '&dialog=pastespecial&url=' . $this->getUrl() . '\',\'pastespecial\',350,280);"/>'; break; case 'print': $form .= '<img alt="' . _XK_PRINT . '" title="' . _XK_PRINT . '" src="' . $skinUrl . '/print.gif" onmousedown="XK_print(\'' . $this->getName() . '\')"/>'; break; case "quote": $form .= '<img alt="' . _XK_QUOTE . '" title="' . _XK_QUOTE . '" src="' . $skinUrl . '/quote.gif" onmousedown="XK_doTextFormat(\'Quote\',\'\',\'' . $this->getName() . '\')"/>'; break; case "redo": $form .= '<img alt="' . _XK_REDO . '" title="' . _XK_REDO . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'redo\',\'\',\'' . $this->getName() . '\')"/>'; break; case "rtl": $form .= '<img alt="' . _XK_RIGHTTOLEFT . '" title="' . _XK_RIGHTTOLEFT . '" src="' . $skinUrl . '/rtl.gif" onmousedown="XK_textDirection(\'rtl\',\'' . $this->getName() . '\')"/>'; break; case "separator": $form .= '<img alt="|" src="' . $skinUrl . '/separator.gif"/>'; break; case 'spellcheck': $form .= '<img alt="' . _XK_SPELLCHECK . '" title="' . _XK_SPELLCHECK . '" src="' . $skinUrl . '/spellcheck.gif" onmousedown="XK_checkspell()"/>'; break; case "strikethrough": $form .= '<img alt="' . _XK_STRIKETHROUGH . '" title="' . _XK_STRIKETHROUGH . '" src="' . $skinUrl . '/strikethrough.gif" onmousedown="XK_doTextFormat(\'strikethrough\',\'\',\'' . $this->getName() . '\')"/>'; break; case "subscript": $form .= '<img alt="' . _XK_SUBSCRIPT . '" title="' . _XK_SUBSCRIPT . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'subscript\',\'\',\'' . $this->getName() . '\')"/>'; break; case "superscript": $form .= '<img alt="' . _XK_SUPERSCRIPT . '" title="' . _XK_SUPERSCRIPT . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'superscript\',\'\',\'' . $this->getName() . '\')"/>'; break; case "removeformat": $form .= '<img alt="' . _XK_REMOVEFORMAT . '" title="' . _XK_REMOVEFORMAT . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'removeformat\',\'\',\'' . $this->getName() . '\')"/>'; $form .= '<img alt="' . _XK_REMOVE_DESC . '" title="' . _XK_REMOVE_DESC . '" id="rformatbutton' . $this->getName() . '" src="' . $skinUrl . '/popup.gif" onclick="XK_showHideDiv(\'' . $this->getName() . '\',\'rformatbutton\',\'RemoveFormat\')"/>'; $extraDivs .= $this->_renderCleanFormats(); break; case "themecss": $themeCss = true; break; case "tableprops": $form .= '<img alt="' . _XK_TABLEPROPS . '" title="' . _XK_TABLEPROPS . '" src="' . $skinUrl . '/tableprops.gif" onmousedown="XK_TTools(\'' . $this->getName() . '\',\'' . $url . '/dialogs.php?id=' . $this->getName() . '&dialog=tableProps&skin=' . $this->getSkin() . '&url=' . $this->getUrl() . '\',\'table\',400,260)"/>'; $form .= '<img alt="' . _XK_TABLETOOLS . '" title="' . _XK_TABLETOOLS . '" id="tpropbutton' . $this->getName() . '" src="' . $skinUrl . '/popup.gif" onclick="XK_useTableOps(\'TableOps\',\'' . $this->getName() . '\')"/>'; $extraDivs .= $this->_renderTableProps(); break; case "toggleborders": $form .= '<img alt="' . _XK_TABLEBORDERS_TOGGLE . '" title="' . _XK_TABLEBORDERS_TOGGLE . '" src="' . $skinUrl . '/toggletableborders.gif" onmousedown="XK_toggleBorders(\'' . $this->getName() . '\',\'document.body\')"/>'; break; case "togglemode": $toggleMode = true; break; case "underline": $form .= '<img alt="' . _XK_UNDERLINE . '" title="' . _XK_UNDERLINE . '" src="' . $skinUrl . '/underline.gif" onmousedown="XK_doTextFormat(\'underline\',\'\',\'' . $this->getName() . '\')"/>'; break; case "undo": $form .= '<img alt="' . _XK_UNDO . '" title="' . _XK_UNDO . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'undo\',\'\',\'' . $this->getName() . '\')"/>'; break; case "unlink": $form .= '<img alt="' . _XK_UNLINK . '" title="' . _XK_UNLINK . '" src="' . $skinUrl . '/' . $tool . '.gif" onmousedown="XK_doTextFormat(\'unlink\',\'\',\'' . $this->getName() . '\')"/>'; break; default: break; } } $form .= '</div></div> <iframe class="' . $this->getSkin() . 'wIframe" id="iframe' . $this->getName() . '"style="height:' . $this->getHeight() . ';" frameBorder="0"></iframe> <textarea wrap=soft id="' . $this->getName() . '" name="' . $this->getName() . '" rows="1" cols="1" style="display:none; width:' . $this->getWidth() . '; height:' . $this->getHeight() . '">' . $this->getValue() . '</textarea> <div class="' . $this->getSkin() . 'statusBar"> <div class="' . $this->getSkin() . 'smileysBar">' . $this->_renderWysiwygSmileys() . '</div>'; if ($toggleMode) { $form .= '<div class="' . $this->getSkin() . 'htmlBar"><input type="checkbox" alt="' . _XK_TOGLE_MODE . '" title="' . _XK_TOGLE_MODE . '" onclick="XK_doToggleView(\'' . $this->getName() . '\')" />HTML</div>'; } if ($themeCss) { $form .= '<div class="' . $this->getSkin() . 'htmlBar"><input type="checkbox" alt="' . _XK_ENABLECSS_MODE . '" title="' . _XK_ENABLECSS_MODE . '" id="cssEnabled' . $this->getName() . '" onclick="XK_appendXoopsCss(\'' . $this->getName() . '\',\'' . $this->getThemeCSS() . '\')" />CSS </div>'; } $form .= '</div>'; // Render additional DIV'S if ($colorPalette) { include_once XOOPS_ROOT_PATH . '' . $this->getUrl() . '/class/colorpalette.class.php'; $palette = new WysiwygColorPalette('XK_applyColor', $this->getName(), $url, $this->getSkin()); $extraDivs .= $palette->_renderColorPalette(); } $extraDivs .= $this->_renderContextMenu(); $form .= $extraDivs; $form .= '<input type="hidden" value="off" id="borderstoggle' . $this->getName() . '"/>'; $form .= '<img alt="" width="0" height="0" src="' . $url . '/skins/common/blank.gif" onload="XK_init(\'' . $this->getName() . '\',\'' . $isie . '\',\'' . $url . '\',\'' . $this->getDirection() . '\')"/>'; $form .= '</div>'; return $form; }
$v = $xoopsConfig['anonymous']; } break; case 'integer': if ($field['name'] == 'hits') { $field['input'] = $v; } break; case 'date': if (empty($v)) { $v = formatTimestamp(time(), 'Y-m-d'); } break; case 'text': $text = new XoopsFormDhtmlTextArea('', $field['name'], $v, 10, 50); $field['input'] = $text->render(); if ($field['name'] == 'description') { $cur = $content->getVar('style'); if (empty($cur)) { $cur = 'b'; } $style = new XoopsFormSelect('', 'style', $cur); $style->addOptionArray($edit_style); $field['option'] = "<br/>" . _MD_CONTENT_STYLE . " " . $style->render(); } } if (is_array($field)) { $field['value'] = $v; } if (preg_match('/\\*$/', $field['label'])) { $rname = $field['name'];