public function setUp()
 {
     // Show the warning message if the authentication key is not set.
     $this->checkAPIKeys();
     if (isset($this->oProps->arrOptions['fetch_tweets_settings']['capabilities']['setting_page_capability']) && !empty($this->oProps->arrOptions['fetch_tweets_settings']['capabilities']['setting_page_capability'])) {
         $this->setCapability($this->oProps->arrOptions['fetch_tweets_settings']['capabilities']['setting_page_capability']);
     }
     $this->setRootMenuPageBySlug('edit.php?post_type=fetch_tweets');
     $this->addSubMenuItems(array('strMenuTitle' => __('Add Rule by User Name', 'fetch-tweets'), 'strType' => 'link', 'strURL' => 'post-new.php?post_type=fetch_tweets&tweet_type=screen_name', 'fPageHeadingTab' => false, 'numOrder' => 1), array('strMenuTitle' => __('Add Rule by Keyword Search', 'fetch-tweets'), 'strType' => 'link', 'strURL' => 'post-new.php?post_type=fetch_tweets&tweet_type=search', 'fPageHeadingTab' => false), array('strPageTitle' => __('Add Rule by List', 'fetch-tweets'), 'strPageSlug' => 'fetch_tweets_add_rule_by_list', 'strScreenIcon' => FetchTweets_Commons::getPluginURL("/image/screen_icon_32x32.png")), array('strPageTitle' => __('Settings', 'fetch-tweets'), 'strPageSlug' => 'fetch_tweets_settings', 'strScreenIcon' => FetchTweets_Commons::getPluginURL("/image/screen_icon_32x32.png")), array('strPageTitle' => __('Extensions', 'fetch-tweets'), 'strPageSlug' => 'fetch_tweets_extensions', 'strScreenIcon' => FetchTweets_Commons::getPluginURL("/image/screen_icon_32x32.png")), array('strPageTitle' => __('Templates', 'fetch-tweets'), 'strPageSlug' => 'fetch_tweets_templates', 'strScreenIcon' => FetchTweets_Commons::getPluginURL("/image/screen_icon_32x32.png")));
     $this->addInPageTabs(array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'authentication', 'strTitle' => __('Authentication', 'fetch-tweets'), 'strParentTabSlug' => 'twitter_connect', 'fHide' => true), array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'twitter_clear_session', 'strTitle' => 'Clear Session', 'fHide' => true), array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'twitter_connect', 'strTitle' => __('Authentication', 'fetch-tweets'), 'numOrder' => 1), array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'twitter_redirect', 'strTitle' => 'Redirect', 'fHide' => true), array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'twitter_callback', 'strTitle' => 'Callback', 'fHide' => true), array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'general', 'strTitle' => __('General', 'fetch-tweets'), 'numOrder' => 2), array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'misc', 'strTitle' => __('Misc', 'fetch-tweets'), 'numOrder' => 3), array('strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'reset', 'strTitle' => __('Reset', 'fetch-tweets'), 'numOrder' => 4));
     $this->addInPageTabs(array('strPageSlug' => 'fetch_tweets_extensions', 'strTabSlug' => 'get_extensions', 'strTitle' => __('Get Extensions', 'fetch-tweets'), 'numOrder' => 10));
     $this->addInPageTabs(array('strPageSlug' => 'fetch_tweets_templates', 'strTabSlug' => 'list_template_table', 'strTitle' => __('Installed Templates', 'fetch-tweets'), 'numOrder' => 1), array('strPageSlug' => 'fetch_tweets_templates', 'strTabSlug' => 'get_templates', 'strTitle' => __('Get Templates', 'fetch-tweets'), 'numOrder' => 10));
     $this->showPageHeadingTabs(false);
     // disables the page heading tabs by passing false.
     $this->setInPageTabTag('h2');
     $this->addSettingSections(array('strSectionID' => 'twitter_connect', 'strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'twitter_connect', 'strTitle' => __('Authenticate', 'fetch-tweets')), array('strSectionID' => 'authentication_keys', 'strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'authentication', 'strTitle' => __('Authentication Keys', 'fetch-tweets'), 'strDescription' => __('These keys are required to process oAuth requests of the twitter API.', 'fetch-tweets')), array('strSectionID' => 'default_values', 'strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'general', 'strTitle' => __('Default Values', 'fetch-tweets'), 'strHelp' => __('Set the default option values which will be applied when the argument values are not set.', 'fetch-tweets') . __('These values will be overridden by the argument set directly to the widget options or shortcode.', 'fetch-tweets')), array('strSectionID' => 'capabilities', 'strCapability' => 'manage_options', 'strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'misc', 'strTitle' => __('Access Rights', 'fetch-tweets'), 'strDescription' => __('Set the access levels to the plugin setting pages.', 'fetch-tweets')), array('strSectionID' => 'reset_settings', 'strPageSlug' => 'fetch_tweets_settings', 'strCapability' => 'manage_options', 'strTabSlug' => 'reset', 'strTitle' => __('Reset Settings', 'fetch-tweets'), 'strDescription' => __('If you get broken options, initialize them by performing reset.', 'fetch-tweets')), array('strSectionID' => 'caches', 'strPageSlug' => 'fetch_tweets_settings', 'strTabSlug' => 'reset', 'strTitle' => __('Caches', 'fetch-tweets'), 'strDescription' => __('If you need to refresh the fetched tweets, clear the cashes.', 'fetch-tweets')));
     $this->addSettingSections(array('strSectionID' => 'add_rule_by_list', 'strPageSlug' => 'fetch_tweets_add_rule_by_list', 'strTitle' => __('Specify the Screen Name', 'fetch-tweets'), 'strDescription' => __('In order to select list, the user name(screen name) of the account that owns the list must be specified.', 'fetch-tweets')));
     // Add setting fields
     $this->addSettingFields(array('strFieldID' => 'connect_to_twitter', 'strSectionID' => 'twitter_connect', 'strTitle' => __('Connect to Twitter', 'fetch-tweets'), 'vLabel' => __('Connect', 'fetch-tweets'), 'vLink' => add_query_arg(array('post_type' => 'fetch_tweets', 'page' => 'fetch_tweets_settings', 'tab' => 'twitter_redirect'), admin_url($GLOBALS['pagenow'])), 'strType' => 'submit'), array('strFieldID' => 'manual_authentication', 'strSectionID' => 'twitter_connect', 'strTitle' => __('Manual', 'fetch-tweets'), 'vClassAttribute' => 'button button-secondary', 'vLabel' => __('Set Keys Manually', 'fetch-tweets'), 'vLink' => add_query_arg(array('post_type' => 'fetch_tweets', 'page' => 'fetch_tweets_settings', 'tab' => 'authentication', 'settings-updated' => false)), 'strType' => 'submit'));
     $this->addSettingFields(array('strFieldID' => 'consumer_key', 'strSectionID' => 'authentication_keys', 'strTitle' => __('Consumer Key', 'fetch-tweets'), 'strType' => 'text', 'vSize' => 80), array('strFieldID' => 'consumer_secret', 'strSectionID' => 'authentication_keys', 'strTitle' => __('Consumer Secret', 'fetch-tweets'), 'strType' => 'text', 'vSize' => 80), array('strFieldID' => 'access_token', 'strSectionID' => 'authentication_keys', 'strTitle' => __('Access Token', 'fetch-tweets'), 'strType' => 'text', 'vSize' => 80), array('strFieldID' => 'access_secret', 'strSectionID' => 'authentication_keys', 'strTitle' => __('Access Secret', 'fetch-tweets'), 'strType' => 'text', 'vSize' => 80, 'strAfterField' => '<p class="description">' . sprintf(__('You can obtain those keys by logging in to <a href="%1$s" target="_blank">Twitter Developers</a>', 'fetch-tweets'), 'https://dev.twitter.com/apps') . '</p>'), array('strFieldID' => 'submit_authentication_keys', 'strSectionID' => 'authentication_keys', 'strType' => 'submit', 'strBeforeField' => "<div class='right-button'>", 'strAfterField' => "</div>", 'vLabelMinWidth' => 0, 'vLabel' => __('Authenticate', 'fetch-tweets'), 'vClassAttribute' => 'button button-primary'));
     // default_values
     $this->addSettingFields(array('strFieldID' => 'count', 'strSectionID' => 'default_values', 'strTitle' => __('Number of Items', 'fetch-tweets'), 'strHelp' => __('The number of tweets to display.', 'fetch-tweets') . __('Default', 'fetch-tweets') . ': ' . $GLOBALS['oFetchTweets_Option']->arrStructure_DefaultParams['count'] . __('This option corresponds to the <code>count</code> argument value. For instance, with this shortcode, <code>[fetch_tweets id="10" count="30"]</code>, the count value, 30, will override this option. If the <code>count</code> parameter is not set, this option value will be used.', 'fetch-tweets'), 'vDefault' => $GLOBALS['oFetchTweets_Option']->arrStructure_DefaultParams['count'], 'strType' => 'number'), array('strFieldID' => 'twitter_media', 'strSectionID' => 'default_values', 'strTitle' => __('Twitter Media', 'fetch-tweets'), 'strType' => 'checkbox', 'vLabel' => __('Display media images posted in the tweet that are recognized as media file by Twitter.'), 'strHelp' => __('This option corresponds to the <code>twitter_media</code> argument value. For instance, with this shortcode, <code>[fetch_tweets id="10" count="30"]</code>, the count value, 30, will override this option. If the <code>count</code> parameter is not set, this option value will be used.', 'fetch-tweets') . ' ' . __('Currently only photos are supported by the Twitter API.'), 'vDefault' => $GLOBALS['oFetchTweets_Option']->arrStructure_DefaultParams['twitter_media']), array('strFieldID' => 'external_media', 'strSectionID' => 'default_values', 'strTitle' => __('External Media', 'fetch-tweets'), 'strType' => 'checkbox', 'vLabel' => __('Replace media links of external sources to an embedded element.', 'fetch-tweets'), 'strHelp' => __('This option corresponds to the <code>external_media</code> argument value. For instance, with this shortcode, <code>[fetch_tweets id="10" count="30"]</code>, the count value, 30, will override this option. If the <code>count</code> parameter is not set, this option value will be used.', 'fetch-tweets') . ' ' . __('Unlike the above media images, there are media links that are not categorized as media by the Twitter API. Thus, enabling this option will attempt to replace them to the embedded elements.', 'fetch-tweets') . ' e.g. youtube, vimeo, dailymotion etc.', 'vDefault' => $GLOBALS['oFetchTweets_Option']->arrStructure_DefaultParams['external_media']), array('strFieldID' => 'submit_default_values', 'strSectionID' => 'default_values', 'strType' => 'submit', 'strBeforeField' => "<div class='right-button'>", 'strAfterField' => "</div>", 'vLabelMinWidth' => 0, 'vLabel' => __('Save Changes', 'fetch-tweets'), 'vClassAttribute' => 'button button-primary'));
     $this->addSettingFields(array('strFieldID' => 'setting_page_capability', 'strSectionID' => 'capabilities', 'strTitle' => __('Capability', 'fetch-tweets'), 'strDescription' => __('Select the user role that is allowed to access the plugin setting pages.', 'fetch-tweets') . __('Default', 'fetch-tweets') . ': ' . __('Administrator', 'fetch-tweets'), 'strType' => 'select', 'strCapability' => 'manage_options', 'vLabel' => array('manage_options' => __('Administrator', 'responsive-column-widgets'), 'edit_pages' => __('Editor', 'responsive-column-widgets'), 'publish_posts' => __('Author', 'responsive-column-widgets'), 'edit_posts' => __('Contributor', 'responsive-column-widgets'), 'read' => __('Subscriber', 'responsive-column-widgets'))), array('strFieldID' => 'submit_misc', 'strSectionID' => 'capabilities', 'strType' => 'submit', 'strBeforeField' => "<div class='right-button'>", 'strAfterField' => "</div>", 'vLabelMinWidth' => 0, 'vLabel' => __('Save Changes', 'fetch-tweets'), 'vClassAttribute' => 'button button-primary'));
     $this->addSettingFields(array('strFieldID' => 'option_sections', 'strSectionID' => 'reset_settings', 'strTitle' => __('Options to Delete', 'fetch-tweets'), 'strType' => 'checkbox', 'vDelimiter' => '<br />', 'vLabel' => array('all' => __('Reset', 'fetch-tweets'))), array('strFieldID' => 'clear_caches', 'strSectionID' => 'caches', 'strTitle' => __('Clear Caches', 'fetch-tweets'), 'strType' => 'checkbox', 'vLabel' => __('Clear tweet caches', 'fetch-tweets')), array('strFieldID' => 'submit_reset_settings', 'strSectionID' => 'caches', 'strType' => 'submit', 'strBeforeField' => "<div class='right-button'>", 'strAfterField' => "</div>", 'vLabelMinWidth' => 0, 'vLabel' => __('Perform', 'fetch-tweets'), 'vClassAttribute' => 'button button-primary'));
     $this->addSettingFields(array('strFieldID' => 'list_owner_screen_name', 'strSectionID' => 'add_rule_by_list', 'strTitle' => __('Owner Screen Name', 'fetch-tweets'), 'strDescription' => __('The screen name(user name) that owns the list.', 'fetch-tweets') . '<br />' . 'e.g. miunosoft', 'strType' => 'text', 'vValue' => '', 'vSize' => 40), array('strFieldID' => 'list_proceed', 'strSectionID' => 'add_rule_by_list', 'strType' => 'submit', 'strBeforeField' => "<div class='right-button'>", 'strAfterField' => "</div>", 'vLabelMinWidth' => 0, 'vLabel' => __('Proceed', 'fetch-tweets'), 'vClassAttribute' => 'button button-primary'));
     $this->addLinkToPluginDescription('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J4UJHETVAZX34">' . __('Donate', 'fetch-tweets') . '</a>', '<a href="http://en.michaeluno.jp/contact/custom-order/?lang=' . (WPLANG ? WPLANG : 'en') . '">' . __('Order custom plugin', 'fetch-tweets') . '</a>');
 }
 public function setUp()
 {
     $this->oOption = $GLOBALS['oFetchTweets_Option'];
     $_sCapability = FetchTweets_Option::get(array('capabilities', 'setting_page_capability'), 'manage_options');
     $this->setArguments(array('labels' => $this->oProp->bIsAdmin ? $this->_getPostTypeLabelArguments() : array(), 'public' => true, 'menu_position' => 110, 'supports' => array('title'), 'taxonomies' => array(''), 'menu_icon' => $this->oProp->bIsAdmin ? FetchTweets_Commons::getPluginURL('/asset/image/menu_icon_16x16.png') : '', 'has_archive' => true, 'hierarchical' => false, 'show_admin_column' => true, 'screen_icon' => $this->oProp->bIsAdmin ? FetchTweets_Commons::getPluginURL("/asset/image/screen_icon_32x32.png") : '', 'exclude_from_search' => !FetchTweets_Option::get(array('search', 'is_searchable')), 'capabilities' => array('publish_posts' => $_sCapability, 'edit_posts' => $_sCapability, 'edit_others_posts' => $_sCapability, 'delete_posts' => $_sCapability, 'delete_others_posts' => $_sCapability, 'read_private_posts' => $_sCapability, 'edit_post' => $_sCapability, 'delete_post' => $_sCapability, 'read_post' => $_sCapability)));
     $this->addTaxonomy(FetchTweets_Commons::TagSlug, array('labels' => $this->oProp->bIsAdmin ? $this->_getTaxonomyTagLabelArgumnents() : array(), 'show_ui' => true, 'show_tagcloud' => false, 'hierarchical' => false, 'show_admin_column' => true, 'show_in_nav_menus' => false, 'show_table_filter' => true, 'show_in_sidebar_menus' => true));
     $_sCurrentPostTypeInAdmin = isset($GLOBALS['post_type']) ? $GLOBALS['post_type'] : (isset($_GET['post_type']) ? $_GET['post_type'] : '');
     // For admin
     if ($_sCurrentPostTypeInAdmin == $this->oProp->sPostType && is_admin()) {
         $this->setAutoSave(false);
         $this->setAuthorTableFilter(true);
         add_filter('enter_title_here', array($this, '_replyToChangeTitleMetaBoxFieldLabel'));
         // add_filter( 'gettext', array( $this, 'changeTitleMetaBoxFieldLabel' ) );
         add_action('edit_form_after_title', array($this, 'addTextAfterTitle'));
     }
     // add_filter( 'the_content', array( $this, '_replyToPreviewTweets' ) );
 }
示例#3
0
        ?>
						</a>
					</li>
					<li class='fetch-tweets-single-intent-favorite'>
						<a href='https://twitter.com/intent/favorite?tweet_id=<?php 
        echo $arrDetail['id_str'];
        ?>
' rel='nofollow' target='_blank' title='<?php 
        _e('Favorite', 'fetch-tweets');
        ?>
'>
							<?php 
        if ($arrArgs['intent_buttons'] == 1 || $arrArgs['intent_buttons'] == 2) {
            ?>
							<span class='fetch-tweets-single-intent-icon' style='background-image: url("<?php 
            echo FetchTweets_Commons::getPluginURL('image/favorite_48x16.png');
            ?>
");' ></span>
							<?php 
        }
        ?>
							<?php 
        if ($arrArgs['intent_buttons'] == 1 || $arrArgs['intent_buttons'] == 3) {
            ?>
							<span class='fetch-tweets-single-intent-buttons-text'><?php 
            _e('Favorite', 'fetch-tweets');
            ?>
</span>
							<?php 
        }
        ?>
 /**
  * Defines the plugin admin page styles.
  */
 private function _setUpStyles()
 {
     $this->setPageHeadingTabsVisibility(false);
     // disables the page heading tabs by passing false.
     $this->setInPageTabTag('h2');
     $this->enqueueStyle(FetchTweets_Commons::getPluginURL('/asset/css/admin.css'));
     $this->enqueueStyle(FetchTweets_Commons::getPluginURL('/asset/css/fetch_tweets_templates.css'), 'fetch_tweets_templates');
     $this->enqueueStyle(FetchTweets_Commons::getPluginURL('/asset/css/fetch_tweets_settings.css'), 'fetch_tweets_settings');
     $this->enqueueStyle(FetchTweets_Commons::getPluginURL('/asset/css/fetch_tweets_add_rule_by_list.css'), 'fetch_tweets_add_rule_by_list');
 }
示例#5
0
$sMarginTop = empty($aArgs['margin_top']) ? 0 : $aArgs['margin_top'] . $aArgs['margin_top_unit'];
$sMarginRight = empty($aArgs['margin_right']) ? 0 : $aArgs['margin_right'] . $aArgs['margin_right_unit'];
$sMarginBottom = empty($aArgs['margin_bottom']) ? 0 : $aArgs['margin_bottom'] . $aArgs['margin_bottom_unit'];
$sMarginLeft = empty($aArgs['margin_left']) ? 0 : $aArgs['margin_left'] . $aArgs['margin_left_unit'];
$sPaddingTop = empty($aArgs['padding_top']) ? 0 : $aArgs['padding_top'] . $aArgs['padding_top_unit'];
$sPaddingRight = empty($aArgs['padding_right']) ? 0 : $aArgs['padding_right'] . $aArgs['padding_right_unit'];
$sPaddingBottom = empty($aArgs['padding_bottom']) ? 0 : $aArgs['padding_bottom'] . $aArgs['padding_bottom_unit'];
$sPaddingLeft = empty($aArgs['padding_left']) ? 0 : $aArgs['padding_left'] . $aArgs['padding_left_unit'];
$sMargins = ($sMarginTop ? "margin-top: {$sMarginTop}; " : "") . ($sMarginRight ? "margin-right: {$sMarginRight}; " : "") . ($sMarginBottom ? "margin-bottom: {$sMarginBottom}; " : "") . ($sMarginLeft ? "margin-left: {$sMarginLeft}; " : "");
$sPaddings = ($sPaddingTop ? "padding-top: {$sPaddingTop}; " : "") . ($sPaddingRight ? "padding-right: {$sPaddingRight}; " : "") . ($sPaddingBottom ? "padding-bottom: {$sPaddingBottom}; " : "") . ($sPaddingLeft ? "padding-left: {$sPaddingLeft}; " : "");
$sMarginForImage = $aArgs['visibilities']['avatar'] ? ($aArgs['avatar_position'] == 'left' ? "margin-left: " : "margin-right: ") . (int) $aArgs['avatar_size'] . "px" : "";
$sGMTOffset = get_option('gmt_offset') * HOUR_IN_SECONDS;
$bIsSSL = is_ssl();
$sURLReplyuButton = esc_url(FetchTweets_Commons::getPluginURL('asset/image/reply_48x16.png'));
$sURLRetweetButton = esc_url(FetchTweets_Commons::getPluginURL('asset/image/retweet_48x16.png'));
$sURLFavoriteButton = esc_url(FetchTweets_Commons::getPluginURL('asset/image/favorite_48x16.png'));
/*
 * For debugging - uncomment the following lines to see the contents of the arrays.
 */
// echo "<pre>" . htmlspecialchars( print_r( $aTweets, true ) ) . "</pre>";
// echo "<pre>" . htmlspecialchars( print_r( $aArgs, true ) ) . "</pre>";
// return;
// Start the layout.
?>

<div class='fetch-tweets' style="<?php 
echo esc_attr($sWidth . $sHeight . $sBackgroundColor . $sMargins . $sPaddings . $sOverflowY);
?>
">

    <?php 
 public function style_FetchTweets_PostType()
 {
     $strNone = 'none';
     return "#post-body-content {\r\n\t\t\t\tmargin-bottom: 10px;\r\n\t\t\t}\r\n\t\t\t#edit-slug-box {\r\n\t\t\t\tdisplay: {$strNone};\r\n\t\t\t}\r\n\t\t\t#icon-edit.icon32.icon32-posts-fetch_tweets {\r\n\t\t\t\tbackground:url('" . FetchTweets_Commons::getPluginURL("/image/screen_icon_32x32.png") . "') no-repeat;\r\n\t\t\t}\t\t\t\r\n\t\t";
     // "";
 }