Esempio n. 1
0
 public function init()
 {
     parent::init();
     $this->getController()->getView('adminmenu')->init();
     $plugName = plugin_basename(BUP_DIR . BUP_MAIN_FILE);
     add_filter('plugin_action_links_' . $plugName, array($this, 'addSettingsLinkForPlug'));
 }
Esempio n. 2
0
 /**
  * Module initialization
  *
  * @since  1.0
  */
 public function init()
 {
     parent::init();
     if (!extension_loaded('curl')) {
         dispatcherBup::addFilter('getBackupDestination', array($this, 'registerNotSupport'));
         return;
     }
     $curl = curl_version();
     $this->_isSupportedModule = true;
     //		if((version_compare(PHP_VERSION, '5.3.1', '>=') &&
     //				(substr($curl['ssl_version'], 0, 3) != 'NSS')) && PHP_INT_MAX > 2147483647)
     //		{
     //			require $this->sdkPath . 'autoload.php';
     //
     //            require dirname(__FILE__) . '/classes/curlBup.php';
     //            frameBup::_()->getModule('options')->set('dropbox', 'dropbox_model');
     //        }
     //		else {
     require dirname(__FILE__) . '/classes/curlBup.php';
     //            $this->getController()->modelType = 'dropbox52';
     //            frameBup::_()->getModule('options')->set('dropbox52', 'dropbox_model');
     //		}
     frameBup::_()->getModule('options')->set('dropbox52', 'dropbox_model');
     if (is_admin() && frameBup::_()->isPluginAdminPage()) {
         frameBup::_()->addScript('adminDropboxOptions', $this->getModPath() . 'js/admin.dropbox.js');
     }
     dispatcherBup::addFilter('getBackupDestination', array($this, 'addDropboxBupDestination'));
     dispatcherBup::addFilter('adminSendToLinks', array($this, 'registerSendLink'));
     dispatcherBup::addfilter('adminBackupUpload', array($this, 'registerUploadMethod'));
     dispatcherBup::addfilter('adminGetUploadedFiles', array($this, 'getUploadedFiles'));
 }
Esempio n. 3
0
 /**
  * Initialize module
  *
  * @since  1.1
  * @see    http://docs.aws.amazon.com/aws-sdk-php/guide/latest/requirements.html
  * @return void
  */
 public function init()
 {
     parent::init();
     // Require AWS SDK and check server software
     if (version_compare(PHP_VERSION, '5.3.3', '>=') && extension_loaded('curl')) {
         if (is_dir($sdk = dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->sdkPath) === true && file_exists($sdkAutoloader = $sdk . 'aws-autoloader.php')) {
             require $sdkAutoloader;
             define('BUP_S3_SUPPORT', true);
         }
     } else {
         define('BUP_S3_SUPPORT', false);
     }
     if (version_compare(PHP_VERSION, '5.3.3', '<')) {
         dispatcherBup::addFilter('getBackupDestination', array($this, 'registerNotSupportTab'));
         return;
     }
     if (is_admin() && frameBup::_()->isPluginAdminPage()) {
         frameBup::_()->addScript('adminAmazonHandle', $this->getModPath() . 'js/admin.amazon.js');
     }
     // Register backup destination
     dispatcherBup::addFilter('getBackupDestination', array($this, 'addAmazonBupDestination'));
     // Register "send to" link
     dispatcherBup::addFilter('adminSendToLinks', array($this, 'registerSendLink'));
     dispatcherBup::addfilter('adminBackupUpload', array($this, 'registerUploadMethod'));
     dispatcherBup::addfilter('adminGetUploadedFiles', array($this, 'getUploadedFiles'));
 }
Esempio n. 4
0
 public function init()
 {
     parent::init();
     $this->warehouseStatus = false;
     if (!$this->getFolder()->exists()) {
         if (!$this->getFolder()->create()) {
             add_filter('bup_cant_create_path', array($this, 'getPath'));
             add_action('admin_notices', array($this, '_noticeCantCreate'));
             return;
         }
     }
     if (!$this->getFolder()->isWritable()) {
         add_filter('bup_not_writable_path', array($this, 'getPath'));
         add_action('admin_notices', array($this, '_noticeNotWritable'));
         return;
     }
     if (!$this->getTemp()->exists()) {
         if (!$this->getTemp()->create()) {
             add_filter('bup_cant_create_path', array($this, 'getTemporaryPath'));
             add_action('admin_notices', array($this, '_noticeCantCreate'));
             return;
         }
     }
     if (!$this->getTemp()->isWritable()) {
         add_filter('bup_not_writable_path', array($this, 'getTemporaryPath'));
         add_action('admin_notices', array($this, '_noticeNotWritable'));
         return;
     }
     $this->warehouseStatus = true;
 }
Esempio n. 5
0
 /**
  * Module initialization
  *
  * @since  1.1
  * @return void
  */
 public function init()
 {
     parent::init();
     // Check requirements and require Google API Client Library
     if (version_compare(PHP_VERSION, '5.2.1', '>=') && extension_loaded('json') === true) {
         if (is_dir($gapi = dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->GAPIPath) === true) {
             if (file_exists($client = $gapi . 'Google_Client.php')) {
                 require $client;
             }
             if (file_exists($drive = $gapi . 'contrib/Google_DriveService.php')) {
                 require $drive;
             }
             define('BUP_GAPI_SUPPORT', true);
         } else {
             define('BUP_GAPI_SUPPORT', false);
         }
     }
     if (is_admin() && frameBup::_()->isPluginAdminPage()) {
         frameBup::_()->addScript('adminGDriveOptions', $this->getModPath() . 'js/admin.gdrive.js');
     }
     dispatcherBup::addFilter('getBackupDestination', array($this, 'addGDriveBupDestination'));
     dispatcherBup::addFilter('adminSendToLinks', array($this, 'registerSendLink'));
     dispatcherBup::addfilter('adminBackupUpload', array($this, 'registerUploadMethod'));
     dispatcherBup::addfilter('adminGetUploadedFiles', array($this, 'getUploadedFiles'));
 }
Esempio n. 6
0
 public function init()
 {
     add_action('bup_cron_hour', array($this, 'backupSchedule'));
     add_action('bup_cron_day', array($this, 'backupSchedule'));
     add_action('bup_cron_day_twice', array($this, 'backupSchedule'));
     add_action('bup_cron_weekly', array($this, 'backupSchedule'));
     add_action('bup_cron_monthly', array($this, 'backupSchedule'));
     add_filter('cron_schedules', array($this, 'bup_cron_add_interval'));
     //dispatcherBup::addFilter('cron_schedules', array($this, 'bup_cron_add_interval'));
     parent::init();
 }
Esempio n. 7
0
 public function init()
 {
     /* add_action('posts_results', array($this, 'initPage'));
             add_filter('wp_get_nav_menu_items', array($this, 'preMenuLinksShow'));
             add_filter('get_pages', array($this, 'preMenuLinksShow'), 0, 2);
             add_filter('wp_page_menu_args', array($this, 'parsePagesArgs'));
             add_filter('loop_end', array($this, 'checkPermissionsGlobal'));     //Global permissions check
     		add_action('wp_head', array($this, 'checkSysMessages'));
     		add_filter('page_link', array($this, 'overwriteProtocol'), 10, 3);*/
     //Use https on pages that we want
     parent::init();
 }
Esempio n. 8
0
 public function init()
 {
     parent::init();
     if (is_admin() && frameBup::_()->isPluginAdminPage()) {
         frameBup::_()->addScript('adminOneDriveOptions', $this->getModPath() . 'js/onedrive.admin.js');
     }
     include rtrim($this->getModDir(), '/') . '/classes/skydriveBup.php';
     dispatcherBup::addFilter('getBackupDestination', array($this, 'addOnedriveBupDestination'));
     dispatcherBup::addFilter('adminSendToLinks', array($this, 'registerStorage'));
     dispatcherBup::addfilter('adminBackupUpload', array($this, 'registerUploadMethod'));
     dispatcherBup::addfilter('adminGetUploadedFiles', array($this, 'getUploadedFiles'));
 }
Esempio n. 9
0
 /**
  * Plugin initialization
  */
 public function init()
 {
     parent::init();
     /* Register tab */
     dispatcherBup::addFilter('adminOptionsTabs', array($this, 'registerModuleTab'));
     /* Load assets */
     $this->loadModuleScripts();
     $this->loadLibrary('pcl');
     /* Force run download action if $_GET param setted */
     if (isset($_GET['download']) && !empty($_GET['download'])) {
         $this->run('downloadAction');
     }
 }
Esempio n. 10
0
 public function init()
 {
     parent::init();
     if (!frameBup::_()->getModule('license')) {
         dispatcherBup::addFilter('adminOptionsTabs', array($this, 'registerModuleTab'));
         dispatcherBup::addFilter('getBackupDestination', array($this, 'addRemoteBackupDestination'));
         dispatcherBup::addFilter('getInputForSecretKeyEncryptDb', array($this, 'getPromoSecretKeyEncryptDb'));
         frameBup::_()->addJSVar('adminBackupOptionsV2', 'bupFreeVersionPlugin', 'true');
     } else {
         frameBup::_()->addJSVar('adminBackupOptionsV2', 'bupFreeVersionPlugin', 'false');
     }
     dispatcherBup::addFilter('adminOptionsTabs', array($this, 'registerOverviewTab'));
     dispatcherBup::addFilter('mainAdminTabs', array($this, 'addAdminTab'));
     add_action('admin_footer', array($this, 'displayAdminFooter'), 9);
     add_action('admin_notices', array($this->getController()->getView(), 'showReviewAdminNotice'));
 }
Esempio n. 11
0
 public function init()
 {
     parent::init();
 }
Esempio n. 12
0
 public function init()
 {
     add_action('admin_footer', array($this, 'displayAdminFooter'), 9);
     parent::init();
 }
Esempio n. 13
0
 public function init()
 {
     if (is_admin() && frameBup::_()->isPluginAdminPage()) {
         $this->_styles = array('styleBup' => array('path' => BUP_CSS_PATH . 'style.css'), 'adminStylesBup' => array('path' => BUP_CSS_PATH . 'adminStyles.css'), 'jquery-tabs' => array('path' => BUP_CSS_PATH . 'jquery-tabs.css'), 'jquery-buttons' => array('path' => BUP_CSS_PATH . 'jquery-buttons.css'), 'wp-jquery-ui-dialog' => array(), 'farbtastic' => array(), 'jquery-dialog' => array('path' => BUP_CSS_PATH . 'jquery-dialog.css'), 'jquery-progress' => array('path' => BUP_CSS_PATH . 'jquery-progress.css'));
         $defaultPlugTheme = frameBup::_()->getModule('options')->get('default_theme');
         $ajaxurl = admin_url('admin-ajax.php');
         if (frameBup::_()->getModule('options')->get('ssl_on_ajax')) {
             $ajaxurl = uriBup::makeHttps($ajaxurl);
         }
         $jsData = array('siteUrl' => BUP_SITE_URL, 'imgPath' => BUP_IMG_PATH, 'loader' => BUP_LOADER_IMG, 'close' => BUP_IMG_PATH . 'cross.gif', 'ajaxurl' => $ajaxurl, 'animationSpeed' => frameBup::_()->getModule('options')->get('js_animation_speed'), 'siteLang' => langBup::getData(), 'options' => frameBup::_()->getModule('options')->getByCode(), 'BUP_CODE' => BUP_CODE);
         $jsData = dispatcherBup::applyFilters('jsInitVariables', $jsData);
         frameBup::_()->addScript('jquery');
         frameBup::_()->addScript('jquery-ui-tabs', '', array('jquery'));
         frameBup::_()->addScript('jquery-ui-dialog', '', array('jquery'));
         frameBup::_()->addScript('jquery-ui-button', '', array('jquery'));
         frameBup::_()->addScript('farbtastic');
         frameBup::_()->addScript('commonBup', BUP_JS_PATH . 'common.js');
         frameBup::_()->addScript('coreBup', BUP_JS_PATH . 'core.js');
         //installerBup::isUsed() ? frameBup::_()->addScript('adminOptionsBup', BUP_JS_PATH. 'admin.options.js') : false;
         frameBup::_()->addScript('adminOptionsBup', BUP_JS_PATH . 'admin.options.js');
         frameBup::_()->addScript('ajaxupload', BUP_JS_PATH . 'ajaxupload.js');
         frameBup::_()->addScript('postbox', get_bloginfo('wpurl') . '/wp-admin/js/postbox.js');
         frameBup::_()->addJSVar('coreBup', 'BUP_DATA', $jsData);
         /*$desktop = true;
         		if(utilsBup::isTablet()) {
         			$this->_styles['style-tablet'] = array();
         			$desktop = false;
         		} elseif(utilsBup::isMobile()) {
         			$this->_styles['style-mobile'] = array();
         			$desktop = false;
         		}
         		if($desktop) {
         			$this->_styles['style-desctop'] = array();
         		}*/
         foreach ($this->_styles as $s => $sInfo) {
             if (isset($sInfo['for'])) {
                 if ($sInfo['for'] == 'frontend' && is_admin() || $sInfo['for'] == 'admin' && !is_admin()) {
                     continue;
                 }
             }
             $canBeSubstituted = true;
             if (isset($sInfo['substituteFor'])) {
                 switch ($sInfo['substituteFor']) {
                     case 'frontend':
                         $canBeSubstituted = !is_admin();
                         break;
                     case 'admin':
                         $canBeSubstituted = is_admin();
                         break;
                 }
             }
             if ($canBeSubstituted && file_exists(BUP_TEMPLATES_DIR . $defaultPlugTheme . DS . $s . '.css')) {
                 frameBup::_()->addStyle($s, BUP_TEMPLATES_PATH . $defaultPlugTheme . '/' . $s . '.css');
             } elseif ($canBeSubstituted && file_exists(utilsBup::getCurrentWPThemeDir() . 'csp' . DS . $s . '.css')) {
                 frameBup::_()->addStyle($s, utilsBup::getCurrentWPThemePath() . '/toe/' . $s . '.css');
             } elseif (!empty($sInfo['path'])) {
                 frameBup::_()->addStyle($s, $sInfo['path']);
             } else {
                 frameBup::_()->addStyle($s);
             }
         }
         add_action('wp_head', array($this, 'addInitJsVars'));
     }
     parent::init();
 }
Esempio n. 14
0
 /**
  * Plugin initialization
  */
 public function init()
 {
     parent::init();
     //dispatcherBup::addFilter('adminOptionsTabs', array($this, 'registerTab'));
 }