Пример #1
0
 public function getMainOptionsHtml()
 {
     if (!isset($this->optModel)) {
         $this->assign('optModel', $this->getModel());
     }
     return parent::getContent('mainOptionsHtml');
 }
Пример #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;
 }
Пример #3
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;
 }
Пример #4
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);
 }
Пример #5
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');
 }
Пример #6
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');
         }
     }
 }
Пример #7
0
 public function getMainOptionsTab()
 {
     if (!isset($this->optModel)) {
         $this->assign('optModel', $this->getModel());
     }
     $backupPlaces = dispatcherBup::applyFilters('getBackupDestination', array());
     // sorting $backupPlaces by $backupPlaces['sortNum']
     $sort = array();
     foreach ($backupPlaces as $key => $row) {
         $sort[$key] = $row['sortNum'];
     }
     array_multisort($sort, SORT_ASC, $backupPlaces);
     $backupDest = frameBup::_()->getModule('options')->get('glb_dest');
     $zipNotExtMsg = frameBup::_()->getModule('backup')->getController()->checkExtensions();
     $zipExtExist = $zipNotExtMsg !== true ? 'disabled' : true;
     $this->assign('zipExtExist', $zipExtExist);
     $this->assign('zipNotExtMsg', $zipNotExtMsg);
     $this->assign('backupPlaces', $backupPlaces);
     $this->assign('backupDest', $backupDest);
     $this->assign('backupOptions', parent::getContent('backupOptions'));
     return parent::getContent('mainOptionsTab');
 }
Пример #8
0
 public function getAdminOptions()
 {
     frameBup::_()->addScript('adminScheduleOptions', $this->getModule()->getModPath() . 'js/admin.schedule.js');
     return parent::getContent('schedulePage');
 }