public static function register() { $fb_page_name = get_option('fbss_setting_fb_page_name'); $fb_access_token = get_option('fbss_setting_fb_access_token'); self::$stream_msg_limit = get_option('fbss_setting_msg_limit', 20); // init registry with plugin data first FBSS_Registry::set('plugin_name', self::$plugin_name); FBSS_Registry::set('plugin_version', self::$plugin_version); FBSS_Registry::set('plugin_base_dir_url', plugin_dir_url(__FILE__)); FBSS_Registry::set('plugin_base_dir', plugin_dir_path(__FILE__)); FBSS_Registry::set('fb_page_name', $fb_page_name); FBSS_Registry::set('fb_access_token', $fb_access_token); FBSS_Registry::set('stream_msg_limit', self::$stream_msg_limit); self::$logger = new FBSS_Logger(__CLASS__); self::$db = new FBSS_DB(); self::$logger->log("Register plugin.", __LINE__); /* hooks */ register_activation_hook(__FILE__, array(__CLASS__, 'onActivation')); register_deactivation_hook(__FILE__, array(__CLASS__, 'onDeactivation')); register_uninstall_hook(__FILE__, array(__CLASS__, 'onUninstall')); /* translations */ add_action('plugins_loaded', array(__CLASS__, 'initTextDomain')); /* init plugin template */ self::initTemplate(); if (is_admin()) { /* administration submenu */ $admin = new FBSS_Admin(); /* settings link */ add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(__CLASS__, 'setPluginSettingsLink')); } /* check plugin version */ self::checkPluginVersion(); /* register shortcodes */ FBSS_Shortcodes::register(); /* register ajax handler to update social stream */ add_action('wp_ajax_wp_fb_social_stream_update', array(__CLASS__, 'ajaxUpdateSocialStream')); add_action('wp_ajax_nopriv_wp_fb_social_stream_update', array(__CLASS__, 'ajaxUpdateSocialStream')); add_action('wp_ajax_wp_fb_social_stream_force_update', array(__CLASS__, 'ajaxForceUpdateSocialStream')); /* register javascript libraries */ FBSS_JS::register(); /* register stylesheets */ FBSS_CSS::register(); }
<?php /** * Do not change this default template-configuration! * * You can create your own template in * templates/{your-template-name}/config.php */ require_once plugin_dir_path(__FILE__) . '../../lib/FBSS_Registry.php'; $template_config = array('api_version' => '1.0.0', 'template_id' => 'default', 'template_name' => 'FBSS Default', 'css' => array(array('name' => __('Message-box', 'wp-fb-social-stream'), 'desc' => __('The main message box', 'wp-fb-social-stream'), 'config' => array('index' => 'message_box', 'configs' => array(array('config_id' => 7, 'desc' => __('Maximum width', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-wrap', 'property' => 'max-width', 'type' => 'size'), array('config_id' => 8, 'desc' => __('Width', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-wrap', 'property' => 'width', 'type' => 'size'), array('config_id' => 1, 'desc' => __('Background color', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-wrap', 'property' => 'background-color', 'type' => 'hexcode'), array('config_id' => 2, 'desc' => __('Border color', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-wrap', 'property' => 'border-color', 'type' => 'hexcode'), array('config_id' => 3, 'desc' => '', 'selector' => '.wp-fb-social-stream .fb-message-wrap:after', 'property' => 'border-color', 'type' => 'hexcode', 'actions' => array('hide' => true, 'copy_value_from' => array('index' => 'message_box', 'config_id' => 2, 'value_prefix' => 'transparent ', 'value_suffix' => ''))), array('config_id' => 5, 'desc' => __('Text color message date', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-wrap .fb-message-date', 'property' => 'color', 'type' => 'hexcode'), array('config_id' => 6, 'desc' => __('Text color message text', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-wrap .fb-message-text', 'property' => 'color', 'type' => 'hexcode')))), array('name' => __('Meta-box', 'wp-fb-social-stream'), 'desc' => __('The meta-box contains the like and comment count', 'wp-fb-social-stream'), 'config' => array('index' => 'meta_box', 'configs' => array(array('config_id' => 2, 'desc' => __('Maximum width', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-info', 'property' => 'max-width', 'type' => 'size'), array('config_id' => 1, 'desc' => __('Background color', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-metadata', 'property' => 'background-color', 'type' => 'hexcode')))), array('name' => __('Link-box', 'wp-fb-social-stream'), 'desc' => __('Links inside the message-box are wrapped by the link-box', 'wp-fb-social-stream'), 'config' => array('index' => 'link_box', 'configs' => array(array('config_id' => 1, 'desc' => __('Background color', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-linkbox', 'property' => 'background-color', 'type' => 'hexcode'), array('config_id' => 2, 'desc' => __('Text color link name', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-linkbox .fb-message-linkbox-name', 'property' => 'color', 'type' => 'hexcode'), array('config_id' => 3, 'desc' => __('Text color link description', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-linkbox .fb-message-linkbox-desc', 'property' => 'color', 'type' => 'hexcode'), array('config_id' => 4, 'desc' => __('Text color link caption', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-linkbox .fb-message-linkbox-caption', 'property' => 'color', 'type' => 'hexcode')))), array('name' => __('Video-box', 'wp-fb-social-stream'), 'desc' => __('The video-box contains the video itself and optional name and description', 'wp-fb-social-stream'), 'config' => array('index' => 'video_box', 'configs' => array(array('config_id' => 3, 'desc' => __('Background color', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-video-linkbox', 'property' => 'background-color', 'type' => 'hexcode'), array('config_id' => 1, 'desc' => __('Text color name', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-video-name', 'property' => 'color', 'type' => 'hexcode'), array('config_id' => 2, 'desc' => __('Text color description', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-video-desc', 'property' => 'color', 'type' => 'hexcode')))), array('name' => __('Event-box', 'wp-fb-social-stream'), 'desc' => __('Events are wrapped by the event-box', 'wp-fb-social-stream'), 'config' => array('index' => 'event_box', 'configs' => array(array('config_id' => 1, 'desc' => __('Background color', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-eventbox', 'property' => 'background-color', 'type' => 'hexcode'), array('config_id' => 2, 'desc' => __('Text color event name', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-eventbox .fb-message-eventbox-name', 'property' => 'color', 'type' => 'hexcode'), array('config_id' => 3, 'desc' => __('Text color event description', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-eventbox .fb-message-eventbox-desc', 'property' => 'color', 'type' => 'hexcode'), array('config_id' => 4, 'desc' => __('Text color event date', 'wp-fb-social-stream'), 'selector' => '.wp-fb-social-stream .fb-message-eventbox .fb-message-eventbox-date', 'property' => 'color', 'type' => 'hexcode')))))); // register configuration FBSS_Registry::set('template_config', $template_config);