summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tinymce.module28
1 files changed, 8 insertions, 20 deletions
diff --git a/tinymce.module b/tinymce.module
index 42d1f6f..d6d80b9 100644
--- a/tinymce.module
+++ b/tinymce.module
@@ -26,24 +26,12 @@ function tinymce_menu($may_cache) {
*/
function tinymce_help($section) {
switch ($section) {
- case 'admin/help#tinymce':
- $output = '<p>'. t('The TinyMCE module adds what-you-see-is-what-you-get (WYSIWYG) html editing to text areas. This enables users to create rich content easily.') .'</p>';
- $output .= '<p>'. t('TinyMCE profiles can be based on user roles. It can define which pages receive this TinyMCE capability, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other editor functions. The default profile setting uses the "simple" TinyMCE theme which just shows the most minimal button set (bold, italic, underline, etc), but many other settings are available by switching to "advanced". And by default, textareas on affected pages will be automatically swapped out with the rich text editor. Users may disable the editor for any textarea without reloading the page. This setting can be reversed so that pages load with conventional textarea form fields. A link below each textarea allows TinyMCE to be turned on or off <em>on the fly</em>.') .'</p>';
- $output .= '<p>'. t('If a user is a member of roles defined in multiple profiles, they will receive the profile with the lowest role id they belong to.') .'</p>';
- $output .= t('<p>You can</p>
-<ul>
-<li>administer roles at <a href="%admin-access-roles">administer &gt;&gt; access control &gt;&gt; roles</a>.</li>
-<li>change user TinyMCE account settings, at <a href="%admin-user-edit">administer &gt;&gt; user &gt;&gt; edit</a>.</li>
-<li>administer TinyMCE at <a href="%admin-settings-tinymce">administer &gt;&gt; settings &gt;&gt; tinymce</a>.</li>
-', array('%admin-access-roles' => url('admin/access/roles'), '%admin-user-edit' => url('admin/user/edit'), '%admin-settings-tinymce' => url('admin/settings/tinymce'))) .'</ul>';
- $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%tinymce">TinyMCE page</a>.', array('%tinymce' => 'http://www.drupal.org/handbook/modules/tinymce/')) .'</p>';
- return $output;
case 'admin/modules#description':
return t('The TinyMCE Javascript HTML WYSIWYG editor.');
case 'admin/settings/tinymce#pages':
return "node/*\nuser/*\ncomment/*";
case 'admin/settings/tinymce':
- return t('<p>TinyMCE adds what-you-see-is-what-you-get (WYSIWYG) html editing to textareas. Profiles can be defined based on user roles. TinyMCE profile can define which pages receive this TinyMCE capability, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other editor functions. The default profile setting uses the "simple" TinyMCE theme which just shows the most minimal buttons set (bold, italic, underline, etc), but many other settings are available by switching to "advanced". And by default, textareas on affected pages will be automatically swapped out with the rich text editor. Users may disable the editor for any textarea without reloading the page. This setting can be reversed so that pages load with conventional textarea form fields. A link below each textarea allows TinyMCE to be turned on or off "on the fly".</p><p>Be aware that things can get confusing if a user is a member of roles defined in multiple profiles. In this case, the user will receive the profile for role with lowest role id they belong to. Did I mention it was confusing?</p><p>lastly, only users with the <code>access tinymce</code> permission will be able to use TinyMCE.</p>');
+ return t('<p>TinyMCE adds what-you-see-is-what-you-get (WYSIWYG) HTML editing to textareas, enabling users to create rich content.</p><p>TinyMCE Profiles are based on user roles, and defines for example, what pages receive TinyMCE capabilities, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other settings. Users may disable the editor for any textarea without reloading the page. This setting can be reversed so that pages load with conventional textarea form fields. A link below each textarea allows TinyMCE to be turned on or off "on the fly".</p><p>Be aware that things can get confusing if a user is a member of a role defined in multiple profiles. In this case, the user will receive the profile for the role with the lowest role id they belong to. Did I mention it was confusing?</p><p>lastly, only users with the <code>access tinymce</code> permission will be able to use TinyMCE.</p>');
}
}
@@ -258,7 +246,7 @@ EOD;
function tinymce_user($type, &$edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account' && user_access('access tinymce')) {
$user_status = $edit['tinymce_status'] != NULL ? $edit['tinymce_status'] : ($user->tinymce_status != NULL ? $user->tinymce_status : variable_get('tinymce_default_state', 0));
- $form['tinymce'] = array('#type' => 'fieldset', '#title' => t('TinyMCE settings'), '#weight' => 5, '#collapsible' => TRUE, '#collapsed' => TRUE);
+ $form['tinymce'] = array('#type' => 'fieldset', '#title' => t('Rich-text settings'), '#weight' => 5, '#collapsible' => TRUE, '#collapsed' => TRUE);
$form['tinymce']['tinymce_status'] = array('#type' => 'radios', '#title' => t('Default status'), '#default_value' => $user_status, '#options' => array(t('Off'), t('On')), '#description' => t('Should rich-text editing be enabled or disabled by default in textarea fields?'));
return array('tinymce' => $form);
}
@@ -618,7 +606,7 @@ function tinymce_profile_form($edit) {
unset($roles[$data->rid]);
}
if (!$orig_roles) {
- drupal_set_message(t('You must assign at least one role with the \'access tinymce\' permission before creating a profile.'), 'error');
+ drupal_set_message(t('You must <a href="%access-control-url">assign</a> at least one role with the \'access tinymce\' permission before creating a profile.', array('%access-control-url' => url('admin/access'))), 'error');
}
else if (!$roles) {
drupal_set_message(t('You will not be allowed to create a new profile since all user roles have already been assigned profiles. Either remove an existing tinymce profile from at least one role or assign another role the \'access tinymce\' permission.'), 'error');
@@ -634,13 +622,13 @@ function tinymce_profile_form($edit) {
}
$form['basic'] = array('#type' => 'fieldset', '#title' => t('Basic setup'), '#collapsible' => TRUE, '#collapsed' => TRUE);
- $form['basic']['name'] = array('#type' => 'textfield', '#title' => t('Profile name'), '#default_value' => $edit->name, '#size' => 40, '#maxlength' => 128, '#description' => t('Enter a unique name for this profile. This name is only visible in the tinymce administration page.'), '#required' => TRUE);
- $form['basic']['rids'] = array('#type' => 'checkboxes', '#title' => t('Roles allowed to use this profile'), '#default_value' => array_keys((array) $edit->rids), '#options' => $roles, '#description' => t('Select at least one role. Listed are the roles with \'access tinymce\' permission.'), '#required' => TRUE);
- // This line upgrades previous versions of TinyMCE for user who previously selected the default theme.
- $edit->settings['theme'] = $edit->settings['theme'] == 'default' ? 'advanced' : $edit->settings['theme'];
+ $form['basic']['name'] = array('#type' => 'textfield', '#title' => t('Profile name'), '#default_value' => $edit->name, '#size' => 40, '#maxlength' => 128, '#description' => t('Enter a name for this profile. This name is only visible within the tinymce administration page.'), '#required' => TRUE);
+ $form['basic']['rids'] = array('#type' => 'checkboxes', '#title' => t('Roles allowed to use this profile'), '#default_value' => array_keys((array) $edit->rids), '#options' => $roles, '#description' => t('Check at least one role. Only roles with \'access tinymce\' permission will be shown here.'), '#required' => TRUE);
+ // This line upgrades previous versions of TinyMCE for user who previously selected a theme other than advanced.
+ if ($edit->settings['theme'] != 'advanced') $edit->settings['theme'] = 'advanced';
$form['basic']['theme'] = array('#type' => 'hidden', '#value' => $edit->settings['theme'] ? $edit->settings['theme'] : 'advanced');
$languages = drupal_map_assoc(array('ar', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en', 'es', 'fa', 'fi', 'fr', 'fr_ca', 'he', 'hu', 'is', 'it', 'ja', 'ko', 'nb', 'nl', 'nn', 'pl', 'pt', 'pt_br', 'ru', 'ru_KOI8-R', 'ru_UTF-8', 'sk', 'sv', 'th', 'zh_cn', 'zh_tw', 'zh_tw_utf8'));
- $form['basic']['language'] = array('#type' => 'select', '#title' => t('Language'), '#default_value' => $edit->settings['language'] ? $edit->settings['language'] : 'en', '#options' => $languages, '#description' => t('Select the default language for this role. Language codes based on the <a href="http://www.loc.gov/standards/iso639-2/englangn.html">ISO-639-2</a> format.'));
+ $form['basic']['language'] = array('#type' => 'select', '#title' => t('Language'), '#default_value' => $edit->settings['language'] ? $edit->settings['language'] : 'en', '#options' => $languages, '#description' => t('The language for the TinyMCE interface. Language codes based on the <a href="http://www.loc.gov/standards/iso639-2/englangn.html">ISO-639-2</a> format.'));
$form['visibility'] = array('#type' => 'fieldset', '#title' => t('Visibility'), '#collapsible' => TRUE, '#collapsed' => TRUE);
$form['visibility']['access'] = array('#type' => 'radios', '#title' => t('Show tinymce on specific pages'), '#default_value' => isset($edit->settings['access']) ? $edit->settings['access'] : 1, '#options' => array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.'), t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).')));