View source
<?php
function bs_shortcodes_help($path, $arg) {
switch ($path) {
case "admin/help#bs_shortcodes":
return '<p>' . t("Adding Twitter Bootstrap functionality to the Shortcode API") . '</p>';
break;
}
}
function bs_shortcodes_preprocess_page(&$variables) {
$path = drupal_get_path('module', 'bs_shortcodes');
drupal_add_js($path . '/inc/js/custom.js', 'file');
drupal_add_css($path . '/inc/css/shortcodes.css', 'file');
}
function bs_shortcodes_shortcode_info() {
$shortcodes['tooltiptop'] = array(
'title' => t('Tooltip Top'),
'description' => t('Makes a Tooltip appear above an element.'),
'process callback' => 'bs_shortcodes_shortcode_tooltiptop',
'tips callback' => 'bs_shortcodes_shortcode_tooltiptop_tip',
);
$shortcodes['tooltipright'] = array(
'title' => t('Tooltip Right'),
'description' => t('Makes a Tooltip appear to the right of an element.'),
'process callback' => 'bs_shortcodes_shortcode_tooltipright',
'tips callback' => 'bs_shortcodes_shortcode_tooltipright_tip',
);
$shortcodes['tooltipbottom'] = array(
'title' => t('Tooltip Bottom'),
'description' => t('Makes a Tooltip appear under an element.'),
'process callback' => 'bs_shortcodes_shortcode_tooltipbottom',
'tips callback' => 'bs_shortcodes_shortcode_tooltipbottom_tip',
);
$shortcodes['tooltipleft'] = array(
'title' => t('Tooltip Left'),
'description' => t('Makes a Tooltip appear to the left of an element.'),
'process callback' => 'bs_shortcodes_shortcode_tooltipleft',
'tips callback' => 'bs_shortcodes_shortcode_tooltipleft_tip',
);
$shortcodes['popovertop'] = array(
'title' => t('popover Top'),
'description' => t('Makes a Popover appear above an element.'),
'process callback' => 'bs_shortcodes_shortcode_popovertop',
'tips callback' => 'bs_shortcodes_shortcode_popovertop_tip',
);
$shortcodes['popoverright'] = array(
'title' => t('Popover Right'),
'description' => t('Makes a Popover appear to the right of an element.'),
'process callback' => 'bs_shortcodes_shortcode_popoverright',
'tips callback' => 'bs_shortcodes_shortcode_popoverright_tip',
);
$shortcodes['popoverbottom'] = array(
'title' => t('Popover Bottom'),
'description' => t('Makes a Popover appear under an element.'),
'process callback' => 'bs_shortcodes_shortcode_popoverbottom',
'tips callback' => 'bs_shortcodes_shortcode_popoverbottom_tip',
);
$shortcodes['popoverleft'] = array(
'title' => t('Popover Left'),
'description' => t('Makes a Popover appear to the left of an element.'),
'process callback' => 'bs_shortcodes_shortcode_popoverleft',
'tips callback' => 'bs_shortcodes_shortcode_popoverleft_tip',
);
$shortcodes['well'] = array(
'title' => t('Well'),
'description' => t('Wraps content in a styled well'),
'process callback' => 'bs_shortcodes_shortcode_well',
'tips callback' => 'bs_shortcodes_shortcode_well_tip',
);
$shortcodes['well_large'] = array(
'title' => t('Well Large'),
'description' => t('Wraps content in a large styled well'),
'process callback' => 'bs_shortcodes_shortcode_well_large',
'tips callback' => 'bs_shortcodes_shortcode_well_large_tip',
);
$shortcodes['well_small'] = array(
'title' => t('Well Small'),
'description' => t('Wraps content in a small styled well'),
'process callback' => 'bs_shortcodes_shortcode_well_small',
'tips callback' => 'bs_shortcodes_shortcode_well_small_tip',
);
$shortcodes['panel'] = array(
'title' => t('Panel'),
'description' => t('Wraps content in a styled panel'),
'process callback' => 'bs_shortcodes_shortcode_panel',
'tips callback' => 'bs_shortcodes_shortcode_panel_tip',
);
$shortcodes['glyphicons'] = array(
'title' => t('Glyphicons'),
'description' => t('Prefixes content with an icon'),
'process callback' => 'bs_shortcodes_shortcode_glyphicons',
'tips callback' => 'bs_shortcodes_shortcode_glyphicons_tip',
);
$shortcodes['jumbotron'] = array(
'title' => t('Jumbotron'),
'description' => t('Wraps content in a jumbotron'),
'process callback' => 'bs_shortcodes_shortcode_jumbotron',
'tips callback' => 'bs_shortcodes_shortcode_jumbotron_tip',
);
$shortcodes['blockquote'] = array(
'title' => t('Blockquote'),
'description' => t('Wraps content in a blockquote'),
'process callback' => 'bs_shortcodes_shortcode_blockquote',
'tips callback' => 'bs_shortcodes_shortcode_blockquote_tip',
);
$shortcodes['blockquote_reverse'] = array(
'title' => t('Blockquote Reverse'),
'description' => t('Wraps content in a reverse blockquote'),
'process callback' => 'bs_shortcodes_shortcode_blockquote_reverse',
'tips callback' => 'bs_shortcodes_shortcode_blockquote_reverse_tip',
);
$shortcodes['abbr'] = array(
'title' => t('Abbreviation'),
'description' => t('Wraps content as a styled abbreviation'),
'process callback' => 'bs_shortcodes_shortcode_abbreviation',
'tips callback' => 'bs_shortcodes_shortcode_abbreviation_tip',
);
return $shortcodes;
}
function bs_shortcodes_theme() {
return array(
'shortcode_tooltiptop' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_tooltipright' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_tooltipbottom' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_tooltipleft' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_popover' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_popoverright' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_popoverbottom' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_popoverleft' => array(
'variables' => array(
'text' => '',
'id' => '',
),
),
'shortcode_well' => array(
'variables' => array(
'text' => '',
),
),
'shortcode_well_large' => array(
'variables' => array(
'text' => '',
),
),
'shortcode_well_small' => array(
'variables' => array(
'text' => '',
),
),
'shortcode_panel' => array(
'variables' => array(
'text' => '',
'heading' => '',
'style' => '',
),
),
'shortcode_glyphicons' => array(
'variables' => array(
'text' => '',
'name' => '',
),
),
'shortcode_jumbotron' => array(
'variables' => array(
'text' => '',
),
),
'shortcode_blockquote' => array(
'variables' => array(
'blockquote' => '',
'text' => '',
'source' => '',
),
),
'shortcode_blockquote_reverse' => array(
'variables' => array(
'blockquoter' => '',
'text' => '',
'sourcer' => '',
),
),
'shortcode_abbr' => array(
'variables' => array(
'abbreviation' => '',
'title' => '',
'text' => '',
),
),
);
}
include "inc/elements/tooltips.php";
include "inc/elements/popovers.php";
include "inc/elements/wells.php";
include "inc/elements/panels.php";
include "inc/elements/glyphicons.php";
include "inc/elements/jumbotron.php";
include "inc/elements/blockquote.php";
include "inc/elements/abbreviation.php";