Movable Type/Â裱£²²óMT¥×¥é¥°¥¤¥óÊÙ¶¯²ñ - MT-App-CMS¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤òÀºÆɤ¹¤ë http://www.ark-web.jp/sandbox/wiki/1392.html
Movable Type/Â裱£²²óMT¥×¥é¥°¥¤¥óÊÙ¶¯²ñ - MT-App-CMS¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤òÀºÆɤ¹¤ë
Â裱£±²ó¤ÏMT::App::CMS¥¯¥é¥¹¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤òÆɤߤޤ¹¡£
MT::App::CMS¤ÏÁ°²ó¤ÈÁ°¡¹²ó¤Ç¥ê¥Õ¥¡¥ì¥ó¥¹¤òÆɤó¤ÀMT::App¥¯¥é¥¹¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¤¹¡£
- Á°¡¹²ó
- Movable Type/Â裱£°²óMT¥×¥é¥°¥¤¥óÊÙ¶¯²ñ - MT-App¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤òÀºÆɤ¹¤ë
- Á°²ó
- Movable Type/Â裱£±²óMT¥×¥é¥°¥¤¥óÊÙ¶¯²ñ - MT-App¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤òÀºÆɤ¹¤ë¡Ê£²¡Ë
Æ°²è¡ÊUstream¡Ë †
ÊÙ¶¯²ñ¤ÎÌÏÍͤò¥¢¥Ã¥×¤·¤Þ¤·¤¿¡£
Ustream¤Î¥Á¥ã¥ó¥Í¥ë¤Ï¤³¤Á¤é¡£
http://www.ustream.tv/channel/mt%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E5%8B%89%E5%BC%B7%E4%BC%9A
METHODS †
°Ê²¼¡¢¥ê¥Õ¥¡¥ì¥ó¥¹¤òį¤á¤Ä¤Ä¡¢¼çÍפʥ᥽¥Ã¥É¤ò¼è¤ê¾å¤²¤Æ²òÀâ¡£
build_<type>_table †
°Ê²¼¤Î¥á¥½¥Ã¥É¤ÏƱ¤¸¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»ý¤Ä¡£
$app->build_author_table(%args) $app->build_blog_table(%args) $app->build_comment_table(%args) $app->build_commenter_table(%args) $app->build_entry_table(%args) $app->build_group_table(%args) $app->build_junk_table(%args) $app->build_log_table(%args) $app->build_ping_table(%args) $app->build_tag_table(%args) $app->build_template_table(%args)
$app->build_<type>_table¥á¥½¥Ã¥É¤Ïtmpl/cms/include/<type>_table.tmpl¥Æ¥ó¥×¥ì¡¼¥È¤Ë°ú¤ÅϤ¹¥Ç¡¼¥¿¹½Â¤¤ò¹½ÃÛ¤·¤ÆÊÖ¤·¤Þ¤¹¡£
%args¤Ç»ØÄê¤Ç¤¤ë°ú¿ô¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
- param
- ¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤Ë°ú¤ÅϤ¹key=>value¤Î¥Ú¥¢¤«¤é¤Ê¤ë¥Ï¥Ã¥·¥å¥ê¥Õ¥¡¥ì¥ó¥¹¡£
param => { hoge => '¤Û¤²¤Ç¤¹', }
¤È¤¹¤ì¤Ð¡¢¥Æ¥ó¥×¥ì¡¼¥ÈÆâ¤Î¡Ö<$mt:var name="hoge"$>¡×¤¬¡Ö¤Û¤²¤Ç¤¹¡×¤Ë¤Ê¤ë¡£ - load_args
- <type>¤ËɳÉÕ¤±¤é¤ì¤¿Class¡ÊÎ㤨¤Ð¡¢<type>¤¬entry¤Ê¤éMT::Entry¡Ë¤Îload¥á¥½¥Ã¥É¤Ë°ú¤ÅϤ¹°ú¿ô¡£Class->load¥á¥½¥Ã¥É¤Ï¾ò·ï¤Ë¹çÃפ¹¤ë¥â¥Ç¥ë¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇÛÎó¥ê¥Õ¥¡¥ì¥ó¥¹¤òÊÖ¤¹¡£load¥á¥½¥Ã¥É¤Î¾ÜºÙ¤ÏMT::Object¤Îload¥á¥½¥Ã¥É¤ò»²¾È¤Î¤³¤È¡£Î㤨¤Ð¡¢blog_id¤¬1¤Ç¥¨¥ó¥È¥ê¡¼ºîÀ®Æü¤Î¹ß½ç¤Çload¤¹¤ë¤è¤¦¤Ê»ØÄê¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£
load_args => { { blog_id => 1 }, { sort => 'created_on', direction => 'descend', }, }
- iter
- <type>¤ËɳÉÕ¤±¤é¤ì¤¿Class¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¥í¡¼¥É¤Ç¤¤ë¥¤¥Æ¥ì¡¼¥¿¡£Class->load_iter¤ÇºîÀ®¤·¤¿¥¤¥Æ¥ì¡¼¥¿¤ò»ØÄꤹ¤ë
- items
- <type>¤ËɳÉÕ¤±¤é¤ì¤¿Class¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇÛÎó¥ê¥Õ¥¡¥ì¥ó¥¹
load_args¡¢iter¡¢items¤Ï¤É¤ì¤«°ì¤Ä¤À¤±»ØÄꤹ¤ë¡£
¤³¤ì¤é¤Î¥á¥½¥Ã¥É¤Ï°ìÍ÷²èÌ̤両º÷·ë²Ì²èÌ̤ÇÍøÍѤµ¤ì¤ë¡£
do_search_replace †
¸¡º÷¡Ê__mode=search_replace¡Ë¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¸¡º÷¥í¥¸¥Ã¥¯¤Î¼Â¹Ô¤È·ë²Ì¤Î¥Ç¡¼¥¿¹½Â¤¤òÊÖ¤¹¥á¥½¥Ã¥É¡£
get_newsbox_content †
sixapart.com¤«¤éÇÛ¿®¤µ¤ì¤ëMovable Type News¤ÎHTML¤òÊÖ¤¹¡£
Movable Type News¤Î¥Ç¡¼¥¿¤Ï¼èÆÀ¤¹¤ë¤È¥¥ã¥Ã¥·¥å¤µ¤ì¤ë¤Î¤Ç¡¢Â¿¤¯¤Æ¤âÆü¤Ë°ìÅÙ¤ÎÉÑÅÙ¤Çsixapart.com¤Ë¼è¤ê¤Ë¹Ô¤¯¤À¤±¡£
mt-config.cgi¤Ê¤É¤ÇNewsboxURL¤ÎÃͤòdisable¤Ë¤¹¤ë¤È¡¢¤³¤Îsiapart.com¤ØMovable Type News¤Î¥Ç¡¼¥¿¤ò¼è¤ê¤Ë¤¤¤¯¤Î¤ò¤ä¤á¡¢¤³¤Î¥á¥½¥Ã¥É¤ÎÊÖ¤êÃͤò¶õ¤Ë¤Ç¤¤ë¡£
is_authorized †
¥ê¥¯¥¨¥¹¥È¤·¤Æ¤¤¤ë¥Ö¥í¥°¤ËÅö³º¥æ¡¼¥¶¤¬¥¢¥¯¥»¥¹¸¢¤ò¤â¤Ã¤Æ¤¤¤ë¤«È½ÃǤ¹¤ë¡£
listing †
°ìÈÌŪ¤Ê°ìÍ÷ɽ¼¨¤Ë»È¤¨¤ë¥á¥½¥Ã¥É¡£
°ú¿ô¤Ï¥Ï¥Ã¥·¥å¤Î»²¾È¡£¥Ï¥Ã¥·¥å¤Ë»ØÄê¤Ç¤¤ëÃͤϰʲ¼¤ÎÄ̤ꡣ
- Type
- ½èÍýÂоݤÎtype¤ò»ØÄꤹ¤ë¡£MT::App::CMS¤¬É¸½à¤ÇÍÑ°Õ¤·¤Æ¤¤¤ëtype¤Ïblog, entry, author, comment, ping, template, notification, templatemap, commenter, banlist, category, ping_cat, log, tag, group, role, association¡£¥á¥½¥Ã¥É¤ÎÆâÉô¤Ç¤Ïtype¤ÎÃͤò»È¤Ã¤Æ$app->model('Type¤ÎÃÍ');¤Ç°ìÍ÷ÂоݤΥ¯¥é¥¹¤ò¥í¡¼¥É¤¹¤ë¡£°ìÍ÷ÂоݤΥ¯¥é¥¹¤ÏMT::Object¤ò·Ñ¾µ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
- Template
- ¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë̾¡£Ì¤»ØÄê¤Î¾ì¹ç¤Ïlist_<type>.tmpl¤Î̿̾µ¬Â§¤Ç¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë̾¤¬ÆÃÄꤵ¤ì¤ë¡£NoHTML¥Ñ¥é¥á¡¼¥¿¤¬»ØÄꤵ¤ì¤ë¤È¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£
- Params
- ¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤ËÅϤ¹¥Ñ¥é¥á¡¼¥¿
- Code
- °ìÍ÷ÂоݤΥ¯¥é¥¹¤Î¥ª¥Ö¥¸¥§¥¯¥È°ì·ï°ì·ï¤Î½èÍý¤ÎÅ٤˸ƤӽФµ¤ì¤ë´Ø¿ô¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¡£¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤Ë½èÍý¤¬ÅϤëÁ°¤Ë¥ª¥Ö¥¸¥§¥¯¥Èñ°Ì¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¾õÂÖ¤ä¥Ñ¥é¥á¡¼¥¿¥«¥¹¥¿¥Þ¥¤¥º¤·¤¿¤¤¾ì¹ç¤ËÍøÍѤ¹¤ë¡£
- Terms
- °ìÍ÷Âоݥ¯¥é¥¹¤Îload_iter¥á¥½¥Ã¥É¤Ë°ú¤ÅϤ¹\%terms¥Ñ¥é¥á¡¼¥¿¡£É½¼¨Âоݥª¥Ö¥¸¥§¥¯¥È¤Î¥Õ¥£¥ë¥¿¥ê¥ó¥°¤ËÍøÍѤ¹¤ë¡£¾ÜºÙ¤ÏMT::Object¤Îload¡¢load_iter¤ò»²¾È¤Î¤³¤È
- Args
- °ìÍ÷Âоݥ¯¥é¥¹¤Îload_iter¥á¥½¥Ã¥É¤Ë°ú¤ÅϤ¹\%arguments¥Ñ¥é¥á¡¼¥¿¡£É½¼¨Âоݥª¥Ö¥¸¥§¥¯¥È¤Î¥½¡¼¥È¤äjoin¤ËÍøÍѤ¹¤ë¡£¾ÜºÙ¤ÏMT::Object¤Îload¡¢load_iter¤ò»²¾È¤Î¤³¤È
- Iterator
- ¥¤¥Æ¥ì¡¼¥¿¤Î¥á¥½¥Ã¥É̾¡£Ì¤»ØÄê»þ¤Ïload_iter¤¬¼«Æ°¤Ç¥»¥Ã¥È¤µ¤ì¤ë¡£Î㤨¤Ð¡¢Type¤¬author¤Î¾ì¹ç¡¢MT::Author->load_iter¤¬¥¤¥Æ¥ì¡¼¥¿¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£¤·¤«¤·¡¢MT::Author¤ÏÅö³ºAuthor¤Îrole¡Ê¥í¡¼¥ë¡Ë¤ò¥¤¥Æ¥ì¡¼¥È¤¹¤ërole_iter¤Ê¤É¤ÎÊØÍø¤Ê¥¤¥Æ¥ì¡¼¥¿¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤ì¤é¤ò»È¤¤¤¿¤¤¾ì¹ç¤Ï¤³¤Î¥Ñ¥é¥á¡¼¥¿¤òÍøÍѤ·¤Æ¥¤¥Æ¥ì¡¼¥¿¥á¥½¥Ã¥É̾¤ò»ØÄꤹ¤ë¡£
- NoHTML
- ¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤Ë°ú¤ÅϤµ¤º¡¢°ú¤ÅϤ¹¥Ç¡¼¥¿¹½Â¤¡Ê¥Ï¥Ã¥·¥å¥ê¥Õ¥¡¥ì¥ó¥¹¡Ë¤òÊÖ¤¹¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ë1¡Ê¤Þ¤¿¤ÏtrueȽÄꤵ¤ì¤ëÃ͡ˤò»ØÄꤹ¤ë¡£
¤Þ¤¿¡¢°Ê²¼¤Îquery¥Ñ¥é¥á¡¼¥¿¤òlisting¥á¥½¥Ã¥É¤Ïǧ¼±¤¹¤ë¡£
- offset
- °ìÍ÷ɽ¼¨¤Î¥ª¥Õ¥»¥Ã¥ÈÃÍ¡£»ØÄꤷ¤¿¿ôÃÍʬ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò°ìÍ÷ɽ¼¨¤«¤é¥¹¥¥Ã¥×¤¹¤ë
- search
- ´ÉÍý²èÌÌ(CMS)¤Ç¤Î¸¡º÷¥¡¼¥ï¡¼¥É¡£¸½ºß¡¢type¤¬currently, blog, author, entry, comment, template, ping¤Î¸¡º÷¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
- filter, filter_val
- ÆÃÄê¤ÎÃͤǥե£¥ë¥¿¥ê¥ó¥°¤ò»ØÄꤹ¤ë¡£filter¤Èfilter_val¤Ë»ØÄꤷ¤¿ÃͤÇTerms¤Ëfilter=filter_val¤Î¾ò·ï¤òÄɲ乤뤳¤È¤Ë¤Ê¤ë¡£
Îã¡Ë¸½ºß¤Î¥í¥°¥¤¥ó¥æ¡¼¥¶¤Î¥¨¥ó¥È¥ê¡¼¤Î°ìÍ÷¤òÆÀ¤ë
return $app->listing({ Type => 'entry', Terms => { author_id => $app->user->id, }, });
A-Form¤Ç¤â¥Õ¥©¡¼¥à¤Î°ìÍ÷¤Ê¤É¤Çlisting¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ¤¤¤ë¡£
my $html = $app->listing({ Type => 'aform', Terms => { }, Args => { sort => 'id' }, Code => \&_form_item_for_display, Params => { saved_deleted => ( $app->param('saved_deleted') || '' ), can_create_aform => $is_aform_superuser, can_delete_aform => $is_aform_superuser, can_publish_aform => $is_aform_superuser, aform_manual_url => plugin()->manual_link, }, }); # ¥ê¥¹¥Èɽ¼¨ÂоݤÎMT::AForm¥ª¥Ö¥¸¥§¥¯¥È°ì·ï°ì·ï¤ËÂФ·¤ÆºîÍѤµ¤»¤ë´Ø¿ô # status¥«¥é¥à¤ÎÃͤ«¤éUnpublished¤Ê¤É¤Îɽ¼¨ÍѤÎʸ¸À¤Ø¤ÎÊÑ´¹¤ò¹Ô¤Ã¤¿¤ê¤·¤Æ¤¤¤ë¡£ sub _form_item_for_display { my $app = shift; my $item_hash = shift; $item_hash->{'disp_id'} = sprintf("%03d", $item_hash->{'id'}); $item_hash->{'title'} = MT::I18N::encode_text($item_hash->{'title'}, 'utf8'); $item_hash->{'publish_term'} = sprintf("%s - %s",¡¡$item_hash->{'start_at'}, $item_hash->{'end_at'}); my %status = ( '0' => 'Unpublished', '1' => 'Waiting', '2' => 'Published', '3' => 'Closed' ); $item_hash->{'status'} = $item_hash->{'status'} ? $item_hash->{'status'} : 0; $item_hash->{'status_label'} = plugin()->translate($status{$item_hash->{'status'}} ); : }
object_edit_uri †
»ØÄꤵ¤ì¤¿type¤Èid¤ÇÆÃÄꤵ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ÎÊÔ½¸²èÌ̤ؤΥê¥ó¥¯¤òÀ¸À®¤¹¤ë¡£
Îã¡ËID=2¤Î¥¨¥ó¥È¥ê¡¼¤ÎÊÔ½¸²èÌ̤ؤΥê¥ó¥¯
my $uri = $app->object_edit_uri('entry', 2);
¤³¤Î¥á¥½¥Ã¥É¤Ï»ØÄꤵ¤ì¤¿type¤ÎÊÔ½¸²èÌ̤¬__mode=view¤Ç²ÔÆ°¤¹¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£
MODE HANDLERS †
UTILITY FUNCTIONS †
CUSTOM REBUILD OPTIONS †
CALLBACKS †
¡Ê¤â¤·¤«¤·¤¿¤é¤ä¤ë¤«¤â¡Ë †
MT4.x¥×¥é¥°¥¤¥óºîÀ®/¥×¥é¥°¥¤¥ó´ÉÍý²èÌ̤κîÀ®
¼¡²óͽÄê †
MT::App::CMS¤Î³¤¤ÈMT::Plugin¥¯¥é¥¹¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤òÆɤळ¤È¤òͽÄꤷ¤Þ¤¹¡£
tag: Movable Type¡¢MT¡¢MTPlugin¡¢ÊÙ¶¯²ñ