示例#1
0
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
示例#2
0
文件: admin.php 项目: vazahat/dudex
 public function save2()
 {
     $tables = $_POST;
     foreach ($tables as $table => $orders) {
         $i = 0;
         foreach ($orders as $order) {
             $i++;
             $query = "UPDATE " . SITETOUR_BOL_StepDao::getInstance()->getTableName() . " SET `order` = :id WHERE id=:order ;";
             OW::getDbo()->query($query, array('order' => $order, 'id' => $i));
         }
     }
 }
示例#3
0
文件: init.php 项目: vazahat/dudex
function sitetour_after_route(OW_Event $event)
{
    if (!OW::getUser()->isAuthenticated() && OW::getConfig()->getValue('sitetour', 'enableForGuests') != '1') {
        return;
    }
    $configs = OW::getConfig()->getValues('sitetour');
    $handlerAttributes = OW::getRequestHandler()->getHandlerAttributes();
    $attrKey = $handlerAttributes[OW_RequestHandler::ATTRS_KEY_CTRL];
    $attrAction = $handlerAttributes[OW_RequestHandler::ATTRS_KEY_ACTION];
    $allSteps = "";
    if ($attrKey == 'BASE_CTRL_ComponentPanel' && $attrAction == 'profile') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('profile');
    }
    if ($attrKey == 'BASE_CTRL_ComponentPanel' && $attrAction == 'dashboard') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('dashboard');
    }
    if ($attrKey == 'BASE_CTRL_ComponentPanel' && $attrAction == 'index') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('index');
    }
    if ($attrKey == 'BASE_CTRL_UserList') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('members');
    }
    if ($attrKey == 'BLOGS_CTRL_Blog' && $attrAction == 'index') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('blogs');
    }
    if ($attrKey == 'BLOGS_CTRL_View' && $attrAction == 'index') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('blog-view');
    }
    if ($attrKey == 'GROUPS_CTRL_Groups') {
        if ($attrAction == 'index') {
            $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('groups');
        } else {
            $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('group-view');
        }
    }
    if ($attrKey == 'LINKS_CTRL_List') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('links');
    }
    if ($attrKey == 'LINKS_CTRL_View' && $attrAction == 'index') {
        $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('link-view');
    }
    if ($attrKey == 'PHOTO_CTRL_Photo') {
        if ($attrAction == 'viewList') {
            $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('photos');
        }
    }
    if ($attrKey == 'VIDEO_CTRL_Video') {
        if ($attrAction == 'viewList') {
            $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('videos');
        }
    }
    if ($attrKey == 'FORUM_CTRL_Index') {
        if ($attrAction == 'index') {
            $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('forum');
        }
    }
    if ($attrKey == 'EVENT_CTRL_Base') {
        if ($attrAction == 'eventsList') {
            $allSteps = SITETOUR_BOL_StepDao::getInstance()->getAllJsonSteps('events');
        }
    }
    if (empty($allSteps)) {
        return;
    }
    $language = OW::getLanguage();
    $headSrc = 'function startIntro(){
                    var intro = introJs();
                    intro.setOptions({
                            steps:  ' . $allSteps . '.filter(function (obj) {return $(obj.element).length;}),
                            nextLabel: "' . $language->text('sitetour', 'next') . '", prevLabel: "' . $language->text('sitetour', 'prev') . '", skipLabel: "' . $language->text('sitetour', 'skip') . '", doneLabel: "' . $language->text('sitetour', 'done') . '",
                            exitOnEsc: ' . $configs['exitOnEsc'] . ',
                            exitOnOverlayClick: ' . $configs['exitOnOverlayClick'] . ',
                            showStepNumbers: ' . $configs['showStepNumbers'] . ',
                            keyboardNavigation: ' . $configs['keyboardNavigation'] . ',
                            showButtons: ' . $configs['showButtons'] . ',
                            showBullets: ' . $configs['showBullets'] . '
                    });
                    
                    intro.start();
                }
                    
                $(document).ready(function(){ 
                    if( typeof $.cookie("sitetour") == "undefined" ){
                        $.cookie("sitetour","done", { expires: 15 });
                        startIntro();
                    }

                    $("#tour-start").click(function() {
                        startIntro();
                    });

                });';
    $tourButton = '<div class="tour-wrap" id="tour-start">
                      <p class="tour-left"> 
                          <span>' . $language->text('sitetour', 'page_guide') . '</span> 
                      </p> 
                      <p class="tour-right"> 
                          <span>' . $language->text('sitetour', 'page_guide_text') . '</span> 
                      </p> 
                   </div>';
    OW::getDocument()->appendBody($tourButton);
    OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('sitetour')->getStaticJsUrl() . 'jquery.cookie.js');
    OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('sitetour')->getStaticJsUrl() . 'intro.min.js');
    OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('sitetour')->getStaticCssUrl() . 'introjs.min.css');
    OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('sitetour')->getStaticCssUrl() . 'style.css');
    $style = '.introjs-tooltip{min-width:' . $configs['introWidth'] . 'px}
    .tour-left {background: none repeat scroll 0 0 ' . $configs['guideColor'] . '; border-right: 1px solid red;}
    .tour-wrap {background: none repeat scroll 0 0 ' . $configs['guideColor'] . '; top: ' . $configs['guidePos'] . '%;}';
    if ($configs['enableRTL'] == '1') {
        OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('sitetour')->getStaticCssUrl() . 'introjs-rtl.min.css');
    }
    OW::getDocument()->addCustomHeadInfo('<script type="text/javascript">' . $headSrc . '</script>');
    OW::getDocument()->addCustomHeadInfo('<style>' . $style . '</style>');
}