['Link','Unlink','Anchor'<?php if (isset($modulesCodeInclude["BasicLink"])) { echo ',' . implode(",", $modulesCodeInclude["BasicLink"]); } ?> ], ['Table','Rule','SpecialChar'] ]; //changed for Automne <?php if (isset($modulesCodeInclude["ToolbarSets"])) { echo implode("\n\n", $modulesCodeInclude["ToolbarSets"]); } //get all toolbars $toolbars = CMS_wysiwyg_toolbar::getAll($cms_user); foreach ($toolbars as $toolbar) { echo $toolbar->getDefinition(true); } ?> FCKConfig.EnterMode = 'p' ; // p | div | br FCKConfig.ShiftEnterMode = 'br' ; // p | div | br FCKConfig.Keystrokes = [ [ CTRL + 65 /*A*/, true ], [ CTRL + 67 /*C*/, true ], [ CTRL + 70 /*F*/, true ], [ CTRL + 83 /*S*/, true ], [ CTRL + 84 /*T*/, true ], [ CTRL + 88 /*X*/, true ],
/** * Gets all toolbars * * @param CMS_profile_user $user the toolbar elements to set * @return array the toolbars * @access public * @static */ function getAll(&$user) { $sql = "\n\t\t\tselect\n\t\t\t\tid_tool\n\t\t\tfrom\n\t\t\t\ttoolbars\n\t\t\torder by\n\t\t\t\tlabel_tool\n\t\t"; $q = new CMS_query($sql); $toolbars = array(); while ($id = $q->getValue("id_tool")) { $toolbar = new CMS_wysiwyg_toolbar($id, $user); if (!$toolbar->hasError()) { $toolbars[$toolbar->getCode()] = $toolbar; } } return $toolbars; }
/** * Return the needed form field tag for current object field * * @param array $values : parameters values array(parameterName => parameterValue) in : * id : the form field id to set * @param multidimentionnal array $tags : xml2Array content of atm-function tag * @return string : the form field HTML tag * @access public */ function getInput($fieldID, $language, $inputParams) { //hidden field : use parent method if (isset($inputParams['hidden']) && ($inputParams['hidden'] == 'true' || $inputParams['hidden'] == 1)) { return parent::getInput($fieldID, $language, $inputParams); } global $cms_user; $params = $this->getParamsValues(); if (isset($inputParams['prefix'])) { $prefixName = $inputParams['prefix']; } else { $prefixName = ''; } //serialize all htmlparameters //$htmlParameters = $this->serializeHTMLParameters($inputParams); $html = ''; //create fieldname $fieldName = $prefixName . $this->_field->getID() . '_0'; //create field value $value = $this->_subfieldValues[0]->getValue(); if ($params['html']) { // Insert prefered text editor for textarea field $module = CMS_poly_object_catalog::getModuleCodenameForField($this->_field->getID()); $toolbarset = !$params['toolbar'] ? $module : $params['toolbar']; if (class_exists('CMS_wysiwyg_toolbar')) { $toolbar = CMS_wysiwyg_toolbar::getByCode($toolbarset, $cms_user); $value = $toolbar->hasModulePlugins() ? CMS_textEditor::parseInnerContent($value, $module) : $value; } $CKEditor = new CKEditor(PATH_MAIN_WR . '/ckeditor/'); $CKEditor->returnOutput = true; $html .= $CKEditor->editor($fieldName, $value, array('language' => $language->getCode(), 'width' => $params['toolbarWidth'] ? $params['toolbarWidth'] : '100%', 'height' => sensitiveIO::isPositiveInteger($params['toolbarHeight']) ? $params['toolbarHeight'] : 200, 'customConfig' => PATH_MAIN_WR . '/ckeditor/config.php?toolbar=' . $toolbarset)); } else { //serialize all htmlparameters $htmlParameters = $this->serializeHTMLParameters($inputParams); //append field id to html field parameters (if not already exists) $htmlParameters .= !isset($inputParams['id']) ? ' id="' . $prefixName . $this->_field->getID() . '_0"' : ''; $width = '100%'; if ($params['toolbarWidth']) { $width = io::substr($params['toolbarWidth'], -1, 1) == '%' ? $params['toolbarWidth'] : $params['toolbarWidth'] . 'px'; } $html .= '<textarea type="text" name="' . $fieldName . '"' . $htmlParameters . ' style="width:' . $width . ';height:' . (sensitiveIO::isPositiveInteger($params['toolbarHeight']) ? $params['toolbarHeight'] : 200) . 'px">' . str_replace('<br />', "\n", str_replace(array("\n", "\r"), "", $value)) . '</textarea>' . "\n"; } if (POLYMOD_DEBUG) { $html .= ' <span class="admin_text_alert">(Field : ' . $this->_field->getID() . ' - SubField : 0)</span>'; } //append html hidden field which store field name if ($html) { $html .= '<input type="hidden" name="polymodFields[' . $this->_field->getID() . ']" value="' . $this->_field->getID() . '" />'; } return $html; }
<input id="toolbarAction" type="hidden" name="cms_action" value="validate" /> <input type="hidden" name="toolbar" value="' . $toolbar->getID() . '" /> <table border="0" cellpadding="2" cellspacing="2"> <tr> <td class="admin" align="right"><span class="admin_text_alert">*</span> ' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_LABEL) . '</td> <td class="admin"><input type="text" class="admin_input_text" name="label" value="' . $toolbar->getLabel() . '" /></td> </tr> <tr> <td class="admin" align="right"><span class="admin_text_alert">*</span> ' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_CODENAME) . '</td> <td class="admin">'; $content .= sensitiveIO::isPositiveInteger($toolbar->getID()) ? $toolbar->getCode() : '<input type="text" class="admin_input_text" name="code" value="' . $toolbar->getCode() . '" /> <small>(' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_CODENAME_ALPHANUM) . ')</small>'; $content .= ' </td> </tr> <tr> <td class="admin" align="right" valign="top"><span class="admin_text_alert">*</span> ' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_ELEMENTS) . '</td> <td class="admin"> '; $allElements = CMS_wysiwyg_toolbar::getAllElements($cms_user); //pr($toolbar->getElements()); //pr($allElements); $args = array('field_name' => 'elements', 'items_possible' => $allElements, 'items_selected' => $toolbar->getElements(), 'select_width' => '300px', 'select_height' => '200px', 'form_name' => 'frmitem'); $content .= CMS_dialog_listboxes::getListBoxes($args) . ' </td> </tr> </table> <input type="submit" class="admin_input_submit" value="' . $cms_language->getMessage(MESSAGE_BUTTON_VALIDATE) . '" /> </form>'; } $dialog->setContent($content); $dialog->show();