本文整理汇总了PHP中Dataset::addHelp方法的典型用法代码示例。如果您正苦于以下问题:PHP Dataset::addHelp方法的具体用法?PHP Dataset::addHelp怎么用?PHP Dataset::addHelp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dataset
的用法示例。
在下文中一共展示了Dataset::addHelp方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDashboardMenuItems
public function getDashboardMenuItems($instance)
{
$menus = array();
$posts_data_tpl = Utils::getPluginViewDirectory('facebook') . 'posts.tpl';
$posts_menu_item = new MenuItem("Posts", "Post insights", $posts_data_tpl);
$posts_menu_ds_1 = new Dataset("all_posts", 'PostDAO', "getAllPosts", array($instance->network_user_id, $instance->network, 5, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()), false);
$posts_menu_item->addDataset($posts_menu_ds_1);
$posts_menu_ds_2 = new Dataset("most_replied_to", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, $instance->network, 5, '#page_number#'));
$posts_menu_item->addDataset($posts_menu_ds_2);
$posts_menu_ds_3 = new Dataset("most_liked", 'PostDAO', "getMostFavedPosts", array($instance->network_user_id, $instance->network, 5, '#page_number#'));
$posts_menu_item->addDataset($posts_menu_ds_3);
$posts_menu_ds_4 = new Dataset("inquiries", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, $instance->network, 5, "#page_number#"));
$posts_menu_item->addDataset($posts_menu_ds_4);
$posts_menu_ds_5 = new Dataset("wallposts", 'PostDAO', "getPostsToUser", array($instance->network_user_id, $instance->network, 5, '#page_number#', !Session::isLoggedIn()), 'getPostsToUserIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()));
$posts_menu_item->addDataset($posts_menu_ds_5);
$menus['posts'] = $posts_menu_item;
$friends_data_tpl = Utils::getPluginViewDirectory('facebook') . 'friends.tpl';
$friend_fan_menu_title = $instance->network == 'facebook page' ? 'Fans' : 'Friends';
$friends_menu_item = new MenuItem($friend_fan_menu_title, "Friends insights", $friends_data_tpl);
$friends_menu_ds_2 = new Dataset("follower_count_history_by_day", 'CountHistoryDAO', 'getHistory', array($instance->network_user_id, $instance->network, 'DAY', 15));
$friends_menu_item->addDataset($friends_menu_ds_2);
$friends_menu_ds_3 = new Dataset("follower_count_history_by_week", 'CountHistoryDAO', 'getHistory', array($instance->network_user_id, $instance->network, 'WEEK', 15));
$friends_menu_item->addDataset($friends_menu_ds_3);
$friends_menu_ds_4 = new Dataset("follower_count_history_by_month", 'CountHistoryDAO', 'getHistory', array($instance->network_user_id, $instance->network, 'MONTH', 11));
$friends_menu_item->addDataset($friends_menu_ds_4);
$menus['friends'] = $friends_menu_item;
$fb_data_tpl = Utils::getPluginViewDirectory('facebook') . 'facebook.inline.view.tpl';
//All tab
$alltab = new MenuItem("All posts", 'All your status updates', $fb_data_tpl, 'posts');
$alltabds = new Dataset("all_facebook_posts", 'PostDAO', "getAllPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()), false);
$alltabds->addHelp('userguide/listings/facebook/dashboard_all_facebook_posts');
$alltab->addDataset($alltabds);
$menus["posts-all"] = $alltab;
// Most replied-to tab
$mrttab = new MenuItem("Most replied-to", "Posts with most replies", $fb_data_tpl, 'posts');
$mrttabds = new Dataset("most_replied_to_posts", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, $instance->network, 15, '#page_number#'));
$mrttabds->addHelp('userguide/listings/facebook/dashboard_mostreplies');
$mrttab->addDataset($mrttabds);
$menus["posts-mostreplies"] = $mrttab;
// Most liked posts
$mltab = new MenuItem("Most liked", "Posts with most likes", $fb_data_tpl, 'posts');
$mltabds = new Dataset("most_replied_to_posts", 'PostDAO', "getMostFavedPosts", array($instance->network_user_id, $instance->network, 15, '#page_number#'));
$mltabds->addHelp('userguide/listings/facebook/dashboard_mostlikes');
$mltab->addDataset($mltabds);
$menus["posts-mostlikes"] = $mltab;
//Questions tab
$qtab = new MenuItem("Inquiries", "Inquiries, or posts with a question mark in them", $fb_data_tpl, 'posts');
$qtabds = new Dataset("all_facebook_posts", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"));
$qtabds->addHelp('userguide/listings/facebook/dashboard_questions');
$qtab->addDataset($qtabds);
$menus["posts-questions"] = $qtab;
// Wall Posts
$messagestab = new MenuItem("Posts On Your Wall", "Posts to your wall by other users", $fb_data_tpl, 'posts');
$messagestabds = new Dataset("messages_to_you", 'PostDAO', "getPostsToUser", array($instance->network_user_id, $instance->network, 15, '#page_number#', !Session::isLoggedIn()), 'getPostsToUserIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()));
$messagestabds->addHelp('userguide/listings/facebook/dashboard-wallposts');
$messagestab->addDataset($messagestabds);
$menus["posts-toyou"] = $messagestab;
return $menus;
}
示例2: getDashboardMenuItems
/**
* Get Dashboard menu
* @param $instance Instance
* @return array of MenuItem objects (Tweets, Friends, Followers, etc)
*/
public function getDashboardMenuItems($instance)
{
// An array to store our list of menu items in
$menus = array();
// Set the view template to checkins.tpl
$checkins_data_tpl = Utils::getPluginViewDirectory('foursquare') . 'checkins.tpl';
// Add a checkins link to the list of pages on the left
$checkins_menu_item = new MenuItem("Checkins", "Your checkins", $checkins_data_tpl);
// Get the data for our checkins link
$checkins_menu_ds_1 = new Dataset("all_checkins", 'PostDAO', "getAllCheckins", array($instance->network_user_id, $instance->network, 15, "#page_number#"));
$checkins_menu_ds_1->addHelp('userguide/listings/foursquare/dashboard_posts');
$checkins_menu_item->addDataset($checkins_menu_ds_1);
// Add the checkins to our array of items
$menus['posts'] = $checkins_menu_item;
// Return the list of items we want to display
return $menus;
}
示例3: getDashboardMenuItems
public function getDashboardMenuItems($instance)
{
$twitter_data_tpl = Utils::getPluginViewDirectory('twitter') . 'twitter.inline.view.tpl';
$menus = array();
//All tab
$all_mi = new MenuItem("All Tweets", "All tweets", $twitter_data_tpl, "Tweets");
$all_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, 'twitter', GridController::getMaxRows()));
$all_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-all');
$all_mi->addDataset($all_mi_ds);
$menus['tweets-all'] = $all_mi;
//Questions
$q_mi = new MenuItem("Inquiries", "Inquiries, or tweets with a question mark in them", $twitter_data_tpl);
$q_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"));
$q_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-questions');
$q_mi->addDataset($q_mi_ds);
$menus['tweets-questions'] = $q_mi;
// Most replied-to
$mrt_mi = new MenuItem("Most replied-to", "Tweets with most replies", $twitter_data_tpl);
$mrt_mi_ds = new Dataset("most_replied_to_tweets", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mrt_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-mostreplies');
$mrt_mi->addDataset($mrt_mi_ds);
$menus['tweets-mostreplies'] = $mrt_mi;
// Most shared
$mstab = new MenuItem("Most retweeted", "Most retweeted tweets", $twitter_data_tpl);
$mstabds = new Dataset("most_retweeted", 'PostDAO', "getMostRetweetedPosts", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mstabds->addHelp('userguide/listings/twitter/dashboard_tweets-mostretweeted');
$mstab->addDataset($mstabds);
$menus["tweets-mostretweeted"] = $mstab;
if (Session::isLoggedIn()) {
//show protected tweets
//All Mentions
$amtab = new MenuItem("All Mentions", "Any post that mentions you", $twitter_data_tpl, 'Replies');
$amtabds1 = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15), "getAllMentionsIterator", array($instance->network_username, GridController::getMaxRows(), 'twitter'));
$amtabds2 = new Dataset("all_mentions", 'PostDAO', "getAllMentions", array($instance->network_username, 15, $instance->network, '#page_number#'));
$amtabds2->addHelp('userguide/listings/twitter/dashboard_mentions-all');
$amtab->addDataset($amtabds1);
$amtab->addDataset($amtabds2);
$menus["mentions-all"] = $amtab;
//All Replies
$artab = new MenuItem("Replies", "Posts that directly reply to you (i.e., start with your name)", $twitter_data_tpl);
$artabds = new Dataset("all_replies", 'PostDAO', "getAllReplies", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$artabds->addHelp('userguide/listings/twitter/dashboard_mentions-allreplies');
$artab->addDataset($artabds);
$menus["mentions-allreplies"] = $artab;
//All Orphan Mentions
$omtab = new MenuItem("Not Replies or Forwards", "Mentions that are not associated with a specific post", $twitter_data_tpl);
$omtabds1 = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15));
$omtabds2 = new Dataset("orphan_replies", 'PostDAO', "getOrphanReplies", array($instance->network_username, 15, $instance->network, '#page_number#'));
$omtabds2->addHelp('userguide/listings/twitter/dashboard_mentions-orphan');
$omtab->addDataset($omtabds1);
$omtab->addDataset($omtabds2);
$menus["mentions-orphan"] = $omtab;
} else {
//All public mentions
$amtab = new MenuItem("All Mentions", "Any post that mentions you", $twitter_data_tpl, 'Replies');
$amtabds2 = new Dataset("all_mentions", 'PostDAO', "getAllMentions", array($instance->network_username, 15, $instance->network, '#page_number#', true));
$amtabds2->addHelp('userguide/listings/twitter/dashboard_mentions-all');
$amtab->addDataset($amtabds2);
$menus["mentions-all"] = $amtab;
}
// Conversations
$convotab = new MenuItem("Conversations", "Exchanges between you and other users", $twitter_data_tpl);
$convotabds = new Dataset("author_replies", 'PostDAO', "getPostsAuthorHasRepliedTo", array($instance->network_user_id, 15, 'twitter', '#page_number#', !Session::isLoggedIn()));
$convotabds->addHelp('userguide/listings/twitter/dashboard_tweets-convo');
$convotab->addDataset($convotabds);
$menus["tweets-convo"] = $convotab;
//Most Active Friends
$motab = new MenuItem('Chatterboxes', 'People you follow who tweet the most', $twitter_data_tpl, 'Who You Follow');
$motabds = new Dataset('people', 'FollowDAO', "getMostActiveFollowees", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$motabds->addHelp('userguide/listings/twitter/dashboard_friends-mostactive');
$motab->addDataset($motabds);
$menus["friends-mostactive"] = $motab;
//Least Active Friends
$latab = new MenuItem('Deadbeats', 'People you follow who tweet the least', $twitter_data_tpl);
$latabds = new Dataset("people", 'FollowDAO', "getLeastActiveFollowees", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$latabds->addHelp('userguide/listings/twitter/dashboard_friends-leastactive');
$latab->addDataset($latabds);
$menus["friends-leastactive"] = $latab;
//Popular friends
$poptab = new MenuItem('Popular', 'Most-followed people you follow', $twitter_data_tpl);
$poptabds = new Dataset("people", 'FollowDAO', "getMostFollowedFollowees", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$poptabds->addHelp('userguide/listings/twitter/dashboard_followers-mostfollowed');
$poptab->addDataset($poptabds);
$menus["friends-mostfollowed"] = $poptab;
//Follower count history
$follower_history_tpl = Utils::getPluginViewDirectory('twitter') . 'twitter.followercount.tpl';
$trendtab = new MenuItem('Follower Count', 'Your follower count over time', $follower_history_tpl, 'Followers');
$trendtabds = new Dataset("follower_count_history_by_day", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'DAY', 15));
$trendtab->addDataset($trendtabds);
$trendtabweekds = new Dataset("follower_count_history_by_week", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'WEEK', 15));
$trendtab->addDataset($trendtabweekds);
$trendtabmonthds = new Dataset("follower_count_history_by_month", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'MONTH', 11));
$trendtabmonthds->addHelp('userguide/listings/twitter/dashboard_followers-history');
$trendtab->addDataset($trendtabmonthds);
$menus['followers-history'] = $trendtab;
//Most followed
$mftab = new MenuItem('Most-followed', 'Followers with most followers', $twitter_data_tpl);
$mftabds = new Dataset("people", 'FollowDAO', "getMostFollowedFollowers", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mftabds->addHelp('userguide/listings/twitter/dashboard_followers-mostfollowed');
$mftab->addDataset($mftabds);
//.........这里部分代码省略.........
示例4: getDashboardMenuItems
public function getDashboardMenuItems($instance)
{
// determine if the Twitter Realtime plugin is active.
$rt_plugin_active = false;
$plugin_dao = DAOFactory::getDAO('PluginDAO');
$plugin_id = $plugin_dao->getPluginId('twitterrealtime');
if (isset($plugin_id)) {
$rt_plugin_active = $plugin_dao->isPluginActive($plugin_id);
}
$menus = array();
$tweets_data_tpl = Utils::getPluginViewDirectory('twitter') . 'tweets.tpl';
$tweets_menu_item = new MenuItem("Tweets", "Tweets insights", $tweets_data_tpl);
$tweets_menu_ds_1 = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 5, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, 'twitter', GridController::getMaxRows()));
$tweets_menu_ds_1->addHelp('userguide/listings/twitter/dashboard_tweets-all');
$tweets_menu_item->addDataset($tweets_menu_ds_1);
$menus['tweets'] = $tweets_menu_item;
$tweets_menu_ds_2 = new Dataset("inquiries", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, 'twitter', 5, "#page_number#"));
$tweets_menu_ds_2->addHelp('userguide/listings/twitter/dashboard_tweets-questions');
$tweets_menu_item->addDataset($tweets_menu_ds_2);
$tweets_menu_ds_3 = new Dataset("most_replied_to_tweets", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, 'twitter', 5, '#page_number#'));
$tweets_menu_ds_3->addHelp('userguide/listings/twitter/dashboard_tweets-mostreplies');
$tweets_menu_item->addDataset($tweets_menu_ds_3);
// $tweets_menu_ds_7 = new Dataset("author_replies", 'PostDAO', "getPostsAuthorHasRepliedTo",
// array($instance->network_user_id, 5, 'twitter', '#page_number#', !Session::isLoggedIn()));
// $tweets_menu_ds_7->addHelp('userguide/listings/twitter/dashboard_tweets-convo');
// $tweets_menu_item->addDataset($tweets_menu_ds_7);
$tweets_menu_ds_4 = new Dataset("most_retweeted", 'PostDAO', "getMostRetweetedPosts", array($instance->network_user_id, 'twitter', 5, '#page_number#'));
$tweets_menu_ds_4->addHelp('userguide/listings/twitter/dashboard_tweets-mostretweeted');
$tweets_menu_item->addDataset($tweets_menu_ds_4);
$tweets_menu_ds_5 = new Dataset("messages_to_you", 'PostDAO', "getPostsToUser", array($instance->network_user_id, $instance->network, 5, '#page_number#', !Session::isLoggedIn()), 'getPostsToUserIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()));
$tweets_menu_ds_5->addHelp('userguide/listings/twitter/dashboard_tweets-touser');
$tweets_menu_item->addDataset($tweets_menu_ds_5);
$tweets_menu_ds_6 = new Dataset("favorites", 'FavoritePostDAO', "getAllFavoritePosts", array($instance->network_user_id, 'twitter', 5, "#page_number#", !Session::isLoggedIn()), 'getAllFavoritePostsIterator', array($instance->network_user_id, 'twitter', GridController::getMaxRows()));
$tweets_menu_ds_6->addHelp('userguide/listings/twitter/dashboard_ftweets-all');
$tweets_menu_item->addDataset($tweets_menu_ds_6);
$follower_data_tpl = Utils::getPluginViewDirectory('twitter') . 'followers.tpl';
$followers_menu_item = new MenuItem("Followers", "Follower insights", $follower_data_tpl);
$menus['followers'] = $followers_menu_item;
$followers_ds1 = new Dataset('leastlikely', 'FollowDAO', "getLeastLikelyFollowers", array($instance->network_user_id, 'twitter', 13, '#page_number#'));
$followers_menu_item->addDataset($followers_ds1);
$followers_ds9 = new Dataset('leastlikelythisweek', 'InsightDAO', "getPreCachedInsightData", array('FollowMySQLDAO::getLeastLikelyFollowersThisWeek', $instance->id, date('Y-m-d')));
$followers_menu_item->addDataset($followers_ds9);
$followers_ds2 = new Dataset("popular", 'FollowDAO', "getMostFollowedFollowers", array($instance->network_user_id, 'twitter', 13, '#page_number#'));
$followers_ds2->addHelp('userguide/listings/twitter/dashboard_followers-mostfollowed');
$followers_menu_item->addDataset($followers_ds2);
$followers_ds3 = new Dataset("follower_count_history_by_day", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'DAY', 15));
$followers_menu_item->addDataset($followers_ds3);
$followers_ds4 = new Dataset("follower_count_history_by_week", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'WEEK', 15));
$followers_menu_item->addDataset($followers_ds4);
$followers_ds5 = new Dataset("follower_count_history_by_month", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'MONTH', 15));
$followers_ds5->addHelp('userguide/listings/twitter/dashboard_followers-history');
$followers_menu_item->addDataset($followers_ds5);
$followers_ds6 = new Dataset("list_membership_count_history_by_day", 'GroupMembershipCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'DAY', 15));
$followers_menu_item->addDataset($followers_ds6);
$followers_ds7 = new Dataset("list_membership_count_history_by_week", 'GroupMembershipCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'WEEK', 15));
$followers_menu_item->addDataset($followers_ds7);
$followers_ds8 = new Dataset("list_membership_count_history_by_month", 'GroupMembershipCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'MONTH', 15));
$followers_ds8->addHelp('userguide/listings/twitter/dashboard_followers-liststats');
$followers_menu_item->addDataset($followers_ds8);
$who_you_follow_data_tpl = Utils::getPluginViewDirectory('twitter') . 'who_you_follow.tpl';
$who_you_follow_menu_item = new MenuItem("Who You Follow", "Friend insights", $who_you_follow_data_tpl);
$menus['you-follow'] = $who_you_follow_menu_item;
$you_follow_ds1 = new Dataset('chatterboxes', 'FollowDAO', "getMostActiveFollowees", array($instance->network_user_id, 'twitter', 13, '#page_number#'));
$you_follow_ds1->addHelp('userguide/listings/twitter/dashboard_friends-mostactive');
$who_you_follow_menu_item->addDataset($you_follow_ds1);
$you_follow_ds2 = new Dataset("deadbeats", 'FollowDAO', "getLeastActiveFollowees", array($instance->network_user_id, 'twitter', 13, '#page_number#'));
$you_follow_ds2->addHelp('userguide/listings/twitter/dashboard_friends-leastactive');
$who_you_follow_menu_item->addDataset($you_follow_ds2);
$you_follow_ds3 = new Dataset("popular", 'FollowDAO', "getMostFollowedFollowees", array($instance->network_user_id, 'twitter', 13, '#page_number#'));
$you_follow_ds3->addHelp('userguide/listings/twitter/dashboard_followers-mostfollowed');
$who_you_follow_menu_item->addDataset($you_follow_ds3);
$links_data_tpl = Utils::getPluginViewDirectory('twitter') . 'links.tpl';
$links_menu_item = new MenuItem("Links", "Links insights", $links_data_tpl);
$menus['links'] = $links_menu_item;
$links_ds_1 = new Dataset("linksinfaves", 'LinkDAO', "getLinksByFavorites", array($instance->network_user_id, 'twitter', 5, '#page_number#', !Session::isLoggedIn()));
$links_ds_1->addHelp('userguide/listings/twitter/dashboard_links-favorites');
$links_menu_item->addDataset($links_ds_1);
$links_ds_2 = new Dataset("linksbyfriends", 'LinkDAO', "getLinksByFriends", array($instance->network_user_id, 'twitter', 5, '#page_number#', !Session::isLoggedIn()));
$links_ds_2->addHelp('userguide/listings/twitter/dashboard_links-friends');
$links_menu_item->addDataset($links_ds_2);
$links_ds_3 = new Dataset("photosbyfriends", 'LinkDAO', "getPhotosByFriends", array($instance->network_user_id, 'twitter', 5, '#page_number#', !Session::isLoggedIn()));
$links_ds_3->addHelp('userguide/listings/twitter/dashboard_links-photos');
$links_menu_item->addDataset($links_ds_3);
//inner items
$twitter_data_tpl = Utils::getPluginViewDirectory('twitter') . 'twitter.inline.view.tpl';
//All tab
$all_mi = new MenuItem("Your tweets", "All your tweets", $twitter_data_tpl, "tweets");
$all_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, 'twitter', GridController::getMaxRows()));
$all_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-all');
$all_mi->addDataset($all_mi_ds);
$menus['tweets-all'] = $all_mi;
//Questions
$q_mi = new MenuItem("Inquiries", "Inquiries, or tweets with a question mark in them", $twitter_data_tpl, 'tweets');
$q_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"));
$q_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-questions');
$q_mi->addDataset($q_mi_ds);
$menus['tweets-questions'] = $q_mi;
// Most replied-to
$mrt_mi = new MenuItem("Most replied-to", "Tweets with most replies", $twitter_data_tpl, 'tweets');
$mrt_mi_ds = new Dataset("most_replied_to_tweets", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
//.........这里部分代码省略.........
示例5: testAddGetHelp
public function testAddGetHelp()
{
$dataset = new Dataset('all-posts', 'PostDAO', 'getAllPostsIDontExist', array(930061, 'twitter', 15));
$this->assertNull($dataset->getHelp());
$dataset->addHelp('userguide/twitter/allposts');
$this->assertEqual($dataset->getHelp(), 'userguide/twitter/allposts');
}
示例6: getDashboardMenuItems
public function getDashboardMenuItems($instance)
{
$menus = array();
$posts_data_tpl = Utils::getPluginViewDirectory('googleplus') . 'posts.tpl';
$posts_menu_item = new MenuItem("Posts", "Post insights", $posts_data_tpl);
$posts_menu_ds_1 = new Dataset("all_posts", 'PostDAO', "getAllPosts", array($instance->network_user_id, $instance->network, 3, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()), false);
$posts_menu_item->addDataset($posts_menu_ds_1);
$posts_menu_ds_2 = new Dataset("most_replied_to", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, $instance->network, 3, '#page_number#'));
$posts_menu_item->addDataset($posts_menu_ds_2);
$posts_menu_ds_3 = new Dataset("plus_oned", 'PostDAO', "getMostFavedPosts", array($instance->network_user_id, $instance->network, 3, '#page_number#'));
$posts_menu_item->addDataset($posts_menu_ds_3);
$posts_menu_ds_4 = new Dataset("questions", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, $instance->network, 3, "#page_number#"));
$posts_menu_item->addDataset($posts_menu_ds_4);
$menus['posts'] = $posts_menu_item;
$gp_data_tpl = Utils::getPluginViewDirectory('googleplus') . 'googleplus.inline.view.tpl';
//All tab
$alltab = new MenuItem("All posts", 'All posts', $gp_data_tpl, 'posts');
$alltabds = new Dataset("gplus_posts", 'PostDAO', "getAllPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()), false);
$alltabds->addHelp('userguide/listings/googleplus/dashboard_all_gplus_posts');
$alltab->addDataset($alltabds);
$menus["posts-all"] = $alltab;
// Most replied-to tab
$mrttab = new MenuItem("Most discussed", "Posts with the most comments", $gp_data_tpl, 'posts');
$mrttabds = new Dataset("gplus_posts", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, $instance->network, 15, '#page_number#'));
$mrttabds->addHelp('userguide/listings/googleplus/dashboard_mostreplies');
$mrttab->addDataset($mrttabds);
$menus["posts-mostreplies"] = $mrttab;
// Most liked posts
$mltab = new MenuItem("Most +1'ed", "Posts with most +1s", $gp_data_tpl, 'posts');
$mltabds = new Dataset("gplus_posts", 'PostDAO', "getMostFavedPosts", array($instance->network_user_id, $instance->network, 15, '#page_number#'));
$mltabds->addHelp('userguide/listings/googleplus/dashboard_mostlikes');
$mltab->addDataset($mltabds);
$menus["posts-mostplusones"] = $mltab;
//Questions tab
$qtab = new MenuItem("Inquiries", "Inquiries, or posts with a question mark in them", $gp_data_tpl, 'posts');
$qtabds = new Dataset("gplus_posts", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"));
$qtabds->addHelp('userguide/listings/googleplus/dashboard_questions');
$qtab->addDataset($qtabds);
$menus["posts-questions"] = $qtab;
return $menus;
}
示例7: getDashboardMenuItems
public function getDashboardMenuItems($instance)
{
$fb_data_tpl = Utils::getPluginViewDirectory('facebook') . 'facebook.inline.view.tpl';
$menus = array();
//All tab
$alltab = new MenuItem("All posts", 'All status updates', $fb_data_tpl, 'Posts');
$alltabds = new Dataset("all_facebook_posts", 'PostDAO', "getAllPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, $instance->network, GridController::getMaxRows()), false);
$alltabds->addHelp('userguide/listings/facebook/dashboard_all_facebook_posts');
$alltab->addDataset($alltabds);
$menus["all_facebook_posts"] = $alltab;
// Most replied-to tab
$mrttab = new MenuItem("Most replied-to", "Posts with most replies", $fb_data_tpl);
$mrttabds = new Dataset("most_replied_to_posts", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, $instance->network, 15, '#page_number#'));
$mrttabds->addHelp('userguide/listings/facebook/dashboard_mostreplies');
$mrttab->addDataset($mrttabds);
$menus["mostreplies"] = $mrttab;
// Most liked posts
$mltab = new MenuItem("Most liked", "Posts with most likes", $fb_data_tpl);
$mltabds = new Dataset("most_replied_to_posts", 'PostDAO', "getMostFavedPosts", array($instance->network_user_id, $instance->network, 15, '#page_number#'));
$mltabds->addHelp('userguide/listings/facebook/dashboard_mostlikes');
$mltab->addDataset($mltabds);
$menus["mostlikes"] = $mltab;
//Questions tab
$qtab = new MenuItem("Inquiries", "Inquiries, or posts with a question mark in them", $fb_data_tpl);
$qtabds = new Dataset("all_facebook_posts", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"));
$qtabds->addHelp('userguide/listings/facebook/dashboard_questions');
$qtab->addDataset($qtabds);
$menus["questions"] = $qtab;
return $menus;
}
示例8: getDashboardMenuItems
public function getDashboardMenuItems($instance)
{
// determine if the Twitter Realtime plugin is active.
$rt_plugin_active = false;
$plugin_dao = DAOFactory::getDAO('PluginDAO');
$plugin_id = $plugin_dao->getPluginId('twitterrealtime');
if (isset($plugin_id)) {
$rt_plugin_active = $plugin_dao->isPluginActive($plugin_id);
}
$twitter_data_tpl = Utils::getPluginViewDirectory('twitter') . 'twitter.inline.view.tpl';
$menus = array();
//All tab
$all_mi = new MenuItem("All tweets", "All tweets", $twitter_data_tpl, "Tweets");
$all_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, 'twitter', GridController::getMaxRows()));
$all_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-all');
$all_mi->addDataset($all_mi_ds);
$menus['tweets-all'] = $all_mi;
//Questions
$q_mi = new MenuItem("Inquiries", "Inquiries, or tweets with a question mark in them", $twitter_data_tpl);
$q_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"));
$q_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-questions');
$q_mi->addDataset($q_mi_ds);
$menus['tweets-questions'] = $q_mi;
// Most replied-to
$mrt_mi = new MenuItem("Most replied-to", "Tweets with most replies", $twitter_data_tpl);
$mrt_mi_ds = new Dataset("most_replied_to_tweets", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mrt_mi_ds->addHelp('userguide/listings/twitter/dashboard_tweets-mostreplies');
$mrt_mi->addDataset($mrt_mi_ds);
$menus['tweets-mostreplies'] = $mrt_mi;
// Most shared
$mstab = new MenuItem("Most retweeted", "Most retweeted tweets", $twitter_data_tpl);
$mstabds = new Dataset("most_retweeted", 'PostDAO', "getMostRetweetedPosts", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mstabds->addHelp('userguide/listings/twitter/dashboard_tweets-mostretweeted');
$mstab->addDataset($mstabds);
$menus["tweets-mostretweeted"] = $mstab;
if ($rt_plugin_active) {
// 'home timeline'
$tltab = new MenuItem("Timeline", "Your Timeline", $twitter_data_tpl);
$tltab2 = new Dataset("home_timeline", 'PostDAO', "getPostsByFriends", array($instance->network_user_id, $instance->network, 20, '#page_number#', !Session::isLoggedIn()), 'getPostsByFriendsIterator', array($instance->network_user_id, 'twitter', GridController::getMaxRows()));
$tltab->addDataset($tltab2);
$menus["home-timeline"] = $tltab;
}
// Conversations
$convotab = new MenuItem("Conversations", "Exchanges between you and other users", $twitter_data_tpl);
$convotabds = new Dataset("author_replies", 'PostDAO', "getPostsAuthorHasRepliedTo", array($instance->network_user_id, 15, 'twitter', '#page_number#', !Session::isLoggedIn()));
$convotabds->addHelp('userguide/listings/twitter/dashboard_tweets-convo');
$convotab->addDataset($convotabds);
$menus["tweets-convo"] = $convotab;
$fvalltab = new MenuItem("Favorites", "All your favorites", $twitter_data_tpl);
$fvalltabds = new Dataset("all_tweets", 'FavoritePostDAO', "getAllFavoritePosts", array($instance->network_user_id, 'twitter', 20, "#page_number#", !Session::isLoggedIn()), 'getAllFavoritePostsIterator', array($instance->network_user_id, 'twitter', GridController::getMaxRows()));
$fvalltabds->addHelp('userguide/listings/twitter/dashboard_ftweets-all');
$fvalltab->addDataset($fvalltabds);
$menus["ftweets-all"] = $fvalltab;
//Most Active Friends
$motab = new MenuItem('Chatterboxes', 'People you follow who tweet the most', $twitter_data_tpl, 'Who You Follow');
$motabds = new Dataset('people', 'FollowDAO', "getMostActiveFollowees", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$motabds->addHelp('userguide/listings/twitter/dashboard_friends-mostactive');
$motab->addDataset($motabds);
$menus["friends-mostactive"] = $motab;
//Least Active Friends
$latab = new MenuItem('Deadbeats', 'People you follow who tweet the least', $twitter_data_tpl);
$latabds = new Dataset("people", 'FollowDAO', "getLeastActiveFollowees", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$latabds->addHelp('userguide/listings/twitter/dashboard_friends-leastactive');
$latab->addDataset($latabds);
$menus["friends-leastactive"] = $latab;
//Popular friends
$poptab = new MenuItem('Popular', 'Most-followed people you follow', $twitter_data_tpl);
$poptabds = new Dataset("people", 'FollowDAO', "getMostFollowedFollowees", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$poptabds->addHelp('userguide/listings/twitter/dashboard_followers-mostfollowed');
$poptab->addDataset($poptabds);
$menus["friends-mostfollowed"] = $poptab;
//Least likely/Most Discerning
$lltab = new MenuItem("Discerning", 'Followers with the greatest follower-to-friend ratio', $twitter_data_tpl, 'Followers');
$lltabds = new Dataset("people", 'FollowDAO', "getLeastLikelyFollowers", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$lltabds->addHelp('userguide/listings/twitter/dashboard_followers-leastlikely');
$lltab->addDataset($lltabds);
$menus["followers-leastlikely"] = $lltab;
//Most followed
$mftab = new MenuItem('Popular', 'Followers with the most followers', $twitter_data_tpl);
$mftabds = new Dataset("people", 'FollowDAO', "getMostFollowedFollowers", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mftabds->addHelp('userguide/listings/twitter/dashboard_followers-mostfollowed');
$mftab->addDataset($mftabds);
$menus["followers-mostfollowed"] = $mftab;
//Follower count history
$follower_history_tpl = Utils::getPluginViewDirectory('twitter') . 'twitter.followercount.tpl';
$trendtab = new MenuItem('Count history', 'Your follower count over time', $follower_history_tpl);
$trendtabds = new Dataset("follower_count_history_by_day", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'DAY', 15));
$trendtab->addDataset($trendtabds);
$trendtabweekds = new Dataset("follower_count_history_by_week", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'WEEK', 15));
$trendtab->addDataset($trendtabweekds);
$trendtabmonthds = new Dataset("follower_count_history_by_month", 'FollowerCountDAO', 'getHistory', array($instance->network_user_id, 'twitter', 'MONTH', 11));
$trendtabmonthds->addHelp('userguide/listings/twitter/dashboard_followers-history');
$trendtab->addDataset($trendtabmonthds);
$menus['followers-history'] = $trendtab;
if ($rt_plugin_active) {
$fvdtab = new MenuItem("Favorited by Others", "Favorited by Others", $twitter_data_tpl);
$ftab2 = new Dataset("all_favd", 'FavoritePostDAO', "getAllFavoritedPosts", array($instance->network_user_id, $instance->network, 20, '#page_number#'));
$fvdtab->addDataset($ftab2);
$menus["favd-all"] = $fvdtab;
}
//.........这里部分代码省略.........