自分で作ったり提供したりするものは、まず自分自身で使ってみろろということです。自分じゃ使わないものなら人はいくらでも無責任にも無思考にもなれる。そういう投げやりな「サービス」やら「プロダクツ」なんて、だれだってイヤだ。自分が作り手と同時に利用者の立場になれば、ちゃんと使えるレベルのものを提供しようとします。

2012年10月8日月曜日

Drupal管理ツール内容ハック



1、koma8モジュール作成
2、koma8.module内容
<?php
function koma8_fieldset($variables)
{
    $element = $variables['element'];
    element_set_attributes($element, array('id'));
    _form_set_class($element, array('form-wrapper'));

    $output = '<fieldset' . drupal_attributes($element['#attributes']) . '>';
    if (!empty($element['#title']))
    {
        // Always wrap fieldset legends in a SPAN for CSS positioning.
        $output .= '<legend><span class="fieldset-legend">' . $element['#title'] . '</span></legend>';
    }
    $output .= '<div class="fieldset-wrapper">';
    if (!empty($element['#description']))
    {
        $output .= '<div class="fieldset-description">' . $element['#description'] . '</div>';
    }
    $output .= $element['#children'];
    if (isset($element['#value']))
    {
        $output .= $element['#value'];
    }

    if (isset($element['#postscript']) && $element['#postscript'])
    {
        $output .= '<div class="postscript">' . $element['#postscript'] . '</div>';
    }

    $output .= '</div>';
    $output .= "</fieldset>\n";
    return $output;
}
function koma8_theme_registry_alter(&$theme_registry)
{
    $theme_registry['fieldset']['function'] = 'koma8_fieldset';
}
function koma8_form_node_form_alter(&$form, &$form_state, $form_id)
{
    $form['revision_information']['#postscript'] = t('何か文言をここに入れる');
}

Done!

修正後文章編集画面



0 件のコメント:

コメントを投稿

ホームページ