# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/00location
# 位置情報送信

# The line number (1 incremented) and filename below must be
# actual. see perlsyn.
# line 10 "keitairc/lib/plugins/00location"

# http://siisise.net/gps.html
# <a href="device:gpsone?url=(CGIのURL)&ver=1&datum={0: wgs84 1:日本測地系 tokyo}&unit={0: dms 1:d.xxx}&acry=0&number=0">位置</a>
# auではdatum=1とかunit=1指定しても0になっちゃう端末があるようなので、
# もとから0を指定したほうが無難

$plugin = {
	name => 'location',
	action_imprementation => sub {
		my ($request, $name, $session_id, $param_string) = @_;
		my $ci = new Keitairc::ClientInfo($request);
		my $view = new Keitairc::View($::cf, $ci);
		my $cid = $param_string;
		my $cname = $::ib->simple_escape($::ib->compact_channel_name($cid));
		return $view->render('location.html', {
			web_schema => $::cf->web_schema(),
			web_host => $::cf->web_host(),
			web_port => $::cf->web_port(),
			session_id => $session_id,
			cid => $cid,
			channel_compact => $cname,
			     });
	}
};

1;
