当前位置: 首页>>代码示例>>PHP>>正文


PHP BOL_QuestionService::getInstance方法代码示例

本文整理汇总了PHP中BOL_QuestionService::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP BOL_QuestionService::getInstance方法的具体用法?PHP BOL_QuestionService::getInstance怎么用?PHP BOL_QuestionService::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BOL_QuestionService的用法示例。


在下文中一共展示了BOL_QuestionService::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getList

 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));
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:28,代码来源:list.php

示例2: __construct

 public function __construct()
 {
     //parent::__construct();
     $this->questionService = BOL_QuestionService::getInstance();
     $this->setPageHeading(OW::getLanguage()->text('base', 'complete_your_profile_page_heading'));
     $this->setPageHeadingIconClass('ow_ic_user');
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:7,代码来源:complete_profile.php

示例3: getInfoList

 protected function getInfoList($userIdList)
 {
     $fields = array();
     $qs = array();
     $qBdate = BOL_QuestionService::getInstance()->findQuestionByName('birthdate');
     if ($qBdate->onView) {
         $qs[] = 'birthdate';
     }
     $qSex = BOL_QuestionService::getInstance()->findQuestionByName('sex');
     if ($qSex->onView) {
         $qs[] = 'sex';
     }
     $questionList = BOL_QuestionService::getInstance()->getQuestionData($userIdList, $qs);
     foreach ($questionList as $uid => $q) {
         $info = array();
         if (!empty($q['sex'])) {
             $info['sex'] = BOL_QuestionService::getInstance()->getQuestionValueLang('sex', $q['sex']);
         }
         if (!empty($q['birthdate'])) {
             $date = UTIL_DateTime::parseDate($q['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
             $age = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
             $info['age'] = $age;
         }
         $fields[$uid] = $info;
     }
     return $fields;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:abstract_user_bridge.php

示例4: __construct

 public function __construct($providerName)
 {
     parent::__construct();
     $providerConfigForm = new YNSOCIALCONNECT_CLASS_ConfigFieldsForm($providerName);
     $this->addForm($providerConfigForm);
     $service = YNSOCIALCONNECT_BOL_ServicesService::getInstance();
     $provider = $service->getProvider($providerName);
     $this->assign('provider', $provider->getTitle());
     $questionDtoList = $service->getOWQuestionDtoList($providerName);
     $questionList = array();
     foreach ($questionDtoList as $dto) {
         $questionList[$dto->sectionName][(int) $dto->sortOrder] = array('name' => $dto->name, 'el_name' => 'alias[' . $dto->name . ']');
     }
     $questionSectionDtoList = BOL_QuestionService::getInstance()->findAllSections();
     $tplQuestionList = array();
     foreach ($questionSectionDtoList as $sectionDto) {
         if (empty($questionList[$sectionDto->name])) {
             continue;
         }
         /* @var $sectionDto BOL_QuestionSection */
         $tplQuestionList[(int) $sectionDto->sortOrder] = array('name' => $sectionDto->name, 'items' => $questionList[$sectionDto->name]);
     }
     ksort($tplQuestionList);
     $this->assign('questionList', $tplQuestionList);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:25,代码来源:popup_config_fields.php

示例5: presentationToCssClass

 public static function presentationToCssClass()
 {
     $result = array();
     $presentations = BOL_QuestionService::getInstance()->getPresentations();
     foreach ($presentations as $presentation => $dataType) {
         switch ($presentation) {
             case BOL_QuestionService::QUESTION_PRESENTATION_CHECKBOX:
                 $result[$presentation] = 'owm_checkbox_wrap owm_simple_checkbox';
                 break;
             case BOL_QuestionService::QUESTION_PRESENTATION_MULTICHECKBOX:
                 $result[$presentation] = 'owm_checkbox_wrap';
                 break;
             case BOL_QuestionService::QUESTION_PRESENTATION_SELECT:
                 $result[$presentation] = 'owm_field_wrap owm_select_wrap';
                 break;
             case BOL_QuestionService::QUESTION_PRESENTATION_RADIO:
                 $result[$presentation] = 'owm_radio_wrap';
                 break;
             case BOL_QuestionService::QUESTION_PRESENTATION_BIRTHDATE:
             case BOL_QuestionService::QUESTION_PRESENTATION_DATE:
             case BOL_QuestionService::QUESTION_PRESENTATION_AGE:
                 $result[$presentation] = 'owm_field_wrap owm_select_wrap';
                 break;
             case BOL_QuestionService::QUESTION_PRESENTATION_TEXTAREA:
                 $result[$presentation] = 'owm_field_wrap owm_box_padding';
                 break;
             default:
                 $result[$presentation] = 'owm_field_wrap';
                 break;
         }
     }
     return $result;
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:33,代码来源:join_form_utlis.php

示例6: __construct

 public function __construct($userId, $idList)
 {
     parent::__construct();
     if (!empty($userId) && !empty($idList)) {
         $this->user = BOL_UserService::getInstance()->findUserById($userId);
         $userService = BOL_UserService::getInstance();
         $avatars = BOL_AvatarService::getInstance()->getAvatarsUrlList($idList, 2);
         $sexValue = array();
         $list = array();
         foreach (BOL_QuestionValueDao::getInstance()->findQuestionValues('sex') as $sexDto) {
             $sexValue[$sexDto->value] = BOL_QuestionService::getInstance()->getQuestionValueLang('sex', $sexDto->value);
         }
         $userData = BOL_QuestionService::getInstance()->getQuestionData($idList, array('sex', 'birthdate', 'googlemap_location'));
         foreach ($idList as $userId) {
             $list[$userId]['userUrl'] = $userService->getUserUrl($userId);
             $list[$userId]['displayName'] = $userService->getDisplayName($userId);
             $list[$userId]['avatarUrl'] = $avatars[$userId];
             $list[$userId]['activity'] = UTIL_DateTime::formatDate(BOL_UserService::getInstance()->findUserById($userId)->getActivityStamp());
             if (!empty($userData[$userId]['birthdate'])) {
                 $date = UTIL_DateTime::parseDate($userData[$userId]['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
                 $list[$userId]['age'] = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
             }
             if (!empty($userData[$userId]['sex'])) {
                 $list[$userId]['sex'] = $sexValue[$userData[$userId]['sex']];
             }
             if (!empty($userData[$userId]['googlemap_location'])) {
                 $list[$userId]['googlemap_location'] = $userData[$userId]['googlemap_location']['address'];
             }
         }
         $this->assign('userName', BOL_UserService::getInstance()->getDisplayName($this->user->id));
         $this->assign('list', $list);
     } else {
         $this->setVisible(FALSE);
     }
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:35,代码来源:notify.php

示例7: onBeforeRender

 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $questionNames = array();
     if ($this->previewMode) {
         $questions = BOL_QuestionService::getInstance()->findViewQuestionsForAccountType($this->user->accountType);
         foreach ($questions as $question) {
             if ($question["name"] == OW::getConfig()->getValue('base', 'display_name_question')) {
                 continue;
             }
             $questionNames[$question['sectionName']][] = $question["name"];
         }
     }
     $questions = BASE_CMP_UserViewWidget::getUserViewQuestions($this->user->id, OW::getUser()->isAdmin(), reset($questionNames));
     $data = array();
     foreach ($questions['data'][$this->user->id] as $key => $value) {
         $data[$key] = $value;
         if (is_array($value)) {
             $data[$key] = implode(', ', $value);
         }
     }
     $this->assign("displaySections", !$this->previewMode);
     $this->assign('questionArray', $questions['questions']);
     $this->assign('questionData', $data);
     $this->assign('questionLabelList', $questions['labels']);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:26,代码来源:profile_info.php

示例8: getAvatarInfo

 public function getAvatarInfo($idList)
 {
     $data = parent::getAvatarInfo($idList);
     $birthdays = BOL_QuestionService::getInstance()->getQuestionData($idList, array('birthdate'));
     foreach ($data as $userId => $item) {
         $yearOld = '';
         if (!empty($birthdays[$userId]['birthdate'])) {
             switch ($this->key) {
                 case 'birthdays_today':
                     $date = UTIL_DateTime::parseDate($birthdays[$userId]['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
                     $yearOld = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']) . " " . OW::getLanguage()->text('base', 'questions_age_year_old');
                     break;
                 case 'birthdays_this_week':
                     $date = UTIL_DateTime::parseDate($birthdays[$userId]['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
                     $yearOld = OW::getLanguage()->text('birthdays', 'birthday') . ' ' . UTIL_DateTime::formatBirthdate($date['year'], $date['month'], $date['day']) . " ";
                     break;
             }
         }
         if (!empty($data[$userId]['title'])) {
             $data[$userId]['attrs'] = ' data-birthday="' . (!empty($yearOld) ? $yearOld : '') . '"';
         } else {
             if (!empty($yearOld)) {
                 $data[$userId]['attrs'] = ' data-birthday="' . $yearOld . '"';
             }
         }
     }
     OW::getDocument()->addOnloadScript("\n                \$('*[title]', \$('.birthdays_avatar_list') ).each( function(i, o){\n                    \$(o).off('mouseenter');\n                    \$(o).on('mouseenter', function(){ \n                        var title = \$(this).attr('title');\n                        var birthday = \$(this).data('birthday');\n                        \n                        if ( !birthday )\n                        {\n                            OW.showTip(\$(this), {timeout:200});\n                        }\n                        else if ( !title && birthday )\n                        {\n                            birthday = '<span class=\"ow_small\" style=\"font-weight:normal;\">' + birthday + '</span>';\n                            \n                            OW.showTip(\$(this), {timeout:200, show:birthday});\n                        }\n                        else\n                        {\n                            birthday = '<br><span class=\"ow_small\" style=\"font-weight:normal;\">' + birthday + '</span>';\n                            \n                            OW.showTip(\$(this), {timeout:200, show:title + birthday});\n                        }\n                     });\n                    \$(o).off('mouseleave');\n                    \$(o).on('mouseleave', function(){ OW.hideTip(\$(this)); });\n            });");
     return $data;
 }
开发者ID:tammyrocks,项目名称:birthdays,代码行数:29,代码来源:avatar_user_list.php

示例9: __construct

 public function __construct($users, $size, $layout)
 {
     parent::__construct();
     $questionService = BOL_QuestionService::getInstance();
     $userService = BOL_UserService::getInstance();
     $this->uniqId = uniqid('ucl_');
     $idList = $this->fetchIdList($users);
     $qList = $questionService->getQuestionData($idList, array('sex', 'birthdate'));
     $displayNames = $userService->getDisplayNamesForList($idList);
     $urls = $userService->getUserUrlsForList($idList);
     $tplData = array();
     foreach ($idList as $userId) {
         $tplData[$userId] = array();
         $tplData[$userId]['displayName'] = empty($displayNames[$userId]) ? null : $displayNames[$userId];
         $tplData[$userId]['url'] = empty($urls[$userId]) ? null : $urls[$userId];
         $tplData[$userId]['sex'] = empty($qList[$userId]['sex']) || in_array($layout, array(3, 4)) ? null : strtolower(BOL_QuestionService::getInstance()->getQuestionValueLang('sex', $qList[$userId]['sex']));
         $tplData[$userId]['birthdate'] = null;
         if (!empty($qList[$userId]['birthdate']) && in_array($layout, array(1, 3))) {
             $date = UTIL_DateTime::parseDate($qList[$userId]['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
             $age = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
             $tplData[$userId]['birthdate'] = $age;
         }
         $avatar = BOL_AvatarService::getInstance()->getAvatarUrl($userId, 2);
         $tplData[$userId]['thumb'] = $avatar ? $avatar : BOL_AvatarService::getInstance()->getDefaultAvatarUrl(2);
     }
     $sizes = array('small' => 100, 'medium' => 150, 'big' => OW::getConfig()->getValue('base', 'avatar_big_size'));
     $this->assign('list', $tplData);
     $avatarSize = $sizes[$size];
     $this->assign('size', $size);
     $this->assign('uniqId', $this->uniqId);
     OW::getDocument()->addStyleDeclaration('.uc-avatar-size { width: ' . $avatarSize . 'px; height: ' . ($avatarSize + $avatarSize / 10) . 'px; }');
     OW::getDocument()->addStyleDeclaration('.uc-carousel-size { height: ' . ($avatarSize + 50) . 'px; }');
     OW::getDocument()->addStyleDeclaration('.uc-shape-waterWheel .uc-carousel { width: ' . ($avatarSize + 20) . 'px; }');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:34,代码来源:users.php

示例10: getList

 public function getList($params)
 {
     $service = SKADATEIOS_ABOL_Service::getInstance();
     $auth = array('photo.view' => $service->getAuthorizationActionStatus('photo', 'view'), 'base.search_users' => $service->getAuthorizationActionStatus('base', 'search_users'));
     $this->assign('auth', $auth);
     if ($auth["base.search_users"]["status"] != BOL_AuthorizationService::STATUS_AVAILABLE) {
         $this->assign("list", array());
         $this->assign("total", 0);
         return;
     }
     $_criteriaList = array_filter($params["criteriaList"]);
     $userId = OW::getUser()->getId();
     $userInfo = BOL_QuestionService::getInstance()->getQuestionData(array($userId), array("sex"));
     $_criteriaList["sex"] = !empty($userInfo[$userId]["sex"]) ? $userInfo[$userId]["sex"] : null;
     $questionList = BOL_QuestionService::getInstance()->findQuestionByNameList(array_keys($_criteriaList));
     $criteriaList = array();
     foreach ($_criteriaList as $questionName => $questionValue) {
         if (empty($questionList[$questionName])) {
             continue;
         }
         $criteriaList[$questionName] = $this->convertQuestionValue($questionList[$questionName]->presentation, $questionValue);
     }
     $idList = OW::getEventManager()->call("usearch.get_user_id_list", array("criterias" => $criteriaList, "limit" => array($params["first"], $params["count"])));
     $idList = empty($idList) ? array() : $idList;
     //$idList = BOL_UserService::getInstance()->findUserIdListByQuestionValues($criteriaList, $params["first"], $params["count"]);
     $total = BOL_UserService::getInstance()->countUsersByQuestionValues($params["criteriaList"]);
     $userData = BOL_AvatarService::getInstance()->getDataForUserAvatars($idList, false, false, true, true);
     $questionsData = BOL_QuestionService::getInstance()->getQuestionData($idList, array("googlemap_location", "birthdate"));
     foreach ($questionsData as $userId => $data) {
         $date = UTIL_DateTime::parseDate($data['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
         $userData[$userId]["ages"] = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
         $userData[$userId]["location"] = empty($data["googlemap_location"]["address"]) ? null : $data["googlemap_location"]["address"];
     }
     $photoList = array();
     $avatarList = array();
     foreach ($idList as $userId) {
         $bigAvatar = SKADATE_BOL_Service::getInstance()->findAvatarByUserId($userId);
         $avatarList[$userId] = $bigAvatar ? SKADATE_BOL_Service::getInstance()->getAvatarUrl($userId, $bigAvatar->hash) : BOL_AvatarService::getInstance()->getAvatarUrl($userId, 2);
         $event = new OW_Event('photo.getMainAlbum', array('userId' => $userId));
         OW::getEventManager()->trigger($event);
         $album = $event->getData();
         $photos = !empty($album['photoList']) ? $album['photoList'] : array();
         foreach ($photos as $photo) {
             $photoList[$userId][] = array("src" => $photo["url"]["main"]);
         }
     }
     $bookmarksList = OW::getEventManager()->call("bookmarks.get_mark_list", array("userId" => OW::getUser()->getId(), "idList" => $idList));
     $bookmarksList = empty($bookmarksList) ? array() : $bookmarksList;
     $list = array();
     foreach ($idList as $userId) {
         $list[] = array("userId" => $userId, "photos" => empty($photoList[$userId]) ? array() : $photoList[$userId], "avatar" => $avatarList[$userId], "name" => empty($userData[$userId]["title"]) ? "" : $userData[$userId]["title"], "label" => $userData[$userId]["label"], "labelColor" => $userData[$userId]["labelColor"], "location" => empty($userData[$userId]["location"]) ? "" : $userData[$userId]["location"], "ages" => $userData[$userId]["ages"], "bookmarked" => !empty($bookmarksList[$userId]));
     }
     $this->assign("list", $list);
     $this->assign("total", $total);
     $allowSendMessage = OW::getPluginManager()->isPluginActive('mailbox');
     $this->assign("actions", array("bookmark" => OW::getPluginManager()->isPluginActive('bookmarks'), "message" => $allowSendMessage, "wink" => OW::getPluginManager()->isPluginActive('winks')));
     BOL_AuthorizationService::getInstance()->trackAction("base", "search_users");
     $mailboxModes = OW::getEventManager()->call('mailbox.get_active_mode_list');
     $this->assign("mailboxModes", empty($mailboxModes) ? array() : $mailboxModes);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:60,代码来源:search.php

示例11: onBeforeRender

 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $userList = array();
     $userDtoList = array();
     $userService = BOL_UserService::getInstance();
     $questionService = BOL_QuestionService::getInstance();
     $userIdList = array_keys($this->userList);
     $userDataList = BOL_QuestionService::getInstance()->getQuestionData($userIdList, $this->fieldList);
     foreach ($userService->findUserListByIdList($userIdList) as $userDto) {
         $userDtoList[$userDto->id] = $userDto;
     }
     foreach ($this->userList as $userId => $fieldList) {
         $fields = array_diff(array_keys($fieldList), $this->fieldList);
         $fieldsData = $questionService->getQuestionData(array($userId), $fields);
         $userList[$userId]['fields'] = array_merge(!empty($userDataList[$userId]) ? $userDataList[$userId] : array(), !empty($fieldsData[$userId]) ? $fieldsData[$userId] : array(), $fieldList);
         $userList[$userId]['dto'] = $userDtoList[$userId];
     }
     $this->assign('userList', $userList);
     $this->assign('avatars', BOL_AvatarService::getInstance()->getAvatarsUrlList($userIdList, 2));
     $this->assign('onlineList', !empty($userIdList) ? $userService->findOnlineStatusForUserList($userIdList) : array());
     $this->assign('usernameList', $userService->getUserNamesForList($userIdList));
     $this->assign('displaynameList', $userService->getDisplayNamesForList($userIdList));
     $this->assign('displayActivity', $this->displayActivity);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:25,代码来源:user_list.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $this->questionService = BOL_QuestionService::getInstance();
     $this->emailVerifyService = BOL_EmailVerifyService::getInstance();
     $this->userService = BOL_UserService::getInstance();
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:7,代码来源:email_verify.php

示例13: getFields

 public function getFields($userIdList)
 {
     $fields = array();
     $qs = array();
     $qBdate = BOL_QuestionService::getInstance()->findQuestionByName('birthdate');
     if ($qBdate->onView) {
         $qs[] = 'birthdate';
     }
     $qSex = BOL_QuestionService::getInstance()->findQuestionByName('sex');
     if ($qSex->onView) {
         $qs[] = 'sex';
     }
     $questionList = BOL_QuestionService::getInstance()->getQuestionData($userIdList, $qs);
     foreach ($questionList as $uid => $q) {
         $fields[$uid] = array();
         $age = '';
         if (!empty($q['birthdate'])) {
             $date = UTIL_DateTime::parseDate($q['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
             $age = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
         }
         if (!empty($q['sex'])) {
             $fields[$uid][] = array('label' => '', 'value' => BOL_QuestionService::getInstance()->getQuestionValueLang('sex', $q['sex']) . ' ' . $age);
         }
         if (!empty($q['birthdate'])) {
             $dinfo = date_parse($q['birthdate']);
         }
     }
     return $fields;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:29,代码来源:floatbox_user_list.php

示例14: getProgressbarData

 public function getProgressbarData($userId, $isOwner = false)
 {
     if (empty($userId)) {
         return NULL;
     }
     $user = BOL_UserService::getInstance()->findUserById($userId);
     if (empty($user)) {
         return NULL;
     }
     $questions = BOL_QuestionService::getInstance()->findAllQuestionsForAccountType($user->getAccountType());
     $questionNameList = array();
     foreach ($questions as $question) {
         $questionNameList[] = $question['name'];
     }
     $questionData = BOL_QuestionService::getInstance()->getQuestionData(array($userId), $questionNameList);
     $data = array(self::KEY_PROGRESSBAR => array(self::COUNT_QUESTION => count($questions), self::COUNT_COMPLETED_QUESTION => count(array_filter($questionData[$userId]))));
     $authService = BOL_AuthorizationService::getInstance();
     $defaultFeatures = self::getEntityTypes();
     $features = array_filter(get_object_vars(json_decode(OW::getConfig()->getValue('profileprogressbar', 'features'))));
     $_features = array();
     $actions = array('blogs' => 'add', 'event' => 'add_event', 'forum' => 'edit', 'friends' => 'add_friend', 'groups' => 'create', 'links' => 'add', 'photo' => 'upload', 'video' => 'add', 'virtualgifts' => 'send_gift');
     foreach ($features as $feature => $count) {
         if (isset($actions[$feature]) && $authService->isActionAuthorizedForUser($userId, $feature, $actions[$feature])) {
             $data[self::KEY_PROGRESSBAR][self::COUNT_QUESTION] += $count;
             $_features[$defaultFeatures[$feature]] = $count;
         }
     }
     $data[self::KEY_PROGRESSBAR][self::COUNT_COMPLETED_QUESTION] += (int) $this->getCompletedFeaturesCount($userId, array_keys($_features));
     if ($isOwner) {
         $langFeatures = array();
         $completedFeatures = $this->getCompletedFeatures($userId, array_keys($_features));
         foreach ($_features as $feature => $count) {
             $need = NULL;
             if (!isset($completedFeatures[$feature]) || ($need = $count - $completedFeatures[$feature]) > 0) {
                 $_feature = array_search($feature, $defaultFeatures);
                 $langFeatures[$_feature] = OW::getLanguage()->text('profileprogressbar', $_feature . '_desc');
                 $langFeatures[$_feature . 'Count'] = $need === NULL ? $count : $need;
             }
         }
         if (count($langFeatures) > 0) {
             $vars = array();
             foreach ($langFeatures as $key => $value) {
                 $vars['{$' . $key . '}'] = $value;
             }
             $hintText = explode('#', OW::getLanguage()->text('profileprogressbar', 'hint_text'));
             foreach ($hintText as $key => $hint) {
                 $hintText[$key] = str_replace(array_keys($vars), array_values($vars), $hint);
             }
             function unsetUnusedHint($val)
             {
                 return strpos($val, '{$') === FALSE;
             }
             $hintText = array_filter($hintText, 'unsetUnusedHint');
             $data[self::KEY_HINT] = trim(implode('', $hintText));
         }
     }
     return $data;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:58,代码来源:service.php

示例15: __construct

 public function __construct()
 {
     parent::__construct('MATCHMAKING_PreferencesForm');
     $this->questionService = BOL_QuestionService::getInstance();
     $language = OW::getLanguage();
     $save = new Submit('save');
     $save->setValue($language->text('matchmaking', 'btn_label_save'));
     $this->addElement($save);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:9,代码来源:preferences_form.php


注:本文中的BOL_QuestionService::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。