Closing #47 with completed manual trigger for social updates.
Moving update/import functionality back to the feed controller (removing the import controller previously created), added an option to the backend that triggers the update from the custom SocialApis class.
This commit is contained in:
1 parent
3792846778
commit
2026e4a872
7 files changed
+87
-41
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
use JasonWilliams\Feed\Classes\SocialApis;
|
||||
|
||||
class Feed extends Controller
|
||||
{
|
||||
@@ -18,4 +19,39 @@ class Feed extends Controller
|
||||
parent::__construct();
|
||||
BackendMenu::setContext('jasonwilliams.feed', 'main-menu-item');
|
||||
}
|
||||
|
||||
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'
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user