ObjectTest03

構成

$MT_DIR/
|__ plugins/
|  |__ ObjectTest03/
|     |__ config.yaml
|     |__ lib/                    
|     |  |__ ObjectTest03
|            |__ Object03.pm
|            |__ L10N.pm
|            |__ L10N/
|                |__ ja.pm
|                |__ en_us.pm
 
 

ソース

config.yaml

id: ObjectTest03
key: ObjectTest03
name: <__trans phrase="_OBJECTTEST03_NAME_">
version: 1.0
description: <__trans phrase="_OBJECTTEST03_DESCRIPTION">
author_name: <__trans phrase="_OBJECTTEST03_AUTHOR">
author_link: http://www.example.com/about/
doc_link: http://www.example.com/docs/
 
# 言語対応
l10n_class: ObjectTest03::L10N
 
# 独自オブジェクトの定義
schema_version: 0.01
object_types:
    object03: ObjectTest03::Object03
 
# リスティングフレームワーク定義
listing_screens:
    # オブジェクト
    object03:
        # 主キー
        primary: id
        # スクリーン名
        screen_label: object03
        # オブジェクト名
        object_label: object03
        # ソートキー
        default_sort_key: id
        # 表示エリア
        view: 
            - website
            - blog
        scope_mode: none
 
# リスティングプロパティ
list_properties:
    # オブジェクト
    object03:
        # 項目
        id:
            auto: 1
            label: id
            display: force
            order: 10
        name:
            auto: 1
            label: name
            display: force
            order: 20
        type:
            auto: 1
            label: type
            display: force
            order: 30
        num:
            auto: 1
            label: num
            display: force
            order: 40
        kingaku:
            auto: 1
            label: kingaku
            display: force
            order: 50
 
applications:
    # CMS管理画面
    cms:
        # メニュー画面
        menus:
            # カスタムメニュー
            custom_menu3:
                # 表示名
                label: Custom Menu3
                # 表示順
                order: 1000
            # 一覧表示
            custom_menu3:list:
                # 表示名
                label: _objecttest03_list
                # 表示順
                order: 300
                # 表示スコープ
                view:
                    - website
                    - blog
                # モード
                mode: list
                # 引数
                args:
                    _type: object03
 
 
 

lib/ObjectTest03/Object03.pm

package ObjectTest03::Object03;
 
use strict;
 
use base qw( MT::Object );
 
__PACKAGE__->install_properties ({
    column_defs => {
        'id'      =>  'integer not null auto_increment',
        'name'    =>  'string(255)',
        'type'    =>  'string(255)',
        'num'     =>  'string(255)',
        'kingaku' =>  'string(255)',
    },
    indexes => {
    },
    child_of => '',
    audit => 1,
    datasource  => 'object03',
    primary_key => 'id',
    class_type  => 'object03',
});
 
1;
 
 

lib/ObjectTest03/L10N.pm

package ObjectTest03::L10N;
use strict;
use base 'MT::Plugin::L10N';
 
1;
 
 

lib/ObjectTest03/L10N/ja.pm

package ObjectTest03::L10N::ja;
 
use strict;
use base 'ObjectTest03::L10N::en_us';
use vars qw( %Lexicon );
 
%Lexicon = (
    '_OBJECTTEST03_NAME_' => 'ObjectTest03',
    '_OBJECTTEST03_DESCRIPTION' => 'ObjectTest03のテスト',
    '_OBJECTTEST03_AUTHOR' => 'プラグイン作者',
 
    '_objecttest03_list' => '一覧',
    '_objecttest03_edit' => '編集',
    '_objecttest03_new'  => '新規',
 
);
 
1;
 
 

lib/ObjectTest03/L10N/en_us.pm

package ObjectTest03::L10N::en_us;
 
use strict;
use base 'ObjectTest03::L10N';
use vars qw( %Lexicon );
 
%Lexicon = (
    '_OBJECTTEST03_NAME_' => 'ObjectTest03',
    '_OBJECTTEST03_DESCRIPTION' => 'ObjectTest03 Test',
    '_OBJECTTEST03_AUTHOR' => 'ObjectTest03 author',
 
    '_objecttest03_list' => 'list',
    '_objecttest03_edit' => 'edit',
    '_objecttest03_new'  => 'new',
 
);
 
1;
 
 

結果

一覧





最終更新:2012年02月07日 23:28