diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 4fc3cbc7a..7bb0ea8a1 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -3259,7 +3259,7 @@ if (!getperms('P')) -class ".$thePlugin."_admin extends e_admin_dispatcher +class ".$thePlugin."_adminArea extends e_admin_dispatcher { protected \$modes = array( @@ -3572,7 +3572,7 @@ $text .= " } // End LOOP. $text .= ' -new '.$thePlugin.'_admin(); +new '.$thePlugin.'_adminArea(); require_once(e_ADMIN."auth.php"); e107::getAdminUI()->runPage(); diff --git a/e107_plugins/social/admin_config.php b/e107_plugins/social/admin_config.php new file mode 100644 index 000000000..f3c1d61c9 --- /dev/null +++ b/e107_plugins/social/admin_config.php @@ -0,0 +1,157 @@ + array( + 'controller' => 'social_ui', + 'path' => null, + 'ui' => 'social_form_ui', + 'uipath' => null + ), + + + ); + + + protected $adminMenu = array( + + // 'main/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'), + // 'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'P'), + + 'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P'), + + // 'main/custom' => array('caption'=> 'Custom Page', 'perm' => 'P') + ); + + protected $adminMenuAliases = array( + 'main/edit' => 'main/list' + ); + + protected $menuTitle = 'social'; +} + + + + + +class social_ui extends e_admin_ui +{ + + protected $pluginTitle = 'Social'; + protected $pluginName = 'social'; + // protected $eventName = 'social-social'; // remove comment to enable event triggers in admin. + // protected $table = 'social'; + // protected $pid = 'interview_id'; + protected $perPage = 10; + protected $batchDelete = true; + // protected $batchCopy = true; + // protected $sortField = 'somefield_order'; + // protected $orderStep = 10; + // protected $tabs = array('Tabl 1','Tab 2'); // Use 'tab'=>0 OR 'tab'=>1 in the $fields below to enable. + + // protected $listQry = "SELECT * FROM `#tableName` WHERE field != '' "; // Example Custom Query. LEFT JOINS allowed. Should be without any Order or Limit. + + protected $listOrder = ''; + + protected $fields = array(); + + protected $fieldpref = array(); + + + protected $preftabs = array('Twitter Menu'); + + protected $prefs = array( + 'twitter_menu_height' => array('title'=> 'Height', 'type'=>'number', 'tab'=>0, 'data' => 'int','help'=>'Height in px'), + 'twitter_menu_limit' => array('title'=> 'Limit', 'type'=>'number', 'tab'=>0, 'data' => 'int','help'=>'Number of tweets to display.'), + + + ); + + + public function init() + { + + + // print_a($this->fields); + } + + + // ------- Customize Create -------- + + public function beforeCreate($new_data) + { + return $new_data; + } + + public function afterCreate($new_data, $old_data, $id) + { + // do something + } + + public function onCreateError($new_data, $old_data) + { + // do something + } + + + // ------- Customize Update -------- + + public function beforeUpdate($new_data, $old_data, $id) + { + return $new_data; + } + + public function afterUpdate($new_data, $old_data, $id) + { + // do something + } + + public function onUpdateError($new_data, $old_data, $id) + { + // do something + } + + + /* + // optional - a custom page. + public function customPage() + { + $ns = e107::getRender(); + $text = 'Hello World!'; + $ns->tablerender('Hello',$text); + + } + */ + +} + + + +class social_form_ui extends e_admin_form_ui +{ + +} + + +new social_adminarea(); + +require_once(e_ADMIN."auth.php"); +e107::getAdminUI()->runPage(); + +require_once(e_ADMIN."footer.php"); +exit; + +?> \ No newline at end of file diff --git a/e107_plugins/social/e_comment.php b/e107_plugins/social/e_comment.php new file mode 100644 index 000000000..76e98454f --- /dev/null +++ b/e107_plugins/social/e_comment.php @@ -0,0 +1,93 @@ +facebookActive = vartrue($social['Facebook']['keys']['id']); + + } + + + + public function config() // Admin Area Configuration. + { + $engine = e107::pref('core','comments_engine','e107'); + + if($engine == 'social::facebook' && empty($this->facebookActive)) + { + e107::getMessage()->addInfo("Facebook comments requires that you have a facebook App ID. See the 'social login' area in admin-preferences to add one."); + } + + $config = array(); + $config[] = array('name' => "Facebook", 'function'=>'facebook'); + + + return $config; + } + + + + function facebook($data) + { + + if(empty($this->facebookActive)) + { + return "