Esempio n. 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');
         }
     }
 }
Esempio n. 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" => "Facebook", "p" => "facebook_settings", "args" => array('social_facebook_id' => false), 'holder_module' => 'social', 'holder_module_page' => 'social_settings', 'menu_include_parent' => 1);
         }
         global $load_modules;
         if (module_social::can_i('view', 'Facebook', 'Social', 'social') && $load_modules && $load_modules[0] == 'social') {
             $accounts = self::get_accounts();
             $facebook = new ucm_facebook();
             foreach ($accounts as $account) {
                 $facebook_account = new ucm_facebook_account($account['social_facebook_id']);
                 $unread = $facebook->get_unread_count(array('social_facebook_id' => $account['social_facebook_id']));
                 $this->links[] = array("name" => $facebook_account->get('facebook_name') . ($unread > 0 ? " <span class='menu_label'>" . $unread . "</span>" : ''), "p" => "social_facebook_list", "args" => array('social_facebook_id' => $account['social_facebook_id'], 'social_twitter_id' => false), 'holder_module' => 'social', 'holder_module_page' => 'social_admin', 'menu_include_parent' => 0, 'current' => isset($_REQUEST['social_facebook_id']) && $_REQUEST['social_facebook_id'] == $account['social_facebook_id'], 'allow_nesting' => 0);
             }
         }
     }
 }