123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class MirrorSettingsAction extends SettingsAction
- {
-
- function title()
- {
-
- return _m('Feed mirror settings');
- }
-
- function getInstructions()
- {
-
- return _m('You can mirror updates from many RSS and Atom feeds ' .
- 'into your GNU social timeline!');
- }
-
- function showContent()
- {
- $provider = $this->trimmed('provider');
- if (!empty($provider) || GNUsocial::isAjax()) {
- $this->showAddFeedForm($provider);
- } else {
- $this->elementStart('div', array('id' => 'add-mirror'));
- $this->showAddWizard();
- $this->elementEnd('div');
- $mirror = new SubMirror();
- $mirror->subscriber = $this->scoped->getID();
- if ($mirror->find()) {
- while ($mirror->fetch()) {
- $this->showFeedForm($mirror);
- }
- }
- }
- }
- function showAddWizard()
- {
- $form = new AddMirrorWizard($this);
- $form->show();
- }
- function showFeedForm(SubMirror $mirror)
- {
- $profile = Profile::getByID($mirror->subscribed);
- $form = new EditMirrorForm($this, $profile);
- $form->show();
- }
- function showAddFeedForm()
- {
- switch ($this->arg('provider')) {
- case 'statusnet':
- break;
- case 'wordpress':
- break;
- case 'linkedin':
- break;
- case 'feed':
- default:
- $form = new AddMirrorForm($this);
- }
- $form->show();
- }
-
- function showLocalNav()
- {
- $menu = new SettingsNav($this);
- $menu->show();
- }
- function showScripts()
- {
- parent::showScripts();
- $this->script('plugins/SubMirror/js/mirrorsettings.js');
- }
- function showStylesheets()
- {
- parent::showStylesheets();
- $this->cssLink('plugins/SubMirror/css/mirrorsettings.css');
- }
- }
|