diff --git a/lib/location.php b/lib/location.php new file mode 100644 index 0000000000..cbd03f33a4 --- /dev/null +++ b/lib/location.php @@ -0,0 +1,77 @@ +. + * + * @category Location + * @package StatusNet + * @author Evan Prodromou + * @copyright 2009 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} + +/** + * class for locations + * + * @category Location + * @package StatusNet + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +class Location +{ + public $lat; + public $lon; + public $location_id; + public $location_ns; + + var $names; + + static function fromName($name, $language=null) + { + if (is_null($language)) { + $language = common_language(); + } + } + + static function fromId($location_id, $location_ns = null) + { + if (is_null($location_ns)) { + $location_ns = common_config('location', 'namespace'); + } + } + + function getName($language=null) + { + if (is_null($language)) { + $language = common_language(); + } + + if (array_key_exists($this->names, $language)) { + return $this->names[$language]; + } + } +}