示例#1
0
 public function pre_menu()
 {
     if (self::is_plugin_enabled()) {
         if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
             $this->links[] = array("name" => "Social", "p" => "social_settings", "args" => array('social_id' => false), 'holder_module' => 'config', 'holder_module_page' => 'config_admin', 'menu_include_parent' => 0);
         }
         if ($this->can_i('view', 'Social') && class_exists('ucm_twitter', false) && class_exists('ucm_facebook', false)) {
             $twitter = new ucm_twitter();
             $facebook = new ucm_facebook();
             $unread = $facebook->get_unread_count() + $twitter->get_unread_count();
             $this->links['social'] = array("name" => _l('Social') . ($unread > 0 ? " <span class='menu_label'>" . $unread . "</span>" : ''), "p" => "social_admin", 'icon_name' => 'comment-o');
         }
     }
 }
示例#2
0
 public function pre_menu()
 {
     if (module_social::is_plugin_enabled() && self::is_plugin_enabled()) {
         if (module_security::has_feature_access(array('name' => 'Settings', 'module' => 'config', 'category' => 'Config', 'view' => 1, 'description' => 'view'))) {
             $this->links[] = array("name" => "Twitter", "p" => "twitter_settings", "args" => array('social_twitter_id' => false), 'holder_module' => 'social', 'holder_module_page' => 'social_settings', 'menu_include_parent' => 1);
         }
         global $load_modules;
         if (module_social::can_i('view', 'Twitter', 'Social', 'social') && $load_modules && $load_modules[0] == 'social') {
             $accounts = self::get_accounts();
             $twitter = new ucm_twitter();
             foreach ($accounts as $account) {
                 $twitter_account = new ucm_twitter_account($account['social_twitter_id']);
                 $unread = $twitter->get_unread_count(array('social_twitter_id' => $account['social_twitter_id']));
                 $this->links[] = array("name" => $twitter_account->get('account_name') . ($unread > 0 ? " <span class='menu_label'>" . $unread . "</span>" : ''), "p" => "social_twitter_list", "args" => array('social_twitter_id' => $account['social_twitter_id'], 'social_facebook_id' => false), 'holder_module' => 'social', 'holder_module_page' => 'social_admin', 'menu_include_parent' => 0, 'current' => isset($_REQUEST['social_twitter_id']) && $_REQUEST['social_twitter_id'] == $account['social_twitter_id'], 'allow_nesting' => 0);
             }
         }
     }
 }