Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Commit

Permalink
issue #263: Замена bbcode на xbbcode (#1284)
Browse files Browse the repository at this point in the history
* issue #263: Замена bbcode на xbbcode

* issue #263: Замена bbcode на xbbcode

* issue #263: Замена bbcode на xbbcode
  • Loading branch information
Andrey Ivnitsky authored Feb 22, 2019
1 parent 411b043 commit 6a50e41
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 7 deletions.
20 changes: 20 additions & 0 deletions profiles/drupalru/themes/druru/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions profiles/drupalru/themes/druru/less/drupal/modules/_xbbcode.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.xbbcode--module::before {
font-family: FontAwesome;
padding-right: @padding-small-vertical;
content: "\f12e";
}

.xbbcode--theme::before {
font-family: FontAwesome;
padding-right: @padding-small-vertical;
content: "\f1fc";
}

.xbbcode--user::before {
font-family: FontAwesome;
padding-right: @padding-small-vertical;
content: "\f007";
}

.xbbcode--api::before {
font-family: FontAwesome;
padding-right: @padding-small-vertical;
content: "\f1a9";
}
14 changes: 14 additions & 0 deletions sites/all/modules/custom/drurum/drurum.install
Original file line number Diff line number Diff line change
Expand Up @@ -925,3 +925,17 @@ function drurum_update_7048() {
function drurum_update_7049() {
module_enable(['responsivewrappers'], TRUE);
}

/**
* Disable and uninstall "bbcode" and "xbbcode_dru" module.
*/
function drurum_update_7050() {
if (module_exists('bbcode')) {
module_disable(['bbcode']);
drupal_uninstall_modules(['bbcode']);
}
if (module_exists('xbbcode_dru')) {
module_disable(['xbbcode_dru']);
drupal_uninstall_modules(['xbbcode_dru']);
}
}
48 changes: 41 additions & 7 deletions sites/all/modules/custom/drurum/drurum.module
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,17 @@ function drurum_form_menu_edit_item_submit($form, &$form_state) {
function drurum_form_user_profile_form_alter(&$form, &$form_state) {
if ($form['#user_category'] == 'account') {
$account = $form['#user'];
$form['forms_help'] = array(
$form['forms_help'] = [
'#type' => 'fieldset',
'#title' => t('Forms Help'),
'#collapsible' => TRUE,
);
$form['forms_help']['forms_help'] = array(
];
$form['forms_help']['forms_help'] = [
'#type' => 'checkbox',
'#title' => t('Show help for all forms'),
'#description' => t('This checkbox allow you to see help for all forms.'),
'#default_value' => !empty($account->data['forms_help']) ? $account->data['forms_help'] : FALSE,
);
];
}
}

Expand Down Expand Up @@ -352,10 +352,44 @@ function drurum_form_node_form_alter(&$form, &$form_state, $form_id) {
}
}

/**
* Implements hook_entity_info_alter().
*/
function drurum_entity_info_alter(&$entity_info) {
// Add 'teaser' view mode to comment display
$entity_info['comment']['view modes']['teaser'] = array(
$entity_info['comment']['view modes']['teaser'] = [
'label' => t('Teaser'),
'custom settings' => TRUE,
);
}
];
}

/**
* Implements hook_xbbcode_info().
*/
function drurum_xbbcode_info() {
$tags['module'] = [
'markup' => '<a class="xbbcode--module" rel="nofollow" href="https://drupal.org/project/{option}" title="{content}">{content}</a>',
'description' => t('Drupal.org module'),
'sample' => t('[module=module_name]Module name[/module]'),
];

$tags['theme'] = [
'markup' => '<a class="xbbcode--theme" rel="nofollow" href="https://drupal.org/project/{option}" title="{content}">{content}</a>',
'description' => t('Drupal.org theme'),
'sample' => t('[theme=theme_name]Theme name[/theme]'),
];

$tags['api'] = [
'markup' => '<a class="xbbcode--api" rel="nofollow" href="http://api.drupal.org/api/function/{option}" title="{content}">{content}</a>',
'description' => t('Drupal.org API'),
'sample' => t('[api=api]API Drupal.org[/api]'),
];

$tags['user'] = [
'markup' => '<a class="xbbcode--user" rel="nofollow" href="/username/{option}" title="{content}">{content}</a>',
'description' => t('Drupal.ru user'),
'sample' => t('[user=user_name]Username[/user]'),
];

return $tags;
}

0 comments on commit 6a50e41

Please sign in to comment.