Beispiel #1
0
 public function init()
 {
     $this->_file = 'ready-backup-and-restore';
     //$this->_options = dispatcherBup::applyFilters('adminMenuOptions', $this->_options);
     add_action('admin_menu', array($this, 'initMenu'), 9);
     parent::init();
 }
Beispiel #2
0
 public function getAdminOptionsLimit($d = array())
 {
     // deprecate
     frameBup::_()->addScript('adminScheduleOptions', $this->getModule()->getModPath() . 'js/admin.storage.js');
     $storage = array();
     //$arrStorage = $this->getModel()->getStorage();
     $arrStorage = $this->getModel()->getList_A($d);
     $storageBlock = array();
     $sendTplData = array();
     $i = 0;
     $ret = array();
     foreach ($arrStorage as $key => $el) {
         $i++;
         $title = frameBup::_()->getModule('backup')->getModel()->fileNameFormat(current($el), 'title');
         $type = frameBup::_()->getModule('backup')->getModel()->fileNameFormat(current($el), 'prefix');
         $header = $type == 'full' ? '<strong>Full backup</strong> ' . $title : $title;
         $sendTplData = array($key, $header, $el);
         $this->assign('storageData', $sendTplData);
         $storageBlock['id'] = $key;
         $storageBlock['bupbackupblock'] = parent::getContent('storageBlock');
         array_push($ret, array('id' => $key, 'bupbackupblock' => parent::getContent('storageBlock')));
     }
     //$this->assign('storageBlock', $storageBlock);
     return $ret;
 }
Beispiel #3
0
 public function displayDeactivatePage()
 {
     $this->assign('GET', reqBup::get('get'));
     $this->assign('POST', reqBup::get('post'));
     $this->assign('REQUEST_METHOD', strtoupper(reqBup::getVar('REQUEST_METHOD', 'server')));
     $this->assign('REQUEST_URI', basename(reqBup::getVar('REQUEST_URI', 'server')));
     parent::display('deactivatePage');
 }
Beispiel #4
0
 public function getBlockLogBup($key, $files)
 {
     $sendTplData = array();
     $title = $this->getModel()->getDateLog($key);
     $header = 'Backup log ' . $title;
     $sendTplData = array($key, $header, $files);
     $this->assign('logData', $sendTplData);
     $ret = parent::getContent('logBlock');
     return $ret;
 }
Beispiel #5
0
 /**
  * Get the content for templates module tab
  * 
  * @return type 
  */
 public function getTabContent()
 {
     $templates = frameBup::_()->getModule('templatesBup')->getModel()->get();
     if (empty($templates)) {
         $tpl = 'noTemplates';
     } else {
         $this->assign('templatesBup', $templates);
         $this->assign('default_theme', frameBup::_()->getModule('optionsBup')->getModel()->get('default_theme'));
         $tpl = 'templatesTab';
     }
     return parent::getContent($tpl);
 }
Beispiel #6
0
 public function getComingSoonPageHtml()
 {
     $this->_beforeShow();
     $this->assign('msgTitle', frameBup::_()->getModule('options')->get('msg_title'));
     $this->assign('msgTitleColor', frameBup::_()->getModule('options')->get('msg_title_color'));
     $this->assign('msgTitleFont', frameBup::_()->getModule('options')->get('msg_title_font'));
     $msgTitleStyle = array();
     if (!empty($this->msgTitleColor)) {
         $msgTitleStyle['color'] = $this->msgTitleColor;
     }
     if (!empty($this->msgTitleFont)) {
         $msgTitleStyle['font-family'] = $this->msgTitleFont;
         $this->_styles[] = 'http://fonts.googleapis.com/css?family=' . $this->msgTitleFont . '&subset=latin,cyrillic-ext';
     }
     $this->assign('msgTitleStyle', utilsBup::arrToCss($msgTitleStyle));
     $this->assign('msgText', frameBup::_()->getModule('options')->get('msg_text'));
     $this->assign('msgTextColor', frameBup::_()->getModule('options')->get('msg_text_color'));
     $this->assign('msgTextFont', frameBup::_()->getModule('options')->get('msg_text_font'));
     $msgTextStyle = array();
     if (!empty($this->msgTextColor)) {
         $msgTextStyle['color'] = $this->msgTextColor;
     }
     if (!empty($this->msgTextFont)) {
         $msgTextStyle['font-family'] = $this->msgTextFont;
         if ($this->msgTitleFont != $this->msgTextFont) {
             $this->_styles[] = 'http://fonts.googleapis.com/css?family=' . $this->msgTextFont . '&subset=latin,cyrillic-ext';
         }
     }
     $this->assign('msgTextStyle', utilsBup::arrToCss($msgTextStyle));
     if ($this->_useSubscribeForm && frameBup::_()->getModule('options')->get('sub_enable')) {
         $this->_scripts[] = frameBup::_()->getModule('subscribe')->getModPath() . 'js/frontend.subscribe.js';
         $this->assign('subscribeForm', frameBup::_()->getModule('subscribe')->getController()->getView()->getUserForm());
     }
     if ($this->_useSocIcons) {
         $this->assign('socIcons', frameBup::_()->getModule('social_icons')->getController()->getView()->getFrontendContent());
     }
     if (file_exists($this->getModule()->getModDir() . 'css/style.css')) {
         $this->_styles[] = $this->getModule()->getModPath() . 'css/style.css';
     }
     $this->assign('logoPath', $this->getModule()->getLogoImgPath());
     $this->assign('bgCssAttrs', dispatcherBup::applyFilters('tplBgCssAttrs', $this->getModule()->getBgCssAttrs()));
     $this->assign('styles', dispatcherBup::applyFilters('tplStyles', $this->_styles));
     $this->assign('scripts', dispatcherBup::applyFilters('tplScripts', $this->_scripts));
     $this->assign('initJsVars', dispatcherBup::applyFilters('tplInitJsVars', $this->initJsVars()));
     $this->assign('messages', frameBup::_()->getRes()->getMessages());
     $this->assign('errors', frameBup::_()->getRes()->getErrors());
     return parent::getContent($this->getCode() . 'BUPHtml');
 }
Beispiel #7
0
 public function showReviewAdminNotice()
 {
     if (is_admin() && frameBup::_()->isPluginAdminPage()) {
         $showReviewBlock = get_option('bupShowReviewBlockV2');
         // v2 because was v1 and it don't using now
         $bupShowReviewBlockTimestamp = get_option('bupShowReviewBlockTimestampV2');
         $sendStatAfterSevenDays = get_option('sendStatAfterSevenDays');
         if ($showReviewBlock === false) {
             add_option('bupShowReviewBlockV2', 'yes');
             add_option('sendStatAfterSevenDays', 'yes');
             add_option('bupShowReviewBlockTimestampV2', time());
         } elseif ($showReviewBlock === 'yes' && time() > $bupShowReviewBlockTimestamp + 86400 * 7) {
             if ($sendStatAfterSevenDays === 'yes') {
                 $this->getModel()->sendUsageStat(array('code' => 'seven_days_passed', 'visits' => 1));
                 update_option('sendStatAfterSevenDays', 'no');
             }
             echo parent::getContent('reviewNotice');
         }
     }
 }
Beispiel #8
0
 public function getAdminOptions()
 {
     frameBup::_()->addScript('adminScheduleOptions', $this->getModule()->getModPath() . 'js/admin.schedule.js');
     return parent::getContent('schedulePage');
 }
Beispiel #9
0
 public function showAdminSendStatNote()
 {
     parent::display('adminSendStatNote');
 }
Beispiel #10
0
 public function init()
 {
     $this->_file = BUP_PLUGIN_PAGE_URL_SUFFIX;
     add_action('admin_menu', array($this, 'initMenu'), 9);
     parent::init();
 }