예제 #1
0
 public function add_menu_bubble()
 {
     global $git;
     global $menu;
     if (!$git->is_versioned()) {
         foreach ($menu as $key => $value) {
             if ($this->menu_slug == $menu[$key][2]) {
                 $menu_bubble = get_transient('gitium_menu_bubble');
                 if (false === $menu_bubble) {
                     $menu_bubble = '';
                 }
                 $menu[$key][0] = str_replace($menu_bubble, '', $menu[$key][0]);
                 delete_transient('gitium_menu_bubble');
                 return;
             }
         }
     }
     list(, $changes) = _gitium_status();
     if (!empty($changes)) {
         $bubble_count = count($changes);
         foreach ($menu as $key => $value) {
             if ($this->menu_slug == $menu[$key][2]) {
                 $menu_bubble = " <span class='update-plugins count-{$bubble_count}'><span class='plugin-count'>" . $bubble_count . '</span></span>';
                 $menu[$key][0] .= $menu_bubble;
                 set_transient('gitium_menu_bubble', $menu_bubble);
                 return;
             }
         }
     }
 }
예제 #2
0
 function test_gitium_status()
 {
     global $git;
     // 1.add local change
     $this->_add_changes_locally('local', true);
     // 2.add remote changes and commit them(add two behind commits)
     $this->_add_changes_remotely('one', true);
     $this->_add_changes_remotely('two', true);
     $git->fetch_ref();
     // 3.test if the changes are visible in status call
     $status = _gitium_status();
     $this->assertStringEndsWith('[ahead 1, behind 2]', $status[0]);
 }
 public function page()
 {
     $this->show_message();
     _gitium_status(true);
     if (gitium_has_the_minimum_version()) {
         $this->changes_page();
     }
 }
 public function page()
 {
     $this->show_message();
     if (wp_content_is_versioned()) {
         return $this->setup_warning();
     }
     if (!$this->git->is_versioned() || !$this->git->get_remote_url()) {
         return $this->setup_step_1();
     }
     if (!$this->git->get_remote_tracking_branch()) {
         return $this->setup_step_2();
     }
     _gitium_status(true);
 }
예제 #5
0
 public function page()
 {
     $this->show_message();
     _gitium_status(true);
     $this->changes_page();
 }