本文整理汇总了PHP中BASE_CLASS_Widget类的典型用法代码示例。如果您正苦于以下问题:PHP BASE_CLASS_Widget类的具体用法?PHP BASE_CLASS_Widget怎么用?PHP BASE_CLASS_Widget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BASE_CLASS_Widget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(BASE_CLASS_WidgetParameter $paramsObj)
{
parent::__construct();
$params = $paramsObj->customParamList;
$addParams = $paramsObj->additionalParamList;
if (empty($addParams['entityId']) || !OW::getUser()->isAuthenticated() || !OW::getUser()->isAuthorized('eventx', 'view_event')) {
$this->setVisible(false);
return;
} else {
$userId = $addParams['entityId'];
}
$eventParams = array('action' => 'event_view_attend_events', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
try {
OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
} catch (RedirectException $e) {
$this->setVisible(false);
return;
}
$language = OW::getLanguage();
$eventService = EVENTX_BOL_EventService::getInstance();
$userEvents = $eventService->findUserParticipatedPublicEvents($userId, null, $params['events_count']);
if (empty($userEvents)) {
$this->setVisible(false);
return;
}
$this->assign('my_events', $eventService->getListingDataWithToolbar($userEvents));
$toolbarArray = array();
if ($eventService->findUserParticipatedPublicEventsCount($userId) > $params['events_count']) {
$url = OW::getRequest()->buildUrlQueryString(OW::getRouter()->urlForRoute('eventx.view_event_list', array('list' => 'user-participated-events')), array('userId' => $userId));
$toolbarArray = array(array('href' => $url, 'label' => $language->text('eventx', 'view_all_label')));
}
$this->assign('toolbars', $toolbarArray);
}
开发者ID:vazahat,项目名称:dudex,代码行数:33,代码来源:profile_page_widget.php
示例2: __construct
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);
}
}
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:slideshow_widget.php
示例3: __construct
public function __construct(BASE_CLASS_WidgetParameter $paramObject)
{
parent::__construct();
$this->assign('url', OW::getRouter()->urlForRoute('base_join'));
$this->assign('label', !empty($paramObject->customParamList['buttonLabel']) ? $paramObject->customParamList['buttonLabel'] : OW::getLanguage()->text('base', 'join_index_join_button'));
$this->setTemplate(OW::getPluginManager()->getPlugin('base')->getMobileCmpViewDir() . 'join_now_widget.html');
}
开发者ID:hardikamutech,项目名称:loov,代码行数:7,代码来源:join_now_widget.php
示例4: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
// $service = PostService::getInstance();
// $count = $params->customParamList['count'];
// $previewLength = $params->customParamList['previewLength'];
// $list = $service->findList(0, $count);
/*
if ( empty($list) && !OW::getUser()->isAuthorized('shoppro', 'add') && !$params->customizeMode )
{
$this->setVisible(false);
return;
}
*/
$this->userId = OW::getUser()->getId();
//citent login user (uwner)
$this->feed_working_Id = $params->additionalParamList['entityId'];
//set wotching user id
$posts = array();
$userService = BOL_UserService::getInstance();
$postIdList = array();
$commentInfo = array();
$this->assign('commentInfo', $commentInfo);
$this->assign('list', $posts);
}
开发者ID:vazahat,项目名称:dudex,代码行数:26,代码来源:menu_widget.php
示例5: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$groupId = $params->additionalParamList['entityId'];
$userId = OW::getUser()->getId();
$service = GROUPS_BOL_Service::getInstance();
$feedService = GROUPRSS_BOL_FeedService::getInstance();
$whoCanAdd = OW::getConfig()->getValue('grouprss', 'actionMember');
if ($whoCanAdd == 'admin' && !OW::getUser()->isAdmin()) {
$this->setVisible(false);
return;
}
$mypaths = explode("/", UTIL_Url::selfUrl());
$groupId = strtolower(end($mypaths));
if ($groupId == 'customize') {
$groupId = strtolower(prev($mypaths));
}
if ($whoCanAdd == 'creator' && $feedService->getGroupCreater($groupId) !== $userId) {
$this->setVisible(false);
return;
}
if ($whoCanAdd == 'both') {
if (!OW::getUser()->isAdmin() && $feedService->getGroupCreater($groupId) !== $userId) {
$this->setVisible(false);
return;
}
}
$this->assign('groupId', (int) $groupId);
}
开发者ID:vazahat,项目名称:dudex,代码行数:29,代码来源:manage_feeds_widget.php
示例6: __construct
/**
* @return Constructor.
*/
public function __construct(BASE_CLASS_WidgetParameter $paramObj)
{
parent::__construct();
$service = GROUPS_BOL_Service::getInstance();
$groupId = (int) $paramObj->additionalParamList['entityId'];
$this->addComponent('briefInfo', new GROUPS_CMP_BriefInfoContent($groupId));
}
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:brief_info_widget.php
示例7: __construct
/**
* @return Constructor.
*/
public function __construct(BASE_CLASS_WidgetParameter $paramObj)
{
parent::__construct();
$avatarService = BOL_AvatarService::getInstance();
$viewerId = OW::getUser()->getId();
$userId = $paramObj->additionalParamList['entityId'];
if ($viewerId == $userId) {
$this->assign('owner', true);
$this->assign('changeAvatarUrl', OW::getRouter()->urlForRoute('base_avatar_crop'));
} else {
$this->assign('owner', false);
}
$avatar = $avatarService->getAvatarUrl($userId, 2);
$this->assign('avatar', $avatar ? $avatar : $avatarService->getDefaultAvatarUrl(2));
$roles = BOL_AuthorizationService::getInstance()->getRoleListOfUsers(array($userId));
$this->assign('role', !empty($roles[$userId]) ? $roles[$userId] : null);
$userService = BOL_UserService::getInstance();
$showPresence = true;
// Check privacy permissions
$eventParams = array('action' => 'base_view_my_presence_on_site', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
try {
OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
} catch (RedirectException $e) {
$showPresence = false;
}
$this->assign('isUserOnline', $userService->findOnlineUserById($userId) && $showPresence);
$this->assign('userId', $userId);
$this->assign('avatarSize', OW::getConfig()->getValue('base', 'avatar_big_size'));
}
开发者ID:vazahat,项目名称:dudex,代码行数:32,代码来源:user_avatar_widget.php
示例8: __construct
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);
}
}
}
开发者ID:hardikamutech,项目名称:loov,代码行数:30,代码来源:bookmarks_widget.php
示例9: __construct
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);
}
开发者ID:hardikamutech,项目名称:loov,代码行数:33,代码来源:welcome_widget.php
示例10: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$service = FRIENDS_BOL_Service::getInstance();
$userId = $params->additionalParamList['entityId'];
$count = (int) $params->customParamList['count'];
$idList = $service->findUserFriendsInList($userId, 0, $count);
$total = $service->countFriends($userId);
$userService = BOL_UserService::getInstance();
$eventParams = array('action' => 'friends_view', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
try {
OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
} catch (RedirectException $e) {
$this->setVisible(false);
return;
}
if (empty($idList) && !$params->customizeMode) {
$this->setVisible(false);
return;
}
if (!empty($idList)) {
$this->addComponent('userList', new BASE_CMP_AvatarUserList($idList));
}
$username = BOL_UserService::getInstance()->getUserName($userId);
$toolbar = array();
if ($total > $count) {
$toolbar = array(array('label' => OW::getLanguage()->text('base', 'view_all'), 'href' => OW::getRouter()->urlForRoute('friends_user_friends', array('user' => $username))));
}
$this->assign('toolbar', $toolbar);
}
开发者ID:tammyrocks,项目名称:friends,代码行数:30,代码来源:user_widget.php
示例11: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$count = (int) $params->customParamList['count'];
$service = SKAPI_BOL_Service::getInstance();
$userId = OW::getUser()->getId();
$guests = $service->findGuestsForUser($userId, 1, $count);
if (!$guests) {
$this->setVisible(false);
return;
}
$userIdList = array();
foreach ($guests as $guest) {
array_push($userIdList, $guest->guestId);
}
$avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars($userIdList);
foreach ($avatars as &$item) {
$item['class'] = 'ow_guest_avatar';
}
$event = new OW_Event('bookmarks.is_mark', array(), $avatars);
OW::getEventManager()->trigger($event);
if ($event->getData()) {
$avatars = $event->getData();
}
$this->assign('avatars', $avatars);
$this->assign('guests', $guests);
$total = $service->countGuestsForUser($userId);
if ($total > $count) {
$toolbar = array('label' => OW::getLanguage()->text('base', 'view_all'), 'href' => OW::getRouter()->urlForRoute('skapi.list'));
$this->setSettingValue(self::SETTING_TOOLBAR, array($toolbar));
}
}
开发者ID:hardikamutech,项目名称:hammu,代码行数:32,代码来源:my_guests_widget.php
示例12: __construct
/**
* @return Constructor.
*/
public function __construct(BASE_CLASS_WidgetParameter $paramObj)
{
parent::__construct();
//echo "call";
$avatarService = BOL_AvatarService::getInstance();
$userId = OW::getUser()->getId();
$avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId), true, true, true, true, 2);
// $avatars = BOL_AvatarService::getInstance()->getAvatarsUrlList(array($userId), 2);
// echo '<pre>';
// print_r($avatars);
// echo '</pre>';
$this->assign('avatar', $avatars[$userId]);
$event = new BASE_CLASS_EventCollector('base.on_avatar_toolbar_collect', array('userId' => $userId));
OW::getEventManager()->trigger($event);
$toolbarItems = $event->getData();
// echo '<pre>';
// print_r($toolbarItems);
// echo '</pre>';
$tplToolbarItems = array();
foreach ($toolbarItems as $item) {
if (empty($item['title']) || empty($item['url']) || empty($item['iconClass'])) {
continue;
}
$order = empty($item['order']) ? count($tplToolbarItems) + 1 : (int) $item['order'];
if (!empty($tplToolbarItems[$order])) {
$order = count($tplToolbarItems) + 1;
}
$tplToolbarItems[$order] = $item;
}
ksort($tplToolbarItems);
$this->assign('toolbarItems', array_values($tplToolbarItems));
}
开发者ID:hardikamutech,项目名称:hammu,代码行数:35,代码来源:my_avatar_widget.php
示例13: __construct
/**
* @param BASE_CLASS_WidgetParameter $params
* @return \BASE_CMP_UserViewWidget
*/
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$userId = $params->additionalParamList['entityId'];
$viewerId = OW::getUser()->getId();
$ownerMode = $userId == $viewerId;
$adminMode = OW::getUser()->isAdmin() || OW::getUser()->isAuthorized('base');
$isSuperAdmin = BOL_AuthorizationService::getInstance()->isSuperModerator($userId);
$user = BOL_UserService::getInstance()->findUserById($userId);
$accountType = $user->accountType;
$questionService = BOL_QuestionService::getInstance();
$questions = self::getUserViewQuestions($userId, $adminMode);
$questionArray = $questions['questions'];
$questionData = $questions['data'];
$questionLabelList = $questions['labels'];
$sections = array_keys($questionArray);
$template = OW::getPluginManager()->getPlugin('base')->getViewDir() . 'components' . DS . 'user_view_widget_table.html';
$userViewPresntation = OW::getConfig()->getValue('base', 'user_view_presentation');
if ($userViewPresntation === self::USER_VIEW_PRESENTATION_TABS) {
$template = OW::getPluginManager()->getPlugin('base')->getViewDir() . 'components' . DS . 'user_view_widget_tabs.html';
OW::getDocument()->addOnloadScript(" view = new UserViewWidget(); ");
$jsDir = OW::getPluginManager()->getPlugin("base")->getStaticJsUrl();
OW::getDocument()->addScript($jsDir . "user_view_widget.js");
$this->addMenu($sections);
}
$script = ' $(".profile_hidden_field").bind( "mouseover.hiddenfield",
function() {
OW.showTip($(this), {side: "top", hideEvent: "mouseout", timeout:0, show: "' . OW::getLanguage()->text('base', 'base_invisible_profile_field_tooltip') . '"});
} );';
OW::getDocument()->addOnloadScript($script);
$this->setTemplate($template);
$accountTypes = $questionService->findAllAccountTypes();
if (!isset($sections[0])) {
$sections[0] = 0;
}
if (count($accountTypes) > 1) {
if (!isset($questionArray[$sections[0]])) {
$questionArray[$sections[0]] = array();
}
array_unshift($questionArray[$sections[0]], array('name' => 'accountType', 'presentation' => 'select'));
$questionData[$userId]['accountType'] = $questionService->getAccountTypeLang($accountType);
}
if (!isset($questionData[$userId])) {
$questionData[$userId] = array();
}
$this->assign('firstSection', $sections[0]);
$this->assign('questionArray', $questionArray);
$this->assign('questionData', $questionData[$userId]);
$this->assign('ownerMode', $ownerMode);
$this->assign('adminMode', $adminMode);
$this->assign('superAdminProfile', $isSuperAdmin);
$this->assign('profileEditUrl', OW::getRouter()->urlForRoute('base_edit'));
if ($adminMode && !$ownerMode) {
$this->assign('profileEditUrl', OW::getRouter()->urlForRoute('base_edit_user_datails', array('userId' => $userId)));
}
$this->assign('avatarUrl', BOL_AvatarService::getInstance()->getAvatarUrl($userId));
$this->assign('displayName', BOL_UserService::getInstance()->getDisplayName($userId));
$this->assign('questionLabelList', $questionLabelList);
$this->assign('userId', $userId);
}
开发者ID:vazahat,项目名称:dudex,代码行数:64,代码来源:user_view_widget.php
示例14: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
if (!BOL_AuthorizationService::getInstance()->isModerator() && !OW::getUser()->isAdmin()) {
$this->setVisible(false);
return;
}
$uniqId = uniqid("mp-");
$this->assign("uniqId", $uniqId);
$event = new BASE_CLASS_EventCollector(self::EVENT_COLLECT_CONTENTS);
OW::getEventManager()->trigger($event);
$tplContents = array();
$activeTab = null;
foreach ($event->getData() as $content) {
$tplContent = array_merge(array("name" => null, "content" => null, "active" => false), $content);
$activeTab = $tplContent["active"] ? $tplContent["name"] : $activeTab;
$tplContents[$tplContent["name"]] = $tplContent;
}
if (empty($tplContents)) {
$this->setVisible(false);
return;
}
if ($activeTab === null) {
$firstTab = reset($tplContents);
$activeTab = $firstTab["name"];
$tplContents[$activeTab]["active"] = true;
}
$this->assign("items", $tplContents);
}
开发者ID:hardikamutech,项目名称:loov,代码行数:29,代码来源:moderation_tools_widget.php
示例15: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$lang = OW::getLanguage();
$service = OCSTOPUSERS_BOL_Service::getInstance();
$limit = $params->customParamList['userCount'];
$list = $service->findList(1, $limit);
if ($list) {
$this->assign('list', $list);
$total = $service->countUsers();
$this->assign('total', $total);
$idList = array();
$scores = array();
$rates = array();
foreach ($list as $user) {
array_push($idList, $user['dto']->id);
$scores[$user['dto']->id] = $user['score'];
$rates[$user['dto']->id] = $user['rates'];
}
$avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars($idList);
foreach ($avatars as $userId => &$av) {
$av['title'] .= ' - ' . $lang->text('ocstopusers', 'rate_info', array('rates' => $rates[$userId], 'score' => floatval($scores[$userId])));
}
$this->assign('avatars', $avatars);
$this->assign('scores', $scores);
if ($total > $limit) {
$toolbar = array(array('href' => OW::getRouter()->urlForRoute('ocstopusers.list'), 'label' => OW::getLanguage()->text('base', 'view_all')));
$this->setSettingValue(self::SETTING_TOOLBAR, $toolbar);
}
} else {
$this->assign('list', null);
}
}
开发者ID:jorgemunoz8807,项目名称:havanabook,代码行数:33,代码来源:index_widget.php
示例16: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$lang = OW::getLanguage();
$service = OCSSITESTATS_BOL_Service::getInstance();
$this->assign('data', $service->getStatistics());
$this->assign('zeroValues', OW::getConfig()->getValue('ocssitestats', 'zero_values'));
}
开发者ID:vazahat,项目名称:dudex,代码行数:8,代码来源:index_widget.php
示例17: __construct
/**
* @return Constructor.
*/
public function __construct(BASE_CLASS_WidgetParameter $paramObj)
{
parent::__construct();
$clipService = VWLS_BOL_ClipService::getInstance();
$count = isset($paramObj->customParamList['clipCount']) ? (int) $paramObj->customParamList['clipCount'] : 4;
$lang = OW::getLanguage();
$this->assign('showTitles', $paramObj->customParamList['showTitles']);
/** $latest = $clipService->findClipsList('latest', 1, $count);
if ( $latest )
{
$latest[0]['code'] = $this->prepareClipCode($latest[0]['code'], $latest[0]['provider']);
}
$this->assign('latest', $latest);
*/
$online = $clipService->findClipsList('online', 1, $count);
if ($online) {
$online[0]['code'] = $this->prepareClipCode($online[0]['code'], $latest[0]['provider']);
}
$this->assign('online', $online);
$userId = OW::getUser()->getId();
$this->assign('userId', $userId);
if (!$latest && !OW::getUser()->isAuthorized('vwls', 'add')) {
$this->setVisible(false);
return;
}
/** $featured = $clipService->findClipsList('featured', 1, $count);
if ( $featured )
{
$featured[0]['code'] = $this->prepareClipCode($featured[0]['code'], $featured[0]['provider']);
}
$this->assign('featured', $featured);
*/
$toprated = $clipService->findClipsList('toprated', 1, $count);
if ($toprated) {
$toprated[0]['code'] = $this->prepareClipCode($toprated[0]['code'], $toprated[0]['provider']);
}
$this->assign('toprated', $toprated);
$menuItems['latest'] = array('label' => $lang->text('vwls', 'menu_latest'), 'id' => 'vwls-widget-menu-latest', 'contId' => 'vwls-widget-latest', 'active' => true);
/** if ( $featured )
{
$menuItems['featured'] = array(
'label' => $lang->text('vwls', 'menu_featured'),
'id' => 'vwls-widget-menu-featured',
'contId' => 'vwls-widget-featured',
);
}
*/
$menuItems['toprated'] = array('label' => $lang->text('vwls', 'menu_toprated'), 'id' => 'vwls-widget-menu-toprated', 'contId' => 'vwls-widget-toprated');
if (!$paramObj->customizeMode) {
$this->addComponent('menu', new BASE_CMP_WidgetMenu($menuItems));
}
$this->assign('items', $menuItems);
$toolbars = self::getToolbar();
$this->assign('toolbars', $toolbars);
if ($latest) {
$this->setSettingValue(self::SETTING_TOOLBAR, $toolbars['latest']);
}
}
开发者ID:vazahat,项目名称:dudex,代码行数:61,代码来源:vwls_list_widget.php
示例18: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$service = LinkService::getInstance();
$userId = $params->additionalParamList['entityId'];
if ($userId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('links', 'view')) {
$this->setVisible(false);
return;
}
/* Check privacy permissions */
$eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
try {
OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
} catch (RedirectException $ex) {
$this->setVisible(false);
return;
}
/* */
if ($service->countUserLinks($userId) == 0 && !$params->customizeMode) {
$this->setVisible(false);
return;
}
$this->assign('displayname', BOL_UserService::getInstance()->getDisplayName($userId));
$this->assign('username', BOL_UserService::getInstance()->getUsername($userId));
$list = array();
$count = $params->customParamList['count'];
$userLinkList = $service->findUserLinkList($userId, 0, $count);
$idList = array();
foreach ($userLinkList as $item) {
/* Check privacy permissions */
if ($item->userId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('links')) {
$eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => $item->userId, 'viewerId' => OW::getUser()->getId());
try {
OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
} catch (RedirectException $ex) {
continue;
}
}
/* */
$list[] = $item;
$idList[] = $item->id;
}
$commentInfo = array();
if (!empty($idList)) {
$commentInfo = BOL_CommentService::getInstance()->findCommentCountForEntityList('link', $idList);
$tb = array();
foreach ($list as $key => $item) {
if (mb_strlen($item->getDescription()) > 100) {
$item->setDescription(UTIL_String::truncate($item->getDescription(), 100, '...'));
}
$list[$key]->setDescription(strip_tags($item->getDescription()));
$tb[$item->getId()] = array(array('label' => '<span class="ow_txt_value">' . $commentInfo[$item->getId()] . '</span> ' . OW::getLanguage()->text('links', 'comments'), 'href' => OW::getRouter()->urlForRoute('link', array('id' => $item->getId()))), array('label' => UTIL_DateTime::formatDate($item->getTimestamp()), 'class' => 'ow_ic_date'));
}
$this->assign('tb', $tb);
}
$this->assign('list', $list);
$this->setSettingValue(self::SETTING_TOOLBAR, array(array('label' => OW::getLanguage()->text('base', 'view_all'), 'href' => OW::getRouter()->urlForRoute('links-user', array('user' => BOL_UserService::getInstance()->getUserName($userId))))));
}
开发者ID:vazahat,项目名称:dudex,代码行数:58,代码来源:user_links_widget.php
示例19: __construct
/**
* @return Constructor.
*/
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$groupId = $params->additionalParamList['entityId'];
$count = empty($params->customParamList['count']) ? 9 : (int) $params->customParamList['count'];
if ($this->assignList($groupId, $count)) {
$this->setSettingValue(self::SETTING_TOOLBAR, array(array('label' => OW::getLanguage()->text('groups', 'widget_users_view_all'), 'href' => OW::getRouter()->urlForRoute('groups-user-list', array('groupId' => $groupId)))));
}
}
开发者ID:vazahat,项目名称:dudex,代码行数:12,代码来源:user_list_widget.php
示例20: __construct
/**
* Constructor.
*/
public function __construct(BASE_CLASS_WidgetParameter $paramObj)
{
parent::__construct();
$cmp = new ADS_CMP_Ads(array('position' => 'sidebar'));
if (!$cmp->isVisible()) {
$this->setVisible(false);
} else {
$this->addComponent('ads', $cmp);
}
}
开发者ID:hardikamutech,项目名称:loov,代码行数:13,代码来源:sidebar_ads.php
注:本文中的BASE_CLASS_Widget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论