本文整理汇总了PHP中CBTxt::Ph方法的典型用法代码示例。如果您正苦于以下问题:PHP CBTxt::Ph方法的具体用法?PHP CBTxt::Ph怎么用?PHP CBTxt::Ph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBTxt
的用法示例。
在下文中一共展示了CBTxt::Ph方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showGroupPanes
/**
* render frontend group panes
*
* @param cbgjGroup $row
* @param cbgjCategory $category
* @param moscomprofilerUser $user
* @param object $plugin
* @return string
*/
static function showGroupPanes( $row, $category, $user, $plugin ) {
$authorized = cbgjClass::getAuthorization( $category, $row, $user );
if ( $row->get( 'published' ) == 1 ) {
$state = '<div><i class="icon-ban-circle"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'unpublish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '">' . CBTxt::Ph( 'Unpublish [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>';
} else {
$state = '<div><i class="icon-ok"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Publish [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>';
}
$groupAdmins = $row->getAdmins();
$groupMods = $row->getModerators();
$return = '<legend class="gjHeaderTitle">' . $row->getName() . '</legend>'
. '<div class="gjGrid row-fluid">'
. '<div class="gjGridLeft span9">'
. '<div class="gjGridLeftLogo span4">'
. $row->getLogo( true )
. '</div>'
. '<div class="gjGridLeftInfo span8">'
. cbgjClass::getIntegrations( 'gj_onBeforeGroupInfo', array( $row, $category, $user, $plugin ) )
. ( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? '<div>' . cbgjClass::getOverride( 'group', true ) . ': ' . $row->nestedCount() . '</div>' : null )
. ( $row->userCount() ? '<div>' . cbgjClass::getOverride( 'user', true ) . ': ' . $row->userCount() . '</div>' : null )
. ( $row->get( 'user_id' ) ? '<div>' . cbgjClass::getOverride( 'owner' ) . ': ' . $row->getOwnerName( true ) . '</div>' : null )
. ( ! empty( $groupMods ) ? '<div>' . cbgjClass::getOverride( 'moderator', true ) . ': ' . implode( ', ', $groupMods ) . '</div>' : null )
. ( ! empty( $groupAdmins ) ? '<div>' . cbgjClass::getOverride( 'admin', true ) . ': ' . implode( ', ', $groupAdmins ) . '</div>' : null )
. '<div>' . CBTxt::Ph( 'Type: [grp_type]', array( '[grp_type]' => $row->getType() ) ) . '</div>'
. '<div>' . CBTxt::Ph( 'Access: [grp_access]', array( '[grp_access]' => $row->getAccess() ) ) . '</div>'
. '<div>' . cbgjClass::getOverride( 'category' ) . ': ' . $category->getName( 0, true ) . '</div>'
. ( $row->get( 'parent' ) ? '<div>' . cbgjClass::getOverride( 'group' ) . ': ' . $row->getParent()->getName( 0, true ) . '</div>' : null )
. '<div>' . CBTxt::Ph( 'Created: [grp_date]', array( '[grp_date]' => cbFormatDate( $row->get( 'date' ), 1, false ) ) ) . '</div>'
. cbgjClass::getIntegrations( 'gj_onAfterGroupInfo', array( $row, $category, $user, $plugin ) )
. '</div>';
if ( $row->get( 'description' ) ) {
$return .= '<div class="gjGridLeftDesc span12 well well-small">'
. $row->getDescription()
. '</div>';
}
$return .= '</div>'
. '<div class="gjGridRight span3">'
. cbgjClass::getIntegrations( 'gj_onBeforeGroupMenu', array( $row, $category, $user, $plugin ), null, null )
. ( cbgjClass::hasAccess( array( 'grp_join', 'grp_approved' ), $authorized, true ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . ( cbgjClass::hasAccess( 'grp_invited', $authorized ) ? CBTxt::Th( 'Accept Invite' ) : CBTxt::Ph( 'Join [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( array( 'grp_nested_create', 'grp_approved' ), $authorized, true ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'new', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( array( 'grp_leave', 'grp_approved' ), $authorized, true ) ? '<div><i class="icon-minus"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'leave', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to leave this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '">' . CBTxt::Ph( 'Leave [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ? '<div><i class="icon-pencil"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Edit [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'grp_message', $authorized ) && $row->userCount() ? '<div><i class="icon-envelope"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'message', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Message [users]', array( '[users]' => cbgjClass::getOverride( 'user', true ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ? $state : null )
. ( cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ? '<div><i class="icon-remove"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'delete', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [group] and all its associated [users]?', array( '[group]' => cbgjClass::getOverride( 'group' ), '[users]' => cbgjClass::getOverride( 'user', true ) ) ) ) . '">' . CBTxt::Ph( 'Delete [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
. cbgjClass::getIntegrations( 'gj_onAfterGroupMenu', array( $row, $category, $user, $plugin ), null, null )
. ( cbgjClass::hasAccess( 'grp_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
. ( $row->get( 'parent' ) ? '<div><i class="icon-share-alt"></i> <a href="' . $row->getParent()->getUrl() . '">' . CBTxt::Ph( 'Back to [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
. ( ! $row->get( 'parent' ) ? '<div><i class="icon-share-alt"></i> <a href="' . $category->getUrl() . '">' . CBTxt::Ph( 'Back to [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
. '</div>'
. '</div>';
return $return;
}
示例2: showCategoryPanes
/**
* render frontend category panes
*
* @param cbgjCategory $row
* @param moscomprofilerUser $user
* @param object $plugin
* @return string
*/
static function showCategoryPanes( $row, $user, $plugin ) {
$authorized = cbgjClass::getAuthorization( $row, null, $user );
if ( $row->get( 'published' ) == 1 ) {
$state = '<div><i class="icon-ban-circle"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'unpublish', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [category]?', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) ) . '">' . CBTxt::Ph( 'Unpublish [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>';
} else {
$state = '<div><i class="icon-ok"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Publish [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>';
}
$return = '<legend class="gjHeaderTitle">' . $row->getName() . '</legend>'
. '<div class="gjGrid row-fluid">'
. '<div class="gjGridLeft span9">'
. '<div class="gjGridLeftLogo span4">'
. $row->getLogo( true )
. '</div>'
. '<div class="gjGridLeftInfo span8">'
. cbgjClass::getIntegrations( 'gj_onBeforeCategoryInfo', array( $row, $user, $plugin ) )
. ( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? '<div>' . cbgjClass::getOverride( 'category', true ) . ': ' . $row->nestedCount() . '</div>' : null )
. ( $row->groupCount() ? '<div>' . cbgjClass::getOverride( 'group', true ) . ': ' . $row->groupCount() . '</div>' : null )
. ( $row->get( 'user_id' ) ? '<div>' . cbgjClass::getOverride( 'owner' ) . ': ' . $row->getOwnerName( true ) . '</div>' : null )
. '<div>' . CBTxt::Ph( 'Types: [cat_types]', array( '[cat_types]' => implode( ', ', $row->getTypes() ) ) ) . '</div>'
. '<div>' . CBTxt::Ph( 'Access: [cat_access]', array( '[cat_access]' => $row->getAccess() ) ) . '</div>'
. ( $row->get( 'parent' ) ? '<div>' . cbgjClass::getOverride( 'category' ) . ': ' . $row->getParent()->getName( 0, true ) . '</div>' : null )
. '<div>' . CBTxt::Ph( 'Created: [cat_date]', array( '[cat_date]' => cbFormatDate( $row->get( 'date' ), 1, false ) ) ) . '</div>'
. cbgjClass::getIntegrations( 'gj_onAfterCategoryInfo', array( $row, $user, $plugin ) )
. '</div>';
if ( $row->get( 'description' ) ) {
$return .= '<div class="gjGridLeftDesc span12 well well-small">'
. $row->getDescription()
. '</div>';
}
$return .= '</div>'
. '<div class="gjGridRight span3">'
. cbgjClass::getIntegrations( 'gj_onBeforeCategoryMenu', array( $row, $user, $plugin ), null, null )
. ( cbgjClass::hasAccess( 'cat_nested_create', $authorized ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'new', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'cat_grp_create', $authorized ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'new', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><i class="icon-pencil"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Edit [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'cat_message', $authorized ) && $row->groupCount() ? '<div><i class="icon-envelope"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'message', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Message [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'cat_can_publish', $authorized ) ? $state : null )
. ( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><i class="icon-remove"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'delete', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [category] and all its associated [groups]?', array( '[category]' => cbgjClass::getOverride( 'category' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) ) . '">' . CBTxt::Ph( 'Delete [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
. cbgjClass::getIntegrations( 'gj_onAfterCategoryMenu', array( $row, $user, $plugin ), null, null )
. ( cbgjClass::hasAccess( 'cat_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
. ( $row->get( 'parent' ) ? '<div><i class="icon-share-alt"></i> <a href="' . $row->getParent()->getUrl() . '">' . CBTxt::Ph( 'Back to [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
. ( ! $row->get( 'parent' ) ? '<div><i class="icon-share-alt"></i> <a href="' . cbgjClass::getPluginURL( array( 'overview' ) ) . '">' . CBTxt::Ph( 'Back to [overview]', array( '[overview]' => cbgjClass::getOverride( 'overview' ) ) ) . '</a></div>' : null )
. '</div>'
. '</div>';
return $return;
}
示例3: showCategoryMessage
/**
* render frontend category message
*
* @param cbgjCategory $row
* @param array $input
* @param moscomprofilerUser $user
* @param object $plugin
*/
static function showCategoryMessage( $row, $input, $user, $plugin ) {
$row->setPathway( CBTxt::P( 'Message [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), cbgjClass::getPluginURL( array( 'categories', 'message', (int) $row->get( 'id' ) ) ) );
$return = '<div class="gjCategoryMessage">'
. '<form action="' . cbgjClass::getPluginURL( array( 'categories', 'send', (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjForm" id="gjForm" class="gjForm form-horizontal">'
. '<legend class="gjEditTitle">' . CBTxt::Ph( 'Message [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</legend>'
. '<div class="gjEditContentInput control-group">'
. '<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Subject' ) . '</label>'
. '<div class="gjEditContentInputField controls">'
. $input['subject']
. '<span class="gjEditContentInputIcon help-inline">'
. cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
. cbgjClass::getIcon( CBTxt::P( 'Input [groups] message subject.', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) )
. '</span>'
. '</div>'
. '</div>'
. '<div class="gjEditContentInput control-group">'
. '<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Body' ) . '</label>'
. '<div class="gjEditContentInputField controls">'
. $input['body']
. '<span class="gjEditContentInputIcon help-inline">'
. cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
. cbgjClass::getIcon( CBTxt::P( 'Input [groups] message body.', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) )
. '</span>'
. '</div>'
. '</div>';
if ( $input['captcha'] !== false ) {
$return .= '<div class="gjEditContentInput control-group">'
. '<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
. '<div class="gjEditContentInputField controls">'
. '<div style="margin-bottom: 5px;">' . $input['captcha']['code'] . '</div>'
. '<div>' . $input['captcha']['input'] . '</div>'
. '<span class="gjEditContentInputIcon help-inline">'
. cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
. '</span>'
. '</div>'
. '</div>';
}
$return .= '<div class="gjButtonWrapper form-actions">'
. '<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Send Message' ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" /> '
. '<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-mini" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'show', (int) $row->get( 'id' ) ), CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '" />'
. '</div>'
. cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>';
echo $return;
}
示例4: showOverviewPanes
/**
* render frontend overview panes
*
* @param moscomprofilerUser $user
* @param object $plugin
* @return string
*/
static function showOverviewPanes( $user, $plugin ) {
$overviewDesc = CBTxt::Th( $plugin->params->get( 'overview_desc', null ) );
$authorized = cbgjClass::getAuthorization( null, null, $user );
$categoryCount = count( cbgjData::getCategories( array( 'cat_access', 'mod_lvl1' ), array( 'parent', '=', 0 ) ) );
$return = '<legend class="gjHeaderTitle">' . cbgjClass::getOverride( 'category', true ) . ' ' . cbgjClass::getOverride( 'overview' ) . '</legend>'
. '<div class="gjGrid row-fluid">'
. '<div class="gjGridLeft span9">'
. '<div class="gjGridLeftLogo span4">'
. '<img alt="' . htmlspecialchars( CBTxt::T( 'Logo' ) ) . '" src="' . $plugin->livePath . '/images/' . $plugin->params->get( 'overview_logo', 'default_overview.png' ) . '" class="gjLogoDefault img-polaroid" />'
. '</div>'
. '<div class="gjGridLeftInfo span8">'
. cbgjClass::getIntegrations( 'gj_onBeforeOverviewInfo', array( $user, $plugin ) )
. ( $categoryCount ? '<div>' . cbgjClass::getOverride( 'category', true ) . ': ' . $categoryCount . '</div>' : null )
. cbgjClass::getIntegrations( 'gj_onAfterOverviewInfo', array( $user, $plugin ) )
. '</div>';
if ( $overviewDesc ) {
if ( $plugin->params->get( 'overview_desc_content', 0 ) ) {
$overviewDesc = cbgjClass::prepareContentPlugins( $overviewDesc );
}
$return .= '<div class="gjGridLeftDesc span12 well well-small">' . $overviewDesc . '</div>';
}
$return .= '</div>'
. '<div class="gjGridRight span3">'
. cbgjClass::getIntegrations( 'gj_onBeforeOverviewMenu', array( $user, $plugin ), null, null )
. ( cbgjClass::hasAccess( 'cat_create', $authorized ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'new' ) ) . '">' . CBTxt::Ph( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'usr_mod', $authorized ) && $categoryCount ? '<div><i class="icon-envelope"></i> <a href="' . cbgjClass::getPluginURL( array( 'overview', 'message' ) ) . '">' . CBTxt::Ph( 'Message [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'usr_panel', $authorized ) ? '<div><i class="icon-home"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel' ) ) . '">' . CBTxt::Ph( 'My [panel]', array( '[panel]' => cbgjClass::getOverride( 'panel' ) ) ) . '</a></div>' : null )
. cbgjClass::getIntegrations( 'gj_onAfterOverviewMenu', array( $user, $plugin ), null, null )
. ( cbgjClass::hasAccess( 'gen_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show' ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
. '</div>'
. '</div>';
return $return;
}
示例5: showUsers
//.........这里部分代码省略.........
$type = CBTxt::Th( 'Banned' );
} elseif ( $row->get( 'status' ) == 2 ) {
$typeClass = 'gjUserTypeMOD';
$type = cbgjClass::getOverride( 'moderator' );
} elseif ( $row->get( 'status' ) == 3 ) {
$typeClass = 'gjUserTypeADMIN';
$type = cbgjClass::getOverride( 'admin' );
} elseif ( $row->get( 'status' ) == 4 ) {
$typeClass = 'gjUserTypeOWNER';
$type = cbgjClass::getOverride( 'owner' );
} else {
$typeClass = 'gjUserTypeUSER';
$type = cbgjClass::getOverride( 'user' );
}
if ( ( ! in_array( $row->get( 'status' ), array( -1, 4 ) ) ) && ( ( $row->get( 'status' ) != 3 ) || cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
$ban = '<div><a href="javascript: void(0);" onclick="' . $banUrl . '"><i class="icon-lock"></i> ' . CBTxt::T( 'Ban' ) . '</a></div>';
} elseif ( ( $row->get( 'status' ) == -1 ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
$ban = '<div><a href="javascript: void(0);" onclick="' . $activeUrl . '"><i class="icon-ok"></i> ' . CBTxt::T( 'Unban' ) . '</a></div>';
} else {
$ban = null;
}
if ( ( $row->get( 'status' ) == 1 ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
$promote = '<div><a href="javascript: void(0);" onclick="' . $modUrl . '"><i class="icon-thumbs-up"></i> ' . CBTxt::T( 'Promote' ) . '</a></div>';
} elseif ( ( $row->get( 'status' ) == 2 ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) {
$promote = '<div><a href="javascript: void(0);" onclick="' . $adminUrl . '"><i class="icon-thumbs-up"></i> ' . CBTxt::T( 'Promote' ) . '</a></div>';
} else {
$promote = null;
}
if ( ( $row->get( 'status' ) == 2 ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
$demote = '<div><a href="javascript: void(0);" onclick="' . $activeUrl . '"><i class="icon-thumbs-down"></i> ' . CBTxt::T( 'Demote' ) . '</a></div>';
} elseif ( ( $row->get( 'status' ) == 3 ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) {
$demote = '<div><a href="javascript: void(0);" onclick="' . $modUrl . '"><i class="icon-thumbs-down"></i> ' . CBTxt::T( 'Demote' ) . '</a></div>';
} elseif ( ( $row->get( 'status' ) == 1 ) && cbgjClass::hasAccess( 'mod_lvl4', $authorized ) ) {
$demote = '<div><a href="javascript: void(0);" onclick="' . $inactiveUrl . '"><i class="icon-thumbs-down"></i> ' . CBTxt::T( 'Demote' ) . '</a></div>';
} else {
$demote = null;
}
if ( ( $row->get( 'status' ) != 4 ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) {
$delete = '<div><a href="javascript: void(0);" onclick="' . $deleteUrl . '"><i class="icon-remove"></i> ' . CBTxt::T( 'Delete' ) . '</a></div>';
} else {
$delete = null;
}
$beforeMenu = cbgjClass::getIntegrations( 'gj_onBeforeGroupUserMenu', array( $row, $group, $category, $user, $plugin ) );
$afterMenu = cbgjClass::getIntegrations( 'gj_onAfterGroupUserMenu', array( $row, $group, $category, $user, $plugin ) );
$return .= '<div class="gjContentBox mini-layout">'
. '<div class="gjContentBoxRow">' . $row->getOwnerName( true ) . '</div>'
. '<div class="gjContentBoxRow">' . $row->getOwnerAvatar( true ) . '</div>'
. '<div class="gjContentBoxRow">' . $row->getOwnerOnline() . '</div>'
. '<div class="gjContentBoxRow">'
. cbgjClass::getIntegrations( 'gj_onBeforeGroupUserInfo', array( $row, $group, $category, $user, $plugin ) )
. '<span class="' . $typeClass . '" title="' . cbFormatDate( $row->get( 'date' ), 1, false ) . '">' . $type . '</span>'
. cbgjClass::getIntegrations( 'gj_onAfterGroupUserInfo', array( $row, $group, $category, $user, $plugin ) )
. '</div>';
if ( ( $row->get( 'status' ) == 0 ) && cbgjClass::hasAccess( 'mod_lvl4', $authorized ) ) {
$return .= '<div class="gjContentBoxRow">'
. '<input type="button" value="' . htmlspecialchars( CBTxt::Th( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'users', 'active', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to set this [user] as Active?', array( '[user]' => cbgjClass::getOverride( 'user' ) ) ), true ) . '" />'
. '</div>';
}
if ( $beforeMenu || $ban || $delete || $promote || $demote || $afterMenu ) {
$return .= '<div class="gjContentBoxRow">'
. cbgjClass::getDropdown( ( $beforeMenu . $ban . $delete . $promote . $demote . $afterMenu ), CBTxt::T( 'Menu' ) )
. '</div>';
}
$return .= '</div>';
}
$return .= '</div>';
} else {
$return .= '<div class="gjContent">';
if ( $groupUsersSearch && $pageNav->searching ) {
$return .= CBTxt::Ph( 'No [user] search results found.', array( '[user]' => cbgjClass::getOverride( 'user' ) ) );
} else {
$return .= CBTxt::Ph( 'There are no [users] available.', array( '[users]' => cbgjClass::getOverride( 'user', true ) ) );
}
$return .= '</div>';
}
if ( $groupUsersPaging ) {
$return .= '<div class="gjPaging pagination pagination-centered">'
. ( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
. ( ! $groupUsersLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
. '</div>';
}
$return .= cbGetSpoofInputTag( 'plugin' )
. '</form>';
return $return;
}
示例6: showOverviewMain
/**
* render frontend overview main
*
* @param object $rows
* @param object $pageNav
* @param moscomprofilerUser $user
* @param object $plugin
* @return string
*/
static function showOverviewMain( $rows, $pageNav, $user, $plugin ) {
$authorized = cbgjClass::getAuthorization( null, null, $user );
$overviewSearch = $plugin->params->get( 'overview_search', 1 );
$overviewPaging = $plugin->params->get( 'overview_paging', 1 );
$overviewLimitbox = $plugin->params->get( 'overview_limitbox', 1 );
$categoryDescLimit = (int) $plugin->params->get( 'overview_cat_desc_limit', 150 );
$categoryApprove = $plugin->params->get( 'category_approve', 0 );
$newCategory = ( $plugin->params->get( 'overview_new_category', 0 ) && cbgjClass::hasAccess( 'cat_create', $authorized ) );
$newGroup = ( $plugin->params->get( 'overview_new_group', 0 ) && cbgjClass::hasAccess( 'grp_create', $authorized ) );
$return = null;
if ( $newCategory || $newGroup ) {
$return .= '<div class="gjTop gjTopCenter">'
. '<div class="btn-group">'
. ( $newCategory ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'new' ), true ) . '" />' : null )
. ( $newGroup ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'new' ), true, true, false, null, true ) . '" />' : null )
. '</div>'
. '</div>';
}
$return .= '<form action="' . cbgjClass::getPluginURL( array( 'overview' ) ) . '" method="post" name="gjForm" id="gjForm" class="gjForm">'
. ( $overviewSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );
if ( $rows ) foreach ( $rows as $row ) {
$authorized = cbgjClass::getAuthorization( $row, null, $user );
if ( $row->get( 'published' ) == 1 ) {
$state = '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'unpublish', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [category]?', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), true, false, null, true ) . '"><i class="icon-ban-circle"></i> ' . CBTxt::Th( 'Unpublish' ) . '</a></div>';
} else {
$state = '<div><a href="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-ok"></i> ' . CBTxt::Th( 'Publish' ) . '</a></div>';
}
$canApprove = ( $categoryApprove && ( $row->get( 'published' ) == -1 ) && cbgjClass::hasAccess( 'cat_can_publish', $authorized ) );
$beforeMenu = cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryMenu', array( $row, $user, $plugin ) );
$afterMenu = cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryMenu', array( $row, $user, $plugin ) );
$return .= '<div class="gjContent row-fluid">'
. '<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
. '<div class="gjContentBody mini-layout span10">'
. '<div class="gjContentBodyHeader row-fluid">'
. '<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . '</small></h5></div>'
. '<div class="gjContentBodyMenu span3">';
if ( $canApprove ) {
$return .= '<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
} else {
if ( ( $row->get( 'published' ) == 0 ) || ( ( $row->get( 'published' ) == 1 ) && ( ! cbgjClass::hasAccess( 'cat_approved', $authorized ) ) ) ) {
$return .= cbgjClass::getIcon( null, CBTxt::P( 'This [category] is currently unpublished.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), 'icon-eye-close' );
}
}
if ( $beforeMenu || cbgjClass::hasAccess( array( 'mod_lvl1', 'cat_can_publish' ), $authorized ) || $afterMenu ) {
$menuItems = $beforeMenu
. ( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
. ( ( ! $canApprove ) && cbgjClass::hasAccess( 'cat_can_publish', $authorized ) ? $state : null )
. ( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'delete', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [category] and all its associated [groups]?', array( '[category]' => cbgjClass::getOverride( 'category' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
. $afterMenu;
$return .= cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
}
$return .= '</div>'
. '</div>'
. '<div class="gjContentBodyInfo">' . ( $row->getDescription( $categoryDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $categoryDescLimit ) . '</div>' : null ) . '</div>'
. '<div class="gjContentDivider"></div>'
. '<div class="gjContentBodyFooter">'
. cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
. ( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'category', $row->nestedCount() ) . ' | ' : null )
. ( $row->groupCount() ? cbgjClass::getOverride( 'group', $row->groupCount() ) . ' | ' : null )
. implode( ', ', $row->getTypes() )
. cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
. '</div>'
. '</div>'
. '</div>';
} else {
$return .= '<div class="gjContent">';
if ( $overviewSearch && $pageNav->searching ) {
$return .= CBTxt::Ph( 'No [category] search results found.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) );
} else {
$return .= CBTxt::Ph( 'There are no [categories] available.', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) );
}
$return .= '</div>';
}
if ( $overviewPaging ) {
$return .= '<div class="gjPaging pagination pagination-centered">'
. ( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
//.........这里部分代码省略.........
示例7: edittab
//.........这里部分代码省略.........
</td>
<td><?php
echo CBTxt::T('In which way the content of this tab will be displayed on the profile.');
?>
</td>
</tr>
<tr>
<td><?php
echo CBTxt::Th('View Access Level');
?>
:</td>
<td><?php
echo $lists['viewaccesslevel'];
?>
</td>
<td><?php
echo CBTxt::Th('Only users which are in groups assigned to this View Access Level will see this tab.') . ($lists['useraccessgroup'] ? ' (' . CBTxt::Th('New method working in all Joomla and Mambo versions') . ')' : '');
?>
</td>
</tr>
<?php
if ($lists['useraccessgroup']) {
?>
<tr>
<td><?php
echo CBTxt::Th('User Group to allow access to') . (checkJversion() >= 2 ? '<br /><em>(' . CBTxt::Th("Old deprecated method of Joomla 1.5, do not use here") . '. ' . CBTxt::Th('Keep setting "-- Everybody --" and Use View Access Level above instead') . ')</em>' : '');
?>
:</td>
<td><?php
echo $lists['useraccessgroup'];
?>
</td>
<td><?php
echo CBTxt::Ph('Old Joomla [VERSION] method', array('[VERSION]' => '1.0 and 1.5 and Mambo')) . ': ' . CBTxt::Th('This method is kept for backwards compatibility but will be removed at next major Community Builder version.') . '<br />' . CBTxt::Th('Use View Access Level above instead and set this Group setting to - "Everybody" -.') . ' ' . CBTxt::Th('All groups above that level will also have access to this tab.');
?>
</td>
</tr>
<?php
}
?>
</table>
</td>
<td width="40%">
<table class="adminform">
<tr>
<th colspan="2">
<?php
echo CBTxt::T('Parameters');
?>
</th>
</tr>
<tr>
<td>
<?php
if ($row->tabid && $row->pluginid > 0) {
$plugin = new moscomprofilerPlugin($_CB_database);
$plugin->load((int) $row->pluginid);
// fail if checked out not by 'me'
if ($plugin->checked_out && $plugin->checked_out != $_CB_framework->myId()) {
echo "<script type=\"text/javascript\">alert('" . addslashes(sprintf(CBTxt::T('The plugin %s is currently being edited by another administrator'), $plugin->name)) . "'); document.location.href='" . $_CB_framework->backendUrl("index.php?option={$option}") . "'</script>\n";
exit(0);
}
// get params values
if ($plugin->type !== "language" && $plugin->id) {
$_PLUGINS->loadPluginGroup($plugin->type, array((int) $plugin->id), 0);
}
示例8: showPanelPanes
/**
* render frontend panel panes
*
* @param moscomprofilerUser $user
* @param object $plugin
* @return string
*/
static function showPanelPanes( $user, $plugin ) {
$panelDesc = CBTxt::Th( $plugin->params->get( 'panel_desc', null ) );
$panelCategoryDisplay = $plugin->params->get( 'panel_category_display', 1 );
$panelGroupDisplay = $plugin->params->get( 'panel_group_display', 1 );
$panelJoinedDisplay = $plugin->params->get( 'panel_joined_display', 1 );
$panelInvitesDisplay = $plugin->params->get( 'panel_invites_display', 1 );
$panelInvitedDisplay = $plugin->params->get( 'panel_invited_display', 1 );
$authorized = cbgjClass::getAuthorization( null, null, $user );
$ownedCategories = count( cbgjData::getCategories( null, array( 'user_id', '=', $user->id ) ) );
if ( $plugin->params->get( 'group_tab_joined', 0 ) ) {
$access = array( 'user_id', '=', (int) $user->id, array( 'e.user_id', '=', (int) $user->id, 'e.status', '!IN', array( -1, 0, 4 ) ) );
} else {
$access = array( 'user_id', '=', (int) $user->id );
}
$ownedGroups = count( cbgjData::getGroups( null, $access ) );
if ( $plugin->params->get( 'joined_tab_owned', 0 ) ) {
$access = array( 'user_id', '=', (int) $user->id, array( 'e.user_id', '=', (int) $user->id, 'e.status', '!IN', array( -1, 0, 4 ) ) );
} else {
$access = array( 'e.user_id', '=', (int) $user->id, 'e.status', '!IN', array( -1, 0, 4 ) );
}
$joinedGroups = count( cbgjData::getGroups( null, $access ) );
$ownedInvites = count( cbgjData::getInvites( null, array( 'user_id', '=', (int) $user->id ) ) );
$invitedTo = count( cbgjData::getInvites( null, array( 'user', '=', (int) $user->id, array( 'email', '=', $user->email ) ) ) );
$return = '<legend class="gjHeaderTitle">' . cbgjClass::getOverride( 'panel' ) . '</legend>'
. '<div class="gjGrid row-fluid">'
. '<div class="gjGridLeft span9">'
. '<div class="gjGridLeftLogo span4">'
. '<img alt="' . htmlspecialchars( CBTxt::Th( 'Logo' ) ) . '" src="' . $plugin->livePath . '/images/' . $plugin->params->get( 'panel_logo', 'default_panel.png' ) . '" class="gjLogoDefault img-polaroid" />'
. '</div>'
. '<div class="gjGridLeftInfo span8">'
. cbgjClass::getIntegrations( 'gj_onBeforePanelInfo', array( $user, $plugin ) )
. ( $panelCategoryDisplay && $ownedCategories ? '<div>' . cbgjClass::getOverride( 'category', true ) . ': ' . $ownedCategories . '</div>' : null )
. ( $panelGroupDisplay && $ownedGroups ? '<div>' . cbgjClass::getOverride( 'group', true ) . ': ' . $ownedGroups . '</div>' : null )
. ( $panelJoinedDisplay && $joinedGroups ? '<div>' . CBTxt::Ph( 'Joined: [grp_joined_count]', array( '[grp_joined_count]' => $joinedGroups ) ) . '</div>' : null )
. ( $panelInvitesDisplay && $ownedInvites ? '<div>' . CBTxt::Ph( 'Invites: [grp_invite_count]', array( '[grp_invite_count]' => $ownedInvites ) ) . '</div>' : null )
. ( $panelInvitedDisplay && $invitedTo ? '<div>' . CBTxt::Ph( 'Invited: [grp_invited_count]', array( '[grp_invited_count]' => $invitedTo ) ) . '</div>' : null )
. cbgjClass::getIntegrations( 'gj_onAfterPanelInfo', array( $user, $plugin ) )
. '</div>';
if ( $panelDesc ) {
if ( $plugin->params->get( 'panel_desc_content', 0 ) ) {
$panelDesc = cbgjClass::prepareContentPlugins( $panelDesc );
}
$return .= '<div class="gjGridLeftDesc span12 well well-small">' . $panelDesc . '</div>';
}
$return .= '</div>'
. '<div class="gjGridRight span3">'
. cbgjClass::getIntegrations( 'gj_onBeforePanelMenu', array( $user, $plugin ) )
. ( $panelCategoryDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-home"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'categories' ) ) . '">' . CBTxt::Ph( 'My [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ) . '</a></div>' : null )
. ( $panelGroupDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-user"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'groups' ) ) . '">' . CBTxt::Ph( 'My [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</a></div>' : null )
. ( $panelJoinedDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-user"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'joined' ) ) . '">' . CBTxt::Ph( 'Joined [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</a></div>' : null )
. ( $panelInvitesDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-inbox"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'invites' ) ) . '">' . CBTxt::Th( 'My Invites' ) . '</a></div>' : null )
. ( $panelInvitedDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-inbox"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'invited' ) ) . '">' . CBTxt::Th( 'Invited To' ) . '</a></div>' : null )
. cbgjClass::getIntegrations( 'gj_onAfterPanelMenu', array( $user, $plugin ) )
. ( cbgjClass::hasAccess( 'gen_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show' ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
. '<div><i class="icon-share-alt"></i> <a href="' . cbgjClass::getPluginURL( array( 'overview' ) ) . '">' . CBTxt::Ph( 'Back to [overview]', array( '[overview]' => cbgjClass::getOverride( 'overview' ) ) ) . '</a></div>'
. '</div>'
. '</div>';
return $return;
}
示例9: showGroupAll
//.........这里部分代码省略.........
$groupAllPaging = $plugin->params->get( 'group_all_paging', 1 );
$groupAllLimitbox = $plugin->params->get( 'group_all_limitbox', 1 );
$groupAllDescLimit = (int) $plugin->params->get( 'group_all_desc_limit', 150 );
$groupApprove = $plugin->params->get( 'group_approve', 0 );
$authorized = cbgjClass::getAuthorization( null, null, $user );
$return = '<div class="gjGroupAll">';
if ( cbgjClass::hasAccess( 'grp_create', $authorized ) ) {
$return .= '<div class="gjTop gjTopCenter">'
. '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'new' ), true, true, false, null, true ) . '" />'
. '</div>';
}
$return .= '<form action="' . cbgjClass::getPluginURL( array( 'groups', ( $self ? 'allmy' : 'all' ) ) ) . '" method="post" name="gjForm" id="gjForm" class="gjForm">'
. ( $groupAllSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );
if ( $rows ) foreach ( $rows as $row ) {
$category = $row->getCategory();
$authorized = cbgjClass::getAuthorization( $category, $row, $user );
if ( $row->get( 'published' ) == 1 ) {
$state = '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'unpublish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-ban-circle"></i> ' . CBTxt::Th( 'Unpublish' ) . '</a></div>';
} else {
$state = '<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-ok"></i> ' . CBTxt::Th( 'Publish' ) . '</a></div>';
}
$canApprove = ( $groupApprove && ( $row->get( 'published' ) == -1 ) && cbgjClass::hasAccess( 'grp_can_publish', $authorized ) );
$beforeMenu = cbgjClass::getIntegrations( 'gj_onBeforeCategoryGroupMenu', array( $row, $category, $user, $plugin ) );
$afterMenu = cbgjClass::getIntegrations( 'gj_onAfterCategoryGroupMenu', array( $row, $category, $user, $plugin ) );
$return .= '<div class="gjContent row-fluid">'
. '<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
. '<div class="gjContentBody mini-layout span10">'
. '<div class="gjContentBodyHeader row-fluid">'
. '<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . ' - ' . $category->getName( 0, true ) . ( $row->get( 'parent' ) ? ' - ' . $row->getParent()->getName( 0, true ) : null ) . '</small></h5></div>'
. '<div class="gjContentBodyMenu span3">';
if ( $canApprove ) {
$return .= '<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
} else {
if ( ( $row->get( 'published' ) == 0 ) || ( ( $row->get( 'published' ) == 1 ) && ( ! cbgjClass::hasAccess( 'grp_approved', $authorized ) ) ) ) {
$return .= cbgjClass::getIcon( null, CBTxt::P( 'This [group] is currently unpublished.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), 'icon-eye-close' );
}
if ( cbgjClass::hasAccess( 'grp_join', $authorized ) ) {
$return .= ' <input type="button" value="' . htmlspecialchars( ( cbgjClass::hasAccess( 'grp_invited', $authorized ) ? CBTxt::T( 'Accept Invite' ) : CBTxt::T( 'Join' ) ) ) . '" class="gjButton gjButtonCancel btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
}
}
if ( $beforeMenu || cbgjClass::hasAccess( array( 'grp_leave', 'mod_lvl2', 'mod_lvl3' ), $authorized ) || $afterMenu || ( ( ! $canApprove ) && cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ) || ( $canApprove && cbgjClass::hasAccess( 'grp_join', $authorized ) ) ) {
$menuItems = $beforeMenu
. ( $canApprove && cbgjClass::hasAccess( 'grp_join', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-plus"></i> ' . CBTxt::Th( 'Join' ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'grp_leave', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'leave', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to leave this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-minus"></i> ' . CBTxt::Th( 'Leave' ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
. ( ( ! $canApprove ) && cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ? $state : null )
. ( cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'delete', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [group] and all its associated [users]?', array( '[group]' => cbgjClass::getOverride( 'group' ), '[users]' => cbgjClass::getOverride( 'user', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
. $afterMenu;
$return .= cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
}
$return .= '</div>'
. '</div>'
. '<div class="gjContentBodyInfo">' . ( $row->getDescription( $groupAllDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $groupAllDescLimit ) . '</div>' : null ) . '</div>'
. '<div class="gjContentDivider"></div>'
. '<div class="gjContentBodyFooter">'
. cbgjClass::getIntegrations( 'gj_onBeforeCategoryGroupInfo', array( $row, $category, $user, $plugin ), null, 'span' )
. ( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'group', $row->nestedCount() ) . ' | ' : null )
. ( $row->userCount() ? cbgjClass::getOverride( 'user', $row->userCount() ) . ' | ' : null )
. $row->getType()
. cbgjClass::getIntegrations( 'gj_onAfterCategoryGroupInfo', array( $row, $category, $user, $plugin ), null, 'span' )
. '</div>'
. '</div>'
. '</div>';
} else {
$return .= '<div class="gjContent">';
if ( $groupAllSearch && $pageNav->searching ) {
$return .= CBTxt::Ph( 'No [group] search results found.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) );
} else {
$return .= CBTxt::Ph( 'There are no [groups] available.', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) );
}
$return .= '</div>';
}
if ( $groupAllPaging ) {
$return .= '<div class="gjPaging pagination pagination-centered">'
. ( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
. ( ! $groupAllLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
. '</div>';
}
$return .= cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>';
echo $return;
}
示例10: editList
//.........这里部分代码省略.........
</td>
<td><?php
echo htmlspecialchars(CBTxt::T('Description appears in frontend under the title of the list.'));
?>
</td>
</tr>
<tr>
<td><?php
echo CBTxt::Th('View Access Level');
?>
:</td>
<td><?php
echo $lists['viewaccesslevel'];
?>
</td>
<td><?php
echo CBTxt::Th('Only users which are in groups assigned to this View Access Level will see this list.') . ($lists['useraccessgroup'] ? ' (' . CBTxt::Th('New method working in all Joomla and Mambo versions') . ')' : '');
?>
</td>
</tr>
<?php
if ($lists['useraccessgroup']) {
?>
<tr>
<td><?php
echo htmlspecialchars(CBTxt::T('User Group to allow access to')) . (checkJversion() >= 2 ? '<br /><em>(' . htmlspecialchars(CBTxt::Th("Old deprecated method of Joomla 1.5, do not use here")) . '. ' . htmlspecialchars(CBTxt::Th('Keep setting "-- Everybody --" and Use View Access Level above instead')) . ')</em>' : '');
?>
:</td>
<td><?php
echo $lists['useraccessgroup'];
?>
</td>
<td><?php
echo htmlspecialchars(CBTxt::Ph('Old Joomla [VERSION] method', array('[VERSION]' => '1.0 and 1.5 and Mambo'))) . ': ' . htmlspecialchars(CBTxt::Th('This method is kept for backwards compatibility but will be removed at next major Community Builder version.')) . '<br />' . htmlspecialchars(CBTxt::Th('Use View Access Level above instead and set this Group setting to - "Everybody" -.')) . ' ' . htmlspecialchars(CBTxt::T('All groups above that level will also have access to the list.'));
?>
</td>
</tr>
<?php
}
?>
<tr>
<td><?php
echo htmlspecialchars(CBTxt::T('User Groups to Include in List'));
?>
:</td>
<td><?php
echo $lists['usergroups'];
?>
</td>
<td><strong><font color="red"><?php
echo htmlspecialchars(CBTxt::T('Multiple choices'));
?>
:</font> <?php
echo htmlspecialchars(CBTxt::T('CTRL/CMD-click to add/remove single choices.'));
?>
</strong></td>
</tr>
<tr>
<td><?php
echo htmlspecialchars(CBTxt::T('Published'));
?>
:</td>
<td><?php
echo $lists['published'];
?>
</td>
示例11: showCategoryApproval
/**
* render frontend categories approval
*
* @param object $rows
* @param object $pageNav
* @param moscomprofilerUser $user
* @param object $plugin
*/
static function showCategoryApproval( $rows, $pageNav, $user, $plugin ) {
global $_CB_framework;
$generalTitle = $plugin->params->get( 'general_title', $plugin->name );
$_CB_framework->setPageTitle( CBTxt::P( '[category] Approval', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) );
if ( $generalTitle != '' ) {
$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( $generalTitle ) ), cbgjClass::getPluginURL() );
}
$_CB_framework->appendPathWay( CBTxt::P( '[category] Approval', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), cbgjClass::getPluginURL( array( 'categories', 'approval' ) ) );
$categoryApprovalSearch = $plugin->params->get( 'category_approval_search', 1 );
$categoryApprovalPaging = $plugin->params->get( 'category_approval_paging', 1 );
$categoryApprovalLimitbox = $plugin->params->get( 'category_approval_limitbox', 1 );
$categoryApprovalDescLimit = (int) $plugin->params->get( 'category_approval_desc_limit', 150 );
$return = '<div class="gjCategoryApproval">'
. '<form action="' . cbgjClass::getPluginURL( array( 'categories', 'approval' ) ) . '" method="post" name="gjForm" id="gjForm" class="gjForm">'
. ( $categoryApprovalSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );
if ( $rows ) foreach ( $rows as $row ) {
$authorized = cbgjClass::getAuthorization( $row, null, $user );
$beforeMenu = cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryMenu', array( $row, $user, $plugin ) );
$afterMenu = cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryMenu', array( $row, $user, $plugin ) );
$return .= '<div class="gjContent row-fluid">'
. '<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
. '<div class="gjContentBody mini-layout span10">'
. '<div class="gjContentBodyHeader row-fluid">'
. '<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . ( $row->get( 'parent' ) ? ' - ' . $row->getParent()->getName( 0, true ) : null ) . '</small></h5></div>'
. '<div class="gjContentBodyMenu span3">';
if ( cbgjClass::hasAccess( 'cat_can_publish', $authorized ) ) {
$return .= '<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
}
if ( $beforeMenu || cbgjClass::hasAccess( 'mod_lvl1', $authorized ) || $afterMenu ) {
$menuItems = $beforeMenu
. ( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'delete', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [category] and all its associated [groups]?', array( '[category]' => cbgjClass::getOverride( 'category' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
. $afterMenu;
$return .= cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
}
$return .= '</div>'
. '</div>'
. '<div class="gjContentBodyInfo">' . ( $row->getDescription( $categoryApprovalDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $categoryApprovalDescLimit ) . '</div>' : null ) . '</div>'
. '<div class="gjContentDivider"></div>'
. '<div class="gjContentBodyFooter">'
. cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
. ( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'category', $row->nestedCount() ) . ' | ' : null )
. ( $row->groupCount() ? cbgjClass::getOverride( 'group', $row->groupCount() ) . ' | ' : null )
. implode( ', ', $row->getTypes() )
. cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
. '</div>'
. '</div>'
. '</div>';
} else {
$return .= '<div class="gjContent">';
if ( $categoryApprovalSearch && $pageNav->searching ) {
$return .= CBTxt::Ph( 'No [category] search results found.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) );
} else {
$return .= CBTxt::Ph( 'There are no [categories] pending approval.', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) );
}
$return .= '</div>';
}
if ( $categoryApprovalPaging ) {
$return .= '<div class="gjPaging pagination pagination-centered">'
. ( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
. ( ! $categoryApprovalLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
. '</div>';
}
$return .= '</form>'
. '</div>';
echo $return;
}
示例12: showConfig
/**
* render backend config
*
* @param array $input
* @param moscomprofilerUser $user
* @param object $plugin
*/
static public function showConfig( $input, $user, $plugin ) {
global $_CB_framework;
HTML_cbgjAdmin::setTitle( CBTxt::T( 'Configuration' ), 'cbicon-48-gjconfig' );
$tabs = new cbTabs( 1, 2 );
$return = '<form action="' . $_CB_framework->backendUrl( 'index.php' ) . '" method="post" name="adminForm" enctype="multipart/form-data" id="adminForm" class="adminform">'
. $tabs->startPane( 'gjConfig' )
. $tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjGeneral' )
. $tabs->startPane( 'gjGeneralTabs' )
. $tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Global' ) ), 'gjGeneralGlobal' )
. '<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
. '<tbody>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Title' ) . '</th>'
. '<td width="40%">' . $input['general_title'] . '</td>'
. '<td>' . CBTxt::Th( 'Optionally replace breadcrumb title from plugin name (CB GroupJive).' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Template' ) . '</th>'
. '<td width="40%">' . $input['general_template'] . '</td>'
. '<td>' . CBTxt::Ph( 'Select template to be used for all of GroupJive. If template is incomplete then missing files will be used from the default template. Template files can be located at the following location: [rel_path]/templates', array( '[rel_path]' => $plugin->relPath ) ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Class' ) . '</th>'
. '<td width="40%">' . $input['general_class'] . '</td>'
. '<td>' . CBTxt::Th( 'Optionally add a class suffix to surrounding DIV encasing all of GroupJive.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Item ID' ) . '</th>'
. '<td width="40%">' . $input['general_itemid'] . '</td>'
. '<td>' . CBTxt::Th( 'Optionally add an Item ID override.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Dynamic ID' ) . '</th>'
. '<td width="40%">' . $input['general_dynamicid'] . '</td>'
. '<td>' . CBTxt::Th( 'Optionally obtain Item ID for every URL. Please note this will perform a query for every URL in attempt to find its menu link.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Tooltips' ) . '</th>'
. '<td width="40%">' . $input['general_tooltips'] . '</td>'
. '<td>' . CBTxt::Th( 'Select method for tooltip display. Applies to frontend only.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Panes' ) . '</th>'
. '<td width="40%">' . $input['general_panes'] . '</td>'
. '<td>' . CBTxt::Th( 'Enable or disable usage of Panes. Please note this will remove ALL menu structures. Only use if another means of menu display is available.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Validation' ) . '</th>'
. '<td width="40%">' . $input['general_validate'] . '</td>'
. '<td>' . CBTxt::Th( 'Enable or disable usage of jQuery form validation. This will prevent users from submitting forms without the required inputs complete. Validation is always done after form submit regardless of this parameter.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Folder Permission' ) . '</th>'
. '<td width="40%">' . $input['general_dirperms'] . '</td>'
. '<td>' . CBTxt::Th( 'Optionally input folder permissions used for folder creation. Only configure if you are sure you know what you are doing.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'File Permission' ) . '</th>'
. '<td width="40%">' . $input['general_fileperms'] . '</td>'
. '<td>' . CBTxt::Th( 'Optionally input file permissions used for file creation. Only configure if you are sure you know what you are doing.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Word Filter' ) . '</th>'
. '<td width="40%">' . $input['general_wordfilter'] . '</td>'
. '<td>' . CBTxt::Th( 'Optionally input word filtering applied to all locations user text can be supplied. Separate a filter and its replacement with an equal (=) sign (e.g. idiot=genius). Separate multiple filters by a linebreak. Lanugage strings are supported. Leave replacement blank to simply remove the word (e.g. idiot=). Note only whole words will be replaced.' ) . '</td>'
. '</tr>'
. '</tbody>'
. '</table>'
. $tabs->endTab()
. $tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Logos' ) ), 'gjGeneralLogos' )
. '<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
. '<tbody>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Size' ) . '</th>'
. '<td width="40%">' . $input['logo_size'] . '</td>'
. '<td>' . CBTxt::Th( 'Input maximum file size for logos. If blank Community Builder avatar size will be used.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Width' ) . '</th>'
. '<td width="40%">' . $input['logo_width'] . '</td>'
. '<td>' . CBTxt::Th( 'Input maximum logo width. If blank Community Builder avatar width will be used.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Height' ) . '</th>'
. '<td width="40%">' . $input['logo_height'] . '</td>'
. '<td>' . CBTxt::Th( 'Input maximum logo height. If blank Community Builder avatar height will be used.' ) . '</td>'
. '</tr>'
. '<tr>'
. '<th width="15%">' . CBTxt::Th( 'Thumbnail Width' ) . '</th>'
. '<td width="40%">' . $input['logo_thumbwidth'] . '</td>'
//.........这里部分代码省略.........
示例13: showInvited
/**
* render frontend tab invites
*
* @param object $rows
* @param object $pageNav
* @param moscomprofilerUser $displayed
* @param moscomprofilerUser $user
* @param object $plugin
* @param boolean $tabbed
* @return mixed
*/
static function showInvited( $rows, $pageNav, $displayed, $user, $plugin, $tabbed ) {
global $_CB_framework;
$invitedTabSearch = $plugin->params->get( 'invited_tab_search', 1 );
$invitedTabPaging = $plugin->params->get( 'invited_tab_paging', 1 );
$invitedTabLimitbox = $plugin->params->get( 'invited_tab_limitbox', 1 );
$invitedTabDescLimit = (int) $plugin->params->get( 'invited_tab_desc_limit', 150 );
if ( ! $tabbed ) {
$formUrl = cbgjClass::getPluginURL( array( 'panel', 'invited' ) );
} else {
$formUrl = $_CB_framework->userProfileUrl( $displayed->id, true, $plugin->tab->tabid );
}
$return = '<div class="gjTabInvited">'
. '<form action="' . $formUrl . '" method="post" name="gjTabForm_invited" id="gjTabForm_invited" class="gjForm">'
. ( $invitedTabSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );
if ( $rows ) foreach ( $rows as $row ) {
$category = $row->getCategory();
$authorized = cbgjClass::getAuthorization( $category, $row, $user );
if ( $row->get( 'published' ) == 1 ) {
$state = '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'unpublish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-ban-circle"></i> ' . CBTxt::Th( 'Unpublish' ) . '</a></div>';
} else {
$state = '<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-ok"></i> ' . CBTxt::Th( 'Publish' ) . '</a></div>';
}
$beforeMenu = cbgjClass::getIntegrations( 'gj_onBeforeProfileGroupInvitedMenu', array( $row, $category, $displayed, $user, $plugin ) );
$afterMenu = cbgjClass::getIntegrations( 'gj_onAfterProfileGroupInvitedMenu', array( $row, $category, $displayed, $user, $plugin ) );
$return .= '<div class="gjContent row-fluid">'
. '<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
. '<div class="gjContentBody mini-layout span10">'
. '<div class="gjContentBodyHeader row-fluid">'
. '<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . ' - ' . $category->getName( 0, true ) . ( $row->get( 'parent' ) ? ' - ' . $row->getParent()->getName( 0, true ) : null ) . '</small></h5></div>'
. '<div class="gjContentBodyMenu span3">';
if ( cbgjClass::hasAccess( 'grp_join', $authorized ) ) {
$return .= '<input type="button" value="' . htmlspecialchars( ( cbgjClass::hasAccess( 'grp_invited', $authorized ) ? CBTxt::T( 'Accept Invite' ) : CBTxt::T( 'Join' ) ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
}
if ( $beforeMenu || cbgjClass::hasAccess( array( 'grp_leave', 'mod_lvl2', 'mod_lvl3', 'grp_can_publish' ), $authorized ) || $afterMenu ) {
$menuItems = $beforeMenu
. ( cbgjClass::hasAccess( 'grp_leave', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'leave', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to leave this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-minus"></i> ' . CBTxt::Th( 'Leave' ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
. ( cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ? $state : null )
. ( cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'delete', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [group] and all its associated [users]?', array( '[group]' => cbgjClass::getOverride( 'group' ), '[users]' => cbgjClass::getOverride( 'user', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
. $afterMenu;
$return .= cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
}
$return .= '</div>'
. '</div>'
. '<div class="gjContentBodyInfo">' . ( $row->getDescription( $invitedTabDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $invitedTabDescLimit ) . '</div>' : null ) . '</div>'
. '<div class="gjContentDivider"></div>'
. '<div class="gjContentBodyFooter">'
. cbgjClass::getIntegrations( 'gj_onBeforeProfileGroupInvitedInfo', array( $row, $category, $displayed, $user, $plugin ), null, 'span' )
. ( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'group', $row->nestedCount() ) . ' | ' : null )
. ( $row->userCount() ? cbgjClass::getOverride( 'user', $row->userCount() ) . ' | ' : null )
. $row->getType()
. cbgjClass::getIntegrations( 'gj_onAfterProfileGroupInvitedInfo', array( $row, $category, $displayed, $user, $plugin ), null, 'span' )
. '</div>'
. '</div>'
. '</div>';
} else {
$return .= '<div class="gjContent">';
if ( $invitedTabSearch && $pageNav->searching ) {
$return .= CBTxt::Th( 'No invite search results found.' );
} else {
if ( $displayed->id == $user->id ) {
$return .= CBTxt::Ph( 'You are not invited to any [groups].', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) );
} else {
$return .= CBTxt::Ph( 'This user is not invited to any [groups].', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) );
}
}
$return .= '</div>';
}
if ( $invitedTabPaging ) {
$return .= '<div class="gjPaging pagination pagination-centered">'
. ( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
. ( ! $invitedTabLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
. '</div>';
}
//.........这里部分代码省略.........
示例14: showInvitesList
/**
* render frontend invites list
*
* @param array $rows
* @param cbgjCategory $category
* @param cbgjGroup $group
* @param moscomprofilerUser $user
* @param object $plugin
* @return mixed
*/
static function showInvitesList( $rows, $category, $group, $user, $plugin ) {
$group->setPathway( CBTxt::T( 'Invites List' ), true );
$inviteBy = explode( '|*|', $plugin->params->get( 'group_invites_by', '1|*|2|*|3|*|4' ) );
$return = '<div class="gjInvitesList">'
. '<form action="' . cbgjClass::getPluginURL( array( 'invites', 'send', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjForm" id="gjForm" class="gjForm">'
. '<legend class="gjEditTitle">' . cbgjClass::getOverride( 'user', true ) . '</legend>';
if ( $rows ) {
$return .= '<div class="gjContent">';
foreach ( $rows as $row ) {
$cbUser =& CBuser::getInstance( (int) $row->get( 'id' ) );
if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}
$recipient =& $cbUser->getUserData();
if ( in_array( 1, $inviteBy ) ) {
$invite = (int) $recipient->id;
} elseif ( in_array( 4, $inviteBy ) ) {
$invite = $recipient->email;
} elseif ( in_array( 2, $inviteBy ) ) {
$invite = $recipient->username;
} elseif ( in_array( 3, $inviteBy ) ) {
$invite = $recipient->name;
}
if ( ! $invite ) {
$invite = (int) $row->get( 'id' );
}
$inviteUrl = "document.gjForm.invites_invite.value = '" . addslashes( $invite ) . "';"
. "document.gjForm.submit();";
$return .= '<div class="gjContentBox mini-layout">'
. '<div class="gjContentBoxRow">' . $cbUser->getField( 'formatname', null, 'html', 'none', 'list', 0, true ) . '</div>'
. '<div class="gjContentBoxRow">' . $cbUser->getField( 'avatar', null, 'html', 'none', 'list', 0, true ) . '</div>'
. '<div class="gjContentBoxRow">' . $cbUser->getField( 'onlinestatus', null, 'html', 'none', 'profile', 0, true ) . '</div>'
. '<div class="gjContentBoxRow">'
. '<input type="button" value="' . htmlspecialchars( CBTxt::Th( 'Invite' ) ) . '" class="gjButton btn btn-success" onclick="' . $inviteUrl . '" />'
. '</div>'
. '</div>';
}
$return .= '</div>';
} else {
$return .= '<div class="gjContent">' . CBTxt::Ph( 'There are no [users] available to invite.', array( '[users]' => cbgjClass::getOverride( 'user', true ) ) ) . '</div>';
}
$return .= '<div class="gjButtonWrapper form-actions">'
. '<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '" />'
. '</div>'
. '<input type="hidden" name="invites_invite" id="invites_invite" value="" />'
. '<input type="hidden" name="invites_list" id="invites_list" value="1" />'
. cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>';
echo $return;
}
示例15: showTools
/**
* prepare backend tools render
*
* @param moscomprofilerUser $user
* @param object $plugin
*/
private function showTools( $user, $plugin ) {
global $_CB_database, $_PLUGINS;
$msgs = new stdClass();
$msgs->errors = array();
$msgs->warnings = array();
$msgs->info = array();
$_PLUGINS->trigger( 'gj_onBeforeTools', array( $msgs, $user, $plugin ) );
if ( file_exists( $plugin->imgsAbs ) ) {
if ( ! is_writable( $plugin->imgsAbs ) ) {
$msgs->errors[] = CBTxt::P( ':: Images :: directory not writable - [img_path]', array( '[img_path]' => $plugin->imgsAbs ) );
}
}
if ( file_exists( str_replace( '/' . $plugin->folder, '', $plugin->imgsAbs ) ) ) {
if ( ! is_writable( str_replace( '/' . $plugin->folder, '', $plugin->imgsAbs ) ) ) {
$msgs->errors[] = CBTxt::P( ':: Images :: directory not writable - [img_path]', array( '[img_path]' => str_replace( '/' . $plugin->folder, '', $plugin->imgsAbs ) ) );
}
}
$categories = cbgjData::getCategories();
$cat_types = array();
$cat_published = array();
$cat_name = array();
$cat_user = array();
$cat_notification = array();
if ( $categories ) foreach ( $categories as $category ) {
$category_url = '<a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $category->get( 'id' ) ) ) . '">' . $category->get( 'id' ) . '</a>';
if ( ! $category->get( 'types' ) ) {
$cat_types[] = $category_url;
}
if ( ! $category->get( 'published' ) ) {
$cat_published[] = $category_url;
}
if ( $category->get( 'name' ) == '' ) {
$cat_name[] = $category_url;
}
if ( ! $category->get( 'user_id' ) ) {
$cat_user[] = $category_url;
} else {
$notification = cbgjData::getNotifications( null, array( array( 'type', '=', 'category' ), array( 'item', '=', (int) $category->get( 'id' ) ), array( 'user_id', '=', (int) $category->get( 'user_id' ) ) ), null, null, false );
if ( ( ! $notification->get( 'id' ) ) && cbgjClass::hasAccess( 'cat_usr_notifications', cbgjClass::getAuthorization( $category, null, $category->getOwner() ) ) ) {
$cat_notification[] = $category_url;
}
}
}
if ( ! empty( $cat_types ) ) {
$fix_url = '<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'types' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
$msgs->errors[] = CBTxt::P( ':: Category :: Missing types - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_types ), '[fixall]' => $fix_url ) );
}
if ( ! empty( $cat_published ) ) {
$fix_url = '<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'published' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
$msgs->info[] = CBTxt::P( ':: Category :: Not published - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_published ), '[fixall]' => $fix_url ) );
}
if ( ! empty( $cat_name ) ) {
$msgs->errors[] = CBTxt::P( ':: Category :: Missing name - [cat]', array( '[cat]' => implode( ', ', $cat_name ) ) );
}
if ( ! empty( $cat_user ) ) {
$fix_url = '<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'user_id' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
$msgs->errors[] = CBTxt::P( ':: Category :: Missing owner - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_user ), '[fixall]' => $fix_url ) );
}
if ( ! empty( $cat_notification ) ) {
$fix_url = '<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'notifications' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
$msgs->errors[] = CBTxt::Ph( ':: Category :: Missing owner notifications - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_notification ), '[fixall]' => $fix_url ) );
}
$groups = cbgjData::getGroups();
$grp_cat_id = array();
$grp_published = array();
$grp_type = array();
$grp_cat = array();
$grp_name = array();
$grp_user = array();
$grp_owner = array();
$grp_notification = array();
if ( $groups ) foreach ( $groups as $group ) {
$group_url = '<a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $group->get( 'id' ) ) ) . '">' . $group->get( 'id' ) . '</a>';
//.........这里部分代码省略.........