knowndiaspora/Pages/Admin.php

38 lines
1.2 KiB
PHP
Raw Normal View History

2015-01-17 23:12:58 +01:00
<?php
/**
* Facebook pages
*/
namespace IdnoPlugins\Facebook\Pages {
/**
* Default class to serve Facebook settings in administration
*/
class Admin extends \Idno\Common\Page
{
function getContent()
{
$this->adminGatekeeper(); // Admins only
$t = \Idno\Core\site()->template();
$body = $t->draw('admin/facebook');
$t->__(array('title' => 'Facebook', 'body' => $body))->drawPage();
}
function postContent() {
$this->adminGatekeeper(); // Admins only
$appId = $this->getInput('appId');
$secret = $this->getInput('secret');
\Idno\Core\site()->config->config['facebook'] = array(
'appId' => $appId,
'secret' => $secret
);
\Idno\Core\site()->config()->save();
\Idno\Core\site()->session()->addMessage('Your Facebook application details were saved.');
$this->forward(\Idno\Core\site()->config()->getDisplayURL() . 'admin/facebook/');
}
}
}