2020-12-30 22:15:50 +00:00
|
|
|
<?php namespace jasonwilliams\feed\Controllers;
|
|
|
|
|
|
|
|
use Backend\Classes\Controller;
|
|
|
|
use BackendMenu;
|
2020-12-31 03:05:29 +00:00
|
|
|
use JasonWilliams\Feed\Classes\SocialApis;
|
2020-12-30 22:15:50 +00:00
|
|
|
|
|
|
|
class Feed extends Controller
|
|
|
|
{
|
|
|
|
public $implement = [
|
|
|
|
'Backend\Behaviors\ListController',
|
|
|
|
'Backend\Behaviors\FormController'
|
|
|
|
];
|
|
|
|
|
|
|
|
public $listConfig = 'config_list.yaml';
|
|
|
|
public $formConfig = 'config_form.yaml';
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
BackendMenu::setContext('jasonwilliams.feed', 'main-menu-item');
|
|
|
|
}
|
2020-12-31 03:05:29 +00:00
|
|
|
|
|
|
|
public function import()
|
|
|
|
{
|
|
|
|
$this->pageTitle = 'Fetch posts';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onImportTwitter()
|
|
|
|
{
|
|
|
|
SocialApis::updateTwitter();
|
|
|
|
|
|
|
|
return $this->makePartial('import', [
|
|
|
|
'importType' => 'Twitter',
|
|
|
|
'content' => 'Done'
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onImportInstagram()
|
|
|
|
{
|
|
|
|
SocialApis::updateInstagram();
|
|
|
|
|
|
|
|
return $this->makePartial('import', [
|
|
|
|
'importType' => 'Instagram',
|
|
|
|
'content' => 'Done'
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onImportFoursquare()
|
|
|
|
{
|
|
|
|
SocialApis::updateFoursquare();
|
|
|
|
|
|
|
|
return $this->makePartial('import', [
|
|
|
|
'importType' => 'Foursquare',
|
|
|
|
'content' => 'Done'
|
|
|
|
]);
|
|
|
|
}
|
2020-12-30 22:15:50 +00:00
|
|
|
}
|