mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-07 09:54:27 +02:00
Move Cache to src
Cache class moved to Friendica\Core namespace
This commit is contained in:
parent
aec554f4d9
commit
036754e455
4 changed files with 76 additions and 46 deletions
|
@ -6,20 +6,24 @@
|
|||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||
*/
|
||||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
|
||||
function geocoordinates_install() {
|
||||
function geocoordinates_install()
|
||||
{
|
||||
register_hook('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
|
||||
register_hook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
|
||||
}
|
||||
|
||||
|
||||
function geocoordinates_uninstall() {
|
||||
function geocoordinates_uninstall()
|
||||
{
|
||||
unregister_hook('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
|
||||
unregister_hook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
|
||||
}
|
||||
|
||||
function geocoordinates_resolve_item(&$item) {
|
||||
function geocoordinates_resolve_item(&$item)
|
||||
{
|
||||
if((!$item["coord"]) || ($item["location"]))
|
||||
return;
|
||||
|
||||
|
@ -72,11 +76,13 @@ function geocoordinates_resolve_item(&$item) {
|
|||
Cache::set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]);
|
||||
}
|
||||
|
||||
function geocoordinates_post_hook($a, &$item) {
|
||||
function geocoordinates_post_hook($a, &$item)
|
||||
{
|
||||
geocoordinates_resolve_item($item);
|
||||
}
|
||||
|
||||
function geocoordinates_plugin_admin(&$a,&$o) {
|
||||
function geocoordinates_plugin_admin(&$a, &$o)
|
||||
{
|
||||
|
||||
$t = get_markup_template("admin.tpl", "addon/geocoordinates/");
|
||||
|
||||
|
@ -87,7 +93,8 @@ function geocoordinates_plugin_admin(&$a,&$o) {
|
|||
));
|
||||
}
|
||||
|
||||
function geocoordinates_plugin_admin_post(&$a) {
|
||||
function geocoordinates_plugin_admin_post(&$a)
|
||||
{
|
||||
$api_key = ((x($_POST,'api_key')) ? notags(trim($_POST['api_key'])) : '');
|
||||
Config::set('geocoordinates','api_key',$api_key);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue