Example #1
0
 /**
  * Registers the menus used by Revisr.
  * @access public
  */
 public function menus()
 {
     $cap = Revisr::get_capability();
     $icon_svg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOC4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjI0NS44IDM4MS4xIDgxLjkgODkuNSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAyNDUuOCAzODEuMSA4MS45IDg5LjUiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTI5NS4yLDM4Ny4yYy01LjEsNS4xLTUuMSwxMy4zLDAsMTguM2MzLjgsMy44LDkuMyw0LjcsMTMuOSwyLjlsNy4yLTcuMmMxLjgtNC43LDAuOS0xMC4yLTIuOS0xMy45DQoJQzMwOC41LDM4Mi4xLDMwMC4zLDM4Mi4xLDI5NS4yLDM4Ny4yeiBNMzA5LjcsNDAxLjZjLTIuOSwyLjktNy42LDIuOS0xMC42LDBjLTIuOS0yLjktMi45LTcuNiwwLTEwLjZjMi45LTIuOSw3LjYtMi45LDEwLjYsMA0KCUMzMTIuNiwzOTQsMzEyLjYsMzk4LjcsMzA5LjcsNDAxLjZ6Ii8+DQo8cGF0aCBmaWxsPSIjZmZmIiBkPSJNMjY4LjEsNDU0Yy0xMy4yLTEwLjEtMTYuMS0yOS02LjQtNDIuNmM0LTUuNiw5LjQtOS40LDE1LjQtMTEuNGwtMi0xMC4yYy04LjUsMi41LTE2LjIsNy43LTIxLjcsMTUuNQ0KCWMtMTIuOSwxOC4yLTguOSw0My41LDguOCw1N2wtNS42LDguM2wyNS45LTEuMmwtOC42LTIzLjZMMjY4LjEsNDU0eiIvPg0KPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTMxOC4zLDQwMy4zYzEuMS0yLjEsMS43LTQuNSwxLjctN2MwLTguNC02LjgtMTUuMi0xNS4yLTE1LjJzLTE1LjIsNi44LTE1LjIsMTUuMnM2LjgsMTUuMiwxNS4yLDE1LjINCgljMi4xLDAsNC4xLTAuNCw1LjktMS4yYzguNCwxMC42LDkuMiwyNS44LDEsMzcuMmMtMy45LDUuNi05LjQsOS40LTE1LjQsMTEuNGwyLDEwLjJjOC41LTIuNSwxNi4yLTcuNywyMS43LTE1LjUNCglDMzMxLjIsNDM4LjEsMzI5LjksNDE3LjQsMzE4LjMsNDAzLjN6IE0zMDQuOCw0MDMuM2MtMy44LDAtNi45LTMuMS02LjktNi45czMuMS02LjksNi45LTYuOXM2LjksMy4xLDYuOSw2LjkNCglTMzA4LjcsNDAzLjMsMzA0LjgsNDAzLjN6Ii8+DQo8L3N2Zz4=';
     if (!Revisr_Admin::is_doing_setup()) {
         $this->page_hooks['menu'] = add_menu_page(__('Dashboard', 'revisr'), __('Revisr', 'revisr'), $cap, 'revisr', array($this, 'include_page'), $icon_svg);
         $this->page_hooks['dashboard'] = add_submenu_page('revisr', __('Revisr - Dashboard', 'revisr'), __('Dashboard', 'revisr'), $cap, 'revisr', array($this, 'include_page'));
         $this->page_hooks['commits'] = add_submenu_page('revisr', __('Revisr - Commits', 'revisr'), __('Commits', 'revisr'), $cap, 'revisr_commits', array($this, 'include_page'));
         $this->page_hooks['new_commit'] = add_submenu_page(NULL, __('Revisr - New Commit', 'revisr'), __('New Commit', 'revisr'), $cap, 'revisr_new_commit', array($this, 'include_page'));
         $this->page_hooks['view_commit'] = add_submenu_page(NULL, __('Revisr - View Commit', 'revisr'), __('View Commit', 'revisr'), $cap, 'revisr_view_commit', array($this, 'include_page'));
         $this->page_hooks['branches'] = add_submenu_page('revisr', __('Revisr - Branches', 'revisr'), __('Branches', 'revisr'), $cap, 'revisr_branches', array($this, 'include_page'));
         $this->page_hooks['settings'] = add_submenu_page('revisr', __('Revisr - Settings', 'revisr'), __('Settings', 'revisr'), $cap, 'revisr_settings', array($this, 'include_page'));
         $this->page_hooks['setup'] = add_submenu_page(NULL, __('Revisr - Setup', 'revisr'), 'Revisr', $cap, 'revisr_setup', array($this, 'include_page'));
     } else {
         $this->page_hooks['setup'] = add_menu_page(__('Revisr Setup', 'revisr'), __('Revisr', 'revisr'), $cap, 'revisr_setup', array($this, 'include_page'), $icon_svg);
         $this->page_hooks['dashboard'] = add_submenu_page(null, __('Revisr - Dashboard', 'revisr'), __('Dashboard', 'revisr'), $cap, 'revisr', array($this, 'include_page'));
         $this->page_hooks['branches'] = add_submenu_page(NULL, __('Revisr - Branches', 'revisr'), __('Branches', 'revisr'), $cap, 'revisr_branches', array($this, 'include_page'));
         $this->page_hooks['settings'] = add_submenu_page(NULL, __('Revisr - Settings', 'revisr'), __('Settings', 'revisr'), $cap, 'revisr_settings', array($this, 'include_page'));
     }
 }
Example #2
0
 /**
  * Downloads the system info.
  * @access public
  */
 public function download_sysinfo()
 {
     Revisr_Admin::verify_nonce($_REQUEST['revisr_info_nonce'], 'process_download_sysinfo');
     if (!current_user_can(Revisr::get_capability())) {
         return;
     }
     nocache_headers();
     header('Content-Type: text/plain');
     header('Content-Disposition: attachment; filename="revisr-system-info.txt"');
     echo wp_strip_all_tags($_POST['revisr-sysinfo']);
     die;
 }