File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/View.tar
Back
AjaxView.php 0000644 00000003036 15030415016 0006770 0 ustar 00 <?php /** ****************************************** * LiteSpeed Web Server Cache Manager * * @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com) * @copyright (c) 2018-2020 * ******************************************* */ namespace Lsc\Wp\View; use \Lsc\Wp\LSCMException; class AjaxView { /** * @var object */ private $viewModel; /** * @var string */ private $sharedTplDir = __DIR__; /** * * @param object $viewModel */ public function __construct( $viewModel ) { $this->viewModel = $viewModel; } /** * * @param string $tplID * @return string * @throws LSCMException Thrown directly and indirectly. */ public function getAjaxContent( $tplID = '' ) { ob_start(); try { $this->loadAjaxTpl($this->viewModel->getTpl($tplID)); } catch ( LSCMException $e ) { ob_clean(); throw $e; } return ob_get_clean(); } /** * * @param string $tplPath * @throws LSCMException */ private function loadAjaxTpl( $tplPath ) { $tplFile = basename($tplPath); $custTpl = "{$this->sharedTplDir}/Cust/{$tplFile}"; if ( file_exists($custTpl) ) { include $custTpl; } elseif ( file_exists($tplPath) ) { include $tplPath; } else { throw new LSCMException("Could not load ajax template {$tplPath}."); } } } Tpl/MassEnableDisable.tpl 0000644 00000005566 15030415016 0011331 0 ustar 00 <input type="hidden" name="act" /> <?php use \Lsc\Wp\View\Model\MassEnableDisableViewModel as ViewModel; $icon = $this->viewModel->getTplData(ViewModel::FLD_ICON); $activeVer = $this->viewModel->getTplData(ViewModel::FLD_ACTIVE_VER); $state = $this->viewModel->getTplData(ViewModel::FLD_STATE); $d = array( 'title' => 'Mass Enable/Disable LiteSpeed Cache', 'icon' => $icon ); $this->loadTplBlock('Title.tpl', $d); if ( $state == ViewModel::ST_INSTALLS_DISCOVERED ): ?> <p> The following operations will affect all WordPress installations not currently flagged. </p> <p> To exclude a WordPress installation from mass operations, flag it in <a href="?do=lscwp_manage" title="Go to Manage Cache Installations"> Manage Cache Installations </a> . </p> <br /> <fieldset class="mass-box"> <legend><b>Mass Enable</b></legend> <?php if ( $activeVer == false ): ?> <div> [Feature Disabled] No active LSCWP version set! Cannot Mass Enable. <br /><br /> </div> <?php else: ?> <div> LiteSpeed Cache will be enabled for all WordPress installations not currently flagged. For WordPress installations that do not already have the plugin, <b> LiteSpeed Cache for WordPress <?php echo htmlspecialchars($activeVer); ?> will be installed. </b> This can be changed anytime in the <a href="?do=lscwpVersionManager" title="Go to Version Manager">Version Manager</a>. <br /><br /> <button class="lsws-primary-btn" type="button" title="Mass Enable LiteSpeed Cache for all unflagged installations." onclick="javascript:actionset('enable');"> Start </button> </div> <?php endif; ?> </fieldset> <br /><br /> <fieldset class="mass-box"> <legend><b>Mass Disable</b></legend> <div> LiteSpeed Cache will be disabled for all WordPress installations not currently flagged. <br /><br /> <button class="lsws-primary-btn" type="button" title="Mass Disable LiteSpeed Cache for all unflagged installations." onclick="javascript:actionset('disable');"> Start </button> </div> </fieldset> <?php elseif ( $state == ViewModel::ST_NO_INSTALLS_DISCOVERED ): ?> <div> <p> No WordPress installations discovered in the previous scan. If you have any newly installed WordPress installations, please go to <a href="?do=lscwp_manage" title="Go to Manage Cache Installations"> Manage Cache Installations </a> and Re-scan/Discover New. </p> </div> <?php else: ?> <div> <p> Please go to <a href="?do=lscwp_manage" title="Go to Manage Cache Installations"> Manage Cache Installations </a> and click Scan to discover all active WordPress installations before attempting to Mass Enable/Disable Cache. </p> </div> <?php endif; $d = array( 'back' => 'Back' ); $this->loadTplBlock('ButtonPanelBackNext.tpl', $d); Tpl/MassDashNotifyProgress.tpl 0000644 00000004202 15030415016 0012436 0 ustar 00 <?php use \Lsc\Wp\View\Model\MassDashNotifyProgressViewModel as ViewModel; $icon = $this->viewModel->getTplData(ViewModel::FLD_ICON); $installsCount = $this->viewModel->getTplData(ViewModel::FLD_INSTALLS_COUNT); $d = array( 'title' => 'Mass Notifying All Discovered WordPress Installations...', 'icon' => $icon ); $this->loadTplBlock('Title.tpl', $d); ?> <div id="progress-box" class="msg-box"> Attempting to notify <span id="currIndex">0</span> out of <span id="totalCount"><?php echo $installsCount; ?></span> ... </div> <div> Currently attempting to notify all discovered WordPress installations. Installations detected with "Error" status or containing a '.dash_notifier_bypass' file will be bypassed. Please be patient. </div> <?php $msgs = array( "<span id=\"bypassedCount\"><b>0</b></span> WordPress installation(s) bypassed.", "Dash Notifier notified <span id=\"succCount\"><b>0</b></span> WordPress installation(s).", "Dash Notifier failed to notify <span id=\"failCount\" class=\"red\"><b>0</b></span> WordPress " . "installation(s)." ); $d = array( 'msgs' => $msgs, 'class' => 'msg-info', ); $this->loadTplBlock('DivMsgBox.tpl', $d); $d = array( 'back' => 'OK', 'backDo' => 'dash_notifier', 'visibility' => 'hidden' ); $this->loadTplBlock('ButtonPanelBackNext.tpl', $d); ?> <button class="accordion accordion-error" type="button" style="display: none"> Error Messages <span id ="errMsgCnt" class="badge errMsg-badge">0</span> </button> <div class="panel panel-error"> <?php $d = array( 'id' => 'errMsgs', 'class' => 'scrollable', ); $this->loadTplBlock('DivMsgBox.tpl', $d); ?> </div> <button class="accordion accordion-success" type="button" style="display: none"> Success Messages <span id="succMsgCnt" class="badge succMsg-badge">0</span> </button> <div class="panel panel-success"> <?php $d = array( 'id' => 'succMsgs', 'class' => 'scrollable', 'title' => 'Success Messages:', ); $this->loadTplBlock('DivMsgBox.tpl', $d); ?> </div> <script type="text/javascript">lswsInitDropdownBoxes();</script> <script type="text/javascript">dashMassNotifyUpdate();</script>