1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-19 12:51:52 +02:00

New Addon: e_admin.php - extends the admin area fields and processing. Replacement for the old e_hook and e_event addons which were doing the same, but were not compatible with the v2.x admin-ui.

This commit is contained in:
Cameron
2015-04-07 19:49:11 -07:00
parent 6b9256c872
commit d128b52576
8 changed files with 1036 additions and 533 deletions

View File

@@ -11,17 +11,8 @@
if (!defined('e107_INIT')) { exit; }
class e_event_social //FIXME should be social_event
class e_event_social //FIXME should be 'social_event'
{
/*
* all event methods have a single parameter
* @param array $data array containing
* @param string $method form,insert,update,delete
* @param string $table the table name of the calling plugin
* @param int $id item id of the record
* @param string $plugin identifier for the calling plugin
* @param string $function identifier for the calling function
*/
/*
* constructor
@@ -30,81 +21,8 @@ class e_event_social //FIXME should be social_event
{
}
/*
* add form field
* @param array $data
*/
function event_form($data)
{
if($data['table'] == 'news' || $data['table'] == 'page')
{
return $this->socialForm($data);
}
}
/*
* handle db create
* @param array $data
*/
function event_create($data)
{
//print_a($data);
$this->socialPost($data);
}
/*
* handle db update
* @param array $data
*/
function event_update($data)
{
$this->socialPost($data);
}
/*
* handle db delete
* @param array $data
*/
function event_delete($data)
{
// N/A
}
/**
* TODO - Make functional.. using hybridAuth class.
* ie. Admin enters a message, and the message + the newly generated link are submitted to Twitter or FB.
*/
function socialForm($data='')
{
//TODO Check Social Logins Pref for presence of FB and Twitter details.. if not found, return nothing.(see admin->preferences)
$frm = e107::getForm();
$input[0]['caption'] = "Post to Twitter";
$input[0]['html'] = $frm->text('twitterPost','', 150); // Text to post.. Link will automatically be appended to message.
$input[0]['help'] = "Enter a message to post a link to this item on Twitter"; // Text to post.. Link will automatically be appended to message.
$input[1]['caption'] = "Post to Facebook";
$input[1]['html'] = $frm->text('FacebookPost');
return $input;
}
//TODO Function to Post Data to Twitter or FB.
// using hybridAuth class.
function socialPost($data)
{
}
} //end class