예제 #1
0
 public function actionUpdate()
 {
     if ($this->validateToken()) {
         $status = N2SmartsliderUpdateModel::getInstance()->update();
         $hasError = N2SS3::hasApiError($status);
         if (is_array($hasError)) {
             $this->redirect($hasError);
         } else {
             if ($hasError === false) {
                 N2Message::success(n2_('Smart Slider 3 updated to the latest version!'));
             }
         }
         $this->redirectToSliders();
     } else {
         $this->refresh();
     }
 }
예제 #2
0
                    </tbody>
                </table>
            </div>
        </div>

        <?php 
function n2GetBox($class, $image, $html, $hasBorder = true)
{
    echo N2Html::tag('div', array('class' => 'n2-box n2-box-title ' . $class . ($hasBorder ? ' n2-box-border' : '')), N2Html::image(N2ImageHelper::fixed('$ss$/admin/images/' . $image)) . N2Html::tag("div", array('class' => 'n2-box-placeholder'), N2Html::tag("table", array(), N2Html::tag("tr", array(), N2Html::tag("td", array('class' => 'n2-box-button'), $html)))));
}
n2GetBox('n2-ss-demo-slider', 'add-demo.png', '<div>' . n2_('100+ Sample slide with one click.') . '</div><a href="#" class="n2-button n2-button-small n2-button-green n2-uc n2-h5">' . n2_('add sample slider') . '</a>');
ob_start();
$this->widget->init("buttonmenu", array("content" => N2Html::tag('div', array('class' => 'n2-button-menu'), N2Html::tag('div', array('class' => 'n2-button-menu-inner n2-border-radius'), N2Html::link(n2_('Import by upload'), $this->appType->router->createUrl(array('sliders/importbyupload')), array('class' => 'n2-h4')) . N2Html::link(n2_('Restore by upload'), $this->appType->router->createUrl(array('sliders/restorebyupload')), array('class' => 'n2-h4')) . N2Html::link(n2_('Import from server'), $this->appType->router->createUrl(array('sliders/importfromserver')), array('class' => 'n2-h4')) . N2Html::link(n2_('Export all slider'), $this->appType->router->createUrl(array('sliders/exportall')), array('class' => 'n2-h4', 'target' => '_blank'))))));
n2GetBox('', 'import-upload.png', '<div>' . n2_('Import slider from different sources.') . '</div>' . N2Html::tag('div', array('class' => 'n2-button n2-button-with-menu n2-button-small n2-button-green'), N2Html::link(n2_('Import by upload'), $this->appType->router->createUrl(array('sliders/importbyupload')), array('class' => 'n2-button-inner n2-uc n2-h5')) . ob_get_clean()));
n2GetBox('n2-box-wide n2-box-overflow n2-box-free', 'free/box2.png', N2Html::tag('div', array(), 'Take your slider to the next level with Smart Slider 3 PRO!') . N2Html::link('See all features', N2SS3::getWhyProUrl(), array('target' => '_blank', 'class' => 'n2-button n2-button-blue n2-button-medium n2-h5 n2-uc')), false);
$updateModel = N2SmartsliderUpdateModel::getInstance();
$hasUpdate = $updateModel->hasUpdate();
$this->appType->router->setMultiSite();
$updateUrl = $this->appType->router->createUrl(array('update/update', N2Form::tokenizeUrl() + array('download' => 1)));
$this->appType->router->unSetMultiSite();
$versionsTXT = '<div>' . sprintf(n2_('Installed version: %s'), N2SS3::$version . (N2SSPRO ? ' Pro' : '')) . ($hasUpdate ? '<br/>' . sprintf(n2_('Latest version: %s'), $updateModel->getVersion() . (N2SSPRO ? ' Pro' : '')) : '<br/>' . sprintf(n2_('Last check: %s'), $updateModel->lastCheck())) . '</div>';
n2GetBox('', 'Update.png', $versionsTXT . ($hasUpdate ? '<a href="' . $updateUrl . '" class="n2-button n2-button-small n2-button-blue n2-uc n2-h5">' . n2_('Update') . '</a>' : '') . (!$hasUpdate ? '<a href="' . $this->appType->router->createUrl(array('update/check', N2Form::tokenizeUrl())) . '" class="n2-button n2-button-small n2-button-blue n2-uc n2-h5">' . n2_('Check') . '</a>' : '') . '<a href="#" onclick="NextendModalDocumentation(\'' . n2_('Changelog') . '\', \'http://doc.smartslider3.com/article/432-changelog\');return false;" class="n2-button n2-button-small n2-button-grey n2-uc n2-h5">' . n2_('Changelog') . '</a>');
if ($hasUpdate) {
    ?>
            <script type="text/javascript">
                n2(window).ready(function ($) {
                    $('.n2-main-top-bar').append('<div class="n2-left n2-top-bar-menu"><span><?php 
    printf(n2_('Version %s available!'), $updateModel->getVersion());
    ?>
</span> <a style="font-size: 12px;margin-right: 10px;" class="n2-h3 n2-uc n2-has-underline n2-button n2-button-blue n2-button-medium" href="<?php 
    echo $updateUrl;