Example #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');
         }
     }
 }
Example #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);
             }
         }
     }
 }
Example #3
0
    public function reply_box($level = 0, $message_from = array())
    {
        if ($this->twitter_account && $this->social_twitter_message_id && (int) $this->get('social_twitter_id') > 0 && $this->get('social_twitter_id') == $this->twitter_account->get('social_twitter_id')) {
            // who are we replying to?
            $account_data = @json_decode($this->twitter_account->get('twitter_data'), true);
            ?>
			<div class="twitter_comment twitter_comment_reply_box twitter_comment_reply_box_level<?php 
            echo $level;
            ?>
">
				<div class="twitter_comment_picture">
					<?php 
            if ($account_data && isset($account_data['id_str'])) {
                $pic = array('screen_name' => isset($account_data['screen_name']) ? $account_data['screen_name'] : '', 'image' => isset($account_data['profile_image_url_https']) ? $account_data['profile_image_url_https'] : '');
            } else {
                $pic = false;
            }
            if ($pic) {
                ?>
						<img src="<?php 
                echo $pic['image'];
                ?>
">
						<?php 
            }
            ?>
				</div>
				<div class="twitter_comment_header">
					<?php 
            echo ucm_twitter::format_person($account_data);
            ?>
				</div>
				<div class="twitter_comment_reply">
					<textarea placeholder="Write a reply..." class="twitter_compose_message"><?php 
            if ($message_from && isset($message_from['screen_name']) && $this->get('type') != _TWITTER_MESSAGE_TYPE_DIRECT) {
                echo '@' . htmlspecialchars($message_from['screen_name']) . ' ';
            }
            ?>
</textarea>
					<button data-id="<?php 
            echo (int) $this->social_twitter_message_id;
            ?>
" data-account-id="<?php 
            echo (int) $this->get('social_twitter_id');
            ?>
"><?php 
            _e('Send');
            ?>
</button>
					<div style="clear:both;">
				    <span class="twitter_characters_remain"><span>140</span> characters remaining.</span>
					<br/>
					(debug) <input type="checkbox" name="debug" class="reply-debug" value="1">
						</div>
				</div>
				<div class="twitter_comment_actions"></div>
			</div>
		<?php 
        } else {
            ?>
			<div class="twitter_comment twitter_comment_reply_box">
				(incorrect settings, please report this bug)
			</div>
			<?php 
        }
    }