public function customizeControlCunfigure($customizeUrl, $normalUrl)
 {
     if ($this->allowCustomize) {
         $js = new UTIL_JsGenerator();
         $js->newVariable('dndCustomizeUrl', $customizeUrl);
         $js->newVariable('dndNormalUrl', $normalUrl);
         $js->jQueryEvent('#goto_customize_btn', 'click', 'if(dndCustomizeUrl) window.location.href=dndCustomizeUrl;');
         $js->jQueryEvent('#goto_normal_btn', 'click', 'if(dndNormalUrl) window.location.href=dndNormalUrl;');
         OW::getDocument()->addOnloadScript($js);
     }
 }
Exemple #2
0
 public function uninstall()
 {
     if (isset($_POST['action']) && $_POST['action'] == 'delete_content') {
         OW::getConfig()->saveConfig('blogs', 'uninstall_inprogress', 1);
         //maint-ce mode
         OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'plugin_set_for_uninstall'));
         $this->redirect();
     }
     $this->setPageHeading(OW::getLanguage()->text('blogs', 'page_title_uninstall'));
     $this->setPageHeadingIconClass('ow_ic_delete');
     $this->assign('inprogress', (bool) OW::getConfig()->getValue('blogs', 'uninstall_inprogress'));
     $js = new UTIL_JsGenerator();
     $js->jQueryEvent('#btn-delete-content', 'click', 'if ( !confirm("' . OW::getLanguage()->text('blogs', 'confirm_delete_photos') . '") ) return false;');
     OW::getDocument()->addOnloadScript($js);
 }
Exemple #3
0
 /**
  * Plugin uninstall action
  */
 public function uninstall()
 {
     if (isset($_POST['action']) && $_POST['action'] == 'delete_content') {
         OW::getConfig()->saveConfig('forum', 'uninstall_inprogress', 1);
         FORUM_BOL_ForumService::getInstance()->setMaintenanceMode(true);
         $event = new OW_Event('forum.uninstall_plugin');
         OW::getEventManager()->trigger($event);
         OW::getFeedback()->info(OW::getLanguage()->text('forum', 'plugin_set_for_uninstall'));
         $this->redirect();
     }
     $this->setPageHeading(OW::getLanguage()->text('forum', 'page_title_uninstall'));
     $this->setPageHeadingIconClass('ow_ic_delete');
     $this->assign('inprogress', (bool) OW::getConfig()->getValue('forum', 'uninstall_inprogress'));
     $js = new UTIL_JsGenerator();
     $js->jQueryEvent('#btn-delete-content', 'click', 'if ( !confirm("' . OW::getLanguage()->text('forum', 'confirm_delete_forum') . '") ) return false;');
     OW::getDocument()->addOnloadScript($js);
 }
Exemple #4
0
 public function uninstall()
 {
     if (isset($_POST['action']) && $_POST['action'] == 'delete_content') {
         $service = SLIDESHOW_BOL_Service::getInstance();
         $list = $service->getAllSlideList();
         if ($list) {
             foreach ($list as $slide) {
                 $service->addSlideToDeleteQueue($slide->id);
             }
         }
         OW::getConfig()->saveConfig('slideshow', 'uninstall_inprogress', 1);
         BOL_ComponentAdminService::getInstance()->deleteWidget('SLIDESHOW_CMP_SlideshowWidget');
         OW::getFeedback()->info(OW::getLanguage()->text('slideshow', 'plugin_set_for_uninstall'));
         $this->redirect();
     }
     $this->setPageHeading(OW::getLanguage()->text('slideshow', 'page_title_uninstall'));
     $this->setPageHeadingIconClass('ow_ic_delete');
     $this->assign('inprogress', (bool) OW::getConfig()->getValue('slideshow', 'uninstall_inprogress'));
     $js = new UTIL_JsGenerator();
     $js->jQueryEvent('#btn-delete-content', 'click', 'if ( !confirm("' . OW::getLanguage()->text('slideshow', 'confirm_delete_plugin') . '") ) return false;');
     OW::getDocument()->addOnloadScript($js);
 }
Exemple #5
0
 /**
  * Action cropping avatar
  */
 public function crop()
 {
     $language = OW::getLanguage();
     $avatarService = BOL_AvatarService::getInstance();
     $userService = BOL_UserService::getInstance();
     $userId = OW_Auth::getInstance()->getUserId();
     $hasAvatar = $avatarService->userHasAvatar($userId);
     $this->assign('hasAvatar', $hasAvatar);
     if ($hasAvatar) {
         $this->assign('avatar', $avatarService->getAvatarUrl($userId, 2));
         $this->assign('original', $avatarService->getAvatarUrl($userId, 3));
     } else {
         $this->assign('default', $avatarService->getDefaultAvatarUrl(2));
     }
     $staticJsUrl = OW::getPluginManager()->getPlugin('base')->getStaticJsUrl();
     $staticCssUrl = OW::getPluginManager()->getPlugin('base')->getStaticCssUrl();
     OW::getDocument()->addScript($staticJsUrl . 'jquery.Jcrop.js');
     OW::getDocument()->addStyleSheet($staticCssUrl . 'jquery.Jcrop.css');
     OW::getDocument()->addScript($staticJsUrl . 'crop_avatar.js');
     $objParams = array('ajaxResponder' => $this->ajaxResponder, 'previewSize' => 100);
     $script = "\$(document).ready(function(){\n                var crop = new cropAvatar( " . json_encode($objParams) . ");\n                crop.initCrop();\n            }); ";
     OW::getDocument()->addOnloadScript($script);
     $profileEditUrl = OW::getRouter()->urlForRoute('base_edit');
     $js = new UTIL_JsGenerator();
     $js->newVariable('profileEditUrl', $profileEditUrl);
     $js->jQueryEvent('#button-profile-edit', 'click', 'window.location.href=profileEditUrl;');
     OW::getDocument()->addOnloadScript($js);
 }
Exemple #6
0
 public function uninstall()
 {
     $config = OW::getConfig();
     if (!$config->configExists('groups', 'uninstall_inprogress')) {
         $config->addConfig('groups', 'uninstall_inprogress', 0);
     }
     if (isset($_POST['action']) && $_POST['action'] == 'delete_content') {
         $config->saveConfig('groups', 'uninstall_inprogress', 1);
         OW::getFeedback()->info(OW::getLanguage()->text('groups', 'plugin_set_for_uninstall'));
         OW::getApplication()->setMaintenanceMode(true);
         $this->redirect();
     }
     $this->setPageHeading(OW::getLanguage()->text('groups', 'page_title_uninstall'));
     $this->setPageHeadingIconClass('ow_ic_delete');
     $inprogress = $config->getValue('groups', 'uninstall_inprogress');
     $this->assign('inprogress', $inprogress);
     $js = new UTIL_JsGenerator();
     $js->jQueryEvent('#btn-delete-content', 'click', 'if ( !confirm("' . OW::getLanguage()->text('groups', 'confirm_delete_groups') . '") ) return false;');
     OW::getDocument()->addOnloadScript($js);
 }
Exemple #7
0
 public function uninstall($params)
 {
     if (isset($_POST['action']) && $_POST['action'] == 'delete_rules') {
         $rules = MATCHMAKING_BOL_Service::getInstance()->findFieldsExceptRequired();
         foreach ($rules as $rule) {
             MATCHMAKING_BOL_Service::getInstance()->delete($rule->id);
         }
         BOL_PluginService::getInstance()->uninstall('matchmaking');
         $this->redirect(OW::getRouter()->urlForRoute('admin_plugins_installed'));
     }
     $js = new UTIL_JsGenerator();
     $js->jQueryEvent('#btn-delete-rules', 'click', 'if ( !confirm("' . OW::getLanguage()->text('base', 'are_you_sure') . '") ) return false;');
     OW::getDocument()->addOnloadScript($js);
 }