Beispiel #1
0
 public function index(array $params)
 {
     if (!($userId = OW::getUser()->getId())) {
         throw new AuthenticateException();
     }
     $page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1;
     $lang = OW::getLanguage();
     $perPage = (int) OW::getConfig()->getValue('base', OW::getPluginManager()->isPluginActive('skadate') ? 'users_on_page' : 'users_count_on_page');
     $guests = OCSGUESTS_BOL_Service::getInstance()->findGuestsForUser($userId, $page, $perPage);
     $guestList = array();
     if ($guests) {
         foreach ($guests as $guest) {
             $guestList[$guest->guestId] = array('last_visit' => $lang->text('ocsguests', 'visited') . ' ' . '<span class="ow_remark">' . $guest->visitTimestamp . '</span>');
         }
         $itemCount = OCSGUESTS_BOL_Service::getInstance()->countGuestsForUser($userId);
         if (OW::getPluginManager()->isPluginActive('skadate')) {
             $cmp = OW::getClassInstance('BASE_CMP_Users', $guestList, array(), $itemCount);
         } else {
             $guestsUsers = OCSGUESTS_BOL_Service::getInstance()->findGuestUsers($userId, $page, $perPage);
             $cmp = new OCSGUESTS_CMP_Users($guestsUsers, $itemCount, $perPage, true, $guestList);
         }
         $this->addComponent('guests', $cmp);
     } else {
         $this->assign('guests', null);
     }
     $this->setPageHeading($lang->text('ocsguests', 'viewed_profile'));
     $this->setPageTitle($lang->text('ocsguests', 'viewed_profile'));
     OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'base', 'dashboard');
 }
Beispiel #2
0
 public function getMenu()
 {
     $language = OW::getLanguage();
     $menu = new BASE_CMP_ContentMenu();
     $menuItem = new BASE_MenuItem();
     $menuItem->setKey('all');
     $menuItem->setPrefix('questions');
     $menuItem->setLabel($language->text('equestions', 'list_all_tab'));
     $menuItem->setOrder(1);
     $menuItem->setUrl(OW::getRouter()->urlForRoute('equestions-all'));
     $menuItem->setIconClass('ow_ic_lens');
     $menu->addElement($menuItem);
     if (OW::getUser()->isAuthenticated()) {
         if (OW::getPluginManager()->isPluginActive('friends')) {
             $menuItem = new BASE_MenuItem();
             $menuItem->setKey('friends');
             $menuItem->setPrefix('questions');
             $menuItem->setLabel($language->text('equestions', 'list_friends_tab'));
             $menuItem->setOrder(2);
             $menuItem->setUrl(OW::getRouter()->urlForRoute('equestions-friends'));
             $menuItem->setIconClass('ow_ic_user');
             $menu->addElement($menuItem);
         }
         $menuItem = new BASE_MenuItem();
         $menuItem->setKey('my');
         $menuItem->setPrefix('questions');
         $menuItem->setLabel($language->text('equestions', 'list_my_tab'));
         $menuItem->setOrder(3);
         $menuItem->setUrl(OW::getRouter()->urlForRoute('equestions-my'));
         $menuItem->setIconClass('ow_ic_user');
         $menu->addElement($menuItem);
     }
     return $menu;
 }
Beispiel #3
0
 public function __construct()
 {
     parent::__construct();
     $plugin = OW::getPluginManager()->getPlugin('BASE');
     $this->setTemplate($plugin->getCmpViewDir() . 'console_list_ipc_item.html');
     $this->addClass('ow_invitation_item ow_cursor_default');
 }
 public function __construct($label, $key = null)
 {
     parent::__construct($label, $key);
     $template = OW::getPluginManager()->getPlugin('BASE')->getCmpViewDir() . 'console_dropdown_click.html';
     $this->setTemplate($template);
     $this->addClass('ow_console_dropdown_click');
 }
Beispiel #5
0
 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCmpViewDir() . 'users_widget.html');
     $randId = UTIL_HtmlTag::generateAutoId('base_users_widget');
     $this->assign('widgetId', $randId);
     $data = $this->getData($params);
     $menuItems = array();
     $dataToAssign = array();
     if (!empty($data)) {
         foreach ($data as $key => $item) {
             $contId = "{$randId}_users_widget_{$key}";
             $toolbarId = !empty($item['toolbar']) ? "{$randId}_toolbar_{$key}" : false;
             $menuItems[$key] = array('label' => $item['menu-label'], 'id' => "{$randId}_users_widget_menu_{$key}", 'contId' => $contId, 'active' => !empty($item['menu_active']), 'toolbarId' => $toolbarId);
             $usersCmp = $this->getUsersCmp($item['userIds']);
             $dataToAssign[$key] = array('users' => $usersCmp->render(), 'active' => !empty($item['menu_active']), 'toolbar' => !empty($item['toolbar']) ? $item['toolbar'] : array(), 'toolbarId' => $toolbarId, 'contId' => $contId);
         }
     }
     $this->assign('data', $dataToAssign);
     $displayMenu = true;
     if (count($data) == 1 && !$this->forceDisplayMenu) {
         $displayMenu = false;
     }
     if (!$params->customizeMode && (count($data) != 1 || $this->forceDisplayMenu)) {
         $menu = $this->getMenuCmp($menuItems);
         if (!empty($menu)) {
             $this->addComponent('menu', $menu);
         }
     }
 }
Beispiel #6
0
    public function addStatic($onloadJs = '')
    {
        static $fistCall = true;
        $staticUrl = OW::getPluginManager()->getPlugin('attachments')->getStaticUrl();
        OW::getDocument()->addStyleSheet($staticUrl . 'styles.css' . '?' . self::PLUGIN_VERSION);
        if ($fistCall) {
            if (OW::getRequest()->isAjax()) {
                OW::getDocument()->addOnloadScript('window.ATTPAjaxLoadCallbackQueue = [];');
                OW::getDocument()->addOnloadScript(UTIL_JsGenerator::composeJsString('
                    if ( !window.ATTP ) OW.addScriptFiles([{$url}]);
                ', array('url' => $staticUrl . 'scripts.js' . '?' . self::PLUGIN_VERSION)));
            } else {
                OW::getDocument()->addScript($staticUrl . 'scripts.js' . '?' . self::PLUGIN_VERSION);
                if (!empty($onloadJs)) {
                    OW::getDocument()->addOnloadScript($onloadJs);
                }
                return;
            }
        }
        $fistCall = false;
        OW::getDocument()->addOnloadScript('(function() {
            var loaded = function() {
                ' . $onloadJs . '
            };

            if ( window.ATTP )
                loaded.call();
            else
                window.ATTPAjaxLoadCallbackQueue.push(loaded);
        })();');
    }
Beispiel #7
0
 public function __construct($list, $showOnline = true)
 {
     parent::__construct();
     $this->list = $list;
     $this->showOnline = $showOnline;
     $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getMobileCmpViewDir() . 'user_list.html');
 }
Beispiel #8
0
function hotlist_usercredits_active(BASE_CLASS_EventCollector $event)
{
    if (!OW::getPluginManager()->isPluginActive('usercredits')) {
        $language = OW::getLanguage();
        $event->add($language->text('hotlist', 'error_usercredits_not_installed'));
    }
}
Beispiel #9
0
 public function addPhoto($userId, $path, $title, $text = null, $addToFeed = true)
 {
     if (!$this->isActive()) {
         return null;
     }
     $pluginfilesDir = OW::getPluginManager()->getPlugin('attachments')->getPluginFilesDir();
     $filePath = $pluginfilesDir . uniqid('tmp_') . '.jpg';
     if (!@copy($path, $filePath)) {
         return null;
     }
     $description = empty($title) ? $text : $title;
     $description = empty($description) ? null : $description;
     $data = OW::getEventManager()->call("photo.add", array("albumId" => $this->getAlbum($userId), "path" => $filePath, "description" => $description, "addToFeed" => false));
     @unlink($filePath);
     if (empty($data["photoId"])) {
         return null;
     }
     $photoId = $data["photoId"];
     if ($addToFeed) {
         //Newsfeed
         $event = new OW_Event('feed.action', array('pluginKey' => 'photo', 'entityType' => 'photo_comments', 'entityId' => $photoId, 'userId' => $userId), array("content" => array("vars" => array("status" => $text))));
         OW::getEventManager()->trigger($event);
     }
     return $photoId;
 }
Beispiel #10
0
 public function initMenu()
 {
     $menuItems = array();
     $listNames = array('connects' => array('iconClass' => 'ow_yn_socialbridge_connects'));
     $listNames = array('connects' => array('iconClass' => 'ow_yn_socialbridge_connects'));
     if (OW::getPluginManager()->isPluginActive('ynsocialstream')) {
         $listNames['stream-settings'] = array('iconClass' => 'ow_yn_socialstream');
     }
     if (OW::getPluginManager()->isPluginActive('ynsocialpublisher')) {
         $listNames['publisher-settings'] = array('iconClass' => 'ow_yn_socialpublisher');
     }
     $count = 0;
     foreach ($listNames as $actionKey => $actionArr) {
         $menuItem = new BASE_MenuItem();
         $menuItem->setKey($actionKey);
         $menuItem->setUrl(OW::getRouter()->urlForRoute('ynsocialbridge-' . $actionKey));
         $menuItem->setOrder($count);
         $menuItem->setLabel(OW::getLanguage()->text('ynsocialbridge', 'menu_item_' . $actionKey));
         $menuItem->setIconClass($actionArr['iconClass']);
         $menuItems[] = $menuItem;
         $count++;
     }
     $contentMenu = new BASE_CMP_ContentMenu($menuItems);
     return $contentMenu;
 }
Beispiel #11
0
 public function rated()
 {
     if (!OW::getUser()->isAuthenticated()) {
         throw new AuthenticateException();
     }
     $lang = OW::getLanguage();
     $page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1;
     $perPage = (int) OW::getConfig()->getValue('base', 'users_count_on_page');
     $service = OCSTOPUSERS_BOL_Service::getInstance();
     $userId = OW::getUser()->getId();
     $users = $service->findRateUserList($userId, $page, $perPage);
     if ($users) {
         $count = $service->countRateUsers($userId);
         $list = array();
         $fields = array();
         foreach ($users as $user) {
             $list[] = $user['dto'];
             $fields[$user['dto']->id] = array('score' => $user['score'], 'timeStamp' => $user['timeStamp']);
         }
         $cmp = new OCSTOPUSERS_CMP_RatedList($list, $count, $perPage, false, $fields);
         $this->addComponent('users', $cmp);
     } else {
         $this->assign($users, null);
     }
     OW::getDocument()->setHeading($lang->text('ocstopusers', 'rated_me'));
     OW::getDocument()->setHeadingIconClass('ow_ic_star');
     OW::getNavigation()->activateMenuItem(BOL_NavigationService::MENU_TYPE_MAIN, 'base', 'users_main_menu_item');
     $this->setTemplate(OW::getPluginManager()->getPlugin('ocstopusers')->getCtrlViewDir() . 'list_index.html');
 }
Beispiel #12
0
 public function getList(array $params)
 {
     OW::getDocument()->setHeading(OW::getLanguage()->text('bookmarks', 'list_headint_title'));
     $this->setTemplate(OW::getPluginManager()->getPlugin('bookmarks')->getCtrlViewDir() . 'list.html');
     $userId = OW::getUser()->getId();
     $page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1;
     $userOnPage = (int) OW::getConfig()->getValue('base', 'users_on_page');
     $first = ($page - 1) * $userOnPage;
     $list = $this->service->findBookmarksUserIdList($userId, $first, $userOnPage, $params['category']);
     $count = $this->service->findBookmarksCount($userId, $params['category']);
     $sexValue = array();
     $userDataList = array();
     $questionService = BOL_QuestionService::getInstance();
     $data = $questionService->getQuestionData($list, array('sex', 'googlemap_location', 'birthdate'));
     foreach (BOL_QuestionValueDao::getInstance()->findQuestionValues('sex') as $sexDto) {
         $sexValue[$sexDto->value] = $questionService->getQuestionValueLang('sex', $sexDto->value);
     }
     foreach ($data as $userId => $user) {
         if (isset($user['birthdate'])) {
             $date = UTIL_DateTime::parseDate($user['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
             $age = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
         } else {
             $age = '';
         }
         $userDataList[$userId] = array('info_gender' => !empty($user['sex']) && !empty($sexValue[$user['sex']]) ? $sexValue[$user['sex']] : '' . ' ' . $age, 'location' => !empty($user['googlemap_location']) ? $user['googlemap_location']['address'] : '');
     }
     $this->addComponent('list', OW::getClassInstance('BASE_CMP_Users', $userDataList, array(), $count));
 }
Beispiel #13
0
 /**
  * Default action
  */
 public function index()
 {
     $lang = OW::getLanguage();
     OW::getDocument()->setHeading($lang->text('ocssitestats', 'admin_page_heading'));
     OW::getDocument()->setHeadingIconClass('ow_ic_gear_wheel');
     $pluginManager = OW::getPluginManager();
     $pluginsActivated = array('total_users' => true, 'online_users' => true, 'new_users_today' => true, 'new_users_this_month' => true, 'photos' => $pluginManager->isPluginActive('photo'), 'videos' => $pluginManager->isPluginActive('video'), 'blogs' => $pluginManager->isPluginActive('blogs'), 'groups' => $pluginManager->isPluginActive('groups'), 'events' => $pluginManager->isPluginActive('event'), 'discussions' => $pluginManager->isPluginActive('forum'), 'links' => $pluginManager->isPluginActive('links'));
     $config = OW::getConfig();
     if (OW::getRequest()->isPost() && !empty($_POST['action'])) {
         switch ($_POST['action']) {
             case 'update_metrics':
                 $conf = array();
                 foreach ($pluginsActivated as $key => $m) {
                     $conf[$key] = $pluginsActivated[$key] && !empty($_POST['metrics'][$key]) && $_POST['metrics'][$key];
                 }
                 $config->saveConfig('ocssitestats', 'metrics', json_encode($conf));
                 OW::getFeedback()->info($lang->text('ocssitestats', 'settings_updated'));
                 $this->redirect();
                 break;
             case 'update_settings':
                 $config->saveConfig('ocssitestats', 'zero_values', !empty($_POST['zero_values']));
                 OW::getFeedback()->info($lang->text('ocssitestats', 'settings_updated'));
                 $this->redirect();
                 break;
         }
     }
     $metricsConf = json_decode($config->getValue('ocssitestats', 'metrics'), true);
     $this->assign('metrics', $metricsConf);
     $zeroValues = $config->getValue('ocssitestats', 'zero_values');
     $this->assign('zeroValues', $zeroValues);
     $this->assign('pluginsActivated', $pluginsActivated);
     $logo = OW::getPluginManager()->getPlugin('ocssitestats')->getStaticUrl() . 'img/oxwallcandystore-logo.jpg';
     $this->assign('logo', $logo);
 }
 public function __construct($params = array())
 {
     parent::__construct();
     $plugin = OW::getPluginManager()->getPlugin('base');
     $document = OW::getDocument();
     $document->addStyleSheet($plugin->getStaticCssUrl() . 'file_upload.css');
 }
Beispiel #15
0
 public function __construct(BASE_CLASS_WidgetParameter $paramObject)
 {
     parent::__construct();
     $text = OW::getLanguage()->text('base', 'welcome_widget_content');
     $text = str_replace('</li>', "</li>\n", $text);
     //if the tags are written in a line it is necessary to make a compulsory hyphenation?
     $photoKey = str_replace('{$key}', self::KEY_PHOTO_UPLOAD, self::PATTERN);
     $avatarKey = str_replace('{$key}', self::KEY_CHANGE_AVATAR, self::PATTERN);
     if (OW::getPluginManager()->isPluginActive('photo') && mb_stripos($text, self::KEY_PHOTO_UPLOAD) !== false) {
         $label = OW::getLanguage()->text('photo', 'upload_photos');
         $js = OW::getEventManager()->call('photo.getAddPhotoURL');
         $langLabel = $this->getLangLabel($photoKey, $text, self::KEY_PHOTO_UPLOAD);
         if ($langLabel != NULL) {
             $label = $langLabel;
         }
         $text = preg_replace($photoKey, '<li><a href="javascript://" onclick="' . $js . '();">' . $label . '</a></li>', $text);
     } else {
         $text = preg_replace($photoKey, '', $text);
     }
     if (mb_stripos($text, self::KEY_CHANGE_AVATAR) !== false) {
         $label = OW::getLanguage()->text('base', 'avatar_change');
         $js = ' $("#welcomeWinget_loadAvatarChangeCmp").click(function(){' . 'document.avatarFloatBox = OW.ajaxFloatBox("BASE_CMP_AvatarChange", [], {width: 749, title: ' . json_encode($label) . '});' . '});';
         OW::getDocument()->addOnloadScript($js);
         $langLabel = $this->getLangLabel($avatarKey, $text, self::KEY_CHANGE_AVATAR);
         if ($langLabel != NULL) {
             $label = $langLabel;
         }
         $text = preg_replace($avatarKey, '<li><a id="welcomeWinget_loadAvatarChangeCmp" href="javascript://">' . $label . '</a></li>', $text);
     } else {
         $text = preg_replace($avatarKey, '', $text);
     }
     $this->assign('text', $text);
 }
Beispiel #16
0
 public function onConsolePagesCollect(BASE_CLASS_EventCollector $event)
 {
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'underscore-min.js', 'text/javascript', 3000);
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'backbone-min.js', 'text/javascript', 3000);
     //        OW::getDocument()->addScript( OW::getPluginManager()->getPlugin('base')->getStaticJsUrl().'backbone.js', 'text/javascript', 3000 );
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('mailbox')->getStaticJsUrl() . 'mobile_mailbox.js', 'text/javascript', 3000);
     $userListUrl = OW::getRouter()->urlForRoute('mailbox_user_list');
     $convListUrl = OW::getRouter()->urlForRoute('mailbox_conv_list');
     $authorizationResponderUrl = OW::getRouter()->urlFor('MAILBOX_CTRL_Ajax', 'authorization');
     $pingResponderUrl = OW::getRouter()->urlFor('MAILBOX_CTRL_Ajax', 'ping');
     $getHistoryResponderUrl = OW::getRouter()->urlFor('MAILBOX_CTRL_Ajax', 'getHistory');
     $userId = OW::getUser()->getId();
     $displayName = BOL_UserService::getInstance()->getDisplayName($userId);
     $avatarUrl = BOL_AvatarService::getInstance()->getAvatarUrl($userId);
     if (empty($avatarUrl)) {
         $avatarUrl = BOL_AvatarService::getInstance()->getDefaultAvatarUrl();
     }
     $profileUrl = BOL_UserService::getInstance()->getUserUrl($userId);
     $lastSentMessage = MAILBOX_BOL_ConversationService::getInstance()->getLastSentMessage($userId);
     $lastMessageTimestamp = (int) ($lastSentMessage ? $lastSentMessage->timeStamp : 0);
     $params = array('getHistoryResponderUrl' => $getHistoryResponderUrl, 'pingResponderUrl' => $pingResponderUrl, 'authorizationResponderUrl' => $authorizationResponderUrl, 'userListUrl' => $userListUrl, 'convListUrl' => $convListUrl, 'pingInterval' => 5000, 'lastMessageTimestamp' => $lastMessageTimestamp, 'user' => array('userId' => $userId, 'displayName' => $displayName, 'profileUrl' => $profileUrl, 'avatarUrl' => $avatarUrl));
     $js = UTIL_JsGenerator::composeJsString('OWM.Mailbox = new MAILBOX_Mobile({$params});', array('params' => $params));
     OW::getDocument()->addOnloadScript($js, 'text/javascript', 3000);
     $event->add(array('key' => 'convers', 'cmpClass' => 'MAILBOX_MCMP_ConsoleConversationsPage', 'order' => 2));
 }
Beispiel #17
0
 public function index($params)
 {
     if (!OW::getPluginManager()->isPluginActive('event')) {
         throw new Redirect404Exception();
     }
     $lat = null;
     $lon = null;
     $hash = null;
     if (!empty($params['lat'])) {
         $lat = (double) $params['lat'];
     }
     if (!empty($params['lat'])) {
         $lat = (double) $params['lat'];
     }
     if (!empty($params['lng'])) {
         $lon = (double) $params['lng'];
     }
     if (!empty($params['hash'])) {
         $hash = $params['hash'];
     }
     $entityIdList = GOOGLELOCATION_BOL_LocationService::getInstance()->getEntityListFromSession($hash);
     $bridge = new GOOGLELOCATION_CLASS_EventBridge();
     $listCmp = $bridge->getEventListCmp($entityIdList);
     $this->addComponent('cmp', $listCmp);
     $locationName = GOOGLELOCATION_BOL_LocationService::getInstance()->getLocationName($lat, $lon);
     $this->assign('locationName', $locationName);
     $language = OW::getLanguage();
     $this->setPageHeading(OW::getLanguage()->text('googlelocation', 'browse_page_heading'));
     $this->setPageTitle(OW::getLanguage()->text('googlelocation', 'events_browse_page_title'));
     $this->setPageHeadingIconClass('ow_ic_bookmark');
     $this->assign('backUrl', empty($_GET['backUri']) ? null : OW_URL_HOME . $_GET['backUri']);
     $this->setTemplate(OW::getPluginManager()->getPlugin('googlelocation')->getCtrlViewDir() . 'entity_list_index.html');
 }
Beispiel #18
0
 public function getUsersetting($userId, $key)
 {
     // user setting
     $userSetting = $this->findByUserIdOrKey($userId, $key);
     // admin setting
     $adminConfigs = json_decode(OW::getConfig()->getValue('ynsocialpublisher', $key), true);
     // return setting
     $setting = array();
     // if do not find this setting in user, use setting in admin
     if (!empty($adminConfigs['active']) && OW::getPluginManager()->isPluginActive($key)) {
         $setting['userId'] = $userId;
         $setting['key'] = $key;
         $setting['providers'] = array();
         $setting['adminProviders'] = $adminConfigs['providers'];
         if (!$userSetting) {
             //$setting['option'] = YNSOCIALPUBLISHER_BOL_UsersettingDao::OPTIONS_NOT_ASK;
             $setting['option'] = YNSOCIALPUBLISHER_BOL_UsersettingDao::OPTIONS_ASK;
             // providers
             $setting['providers'] = $adminConfigs['providers'];
         } else {
             $setting['option'] = $userSetting->option;
             // providers
             $setting['providers'] = array_intersect(json_decode($userSetting->providers, true), $adminConfigs['providers']);
         }
     }
     return $setting;
 }
Beispiel #19
0
 public function __construct()
 {
     parent::__construct();
     $menuItems = array();
     $item = new BASE_MenuItem();
     $item->setLabel(OW::getLanguage()->text('profileprogressbar', 'themes_menu_item'));
     $item->setUrl(OW::getRouter()->urlForRoute('profileprogressbar.admin'));
     $item->setIconClass('ow_ic_picture');
     $item->setOrder(0);
     array_push($menuItems, $item);
     $item = new BASE_MenuItem();
     $item->setLabel(OW::getLanguage()->text('profileprogressbar', 'features_menu_item'));
     $item->setUrl(OW::getRouter()->urlForRoute('profileprogressbar.admin_features'));
     $item->setIconClass('ow_ic_flag');
     $item->setOrder(1);
     array_push($menuItems, $item);
     $item = new BASE_MenuItem();
     $item->setLabel(OW::getLanguage()->text('profileprogressbar', 'hint_menu_item'));
     $item->setUrl(OW::getRouter()->urlForRoute('profileprogressbar.admin_hint'));
     $item->setIconClass('ow_ic_comment');
     $item->setOrder(2);
     array_push($menuItems, $item);
     $this->addComponent('menu', new BASE_CMP_ContentMenu($menuItems));
     $this->document = OW::getDocument();
     $this->plugin = OW::getPluginManager()->getPlugin('profileprogressbar');
     $this->theme = OW::getConfig()->getValue('profileprogressbar', 'theme');
 }
Beispiel #20
0
 public function index()
 {
     $billingService = BOL_BillingService::getInstance();
     $gwKey = OCSBILLINGMONEYBOOKERS_CLASS_MoneybookersAdapter::GATEWAY_KEY;
     $language = OW::getLanguage();
     $form = new MoneybookersConfigForm();
     $this->addForm($form);
     if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
         $values = $form->getValues();
         $billingService->setGatewayConfigValue($gwKey, 'merchantId', $values['merchantId']);
         $billingService->setGatewayConfigValue($gwKey, 'merchantEmail', $values['merchantEmail']);
         $billingService->setGatewayConfigValue($gwKey, 'secret', $values['secret']);
         $billingService->setGatewayConfigValue($gwKey, 'sandboxMode', $values['sandboxMode']);
         $billingService->setGatewayConfigValue($gwKey, 'recipientDescription', $values['recipientDescription']);
         $billingService->setGatewayConfigValue($gwKey, 'language', $values['language']);
         OW::getFeedback()->info($language->text('ocsbillingmoneybookers', 'settings_updated'));
         $this->redirect();
     }
     $adapter = new OCSBILLINGMONEYBOOKERS_CLASS_MoneybookersAdapter();
     $this->assign('logoUrl', $adapter->getLogoUrl());
     $gateway = $billingService->findGatewayByKey($gwKey);
     $this->assign('gateway', $gateway);
     $this->assign('activeCurrency', $billingService->getActiveCurrency());
     $supported = $billingService->currencyIsSupported($gateway->currencies);
     $this->assign('currSupported', $supported);
     $logo = OW::getPluginManager()->getPlugin('ocsbillingmoneybookers')->getStaticUrl() . 'img/oxwallcandystore-logo.jpg';
     $this->assign('logo', $logo);
     $this->setPageHeading(OW::getLanguage()->text('ocsbillingmoneybookers', 'config_page_heading'));
     $this->setPageHeadingIconClass('ow_ic_app');
 }
Beispiel #21
0
 public function __construct()
 {
     parent::__construct();
     $this->uniqId = uniqid('attachmentPanel');
     $plugin = OW::getPluginManager()->getPlugin('equestions');
     $this->setTemplate($plugin->getCmpViewDir() . 'attachment_panel.html');
 }
Beispiel #22
0
 public function __construct($label, $key)
 {
     parent::__construct($label, $key);
     $template = OW::getPluginManager()->getPlugin('BASE')->getCmpViewDir() . 'console_dropdown_list.html';
     $this->setTemplate($template);
     $this->list = new BASE_CMP_ConsoleList($this->getKey());
 }
Beispiel #23
0
 public function __construct($params)
 {
     parent::__construct();
     $this->visiblePhotoCount = !empty($params['photoCount']) ? (int) $params['photoCount'] : 8;
     $checkAuth = isset($params['checkAuth']) ? (bool) $params['checkAuth'] : true;
     $wrap = isset($params['wrapBox']) ? (bool) $params['wrapBox'] : true;
     $boxType = isset($params['boxType']) ? $params['boxType'] : '';
     $showTitle = isset($params['showTitle']) ? (bool) $params['showTitle'] : true;
     $uniqId = isset($params['uniqId']) ? $params['uniqId'] : uniqid();
     if ($checkAuth && !OW::getUser()->isAuthorized('photo', 'view')) {
         $this->setVisible(false);
         return;
     }
     $photoService = PHOTO_BOL_PhotoService::getInstance();
     $latest = $photoService->findPhotoList('latest', 1, $this->visiblePhotoCount, NULL, PHOTO_BOL_PhotoService::TYPE_PREVIEW);
     $this->assign('latest', $latest);
     $featured = $photoService->findPhotoList('featured', 1, $this->visiblePhotoCount, NULL, PHOTO_BOL_PhotoService::TYPE_PREVIEW);
     $this->assign('featured', $featured);
     $toprated = $photoService->findPhotoList('toprated', 1, $this->visiblePhotoCount, NULL, PHOTO_BOL_PhotoService::TYPE_PREVIEW);
     $this->assign('toprated', $toprated);
     $items = array('latest', 'toprated');
     if ($featured) {
         $items[] = 'featured';
     }
     $menuItems = $this->getMenuItems($items, $uniqId);
     $this->assign('items', $menuItems);
     $this->assign('wrapBox', $wrap);
     $this->assign('boxType', $boxType);
     $this->assign('showTitle', $showTitle);
     $this->assign('url', OW::getEventManager()->call('photo.getAddPhotoURL', array('')));
     $this->assign('uniqId', $uniqId);
     $this->setTemplate(OW::getPluginManager()->getPlugin('photo')->getMobileCmpViewDir() . 'index_photo_list.html');
 }
Beispiel #24
0
 public function onCollectButtonList(BASE_CLASS_EventCollector $event)
 {
     $cssUrl = OW::getPluginManager()->getPlugin('FBCONNECT')->getStaticCssUrl() . 'fbconnect.css';
     OW::getDocument()->addStyleSheet($cssUrl);
     $button = new FBCONNECT_MCMP_ConnectButton();
     $event->add(array('iconClass' => 'owm_ico_signin_f', 'markup' => $button->render()));
 }
Beispiel #25
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);
 }
 /**
  * Constructor.
  *
  */
 public function __construct()
 {
     parent::__construct('');
     $template = OW::getPluginManager()->getPlugin('BASE')->getCmpViewDir() . 'console_switch_language.html';
     $this->setTemplate($template);
     $languages = BOL_LanguageService::getInstance()->getLanguages();
     $session_language_id = BOL_LanguageService::getInstance()->getCurrent()->getId();
     $active_languages = array();
     foreach ($languages as $id => $language) {
         if ($language->status == 'active') {
             $tag = $this->parseCountryFromTag($language->tag);
             $active_lang = array('id' => $language->id, 'label' => $tag['label'], 'order' => $language->order, 'tag' => $language->tag, 'class' => "ow_console_lang{$tag['country']}", 'url' => OW::getRequest()->buildUrlQueryString(null, array("language_id" => $language->id)), 'is_current' => false);
             if ($session_language_id == $language->id) {
                 $active_lang['is_current'] = true;
                 $this->assign('label', $tag['label']);
                 $this->assign('class', "ow_console_lang{$tag['country']}");
             }
             $active_languages[] = $active_lang;
         }
     }
     if (count($active_languages) <= 1) {
         $this->setVisible(false);
         return;
     }
     function sortActiveLanguages($lang1, $lang2)
     {
         return $lang1['order'] < $lang2['order'] ? -1 : 1;
     }
     usort($active_languages, 'sortActiveLanguages');
     $switchLanguage = new BASE_CMP_SwitchLanguage($active_languages);
     $this->setContent($switchLanguage->render());
 }
Beispiel #27
0
 public function render()
 {
     $cssUrl = OW::getPluginManager()->getPlugin('FBCONNECT')->getStaticCssUrl() . 'fbconnect.css';
     OW::getDocument()->addStyleSheet($cssUrl);
     FBCONNECT_BOL_Service::getInstance()->initializeJs(array('email', 'user_about_me', 'user_birthday'), $_GET);
     return parent::render();
 }
Beispiel #28
0
 public function chooseTheme()
 {
     $this->themeService->updateThemeList();
     $this->themeService->updateThemesInfo();
     $themes = $this->themeService->findAllThemes();
     $themesInfo = array();
     $activeTheme = OW::getThemeManager()->getSelectedTheme()->getDto()->getName();
     /* @var $theme BOL_Theme */
     foreach ($themes as $theme) {
         $themesInfo[$theme->getName()] = (array) json_decode($theme->getDescription());
         $themesInfo[$theme->getName()]['key'] = $theme->getName();
         $themesInfo[$theme->getName()]['title'] = $theme->getTitle();
         $themesInfo[$theme->getName()]['iconUrl'] = $this->themeService->getStaticUrl($theme->getName()) . BOL_ThemeService::ICON_FILE;
         $themesInfo[$theme->getName()]['previewUrl'] = $this->themeService->getStaticUrl($theme->getName()) . BOL_ThemeService::PREVIEW_FILE;
         $themesInfo[$theme->getName()]['active'] = $theme->getName() === $activeTheme;
         $themesInfo[$theme->getName()]['changeUrl'] = OW::getRouter()->urlFor(__CLASS__, 'changeTheme', array('theme' => $theme->getName()));
         $themesInfo[$theme->getName()]['update_url'] = (int) $theme->getUpdate() === 1 && !defined('OW_PLUGIN_XP') ? OW::getRouter()->urlFor('ADMIN_CTRL_Themes', 'updateRequest', array('name' => $theme->getName())) : false;
     }
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('admin')->getStaticJsUrl() . 'theme_select.js');
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'jquery.sticky.js');
     OW::getDocument()->addOnloadScript("window.owThemes = new ThemesSelect(" . json_encode($themesInfo) . ");\n        \t\$('.selected_theme_info input.theme_select_submit').click(function(){\n    \t\t\twindow.location.href = '" . $themesInfo[$activeTheme]['changeUrl'] . "';\n    \t\t});\n            \$('.selected_theme_info_stick').sticky({topSpacing:60});\n            ");
     $adminTheme = OW::getThemeManager()->getThemeService()->getThemeObjectByName('origin');
     $defaultThemeImgUrl = $adminTheme === null ? '' : $adminTheme->getStaticImagesUrl();
     $this->assign('themeInfo', $themesInfo[$activeTheme]);
     $this->assign('themes', $themesInfo);
     $this->assign('defaultThemeImgDir', $defaultThemeImgUrl);
 }
Beispiel #29
0
    public function __construct(BASE_CLASS_WidgetParameter $objParams)
    {
        parent::__construct();
        $uniqName = $objParams->widgetDetails->uniqName;
        $this->assign('uniqName', $uniqName);
        $service = SLIDESHOW_BOL_Service::getInstance();
        $slides = $service->getSlideList($uniqName);
        $this->assign('slides', $slides);
        if ($slides) {
            $url = OW::getPluginManager()->getPlugin('slideshow')->getStaticJsUrl() . 'slides.min.jquery.js';
            OW::getDocument()->addScript($url);
            $settings = $objParams->customParamList;
            $params = array('sizes' => $service->getSizes($slides), 'pagination' => $settings['navigation'] ? "true" : "false", 'interval' => $settings['interval'], 'uniqname' => $uniqName, 'effect' => $settings['effect'], 'preloadImage' => OW::getThemeManager()->getThemeImagesUrl() . '/ajax_preloader_content.gif');
            $url = OW::getPluginManager()->getPlugin('slideshow')->getStaticJsUrl() . 'slideshow.js';
            OW::getDocument()->addScript($url);
            $id = uniqid();
            $script = 'var slideshow' . $id . ' = new slideshow(' . json_encode($params) . '); slideshow' . $id . '.init();';
            if ($objParams->customizeMode) {
                $script .= 'OW.WidgetPanel.bind("move", function(e) {
		            if ( e.widgetName == "' . $uniqName . '" ) {
		               OW.WidgetPanel.reloadWidget("' . $uniqName . '", function(markup, data){});
		            }
		        });';
            }
            OW::getDocument()->addOnloadScript($script);
        }
    }
Beispiel #30
0
 private function __construct()
 {
     $this->coverDao = UHEADER_BOL_CoverDao::getInstance();
     $this->templateDao = UHEADER_BOL_TemplateDao::getInstance();
     $this->templateRoleDao = UHEADER_BOL_TemplateRoleDao::getInstance();
     $this->plugin = OW::getPluginManager()->getPlugin('uheader');
 }