本文整理汇总了PHP中cbTooltip函数的典型用法代码示例。如果您正苦于以下问题:PHP cbTooltip函数的具体用法?PHP cbTooltip怎么用?PHP cbTooltip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cbTooltip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showTags
/**
* @param TagTable[] $rows
* @param Tags $stream
* @param int $output 0: Normal, 1: Raw, 2: Inline, 3: Load , 4: Save
* @param UserTable $user
* @param UserTable $viewer
* @param cbPluginHandler $plugin
* @return null|string
*/
static public function showTags( $rows, $stream, $output, $user, $viewer, $plugin )
{
global $_PLUGINS;
CBActivity::loadHeaders( $output );
$sourceClean = htmlspecialchars( $stream->source() );
$tags = array();
$return = null;
$_PLUGINS->trigger( 'activity_onBeforeDisplayTags', array( &$return, &$rows, $stream, $output ) );
if ( $rows ) foreach ( $rows as $row ) {
$rowId = $sourceClean . 'Tag' . (int) $row->get( 'id' );
if ( is_numeric( $row->get( 'user' ) ) ) {
$name = CBuser::getInstance( (int) $row->get( 'user' ), false )->getField( 'formatname', null, 'html', 'none', 'list', 0, true );
} else {
$name = htmlspecialchars( $row->get( 'user' ) );
}
if ( ! $name ) {
continue;
}
$tags[] = '<span id="' . $rowId . '" class="streamTag">'
. $name
. '</span>';
}
if ( $tags ) {
$return .= ( ! in_array( $output, array( 1, 4 ) ) ? '<span class="' . $sourceClean . 'Tags streamTags">' : null );
if ( count( $tags ) > 2 ) {
$tagOne = array_shift( $tags );
$tagTwo = array_shift( $tags );
$moreTooltip = cbTooltip( null, '<div class="streamTagRow">' . implode( '</div><div class="streamTagRow">', $tags ) . '</div>', null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-open-event="click" data-cbtooltip-close-event="click unfocus" data-cbtooltip-button-hide="true"' );
$more = '<a href="javascript: void(0);"' . $moreTooltip . '>' . CBTxt::T( 'TAGS_MORE', '%%COUNT%% more', array( '%%COUNT%%' => count( $tags ) ) ) . '</a>';
$return .= CBTxt::T( 'TAGS_MORE_THAN_TWO', '[tag_1], [tag_2], and [more]', array( '[tag_1]' => $tagOne, '[tag_2]' => $tagTwo, '[more]' => $more ) );
} elseif ( count( $tags ) > 1 ) {
$return .= CBTxt::T( 'TAGS_TWO', '[tag_1] and [tag_2]', array( '[tag_1]' => $tags[0], '[tag_2]' => $tags[1] ) );
} else {
$return .= $tags[0];
}
$return .= ( ! in_array( $output, array( 1, 4 ) ) ? '</span>' : null );
}
$return .= CBActivity::reloadHeaders( $output );
$_PLUGINS->trigger( 'activity_onAfterDisplayTags', array( &$return, $rows, $stream, $output ) );
return $return;
}
示例2: showDisable
/**
* @param int $userId
* @param UserTable $user
* @param cbPluginHandler $plugin
*/
static public function showDisable( $userId, $user, $plugin )
{
global $_CB_framework;
cbValidator::loadValidation();
$profileUrl = $_CB_framework->userProfileUrl( $user->get( 'id' ) );
$pageTitle = CBTxt::T( 'Disable My Account' );
$_CB_framework->setPageTitle( $pageTitle );
$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $profileUrl );
initToolTip();
$tooltip = cbTooltip( null, CBTxt::T( 'Optionally input a reason for disabling your account.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$return = '<div class="privacyDisableAccount">'
. '<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'privacy', 'func' => 'disableuser', 'id' => (int) $userId ) ) . '" method="post" enctype="multipart/form-data" name="privacyForm" id="privacyForm" class="cb_form privacyForm form-auto cbValidation">'
. ( $pageTitle ? '<div class="privacyTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
. '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
. '<label for="reason" class="col-sm-3 control-label">' . CBTxt::T( 'Reason' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. '<textarea id="reason" name="reason" class="form-control" cols="40" rows="5"' . ( $tooltip ? ' ' . $tooltip : null ) . '></textarea>'
. getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input a reason for disabling your account.' ) )
. '</div>'
. '</div>'
. '<div class="form-group cb_form_line clearfix">'
. '<div class="col-sm-offset-3 col-sm-9">'
. '<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Disable Account' ) ) . '" class="privacyButton privacyButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' /> '
. ' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="privacyButton privacyButtonCancel btn btn-default" onclick="location.href = \'' . $profileUrl . '\';" />'
. '</div>'
. '</div>'
. cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>';
echo $return;
}
示例3: showVideos
/**
* render frontend videos
*
* @param VideoTable[] $rows
* @param cbPageNav $pageNav
* @param bool $searching
* @param array $input
* @param array $counters
* @param GroupTable $group
* @param UserTable $user
* @param cbgjVideoPlugin $plugin
* @return string
*/
static function showVideos( $rows, $pageNav, $searching, $input, &$counters, $group, $user, $plugin )
{
global $_CB_framework, $_PLUGINS;
$_CB_framework->outputCbJQuery( "$( '.gjVideoPlayer' ).mediaelementplayer();", 'media' );
$counters[] = '<span class="gjGroupVideoIcon fa-before fa-film"> ' . CBTxt::T( 'GROUP_VIDEOS_COUNT', '%%COUNT%% Video|%%COUNT%% Videos', array( '%%COUNT%%' => (int) $pageNav->total ) ) . '</span>';
initToolTip();
$isModerator = CBGroupJive::isModerator( $user->get( 'id' ) );
$isOwner = ( $user->get( 'id' ) == $group->get( 'user_id' ) );
$userStatus = CBGroupJive::getGroupStatus( $user, $group );
$canCreate = CBGroupJive::canCreateGroupContent( $user, $group, 'video' );
$canSearch = ( $plugin->params->get( 'groups_video_search', 1 ) && ( $searching || $pageNav->total ) );
$return = null;
$_PLUGINS->trigger( 'gj_onBeforeDisplayVideos', array( &$return, &$rows, $group, $user ) );
$return .= '<div class="gjGroupVideo">'
. '<form action="' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, true, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '" method="post" name="gjGroupVideoForm" id="gjGroupVideoForm" class="gjGroupVideoForm">';
if ( $canCreate || $canSearch ) {
$return .= '<div class="gjHeader gjGroupVideoHeader row">';
if ( $canCreate ) {
$return .= '<div class="' . ( ! $canSearch ? 'col-sm-12' : 'col-sm-8' ) . ' text-left">'
. '<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'video', 'func' => 'new', 'group' => (int) $group->get( 'id' ) ) ) . '\';" class="gjButton gjButtonNewVideo btn btn-success"><span class="fa fa-plus-circle"></span> ' . CBTxt::T( 'New Video' ) . '</button>'
. '</div>';
}
if ( $canSearch ) {
$return .= '<div class="' . ( ! $canCreate ? 'col-sm-offset-8 ' : null ) . 'col-sm-4 text-right">'
. '<div class="input-group">'
. '<span class="input-group-addon"><span class="fa fa-search"></span></span>'
. $input['search']
. '</div>'
. '</div>';
}
$return .= '</div>';
}
$return .= '<div class="gjGroupVideoRows">';
if ( $rows ) foreach ( $rows as $row ) {
$rowCounters = array();
$content = null;
$menu = array();
$_PLUGINS->trigger( 'gj_onDisplayVideo', array( &$row, &$rowCounters, &$content, &$menu, $group, $user ) );
$return .= '<div class="gjGroupVideoRow gjContainerBox img-thumbnail">'
. '<div class="gjContainerBoxHeader">'
. '<video width="640" height="360" style="width: 100%; height: 100%;" id="gjVideoPlayer' . (int) $row->get( 'id' ) . '" src="' . htmlspecialchars( $row->get( 'url' ) ) . '" type="' . htmlspecialchars( $row->mimeType() ) . '" controls="controls" preload="none" class="gjVideoPlayer"></video>'
. '</div>'
. '<div class="gjContainerBoxBody text-left">'
. '<div class="gjContainerBoxTitle">'
. '<a href="' . htmlspecialchars( $row->get( 'url' ) ) . '" target="_blank" rel="nofollow">' . htmlspecialchars( ( $row->get( 'title' ) ? $row->get( 'title' ) : $row->name() ) ) . '</a>'
. '</div>'
. '<div class="gjContainerBoxCounters text-muted small row">'
. '<div class="gjGroupVideoPublisher gjContainerBoxCounter col-sm-6">' . CBuser::getInstance( (int) $row->get( 'user_id' ), false )->getField( 'formatname', null, 'html', 'none', 'list', 0, true ) . '</div>'
. '<div class="gjContainerBoxCounter col-sm-6 text-right">'
. '<span title="' . htmlspecialchars( $row->get( 'date' ) ) . '">'
. cbFormatDate( $row->get( 'date' ), true, false, CBTxt::T( 'GROUP_VIDEO_DATE_FORMAT', 'M j, Y' ) )
. '</span>'
. '</div>'
. ( $rowCounters ? '<div class="gjContainerBoxCounter col-sm-6">' . implode( '</div><div class="gjContainerBoxCounter col-sm-6">', $rowCounters ) . '</div>' : null )
. '</div>'
. ( $content ? '<div class="gjContainerBoxContent">' . $content . '</div>' : null )
. ( $row->get( 'caption' ) ? '<div class="gjContainerBoxDescription">' . cbTooltip( 1, $row->get( 'caption' ), $row->name(), 400, null, '<span class="fa fa-info-circle text-muted"></span>' ) . '</div>' : null );
if ( ( $isModerator || $isOwner || ( $userStatus >= 2 ) ) && ( $row->get( 'published' ) == -1 ) && ( $group->params()->get( 'video', 1 ) == 2 ) ) {
$return .= '<div class="gjContainerBoxButton text-right">'
. '<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'video', 'func' => 'publish', 'id' => (int) $row->get( 'id' ) ) ) . '\';" class="gjButton gjButtonApprove btn btn-xs btn-success">' . CBTxt::T( 'Approve' ) . '</button>'
. '</div>';
}
$return .= '</div>';
if ( $isModerator || $isOwner || ( $user->get( 'id' ) == $row->get( 'user_id' ) ) || ( $userStatus >= 2 ) || $menu ) {
$menuItems = '<ul class="gjVideoMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">';
if ( $isModerator || $isOwner || ( $user->get( 'id' ) == $row->get( 'user_id' ) ) || ( $userStatus >= 2 ) ) {
$menuItems .= '<li class="gjVideoMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'video', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'Edit' ) . '</a></li>';
if ( ( $row->get( 'published' ) == -1 ) && ( $group->params()->get( 'video', 1 ) == 2 ) ) {
//.........这里部分代码省略.........
示例4: showActivity
/**
* render frontend group activity
*
* @param CB\Plugin\Activity\Table\ActivityTable $row
* @param string $title
* @param string $message
* @param CB\Plugin\Activity\Activity $stream
* @param GroupTable $group
* @param cbgjPlugin $plugin
* @return string
*/
static function showActivity( $row, &$title, &$message, $stream, $group, $plugin )
{
global $_CB_framework;
initToolTip();
$message = null;
switch( $row->get( 'subtype' ) ) {
case 'group.join':
$title = CBTxt::T( 'joined a group' );
break;
case 'group.leave':
$title = CBTxt::T( 'left a group' );
break;
case 'group':
$title = CBTxt::T( 'created a group' );
break;
}
$user = CBuser::getMyUserDataInstance();
$isModerator = CBGroupJive::isModerator( $user->get( 'id' ) );
$groupOwner = ( $user->get( 'id' ) == $group->get( 'user_id' ) );
$userStatus = CBGroupJive::getGroupStatus( $user, $group );
$return = '<div class="gjActivity">'
. '<div class="gjGroupCanvas gjPageHeader border-default">'
. '<div class="gjPageHeaderCanvas">'
. '<div class="gjPageHeaderCanvasBackground">'
. $group->canvas()
. '</div>'
. '<div class="gjPageHeaderCanvasLogo">'
. $group->logo( false, true, true )
. '</div>';
if ( $isModerator || $groupOwner || ( ( ! $groupOwner ) && ( ( $userStatus === null ) || ( $userStatus === 0 ) || ( $userStatus >= 1 ) ) ) ) {
$return .= '<div class="gjPageHeaderCanvasButtons text-right">';
if ( $isModerator && ( $group->get( 'published' ) == -1 ) && $plugin->params->get( 'groups_create_approval', 0 ) ) {
$return .= ' <span class="gjPageHeaderCanvasButton">'
. '<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'publish', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\';" class="gjButton gjButtonApprove btn btn-xs btn-success">' . CBTxt::T( 'Approve' ) . '</button>'
. '</span>';
} elseif ( ! $groupOwner ) {
if ( $userStatus === null ) {
$return .= ' <span class="gjPageHeaderCanvasButton">'
. ( $group->get( '_invite_id' ) ? '<button type="button" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to reject all invites to this Group?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'reject', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\'; })" class="gjButton gjButtonReject btn btn-xs btn-danger">' . CBTxt::T( 'Reject' ) . '</button> ' : null )
. '<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'join', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\';" class="gjButton gjButtonJoin btn btn-xs btn-success">' . ( $group->get( '_invite_id' ) ? CBTxt::T( 'Accept Invite' ) : CBTxt::T( 'Join' ) ) . '</button>'
. '</span>';
} elseif ( $userStatus === 0 ) {
$return .= ' <span class="gjPageHeaderCanvasButton">'
. '<button type="button" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel your pending join request to this Group?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'cancel', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\'; })" class="gjButton gjButtonCancel btn btn-xs btn-danger">' . CBTxt::T( 'Cancel' ) . '</button> '
. '<span class="gjButton gjButtonPending btn btn-xs btn-warning disabled">' . CBTxt::T( 'Pending Approval' ) . '</span>'
. '</span>';
}
}
$return .= '</div>';
}
$return .= '</div>'
. '<div class="gjPageHeaderBar border-default">'
. '<div class="gjPageHeaderBarTitle text-primary">'
. '<strong><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '">' . htmlspecialchars( CBTxt::T( $group->get( 'name' ) ) ) . '</a></strong>'
. '</div>'
. '<div class="gjPageHeaderBarCounters text-muted small">';
if ( $group->get( 'category' ) ) {
$return .= '<span class="gjPageHeaderBarCounter"><span class="gjGroupCategoryIcon fa-before fa-folder">'
. ' <a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'categories', 'func' => 'show', 'id' => (int) $group->get( 'category' ) ) ) . '">' . CBTxt::T( $group->category()->get( 'name' ) ) . '</a>'
. '</span></span>';
}
$return .= ' <span class="gjPageHeaderBarCounter"><span class="gjGroupTypeIcon fa-before fa-globe"> ' . $group->type() . '</span></span>'
. ' <span class="gjPageHeaderBarCounter"><span class="gjGroupUsersIcon fa-before fa-user"> ' . CBTxt::T( 'GROUP_USERS_COUNT', '%%COUNT%% User|%%COUNT%% Users', array( '%%COUNT%%' => (int) $group->get( '_users', 0 ) ) ) . '</span></span>'
. '</div>'
. ( $group->get( 'description' ) ? ' <div class="gjPageHeaderBarDescription">' . cbTooltip( 1, CBTxt::T( $group->get( 'description' ) ), CBTxt::T( $group->get( 'name' ) ), 400, null, '<span class="fa fa-info-circle text-muted"></span>' ) . '</div>' : null )
. '</div>'
. '</div>'
. '</div>';
return $return;
}
示例5: showFolder
/**
* @param cbgalleryFolderTable $row
* @param string $type
* @param UserTable $viewer
* @param UserTable $user
* @param TabTable $tab
* @param cbTabHandler $plugin
* @return string
*/
static public function showFolder( $row, $type, $viewer, $user, $tab, $plugin )
{
global $_CB_framework, $_PLUGINS;
$_PLUGINS->trigger( 'gallery_onBeforeDisplayFolder', array( &$row, $type, $viewer, $user, $tab, $plugin ) );
/** @var Registry $params */
$params = $tab->params;
switch( $type ) {
case 'photos':
$galleryType = CBTxt::T( 'Photos' );
break;
case 'files':
$galleryType = CBTxt::T( 'Files' );
break;
case 'videos':
$galleryType = CBTxt::T( 'Videos' );
break;
case 'music':
$galleryType = CBTxt::T( 'Music' );
break;
default:
$galleryType = CBTxt::T( 'Items' );
break;
}
switch( $type ) {
case 'photos':
case 'videos':
case 'music':
$typeTranslated = CBTxt::T( 'Album' );
break;
default:
$typeTranslated = CBTxt::T( 'Folder' );
break;
}
$profileOwner = ( $viewer->get( 'id' ) == $user->get( 'id' ) );
$cbModerator = Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator();
$date = cbFormatDate( $row->get( 'date' ), true, (int) $params->get( 'tab_' . $type . '_folder_items_time_display', 0 ), $params->get( 'tab_' . $type . '_folder_items_date_format', 'F j, Y' ), $params->get( 'tab_' . $type . '_folder_items_time_format', ' g:h A' ) );
$return = '<div class="galleryFolderTitle page-header clearfix">'
. '<h3 class="row">'
. '<div class="col-sm-8 text-left">'
. ( $row->get( 'title' ) ? htmlspecialchars( $row->get( 'title' ) ) . ( $row->get( 'id' ) !== 0 ? '<div class="small" title="' . htmlspecialchars( $row->get( 'date' ) ) . '">' . $date . '</div>' : null ) : $date )
. '</div>'
. '<div class="col-sm-4 text-right">'
. '<small>'
. '<a href="' . $_CB_framework->userProfileUrl( (int) $user->get( 'id' ), true, (int) $tab->get( 'tabid' ) ) . '">'
. CBuser::getInstance( (int) $row->get( 'user_id' ), false )->getField( 'formatname', null, 'html', 'none', 'profile', 0, true )
. '</a>'
. '</small>';
if ( ( $row->get( 'id' ) !== 0 ) && ( $cbModerator || $profileOwner ) ) {
$menuItems = '<ul class="galleryFolderMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">'
. '<li class="galleryFolderMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'folders', 'func' => 'edit', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'Edit' ) . '</a></li>';
if ( ( $row->get( 'published' ) == -1 ) && $plugin->params->get( $type . '_folder_approval', 0 ) ) {
if ( $cbModerator ) {
$menuItems .= '<li class="galleryFolderMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'folders', 'func' => 'publish', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Approve' ) . '</a></li>';
}
} elseif ( $row->get( 'published' ) > 0 ) {
$menuItems .= '<li class="galleryFolderMenuItem"><a href="javascript: void(0);" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'FOLDER_UNPUBLISH_TYPE', 'Are you sure you want to unpublish this [type]?', array( '[type]' => $typeTranslated ) ) ) . '\' ) ) { location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'folders', 'func' => 'unpublish', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '\'; }"><span class="fa fa-times-circle"></span> ' . CBTxt::T( 'Unpublish' ) . '</a></li>';
} else {
$menuItems .= '<li class="galleryFolderMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'folders', 'func' => 'publish', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Publish' ) . '</a></li>';
}
$menuItems .= '<li class="galleryFolderMenuItem"><a href="javascript: void(0);" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'FOLDER_DELETE_TYPE', 'Are you sure you want to delete this [folder_type] and all its [item_type]?', array( '[folder_type]' => $typeTranslated, '[item_type]' => $galleryType ) ) ) . '\' ) ) { location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'folders', 'func' => 'delete', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ) ) ) . '\'; }"><span class="fa fa-trash-o"></span> ' . CBTxt::T( 'Delete' ) . '</a></li>'
. '</ul>';
$menuAttr = cbTooltip( 1, $menuItems, null, 'auto', null, null, null, 'class="btn btn-default btn-xs" data-cbtooltip-menu="true" data-cbtooltip-classes="qtip-nostyle"' );
$return .= '<div class="folderMenu">'
. '<div class="galleryFolderMenu btn-group">'
. '<button type="button" ' . trim( $menuAttr ) . '><span class="fa fa-cog"></span> <span class="fa fa-caret-down"></span></button>'
. '</div>'
. '</div>';
}
$return .= '</div>'
. '</h3>'
. '</div>'
. ( $row->get( 'description' ) ? '<div class="galleryFolderDescription well well-sm">' . htmlspecialchars( $row->get( 'description' ) ) . '</div>' : null );
return $return;
}
示例6: getViewTabs
/**
* Gets html code for all cb tabs, sorted by position (default: all, no position name in db means "cb_tabmain")
*
* @param UserTable $user CB user object to display
* @param string $position Name of position if only one position to display (default: null)
* @return array Array of string with html to display at each position, key = position name, or NULL if position is empty.
*
* @throws \LogicException
*/
public function getViewTabs($user, $position = '')
{
global $_CB_framework, $ueConfig;
// returns cached rendering if needed:
static $renderedCache = array();
if (isset($renderedCache[$user->id])) {
if ($position == '') {
return $renderedCache[$user->id];
}
if (isset($renderedCache[$user->id][$position])) {
return array($position => $renderedCache[$user->id][$position]);
}
}
// detects recursion loops (e.g. trying to render a position within a position !):
static $callCounter = 0;
if ($callCounter++ > 10) {
throw new \LogicException('Rendering recursion for CB position: ' . $position, 500);
}
// loads the tabs and generate the inside content of the tab:
$this->generateViewTabsContent($user, $position);
// recursion counter decrement:
$callCounter--;
if (!isset($this->tabsToDisplay[$position])) {
return null;
}
// $output = 'html';
$tabsMap = array();
$html = array();
$results = array();
$oNest = array();
$oNestVert = array();
$oMenu = array();
$oMenuNest = array();
$oVert = array();
$i = 0;
//Pass 3: generate formatted output for each position by display type (keeping tabs together in each position)
foreach ($this->tabsToDisplay[$position] as $k => $oTab) {
if ($oTab->pluginclass) {
$tabsMap[strtolower($oTab->pluginclass)] = $oTab->tabid;
}
$pos = $oTab->position;
if (!isset($html[$pos])) {
$html[$pos] = '';
$results[$pos] = '';
$oNest[$pos] = '';
$oNestVert[$pos] = '';
$oMenu[$pos] = '';
$oMenuNest[$pos] = '';
$oVert[$pos] = '';
}
// handles content of tab:
$tabContent = $this->tabsContents[$k];
if ($tabContent != '' || $oTab->fields && $oTab->_fieldsCount > 0 && isset($ueConfig['showEmptyTabs']) && $ueConfig['showEmptyTabs'] == 1) {
$overlaysWidth = '400';
//BB later this could be one more tab parameter...
$tabTitle = $this->_callTabPlugin($oTab, $user, $oTab->pluginclass, 'getTabTitle', $oTab->pluginid);
switch ($oTab->displaytype) {
// case "template":
// $cbTemplate = HTML_comprofiler::_cbTemplateLoad();
// $html[$pos] .= HTML_comprofiler::_cbTemplateRender( $cbTemplate, $user, 'Profile', 'drawTab', array( &$user, $oTab, $tabTitle, $tabContent, 'cb_tabid_' . $oTab->tabid ), $output );
// break;
case "html":
$html[$pos] .= '<div class="cb_tab_content cb_tab_html' . ($oTab->cssclass ? ' ' . htmlspecialchars($oTab->cssclass) : null) . '" id="cb_tabid_' . (int) $oTab->tabid . '">' . $tabContent . '</div>';
break;
case "div":
$html[$pos] .= '<div class="cb_tab_content cb_tab_div' . ($oTab->cssclass ? ' ' . htmlspecialchars($oTab->cssclass) : null) . '" id="cb_tabid_' . (int) $oTab->tabid . '">' . '<div class="cb_tab_content_heading page-header"><h4>' . $tabTitle . '</h4></div>' . $tabContent . '</div>';
break;
case "rounddiv":
$html[$pos] .= '<div class="cb_tab_container cb_tab_rounddiv panel panel-default' . ($oTab->cssclass ? ' ' . htmlspecialchars($oTab->cssclass) : null) . '">' . '<div class="panel-heading">' . $tabTitle . '</div>' . '<div class="cb_tab_content panel-body" id="cb_tabid_' . (int) $oTab->tabid . '">' . $tabContent . '</div>' . '</div>';
break;
case "roundhtml":
$html[$pos] .= '<div class="cb_tab_container cb_tab_roundhtml panel panel-default' . ($oTab->cssclass ? ' ' . htmlspecialchars($oTab->cssclass) : null) . '">' . '<div class="cb_tab_content panel-body" id="cb_tabid_' . (int) $oTab->tabid . '">' . $tabContent . '</div>' . '</div>';
break;
case "overlib":
$fieldTip = '<div class="cb_tab_content cb_tab_overlib' . ($oTab->cssclass ? ' ' . htmlspecialchars($oTab->cssclass) : null) . '" id="cb_tabid_' . (int) $oTab->tabid . '" style="width:100%">' . $tabContent . '</div>';
$html[$pos] .= cbTooltip($this->ui, $fieldTip, $tabTitle, $overlaysWidth, null, $tabTitle, null, 'data-cbtooltip-position-target="mouse" data-cbtooltip-tip-hide="true" class="cb_tab_overlib_container"');
break;
case "overlibfix":
$fieldTip = '<div class="cb_tab_content cb_tab_overlib_fix' . ($oTab->cssclass ? ' ' . htmlspecialchars($oTab->cssclass) : null) . '" id="cb_tabid_' . (int) $oTab->tabid . '" style="width:100%">' . $tabContent . '</div>';
$html[$pos] .= cbTooltip($this->ui, $fieldTip, $tabTitle, $overlaysWidth, null, $tabTitle, null, 'data-cbtooltip-delay="200" class="cb_tab_overlib_fix_container"');
break;
case "overlibsticky":
$fieldTitle = '<button type="button" class="cb_tab_overlib_sticky_button btn btn-default">' . $tabTitle . '</button>';
$fieldTip = '<div class="cb_tab_content cb_tab_overlib_sticky' . ($oTab->cssclass ? ' ' . htmlspecialchars($oTab->cssclass) : null) . '" id="cb_tabid_' . (int) $oTab->tabid . '" style="width:100%">' . $tabContent . '</div>';
$html[$pos] .= cbTooltip($this->ui, $fieldTip, $tabTitle, $overlaysWidth, null, $fieldTitle, null, 'data-cbtooltip-open-event="click" data-cbtooltip-close-event="click unfocus" class="cb_tab_overlib_sticky_container"');
break;
case "nested":
$oNest[$pos] .= $this->startTab('CBNested' . $pos, $tabTitle, $oTab->tabid, array('tab' => 'cbTabNavNested' . ($oTab->cssclass ? ' ' . $oTab->cssclass : null), 'pane' => 'cbTabPaneNested' . ($oTab->cssclass ? ' ' . $oTab->cssclass : null))) . '<div class="cb_tab_content cb_tab_nested" id="cb_tabid_' . $oTab->tabid . '">' . $tabContent . '</div>' . $this->endTab();
$i++;
break;
case "nestedvertical":
//.........这里部分代码省略.........
示例7: _fieldEditToHtml
/**
* converts to HTML
*
* @param FieldTable $field
* @param UserTable $user
* @param string $reason 'profile' for user profile view, 'edit' for profile edit, 'register' for registration, 'search' for searches
* @param string $tag <tag
* @param string $type type="$type"
* @param string $value value="$value"
* @param string $additional 'xxxx="xxx" yy="y"' WARNING: No classes in here, use $classes
* @param string $allValues
* @param boolean $displayFieldIcons
* @param array $classes CSS classes
* @return string HTML: <tag type="$type" value="$value" xxxx="xxx" yy="y" />
*/
protected function _fieldEditToHtml(&$field, &$user, $reason, $tag, $type, $value, $additional, $allValues = null, $displayFieldIcons = true, $classes = null)
{
global $_CB_framework, $_PLUGINS;
$readOnly = $this->_isReadOnly($field, $user, $reason);
$oReq = $this->_isRequired($field, $user, $reason);
if ($readOnly) {
$additional .= ' disabled="disabled"';
$oReq = 0;
}
if ($oReq) {
$classes[] = 'required';
}
$inputName = $field->name;
$translatedTitle = $this->getFieldTitle($field, $user, 'html', $reason);
$translatedPlaceholder = $this->getFieldPlaceholder($field, $user, 'text', $reason);
$htmlDescription = $this->getFieldDescription($field, $user, 'htmledit', $reason);
$trimmedDescription = trim(strip_tags($htmlDescription));
$htmlInput = null;
switch ($type) {
case 'radio':
if ($classes) {
$additional .= ' class="' . implode(' ', $classes) . '"';
}
$tooltip = $trimmedDescription ? cbTooltip($_CB_framework->getUi(), $htmlDescription, $translatedTitle, null, null, null, null, 'data-hascbtooltip="true"') : null;
$htmlInput = moscomprofilerHTML::radioListTable($allValues, $inputName, $additional, 'value', 'text', $value, $field->cols, $field->rows, $field->size, $oReq, null, $tooltip);
break;
/** @noinspection PhpMissingBreakStatementInspection */
/** @noinspection PhpMissingBreakStatementInspection */
case 'multiselect':
$additional .= ' multiple="multiple"';
$inputName .= '[]';
// no break on purpose for fall-through:
// no break on purpose for fall-through:
case 'select':
$classes[] = 'form-control';
$additional .= ' class="' . implode(' ', $classes) . '"';
if ($field->size > 0) {
$additional .= ' size="' . $field->size . '"';
}
$tooltip = $trimmedDescription ? cbTooltip($_CB_framework->getUi(), $htmlDescription, $translatedTitle, null, null, null, null, $additional) : $additional;
$htmlInput = moscomprofilerHTML::selectList($allValues, $inputName, $tooltip, 'value', 'text', $this->_explodeCBvaluesToObj($value), $oReq);
break;
case 'multicheckbox':
if ($classes) {
$additional .= ' class="' . implode(' ', $classes) . '"';
}
$tooltip = $trimmedDescription ? cbTooltip($_CB_framework->getUi(), $htmlDescription, $translatedTitle, null, null, null, null, 'data-hascbtooltip="true"') : null;
$htmlInput = moscomprofilerHTML::checkboxListTable($allValues, $inputName . '[]', $additional, 'value', 'text', $this->_explodeCBvaluesToObj($value), $field->cols, $field->rows, $field->size, $oReq, null, $tooltip);
break;
case 'checkbox':
if ($classes) {
$additional .= ' class="' . implode(' ', $classes) . '"';
}
$tooltip = $trimmedDescription ? cbTooltip($_CB_framework->getUi(), $htmlDescription, $translatedTitle, null, null, null, null, $additional) : $additional;
$htmlInput = '<span class="cbSingleCntrl">' . '<label for="' . htmlspecialchars($inputName) . '" class="checkbox-inline">' . '<input type="checkbox" id="' . htmlspecialchars($inputName) . '" name="' . htmlspecialchars($inputName) . '" value="' . htmlspecialchars($value) . '"' . $tooltip . ' />' . '</label>' . '</span>';
break;
/** @noinspection PhpMissingBreakStatementInspection */
/** @noinspection PhpMissingBreakStatementInspection */
case 'password':
$additional .= ' autocomplete="off"';
// on purpose no break here !
// on purpose no break here !
case 'text':
case 'primaryemailaddress':
case 'emailaddress':
case 'webaddress':
case 'predefined':
if ($type != 'password') {
$type = 'text';
// Prevent predefined, emailaddress, etc.. from using invalid html type
}
if ($field->size > 0) {
$additional .= ' size="' . $field->size . '"';
} else {
$additional .= ' size="25"';
}
$fieldMaxLength = $this->getMaxLength($field);
if ($fieldMaxLength > 0) {
$additional .= ' maxlength="' . $fieldMaxLength . '"';
}
if ($translatedPlaceholder) {
$additional .= ' placeholder="' . htmlspecialchars($translatedPlaceholder) . '"';
}
$classes[] = 'form-control';
break;
//.........这里部分代码省略.........
示例8: showPhotoActivity
/**
* render frontend event activity
*
* @param CB\Plugin\Activity\Table\ActivityTable $row
* @param string $title
* @param string $message
* @param CB\Plugin\Activity\Activity $stream
* @param PhotoTable $photo
* @param cbgjPhotoPlugin $plugin
* @return string
*/
static function showPhotoActivity( $row, &$title, &$message, $stream, $photo, $plugin )
{
global $_CB_framework;
$title = CBTxt::T( 'GROUP_PHOTO_ACTIVITY_TITLE', 'uploaded a photo in [group]', array( '[group]' => '<strong><a href="' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, true, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $photo->group()->get( 'id' ) ) ) . '">' . htmlspecialchars( CBTxt::T( $photo->group()->get( 'name' ) ) ) . '</a></strong>' ) );
$name = ( $photo->get( 'title' ) ? htmlspecialchars( $photo->get( 'title' ) ) : $photo->name() );
$item = $name;
$logo = null;
if ( $photo->exists() ) {
$showPath = $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'photo', 'func' => 'show', 'id' => (int) $photo->get( 'id' ) ), 'raw', 0, true );
$image = '<div class="gjGroupPhotoImageContainer">'
. '<div style="background-image: url(' . $showPath . ')" class="gjGroupPhotoImage"></div>'
. '<div class="gjGroupPhotoImageInfo">'
. '<div class="gjGroupPhotoImageInfoRow">'
. '<div class="gjGroupPhotoImageInfoTitle col-sm-8 text-left"><strong>' . $name . '</strong></div>'
. '<div class="gjGroupPhotoImageInfoOriginal col-sm-4 text-right">'
. '<a href="' . $showPath . '" target="_blank">'
. CBTxt::T( 'Original' )
. '</a>'
. '</div>'
. '</div>';
if ( $photo->get( 'description' ) ) {
$image .= '<div class="gjGroupPhotoImageInfoRow">'
. '<div class="gjGroupPhotoImageInfoDescription col-sm-8 text-left">' . htmlspecialchars( $photo->get( 'description' ) ) . '</div>'
. '<div class="gjGroupPhotoImageInfoDownload col-sm-4 text-right">'
. '</div>'
. '</div>';
}
$image .= '</div>'
. '</div>';
$item = cbTooltip( 1, $image, null, array( '80%', '80%' ), null, $item, 'javascript: void(0);', 'class="gjGroupPhotoItem" data-cbtooltip-modal="true" data-cbtooltip-open-solo="document" data-cbtooltip-classes="gjGroupPhotoImageModal"' );
$logo = cbTooltip( 1, $image, null, array( '80%', '80%' ), null, '<img src="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'photo', 'func' => 'preview', 'id' => (int) $photo->get( 'id' ) ), 'raw', 0, true ) . '" class="gjGroupPhotoLogo" />', 'javascript: void(0);', 'class="gjGroupPhotoLogo" data-cbtooltip-modal="true" data-cbtooltip-open-solo="document" data-cbtooltip-classes="gjGroupPhotoImageModal"' );
}
$return = '<div class="gjPhotoActivity text-center">'
. '<div class="gjGroupPhotoRow gjContainerBox img-thumbnail">'
. '<div class="gjContainerBoxHeader">'
. '<div class="gjContainerBoxCanvas">'
. $logo
. '</div>'
. '</div>'
. '<div class="gjContainerBoxBody text-left border-default">'
. '<div class="gjContainerBoxTitle">'
. '<strong>'
. $item
. '</strong>'
. '</div>';
if ( $photo->get( 'description' ) ) {
$return .= '<div class="gjContainerBoxContent cbMoreLess">'
. '<div class="cbMoreLessContent">'
. htmlspecialchars( $photo->get( 'description' ) )
. '</div>'
. '<div class="cbMoreLessOpen fade-edge hidden">'
. '<a href="javascript: void(0);" class="cbMoreLessButton">' . CBTxt::T( 'See More' ) . '</a>'
. '</div>'
. '</div>';
}
$return .= '</div>'
. '</div>'
. '</div>';
return $return;
}
示例9: showInviteEdit
/**
* prepare frontend invite edit render
*
* @param int $id
* @param UserTable $user
*/
private function showInviteEdit( $id, $user )
{
global $_CB_framework;
$row = new InviteTable();
$row->load( (int) $id );
$isModerator = CBGroupJive::isModerator( $user->get( 'id' ) );
$groupId = $this->input( 'group', null, GetterInterface::INT );
if ( $groupId === null ) {
$group = $row->group();
} else {
$group = CBGroupJive::getGroup( $groupId );
}
$returnUrl = $_CB_framework->pluginClassUrl( $this->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) );
if ( ! CBGroupJive::canAccessGroup( $group, $user ) ) {
cbRedirect( $returnUrl, CBTxt::T( 'Group does not exist.' ), 'error' );
} elseif ( $row->get( 'id' ) && ( $user->get( 'id' ) != $row->get( 'user_id' ) ) ) {
cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to edit this invite.' ), 'error' );
} elseif ( ! $isModerator ) {
if ( ( $row->get( 'published' ) == -1 ) || ( ( ! $this->params->get( 'groups_invites_display', 1 ) ) && ( $group->get( 'type' ) != 3 ) ) ) {
cbRedirect( $returnUrl, CBTxt::T( 'You do not have access to invites in this group.' ), 'error' );
} elseif ( ( ! $row->get( 'id' ) ) && ( ! CBGroupJive::canCreateGroupContent( $user, $group, 'invites' ) ) ) {
cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to create an invite in this group.' ), 'error' );
}
}
CBGroupJive::getTemplate( 'invite_edit' );
$input = array();
$inviteBy = array();
$inviteByLimit = explode( '|*|', $this->params->get( 'groups_invites_by', '1|*|2|*|3|*|4' ) );
if ( ! $inviteByLimit ) {
$inviteByLimit = array( 1, 2, 3, 4 );
}
if ( in_array( 1, $inviteByLimit ) ) {
$inviteBy[] = CBTxt::T( 'User ID' );
}
if ( in_array( 2, $inviteByLimit ) ) {
$inviteBy[] = CBTxt::T( 'Username' );
}
if ( in_array( 3, $inviteByLimit ) ) {
$inviteBy[] = CBTxt::T( 'Name' );
}
if ( in_array( 4, $inviteByLimit ) ) {
$inviteBy[] = CBTxt::T( 'Email Address' );
}
$input['invite_by'] = $inviteBy;
$listConnections = array();
if ( Application::Config()->get( 'allowConnections' ) ) {
$cbConnection = new cbConnection( (int) $user->get( 'id' ) );
foreach( $cbConnection->getConnectedToMe( (int) $user->get( 'id' ) ) as $connection ) {
$listConnections[] = moscomprofilerHTML::makeOption( (string) $connection->id, getNameFormat( $connection->name, $connection->username, Application::Config()->get( 'name_format', 3 ) ) );
}
}
if ( $listConnections ) {
array_unshift( $listConnections, moscomprofilerHTML::makeOption( '0', CBTxt::T( '- Select Connection -' ) ) );
$listTooltip = cbTooltip( null, CBTxt::T( 'Select a connection to invite.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['list'] = moscomprofilerHTML::selectList( $listConnections, 'selected', 'class="gjInviteConnection form-control"' . $listTooltip, 'value', 'text', (int) $this->input( 'post/selected', 0, GetterInterface::INT ), 1, false, false );
} else {
$input['list'] = null;
}
$toTooltup = cbTooltip( null, CBTxt::T( 'GROUP_INVITE_BY', 'Input the recipient as [invite_by].', array( '[invite_by]' => implode( ', ', $inviteBy ) ) ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['to'] = '<input type="text" id="to" name="to" value="' . htmlspecialchars( $this->input( 'post/to', ( $row->get( 'user' ) ? (int) $row->get( 'user' ) : $row->get( 'email' ) ), GetterInterface::STRING ) ) . '" class="gjInviteOther form-control" size="40"' . $toTooltup . ' />';
$messageTooltip = cbTooltip( null, CBTxt::T( 'Optionally input private message to include with the invite.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['message'] = '<textarea id="message" name="message" class="form-control" cols="40" rows="5"' . $messageTooltip . '>' . htmlspecialchars( $this->input( 'post/message', $row->get( 'message' ), GetterInterface::STRING ) ) . '</textarea>';
HTML_groupjiveInviteEdit::showInviteEdit( $row, $input, $group, $user, $this );
}
示例10: selectTemplate
$itemCount = 0;
?>
<div class="cb_template cb_template_<?php
echo selectTemplate('dir');
?>
">
<div class="cbFeed">
<?php
foreach ($items as $index => $item) {
$itemCount++;
?>
<div class="cbFeedItem<?php
echo ($modalDisplay ? ' cbTooltip' : null) . ($feedEntries && $index >= $feedEntries ? ' cbFeedItemDisabled' : null);
?>
" <?php
echo $modalDisplay ? cbTooltip($_CB_framework->getUi(), modCBAdminHelper::longDescription($item->description), $item->title, array($modalWidth, $modalHeight), null, null, null, 'data-cbtooltip-modal="true" data-cbtooltip-callback-show="cbFeedShow" data-cbtooltip-callback-hide="cbFeedHide"') : null;
?>
>
<div class="media">
<a class="pull-left" href="#">
<div class="cbFeedItemLogo media-object"><?php
echo modCBAdminHelper::descriptionIcon($item->description);
?>
</div>
</a>
<div class="media-body">
<h4 class="cbFeedItemTitle media-heading"><a href="<?php
echo htmlspecialchars($item->link);
?>
" target="_blank"><strong><?php
echo $item->title;
示例11: showEdit
/**
* @param ActivityTable $row
* @param Activity $stream
* @param int $output 0: Normal, 1: Raw, 2: Inline, 3: Load, 4: Save
* @param UserTable $user
* @param UserTable $viewer
* @param cbPluginHandler $plugin
* @return null|string
*/
static public function showEdit( $row, $stream, $output, $user, $viewer, $plugin )
{
global $_PLUGINS;
$cbModerator = CBActivity::isModerator( (int) $viewer->get( 'id' ) );
$messageLimit = ( $cbModerator ? 0 : (int) $stream->get( 'message_limit', 400 ) );
$showActions = (int) $stream->get( 'actions', 1 );
$actionLimit = ( $cbModerator ? 0 : (int) $stream->get( 'actions_message_limit', 100 ) );
$showLocations = (int) $stream->get( 'locations', 1 );
$locationLimit = ( $cbModerator ? 0 : (int) $stream->get( 'locations_address_limit', 200 ) );
$showLinks = (int) $stream->get( 'links', 1 );
$linkLimit = ( $cbModerator ? 0 : (int) $stream->get( 'links_link_limit', 5 ) );
$showTags = (int) $stream->get( 'tags', 1 );
$actionTooltip = cbTooltip( null, CBTxt::T( 'What are you doing or feeling?' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
$locationTooltip = cbTooltip( null, CBTxt::T( 'Share your location.' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
$tagTooltip = cbTooltip( null, CBTxt::T( 'Are you with anyone?' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
$linkTooltip = cbTooltip( null, CBTxt::T( 'Have a link to share?' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
$actionOptions = ( $showActions ? CBActivity::loadActionOptions() : array() );
$locationOptions = ( $showLocations ? CBActivity::loadLocationOptions() : array() );
$rowId = $stream->id() . '_edit_' . (int) $row->get( 'id' );
$actionId = null;
$locationId = null;
$tags = array();
$links = array();
$editBody = null;
$editFooter = null;
$_PLUGINS->trigger( 'activity_onDisplayActivityEdit', array( &$row, &$editBody, &$editFooter, $stream, $output ) );
$return = '<div class="streamItemEdit activityContainerContentEdit border-default hidden">'
. '<form action="' . $stream->endpoint( 'save', array( 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="' . $rowId . 'Form" id="' . $rowId . 'Form" class="cb_form streamItemForm form">'
. '<textarea id="' . $stream->id() . '_message_edit_' . (int) $row->get( 'id' ) . '" name="message" rows="3" class="streamInput streamInputAutosize streamInputMessage form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What's on your mind?" ) ) . '" data-cbactivity-input-size="3"' . ( $messageLimit ? ' data-cbactivity-input-limit="' . (int) $messageLimit . '" maxlength="' . (int) $messageLimit . '"' : null ) . '>' . htmlspecialchars( $row->get( 'message' ) ) . '</textarea>';
if ( $showLinks ) {
$links = $row->attachments();
if ( $links ) {
$return .= '<div class="streamPanelBody streamItemInputGroup streamInputAttachmentsContainer panel-body border-default clearfix">'
. self::showAttachments( $row, $stream, $output, $user, $viewer, $plugin )
. '</div>';
}
if ( ( ! $linkLimit ) || ( $linkLimit > 1 ) ) {
$return .= '<div class="streamItemInputGroup streamInputLinkContainer cbRepeat border-default clearfix' . ( ! $links ? ' hidden' : null ) . '" data-cbrepeat-sortable="false"' . ( $linkLimit ? ' data-cbrepeat-max="' . (int) $linkLimit . '"' : null ) . '>';
if ( $links ) {
foreach ( $links as $i => $link ) {
$return .= '<div class="streamItemInputGroupRow cbRepeatRow border-default">'
. '<span class="streamItemInputGroupLabel form-control">'
. '<button type="button" class="cbRepeatRowAdd btn btn-xs btn-success"><span class="fa fa-plus "></span></button>'
. '<button type="button" class="cbRepeatRowRemove btn btn-xs btn-danger"><span class="fa fa-minus"></span></button>'
. '</span>'
. '<div class="streamItemInputGroupInput border-default">'
. '<input type="text" id="' . $stream->id() . '_links__' . $i . '__url_edit_' . (int) $row->get( 'id' ) . '" name="links[' . $i . '][url]" value="' . htmlspecialchars( $link['url'] ) . '" class="streamInput streamInputLinkURL form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What link would you like to share?" ) ) . '" />'
. '</div>'
. '</div>';
}
} else {
$return .= '<div class="streamItemInputGroupRow cbRepeatRow border-default">'
. '<span class="streamItemInputGroupLabel form-control">'
. '<button type="button" class="cbRepeatRowAdd btn btn-xs btn-success"><span class="fa fa-plus "></span></button>'
. '<button type="button" class="cbRepeatRowRemove btn btn-xs btn-danger"><span class="fa fa-minus"></span></button>'
. '</span>'
. '<div class="streamItemInputGroupInput border-default">'
. '<input type="text" id="' . $stream->id() . '_links__0__url_edit_' . (int) $row->get( 'id' ) . '" name="links[0][url]" class="streamInput streamInputLinkURL form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What link would you like to share?" ) ) . '" disabled="disabled" />'
. '</div>'
. '</div>';
}
$return .= '</div>';
} else {
$return .= '<div class="streamItemInputGroup streamInputLinkContainer border-default clearfix' . ( ! $links ? ' hidden' : null ) . '">'
. '<input type="text" id="' . $stream->id() . '_links__0__url_edit_' . (int) $row->get( 'id' ) . '" name="links[0][url]" value="' . htmlspecialchars( ( $links ? $links[0]['url'] : null ) ) . '" class="streamInput streamInputLinkURL form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What link would you like to share?" ) ) . '"' . ( ! $links ? ' disabled="disabled"' : null ) . ' />'
. '</div>';
}
}
if ( $actionOptions ) {
$action = $row->params()->subTree( 'action' );
$actionId = (int) $action->get( 'id' );
$emoteOptions = CBActivity::loadEmoteOptions();
$return .= '<div class="streamItemInputGroup streamInputActionContainer border-default clearfix' . ( ! $actionId ? ' hidden' : null ) . '">'
. '<span class="streamItemInputGroupLabel streamInputSelectToggleLabel form-control"></span>'
. '<div class="streamItemInputGroupInput border-default">'
. '<input type="text" id="' . $stream->id() . '_actions_message_edit_' . (int) $row->get( 'id' ) . '" name="actions[message]" value="' . htmlspecialchars( $action->get( 'message' ) ) . '" class="streamInput streamInputActionMessage streamInputSelectTogglePlaceholder form-control no-border"' . ( $actionLimit ? ' maxlength="' . (int) $actionLimit . '"' : null ) . ( ! $actionId ? ' disabled="disabled"' : null ) . ' />'
. ( $emoteOptions ? str_replace( 'action__emote', $stream->id() . '_actions_emote_edit_' . (int) $row->get( 'id' ), moscomprofilerHTML::selectList( $emoteOptions, 'actions[emote]', 'class="streamInputSelect streamInputEmote" data-cbselect-width="auto" data-cbselect-height="100%" data-cbselect-dropdown-css-class="streamEmoteOptions"' . ( ! $actionId ? ' disabled="disabled"' : null ), 'value', 'text', $action->get( 'emote' ), 0, false, false, false ) ) : null )
. '</div>'
//.........这里部分代码省略.........
示例12: getTooltipAttr
/**
* Returns HTML attributes with tooltip appended
*
* @param SimpleXMLElement $node
* @param null|string $attributes
* @return string
*/
protected function getTooltipAttr( $node, $attributes = null ) {
$label = CBTxt::Th( $node->attributes( 'label' ) );
if ( $label !== null ) {
if ( substr( $label, -2 ) == "%s" ) {
$label = substr( $label, 0, -2 );
}
} else {
$label = $node->attributes( 'name' );
}
$title = null;
$description = null;
if ( $node->attributes( 'valuedescription' ) ) {
$title = CBTxt::Th( $node->attributes( 'valuedescriptiontitle' ) );
if ( ! $title ) {
$title = $label;
}
$description = CBTxt::Th( $node->attributes( 'valuedescription' ) );
} elseif ( $node->attributes( 'description' ) ) {
$title = $label;
$description = CBTxt::Th( $node->attributes( 'description' ) );
}
if ( $title || $description ) {
$return = cbTooltip( null, $description, $title, null, null, null, null, $attributes );
} else {
$return = ' ' . $attributes;
}
return $return;
}
示例13: showInviteEdit
/**
* @param null|int $id
* @param UserTable $user
* @param null|string $message
* @param null|string $messageType
*/
public function showInviteEdit( $id, $user, $message = null, $messageType = 'error' )
{
global $_CB_framework, $_CB_database;
$inviteLimit = (int) $this->params->get( 'invite_limit', null );
$cbModerator = Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();
$row = new cbinvitesInviteTable();
$row->load( (int) $id );
$canAccess = false;
if ( ! $row->get( 'id' ) ) {
if ( $cbModerator ) {
$canAccess = true;
} elseif ( $user->get( 'id' ) && Application::MyUser()->canViewAccessLevel( $this->params->get( 'invite_create_access', 2 ) ) ) {
if ( $inviteLimit ) {
$query = 'SELECT COUNT(*)'
. "\n FROM " . $_CB_database->NameQuote( '#__comprofiler_plugin_invites' )
. "\n WHERE " . $_CB_database->NameQuote( 'user_id' ) . " = " . (int) $user->get( 'id' )
. "\n AND ( " . $_CB_database->NameQuote( 'user' ) . " IS NULL OR " . $_CB_database->NameQuote( 'user' ) . " = " . $_CB_database->Quote( '' ) . " )";
$_CB_database->setQuery( $query );
$inviteCount = (int) $_CB_database->loadResult();
if ( $inviteCount < $inviteLimit ) {
$canAccess = true;
}
} else {
$canAccess = true;
}
}
} elseif ( $cbModerator || ( $row->get( 'user_id' ) == $user->get( 'id' ) ) ) {
$canAccess = true;
}
$profileUrl = $_CB_framework->userProfileUrl( $row->get( 'user_id', $user->get( 'id' ) ), false, 'cbinvitesTab' );
if ( $canAccess && ( ! $row->isAccepted() ) ) {
$inviteEditor = $this->params->get( 'invite_editor', 2 );
cbinvitesClass::getTemplate( 'invite_edit' );
$input = array();
$toTooltip = cbTooltip( null, ( $this->params->get( 'invite_multiple', 1 ) ? CBTxt::T( 'Input invite email to address. Separate multiple email addresses with a comma.' ) : CBTxt::T( 'Input invite email to address.' ) ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['to'] = '<input type="text" id="to" name="to" value="' . htmlspecialchars( $this->input( 'post/to', $row->get( 'to' ), GetterInterface::STRING ) ) . '" class="required form-control" size="35"' . ( $toTooltip ? ' ' . $toTooltip : null ) . ' />';
$subjectTooltip = cbTooltip( null, CBTxt::T( 'Input invite email subject; if left blank a subject will be applied.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['subject'] = '<input type="text" id="subject" name="subject" value="' . htmlspecialchars( $this->input( 'post/subject', $row->get( 'subject' ), GetterInterface::STRING ) ) . '" class="form-control" size="25"' . ( $subjectTooltip ? ' ' . $subjectTooltip : null ) . ' />';
if ( $inviteEditor >= 2 ) {
$body = $this->input( 'post/body', $row->get( 'body' ), GetterInterface::HTML );
} else {
$body = $this->input( 'post/body', $row->get( 'body' ), GetterInterface::STRING );
}
if ( $inviteEditor == 3 ) {
$input['body'] = cbTooltip( null, CBTxt::T( 'Optionally input private message to include with invite email.' ), null, null, null, $_CB_framework->displayCmsEditor( 'body', $body, 350, 175, 35, 4 ), null, 'style="display:block;"' );
} else {
$bodyTooltip = cbTooltip( null, CBTxt::T( 'Optionally input private message to include with invite email.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['body'] = '<textarea id="body" name="body" class="form-control" cols="35" rows="4"' . ( $bodyTooltip ? ' ' . $bodyTooltip : null ) . '>' . htmlspecialchars( $body ) . '</textarea>';
}
$ownerTooltip = cbTooltip( null, CBTxt::T( 'Input owner of invite as single integer user_id. This is the user who sent the invite.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['user_id'] = '<input type="text" id="user_id" name="user_id" value="' . (int) $this->input( 'post/user_id', $row->get( 'user_id', $user->get( 'id' ) ), GetterInterface::INT ) . '" class="digits required form-control" size="6"' . ( $ownerTooltip ? ' ' . $ownerTooltip : null ) . ' />';
$userTooltip = cbTooltip( null, CBTxt::T( 'Optionally input user of invite as single integer user_id. This is the user who accepted the invite.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['user'] = '<input type="text" id="user" name="user" value="' . (int) $this->input( 'post/user', $row->get( 'user' ), GetterInterface::INT ) . '" class="digits form-control" size="6"' . ( $userTooltip ? ' ' . $userTooltip : null ) . ' />';
if ( $message ) {
$_CB_framework->enqueueMessage( $message, $messageType );
}
HTML_cbinvitesInviteEdit::showInviteEdit( $row, $input, $user, $this );
} else {
cbRedirect( $profileUrl, CBTxt::T( 'Not authorized.' ), 'error' );
}
}
示例14: showBlogEdit
/**
* @param null|int $id
* @param UserTable $user
* @param stdClass $model
* @param PluginTable $plugin
* @param null|string $message
* @param null|string $messageType
*/
public function showBlogEdit( $id, $user, $model, $plugin, $message = null, $messageType = 'error' )
{
global $_CB_framework;
$blogLimit = (int) $plugin->params->get( 'blog_limit', null );
$blogMode = $plugin->params->get( 'blog_mode', 1 );
$cbModerator = Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();
$row = new cbblogsBlogTable();
$canAccess = false;
if ( $row->load( (int) $id ) ) {
if ( ! $row->get( 'id' ) ) {
if ( $cbModerator ) {
$canAccess = true;
} elseif ( $user->get( 'id' ) && Application::MyUser()->canViewAccessLevel( $plugin->params->get( 'blog_create_access', 2 ) ) ) {
if ( ( ! $blogLimit ) || ( $blogLimit && ( cbblogsModel::getBlogsTotal( null, $user, $user, $plugin ) < $blogLimit ) ) ) {
$canAccess = true;
}
}
} elseif ( $cbModerator || ( $row->get( 'user' ) == $user->get( 'id' ) ) ) {
$canAccess = true;
}
}
$profileUrl = $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbblogsTab' );
if ( $canAccess ) {
cbblogsClass::getTemplate( 'blog_edit' );
$input = array();
$publishedTooltip = cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Select publish status of the blog. Unpublished blogs will not be visible to the public.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['published'] = moscomprofilerHTML::yesnoSelectList( 'published', 'class="form-control"' . ( $publishedTooltip ? ' ' . $publishedTooltip : null ), (int) $this->input( 'post/published', $row->get( 'published', ( $cbModerator || ( ! $plugin->params->get( 'blog_approval', 0 ) ) ? 1 : 0 ) ), GetterInterface::INT ) );
$categoryTooltip = cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Select blog category. Select the category that best describes your blog.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$listCategory = cbblogsModel::getCategoriesList();
$input['category'] = moscomprofilerHTML::selectList( $listCategory, 'category', 'class="form-control"' . ( $categoryTooltip ? ' ' . $categoryTooltip : null ), 'value', 'text', $this->input( 'post/category', $row->get( 'category' ), GetterInterface::STRING ), 1, false, false );
$accessTooltip = cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Select access to blog; all groups above that level will also have access to the blog.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$listAccess = Application::CmsPermissions()->getAllViewAccessLevels( true, Application::MyUser() );
$input['access'] = moscomprofilerHTML::selectList( $listAccess, 'access', 'class="form-control"' . ( $accessTooltip ? ' ' . $accessTooltip : null ), 'value', 'text', (int) $this->input( 'post/access', $row->get( 'access', $plugin->params->get( 'blog_access_default', 1 ) ), GetterInterface::INT ), 1, false, false );
$titleTooltip = cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input blog title. This is the title that will distinguish this blog from others. Suggested to input something unique and intuitive.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['title'] = '<input type="text" id="title" name="title" value="' . htmlspecialchars( $this->input( 'post/title', $row->get( 'title' ), GetterInterface::STRING ) ) . '" class="required form-control" size="30"' . ( $titleTooltip ? ' ' . $titleTooltip : null ) . ' />';
if ( in_array( $blogMode, array( 1, 2 ) ) ) {
$blogIntro = $_CB_framework->displayCmsEditor( 'blog_intro', $this->input( 'post/blog_intro', $row->get( 'blog_intro' ), GetterInterface::HTML ), 400, 200, 40, 7 );
$input['blog_intro'] = cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input HTML supported blog intro contents. Suggested to use minimal but well formatting for easy readability.' ), null, null, null, $blogIntro, null, 'style="display:block;"' );
}
if ( in_array( $blogMode, array( 1, 3 ) ) ) {
$blogFull = $_CB_framework->displayCmsEditor( 'blog_full', $this->input( 'post/blog_full', $row->get( 'blog_full' ), GetterInterface::HTML ), 400, 200, 40, 7 );
$input['blog_full'] = cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input HTML supported blog contents. Suggested to use minimal but well formatting for easy readability.' ), null, null, null, $blogFull, null, 'style="display:block;"' );
}
$userTooltip = cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input owner of blog as single integer user_id.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );
$input['user'] = '<input type="text" id="user" name="user" value="' . (int) ( $cbModerator ? $this->input( 'post/user', $row->get( 'user', $user->get( 'id' ) ), GetterInterface::INT ) : $user->get( 'id' ) ) . '" class="digits required form-control" size="4"' . ( $userTooltip ? ' ' . $userTooltip : null ) . ' />';
if ( $message ) {
$_CB_framework->enqueueMessage( $message, $messageType );
}
HTML_cbblogsBlogEdit::showBlogEdit( $row, $input, $user, $model, $plugin );
} else {
cbRedirect( $profileUrl, CBTxt::T( 'Not authorized.' ), 'error' );
}
}
示例15: getPaymentBasketPaymentForm
//.........这里部分代码省略.........
if ( ! $termsHeight ) {
$termsHeight = 200;
}
if ( ( ( $termsOutput == 'url' ) && $termsURL ) || ( ( $termsOutput == 'text' ) && $termsText ) ) {
if ( $termsDisplay == 'iframe' ) {
if ( $termsOutput == 'url' ) {
$txtTerms .= '<iframe class="cbTermsFrameURL" height="' . $termsHeight . '" width="' . ( $termsWidth ? $termsWidth : '100%' ) . '" src="' . htmlspecialchars( $termsURL ) . '"></iframe>';
} else {
$txtTerms .= '<div class="cbTermsFrameText" style="height:' . $termsHeight . 'px;width:' . ( $termsWidth ? $termsWidth . 'px' : '100%' ) . ';overflow:auto;">' . CBPTXT::T( $termsText ) . '</div>';
}
}
if ( $termsDisplay != 'iframe' ) {
$attributes = ' class="cbTermsLink"';
if ( ( $termsOutput == 'text' ) && ( $termsDisplay == 'window' ) ) {
$termsDisplay = 'modal';
}
if ( $termsDisplay == 'modal' ) {
if ( ! $termsWidth ) {
$termsWidth = 400;
}
if ( $termsOutput == 'url' ) {
$tooltip = '<iframe class="cbTermsModalURL" height="' . $termsHeight . '" width="' . $termsWidth . '" src="' . htmlspecialchars( $termsURL ) . '"></iframe>';
} else {
$tooltip = '<div class="cbTermsModalText" style="height:' . $termsHeight . 'px;width:' . $termsWidth . 'px;overflow:auto;">' . CBPTXT::T( $termsText ) . '</div>';
}
$url = 'javascript:void(0);';
$attributes .= ' ' . cbTooltip( $_CB_framework->getUi(), $tooltip, CBPTXT::T( 'Terms and Conditions' ), 'auto', null, null, null, 'data-cbtooltip="true" data-modal="true"' );
} else {
$url = htmlspecialchars( $termsURL );
$attributes .= ' target="_blank"';
}
$txtTerms .= CBPTXT::P( 'I have read and approve the <a href="[url]"[attributes]>Terms and Conditions</a>', array( '[url]' => $url, '[attributes]' => $attributes ) );
} else {
$txtTerms .= CBPTXT::T( 'I have read and approve the above Terms and Conditions.' );
}
}
} elseif ( $basket_requiredterms == 2 ) {
$txtTerms = $params->get( 'basket_termsandconditions' );
}
if ($introText) {
$result .= '<div class="cbregIntro">' . CBPTXT::Th( $introText ) . "</div>\n";
}
$result .= $basketHtml;
if ( $allow_select_currency == 2 ) {
$result .= $currencySelector;
}
if ( $invoicingAddressQuery > 0 ) {
$errorMsg = $paymentBasket->checkAddressComplete();
if ( $errorMsg && ( $invoicingAddressQuery == 2 ) ) {
$result = '';
$introAddrNeeded = $params->get('invoicing_address_required_into_text');
if ($introAddrNeeded) {
$result .= '<div class="cbregIntro">' . CBPTXT::Th( $introAddrNeeded ) . "</div>\n";
}
$result .= $paymentBasket->renderInvoicingAddressForm( $user ); // $xmlController->handleAction( 'action', 'editinvoiceaddress' );