本文整理汇总了PHP中CBLib\Language\CBTxt::Th方法的典型用法代码示例。如果您正苦于以下问题:PHP CBTxt::Th方法的具体用法?PHP CBTxt::Th怎么用?PHP CBTxt::Th使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBLib\Language\CBTxt
的用法示例。
在下文中一共展示了CBTxt::Th方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: emailUsers
/**
* Outputs legacy mass mailer display
*
* @deprecated 2.0
*
* @param UserTable[] $rows
* @param string $emailSubject
* @param string $emailBody
* @param string $emailAttach
* @param string $emailFromName
* @param string $emailFromAddr
* @param string $emailReplyName
* @param string $emailReplyAddr
* @param int $emailsPerBatch
* @param int $emailsBatch
* @param int $emailPause
* @param bool $simulationMode
* @param array $pluginRows
*/
public function emailUsers($rows, $emailSubject, $emailBody, $emailAttach, $emailFromName, $emailFromAddr, $emailReplyName, $emailReplyAddr, $emailsPerBatch, $emailsBatch, $emailPause, $simulationMode, $pluginRows)
{
global $_CB_framework, $_CB_Backend_Title;
_CBsecureAboveForm('showUsers');
cbimport('cb.validator');
outputCbTemplate(2);
outputCbJs(2);
$_CB_Backend_Title = array(0 => array('fa fa-envelope-o', CBTxt::T('Community Builder: Mass Mailer')));
$editorSave = $_CB_framework->saveCmsEditorJS('emailbody');
if ($editorSave) {
$js = "\$( '.cbEmailUsersForm' ).submit( function() { " . $editorSave . "});";
} else {
$js = null;
}
cbValidator::outputValidatorJs($js);
$emailsList = array();
foreach (array_slice($rows, 0, 100) as $row) {
$emailsList[] = htmlspecialchars($row->name) . ' <' . htmlspecialchars($row->email) . '>';
}
$return = '<form action="' . $_CB_framework->backendUrl('index.php') . '" method="post" name="adminForm" class="cb_form form-auto cbEmailUsersForm">' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('SEND_EMAIL_TO_TOTAL_USERS', 'Send Email to [total] users', array('[total]' => (int) count($rows))) . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . implode(', ', $emailsList) . (count($rows) > 100 ? ' <strong>' . CBTxt::Th('AND_COUNT_MORE_USERS', 'and [count] more users.', array('[count]' => (int) (count($rows) - 100))) . '</strong>' : null) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_SIMULATION_MODE_LABEL', 'Simulation Mode') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="checkbox" name="simulationmode" id="simulationmode"' . ($simulationMode ? ' checked="checked"' : null) . ' /> <label for="simulationmode">' . CBTxt::T('Do not send emails, just show me how it works') . '</label>' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_SIMULATION_MODE_TOOLTIP', 'Check this box to simulate email sending in a dry run mode. No emails are actually sent.'), CBTxt::T('MASS_MAILER_SIMULATION_MODE_LABEL', 'Simulation Mode'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_SUBJECT_LABEL', 'Email Subject') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailsubject" value="' . htmlspecialchars($emailSubject) . '" class="form-control required" size="60" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_SUBJECT_TOOLTIP', 'Type in the subject of the mass mailing (CB field substitutions are supported).'), CBTxt::T('MASS_MAILER_SUBJECT_LABEL', 'Email Subject'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_MESSAGE_LABEL', 'Email Message') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . $_CB_framework->displayCmsEditor('emailbody', $emailBody, 600, 200, 50, 7) . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_MESSAGE_TOOLTIP', 'Type in the main message body of your mass mailing (HTML editor and CB field substitutions are supported).'), CBTxt::T('MASS_MAILER_MESSAGE_LABEL', 'Email Message'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_ATTACHMENTS_LABEL', 'Email Attachments') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailattach" value="' . htmlspecialchars($emailAttach) . '" class="form-control" size="80" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_ATTACHMENTS_TOOLTIP', 'Absolute server path to file that should be attached to each email. Multiple files can be specified using a comma separator.'), CBTxt::T('MASS_MAILER_ATTACHMENTS_LABEL', 'Email Attachments'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('Substitutions for Subject, Message, and Attachments') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . CBTxt::T('You can use all CB substitutions as in most parts: e.g.: [cb:if team="winners"] Congratulations [cb:userfield field="name" /], you are in the winning team! [/cb:if]') . '</div>' . '</div>' . '</div>' . $this->_pluginRows($pluginRows) . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_FROM_NAME_LABEL', 'From Name') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailfromname" value="' . htmlspecialchars($emailFromName) . '" class="form-control" size="30" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_FROM_NAME_TOOLTIP', 'The name to be used in the From field of email. If left empty the CB and Joomla configuration defaults will be used.'), CBTxt::T('MASS_MAILER_FROM_NAME_LABEL', 'From Name'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_FROM_ADDRESS_LABEL', 'From Email Address') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailfromaddr" value="' . htmlspecialchars($emailFromAddr) . '" class="form-control" size="40" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_FROM_ADDRESS_TOOLTIP', 'The email address to be user in the From field of email. If left empty the CB and Joomla settings will be used.'), CBTxt::T('MASS_MAILER_FROM_ADDRESS_LABEL', 'From Email Address'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_REPLY_TO_NAME_LABEL', 'Reply-To Name') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailreplyname" value="' . htmlspecialchars($emailReplyName) . '" class="form-control" size="30" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_REPLY_TO_NAME_TOOLTIP', 'The Reply-To Name value to be used in the From field of email. If left empty the CB and Joomla settings will be used.'), CBTxt::T('MASS_MAILER_REPLY_TO_NAME_LABEL', 'Reply-To Name'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_REPLY_TO_ADDRESS_LABEL', 'Reply-To Email Address') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailreplyaddr" value="' . htmlspecialchars($emailReplyAddr) . '" class="form-control" size="40" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_REPLY_TO_ADDRESS_TOOLTIP', 'The Reply-To Email address to be used in the email.'), CBTxt::T('MASS_MAILER_REPLY_TO_ADDRESS_LABEL', 'Reply-To Email Address'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_EMAILS_PER_BATCH_LABEL', 'Emails per batch') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailsperbatch" value="' . htmlspecialchars($emailsPerBatch) . '" class="form-control required digits" size="12" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_EMAILS_PER_BATCH_TOOLTIP', 'The number of emails to be sent in each batch (default 50).'), CBTxt::T('MASS_MAILER_EMAILS_PER_BATCH_LABEL', 'Emails per batch'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_SECONDS_BETWEEN_BATCHES_LABEL', 'Seconds of pause between batches') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailpause" value="' . htmlspecialchars($emailPause) . '" class="form-control required digits" size="12" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_SECONDS_BETWEEN_BATCHES_TOOLTIP', 'The number of seconds to pause between batch sending (default is 30 sec).'), CBTxt::T('MASS_MAILER_SECONDS_BETWEEN_BATCHES_LABEL', 'Seconds of pause between batches'), false, 4) . '</div>' . '</div>' . '</div>' . '<input type="hidden" name="option" value="com_comprofiler" />' . '<input type="hidden" name="view" value="emailusers" />' . '<input type="hidden" name="boxchecked" value="0" />';
foreach ($rows as $row) {
$return .= '<input type="hidden" name="cid[]" value="' . (int) $row->id . '">';
}
$return .= cbGetSpoofInputTag('user') . '</form>';
echo $return;
}
示例2: showBlogEdit
/**
* @param OrderedTable $row
* @param string[] $input
* @param UserTable $user
* @param stdClass $model
* @param PluginTable $plugin
*/
static function showBlogEdit($row, $input, $user, $model, $plugin)
{
global $_CB_framework, $_PLUGINS;
cbValidator::loadValidation();
$blogMode = $plugin->params->get('blog_mode', 1);
$pageTitle = $row->get('id') ? CBTxt::T('Edit Blog') : CBTxt::T('Create Blog');
$cbModerator = Application::User((int) $user->get('id'))->isGlobalModerator();
$_CB_framework->setPageTitle($pageTitle);
$_CB_framework->appendPathWay(htmlspecialchars(CBTxt::T('Blogs')), $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), true, 'cbblogsTab'));
$_CB_framework->appendPathWay(htmlspecialchars($pageTitle), $_CB_framework->pluginClassUrl($plugin->element, true, $row->get('id') ? array('action' => 'blogs', 'func' => 'edit', 'id' => (int) $row->get('id')) : array('action' => 'blogs', 'func' => 'new')));
initToolTip();
$return = '<div class="blogEdit">' . '<form action="' . $_CB_framework->pluginClassUrl($plugin->element, true, array('action' => 'blogs', 'func' => 'save', 'id' => (int) $row->get('id'))) . '" method="post" enctype="multipart/form-data" name="blogForm" id="blogForm" class="cb_form blogForm form-auto cbValidation">' . ($pageTitle ? '<div class="blogsTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null);
if ($cbModerator || !$plugin->params->get('blog_approval', 0)) {
$return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="published" class="col-sm-3 control-label">' . CBTxt::Th('Published') . '</label>' . '<div class="cb_field col-sm-9">' . $input['published'] . getFieldIcons(1, 0, null, CBTxt::T('Select publish status of the blog. Unpublished blogs will not be visible to the public.')) . '</div>' . '</div>';
}
if ($plugin->params->get('blog_category_config', 1) || $cbModerator) {
$return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="category" class="col-sm-3 control-label">' . CBTxt::Th('Category') . '</label>' . '<div class="cb_field col-sm-9">' . $input['category'] . getFieldIcons(1, 0, null, CBTxt::T('Select blog category. Select the category that best describes your blog.')) . '</div>' . '</div>';
}
if ($plugin->params->get('blog_access_config', 1) || $cbModerator) {
$return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="access" class="col-sm-3 control-label">' . CBTxt::Th('Access') . '</label>' . '<div class="cb_field col-sm-9">' . $input['access'] . getFieldIcons(1, 0, null, CBTxt::T('Select access to blog; all groups above that level will also have access to the blog.')) . '</div>' . '</div>';
}
$return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="title" class="col-sm-3 control-label">' . CBTxt::Th('Title') . '</label>' . '<div class="cb_field col-sm-9">' . $input['title'] . getFieldIcons(1, 1, null, CBTxt::T('Input blog title. This is the title that will distinguish this blog from others. Suggested to input something unique and intuitive.')) . '</div>' . '</div>';
if (in_array($blogMode, array(1, 2))) {
$return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_intro" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Intro') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_intro'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog intro contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
}
if (in_array($blogMode, array(1, 3))) {
$return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_full" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Full') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_full'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
}
if ($cbModerator) {
$return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="user" class="col-sm-3 control-label">' . CBTxt::T('Owner') . '</label>' . '<div class="cb_field col-sm-9">' . $input['user'] . getFieldIcons(1, 1, null, CBTxt::T('Input owner of blog as single integer user_id.')) . '</div>' . '</div>';
}
if ($plugin->params->get('blog_captcha', 0) && !$cbModerator) {
$_PLUGINS->loadPluginGroup('user');
$captcha = $_PLUGINS->trigger('onGetCaptchaHtmlElements', array(false));
if (!empty($captcha)) {
$captcha = $captcha[0];
$return .= '<div class="form-group cb_form_line clearfix">' . '<label class="col-sm-3 control-label">' . CBTxt::Th('Captcha') . '</label>' . '<div class="cb_field col-sm-9">' . (isset($captcha[0]) ? $captcha[0] : null) . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<div class="cb_field col-sm-offset-3 col-sm-9">' . str_replace('inputbox', 'form-control', isset($captcha[1]) ? $captcha[1] : null) . getFieldIcons(1, 1, null) . '</div>' . '</div>';
}
}
$return .= '<div class="form-group cb_form_line clearfix">' . '<div class="col-sm-offset-3 col-sm-9">' . '<input type="submit" value="' . htmlspecialchars($row->get('id') ? CBTxt::T('Update Blog') : CBTxt::T('Create Blog')) . '" class="blogsButton blogsButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' /> ' . ' <input type="button" value="' . htmlspecialchars(CBTxt::T('Cancel')) . '" class="blogsButton blogsButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes(CBTxt::T('Are you sure you want to cancel? All unsaved data will be lost!')) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), false, 'cbblogsTab') . '\'; }" />' . '</div>' . '</div>' . cbGetSpoofInputTag('plugin') . '</form>' . '</div>';
echo $return;
}
示例3: processConnectionActions
function processConnectionActions($connectionids)
{
global $_CB_framework, $ueConfig, $_PLUGINS;
// simple spoof check security
cbSpoofCheck('manageconnections');
if (!$ueConfig['allowConnections']) {
$msg = CBTxt::Th('UE_FUNCTIONALITY_DISABLED', 'This functionality is currently disabled.');
} elseif (!($_CB_framework->myId() > 0)) {
$msg = CBTxt::Th('UE_NOT_AUTHORIZED', 'You are not authorized to view this page!');
} else {
$msg = null;
}
$_PLUGINS->loadPluginGroup('user');
$_PLUGINS->trigger('onBeforeProcessConnectionsRequest', array($connectionids, &$msg));
if ($msg) {
$_CB_framework->enqueueMessage($msg, 'error');
return;
}
$cbCon = new cbConnection($_CB_framework->myId());
if (is_array($connectionids)) {
foreach ($connectionids as $cid) {
$action = cbGetParam($_POST, $cid . 'action');
if ($action == 'd') {
$cbCon->denyConnection($_CB_framework->myId(), $cid);
} elseif ($action == 'a') {
$cbCon->acceptConnection($_CB_framework->myId(), $cid);
}
}
}
$error = $cbCon->getErrorMSG();
if ($error) {
cbRedirect($_CB_framework->viewUrl('manageconnections', false), $error, 'error');
} else {
cbRedirect($_CB_framework->viewUrl('manageconnections', false), is_array($connectionids) ? CBTxt::Th('UE_CONNECTIONACTIONSSUCCESSFULL', 'Connection actions successful!') : null);
}
}
示例4: array
if (file_exists($_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubstax')) {
$cbsubsMenu['menu'][] = array('title' => CBTxt::Th('Taxes'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showtaxsettings', 'cbprevstate' => base64_encode($prevStateBase))), 'access' => array('cbsubs.financial', 'com_cbsubs'), 'icon' => 'cbsubs-taxes', 'submenu' => array(array('title' => CBTxt::Th('Sales Tax / VAT Report'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showtable', 'table' => 'taxreportmonthly', 'cbprevstate' => base64_encode($prevStateBase . '&action=showtaxsettings'))), 'access' => array('cbsubs.financial', 'com_cbsubs'), 'icon' => 'cbsubs-taxes_report')));
}
if (file_exists($_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubspromotion')) {
$cbsubsMenu['menu'][] = array('title' => CBTxt::Th('Promotions'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showpromotionssettings', 'cbprevstate' => base64_encode($prevStateBase))), 'access' => array('cbsubs.marketing', 'com_cbsubs'), 'icon' => 'cbsubs-promotions', 'submenu' => array(array('title' => CBTxt::Th('Add New Promotion'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'editrow', 'table' => 'promotionsbrowser')), 'access' => array('cbsubs.marketing', 'com_cbsubs'), 'icon' => 'cb-new'), array('title' => CBTxt::Th('Promotions Used'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showtable', 'table' => 'promotionsuses', 'cbprevstate' => base64_encode($prevStateBase . '&action=showpromotionssettings'))), 'access' => array('cbsubs.marketing', 'com_cbsubs'), 'icon' => 'cbsubs-promotions_used'), array('title' => CBTxt::Th('Promotions Statistics'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showtable', 'table' => 'promotionsstats', 'cbprevstate' => base64_encode($prevStateBase . '&action=showpromotionssettings'))), 'access' => array('cbsubs.marketing', 'com_cbsubs'), 'icon' => 'cbsubs-promotions_statistics')));
}
if (file_exists($_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubsmailer')) {
$cbsubsMenu['menu'][] = array('title' => CBTxt::Th('Mailer'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showmailersettings', 'cbprevstate' => base64_encode($prevStateBase))), 'access' => array(array('core.admin', 'cbsubs.marketing'), 'com_cbsubs'), 'icon' => 'cbsubs-mailer', 'submenu' => array(array('title' => CBTxt::Th('Add New Mailer'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'editrow', 'table' => 'mailersbrowser', 'cbprevstate' => base64_encode($prevStateBase . '&action=showmailersettings'))), 'access' => array('cbsubs.marketing', 'com_cbsubs'), 'icon' => 'cb-new'), array('title' => CBTxt::Th('Messages Queue'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showtable', 'table' => 'mailermailqueue', 'cbprevstate' => base64_encode($prevStateBase . '&action=showmailersettings'))), 'access' => array('cbsubs.marketing', 'com_cbsubs'), 'icon' => 'cbsubs-mailer_queue'), array('title' => CBTxt::Th('Sent Messages'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'showtable', 'table' => 'mailersentmessages', 'cbprevstate' => base64_encode($prevStateBase . '&action=showmailersettings'))), 'access' => array('cbsubs.marketing', 'com_cbsubs'), 'icon' => 'cbsubs-mailer_sent')));
}
$menu[] = $cbsubsMenu;
}
}
if ($params->get('menu_cbgj', 1) && file_exists($_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/user/plug_cbgroupjive')) {
$query = 'SELECT ' . $_CB_database->NameQuote('id') . "\n FROM " . $_CB_database->NameQuote('#__comprofiler_plugin') . "\n WHERE " . $_CB_database->NameQuote('element') . ' = ' . $_CB_database->Quote('cbgroupjive');
$_CB_database->setQuery($query, 0, 1);
$pluginId = $_CB_database->loadResult();
if ($pluginId) {
$gjMenu = array();
$gjMenu['component'] = array('title' => CBTxt::Th('GroupJive'));
$gjMenu['menu'] = array(array('title' => CBTxt::Th('Plugin'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId)), 'icon' => 'cbgj-plugin'), array('title' => CBTxt::Th('Categories'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'categories')), 'icon' => 'cbgj-categories', 'submenu' => array(array('title' => CBTxt::Th('Add New Category'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'categories.new')), 'icon' => 'cb-new'))), array('title' => CBTxt::Th('Groups'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'groups')), 'icon' => 'cbgj-groups', 'submenu' => array(array('title' => CBTxt::Th('Add New Group'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'groups.new')), 'icon' => 'cb-new'))), array('title' => CBTxt::Th('Users'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'users')), 'icon' => 'cbgj-users', 'submenu' => array(array('title' => CBTxt::Th('Add New User to Group'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'users.new')), 'icon' => 'cb-new'))), array('title' => CBTxt::Th('Invites'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'invites')), 'icon' => 'cbgj-invites'), array('title' => CBTxt::Th('Configuration'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'config')), 'icon' => 'cbgj-configuration'), array('title' => CBTxt::Th('Tools'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'tools')), 'icon' => 'cbgj-tools'), array('title' => CBTxt::Th('Integrations'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'integrations')), 'icon' => 'cbgj-integrations'), array('title' => CBTxt::Th('Menus'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'menus')), 'icon' => 'cbgj-menus'));
if (file_exists($_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/user/plug_cbgroupjive/plugins/cbgroupjiveauto')) {
$gjMenu['menu'][] = array('title' => CBTxt::Th('Auto'), 'link' => $_CB_framework->backendViewUrl('editPlugin', true, array('cid' => $pluginId, 'action' => 'plugin.auto')), 'icon' => 'cbgj-auto');
}
$menu[] = $gjMenu;
}
}
if ($params->get('menu_plugins', 1)) {
$_PLUGINS->loadPluginGroup('user');
$_PLUGINS->trigger('mod_onCBAdminMenu', array(&$menu, $disabled));
}
}
示例5: getField
/**
* Returns a field in specified format
*
* @param FieldTable $field
* @param UserTable $user
* @param string $output 'html', 'xml', 'json', 'php', 'csvheader', 'csv', 'rss', 'fieldslist', 'htmledit'
* @param string $reason 'profile' for user profile view, 'edit' for profile edit, 'register' for registration, 'list' for user-lists
* @param int $list_compare_types IF reason == 'search' : 0 : simple 'is' search, 1 : advanced search with modes, 2 : simple 'any' search
* @return mixed
*/
public function getField(&$field, &$user, $output, $reason, $list_compare_types)
{
global $_CB_framework;
$return = null;
if ($output == 'htmledit' && $reason != 'search') {
if (Application::MyUser()->getUserId() != $user->get('id')) {
// Terms and Conditions should never be required to be accepted by a user other than the profile owner:
$field->set('required', 0);
}
$value = $user->get($field->name);
$termsOutput = $field->params->get('terms_output', 'text');
$termsType = CBTxt::T($field->params->get('terms_type', null));
$termsDisplay = $field->params->get('terms_display', 'modal');
$termsURL = $field->params->get('terms_url', null);
$termsText = CBTxt::T($field->params->get('terms_text', null));
$termsWidth = $field->params->get('terms_width', 400);
$termsHeight = $field->params->get('terms_height', 200);
if ($termsOutput == 'url' && !$termsURL || $termsOutput == 'text' && !$termsText) {
return parent::getField($field, $user, $output, $reason, $list_compare_types);
}
if (!$termsType) {
$termsType = CBTxt::T('TERMS_AND_CONDITIONS', 'Terms and Conditions');
}
if (!$termsWidth) {
$termsWidth = 400;
}
if (!$termsHeight) {
$termsHeight = 200;
}
if ($termsDisplay == 'iframe') {
if (is_numeric($termsHeight)) {
$termsHeight .= 'px';
}
if (is_numeric($termsWidth)) {
$termsWidth .= 'px';
}
if ($termsOutput == 'url') {
$return .= '<div class="embed-responsive cbTermsFrameContainer" style="padding-bottom: ' . htmlspecialchars($termsHeight) . ';">' . '<iframe class="embed-responsive-item cbTermsFrameURL" style="width: ' . htmlspecialchars($termsWidth) . ';" src="' . htmlspecialchars($termsURL) . '"></iframe>' . '</div>';
} else {
$return .= '<div class="cbTermsFrameText" style="height:' . htmlspecialchars($termsHeight) . ';width:' . htmlspecialchars($termsWidth) . ';overflow:auto;">' . $termsText . '</div>';
}
$label = CBTxt::Th('TERMS_FIELD_I_AGREE_ON_THE_ABOVE_CONDITIONS', 'I Agree to the above [type].', array('[type]' => $termsType));
} else {
$attributes = ' class="cbTermsLink"';
if ($termsOutput == 'text' && $termsDisplay == 'window') {
$termsDisplay = 'modal';
}
if ($termsDisplay == 'modal') {
// Tooltip height percentage would be based off window height (including scrolling); lets change it to be based off the viewport height:
$termsHeight = substr($termsHeight, -1) == '%' ? (int) substr($termsHeight, 0, -1) . 'vh' : $termsHeight;
if ($termsOutput == 'url') {
$tooltip = '<iframe class="cbTermsModalURL" height="100%" width="100%" src="' . htmlspecialchars($termsURL) . '"></iframe>';
} else {
$tooltip = '<div class="cbTermsModalText" style="height:100%;width:100%;overflow:auto;">' . $termsText . '</div>';
}
$url = 'javascript:void(0);';
$attributes .= ' ' . cbTooltip($_CB_framework->getUi(), $tooltip, $termsType, array($termsWidth, $termsHeight), null, null, null, 'data-hascbtooltip="true" data-cbtooltip-modal="true"');
} else {
$url = htmlspecialchars($termsURL);
$attributes .= ' target="_blank"';
}
$label = CBTxt::Th('TERMS_FIELD_ACCEPT_URL_CONDITIONS', 'Accept <!--suppress HtmlUnknownTarget --><a href="[url]"[attributes]>[type]</a>', array('[url]' => $url, '[attributes]' => $attributes, '[type]' => $termsType));
}
$inputName = $field->name;
$translatedTitle = $this->getFieldTitle($field, $user, 'html', $reason);
$htmlDescription = $this->getFieldDescription($field, $user, 'htmledit', $reason);
$trimmedDescription = trim(strip_tags($htmlDescription));
$attributes = null;
if ($this->_isRequired($field, $user, $reason)) {
$attributes .= ' class="required"';
}
$attributes .= $trimmedDescription ? cbTooltip($_CB_framework->getUi(), $htmlDescription, $translatedTitle, null, null, null, null, 'data-hascbtooltip="true"') : null;
$return .= '<span class="cbSnglCtrlLbl">' . '<label for="' . htmlspecialchars($inputName) . '" class="checkbox-inline">' . '<input type="checkbox" id="' . htmlspecialchars($inputName) . '" name="' . htmlspecialchars($inputName) . '" value="1"' . ($value == 1 ? ' checked="checked"' : null) . $attributes . ' />' . $label . '</label>' . '</span>' . $this->_fieldIconsHtml($field, $user, $output, $reason, null, $field->type, $value, 'input', null, true, $this->_isRequired($field, $user, $reason) && !$this->_isReadOnly($field, $user, $reason));
} else {
$return .= parent::getField($field, $user, $output, $reason, $list_compare_types);
}
return $return;
}
示例6: SimpleXMLElement
/**
* Implements a form xpath-type field for showing a given xpath value
*
* @param string $name The name of the form element
* @param string $value The value of the element
* @param SimpleXMLElement $node The xml element for the parameter
* @param string $control_name The control name
* @return string The html for the element
*/
function _form_xpath( /** @noinspection PhpUnusedParameterInspection */ $name, $value, &$node, $control_name ) {
$fromNode = $node->attributes( 'path' );
$fromFile = $node->attributes( 'file' );
$translate = $node->attributes( 'translate' );
$return = null;
if ( $fromNode && ( $fromFile !== null ) ) {
$this->substituteName( $fromFile, true );
$this->substituteName( $fromNode, false );
if ( $fromFile !== '' ) {
$fromFile = static::pathFromXML( $fromFile . '.xml', $node, $this->_pluginObject );
}
if ( ( $fromFile === '' ) || is_readable( $fromFile ) ) {
if ( $fromFile === '' ) {
$fromRoot = $node;
} else {
$fromRoot = new SimpleXMLElement( $fromFile, LIBXML_NONET | ( defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0 ), true );
}
/** @var SimpleXMLElement[] $xmlPath */
$xmlPath = $fromRoot->xpath( $fromNode );
if ( $xmlPath && count( $xmlPath ) ) {
$return = $xmlPath[0]->data();
}
if ( $translate == 'yes' ) {
$return = CBTxt::Th( $return );
}
}
}
return $return;
}
示例7: renderList
/**
* Renders as ECHO HTML code of a table
*
* @param SimpleXMLElement $modelView
* @param array $modelRows
* @param DrawController $controllerView
* @param array $options
* @param string $viewType ( 'view', 'param', 'depends': means: <param> tag => param, <field> tag => view )
*/
protected function renderList(&$modelView, &$modelRows, &$controllerView, &$options, $viewType = 'view')
{
global $_CB_framework;
static $JS_loaded = 0;
$pluginParams = $this->_pluginParams;
$renderer = new RegistryEditView($this->input, $this->_db, $pluginParams, $this->_types, $this->_actions, $this->_views, $this->_pluginObject, $this->_tabid);
$renderer->setParentView($modelView);
$renderer->setModelOfDataRows($modelRows);
$name = $modelView->attributes('name');
$listFieldsRows = $modelView->getElementByPath('listfields/rows');
$listFieldsPager = $modelView->getElementByPath('listfields/paging');
$filtersArray = $controllerView->filters($renderer, 'table');
$batchArray = $controllerView->batchprocess($renderer, 'table');
outputCbJs();
$tableLabel = trim(CBTxt::Th($modelView->attributes('label')));
$tableMenu = $modelView->getElementByPath('tablemenu');
if (!$JS_loaded++) {
if ($controllerView->pageNav !== null) {
$searchButtonJs = $controllerView->pageNav->limitstartJs(0);
} else {
$searchButtonJs = 'cbParentForm( this ).submit();';
}
$js = "\$( '.cbTableHeader' ).on( 'click', '.cbTableHeaderExpand', function() {" . "\$( this ).removeClass( 'btn-default cbTableHeaderExpand' ).addClass( 'btn-primary cbTableHeaderCollapse' );" . "\$( this ).find( '.fa' ).removeClass( 'fa-caret-down' ).addClass( 'fa-caret-up' );" . "\$( '.' + \$( this ).data( 'toggle' ) ).slideDown();" . "});" . "\$( '.cbTableHeader' ).on( 'click', '.cbTableHeaderCollapse', function() {" . "var toggle = \$( this ).data( 'toggle' );" . "\$( this ).removeClass( 'btn-primary cbTableHeaderCollapse' ).addClass( 'btn-default cbTableHeaderExpand' );" . "\$( this ).find( '.fa' ).removeClass( 'fa-caret-up' ).addClass( 'fa-caret-down' );" . "\$( '.' + toggle ).slideUp();" . "if ( toggle == 'cbBatchTools' ) {" . "\$( '.' + toggle ).find( 'input,textarea,select' ).val( '' );" . "if ( \$.fn.cbselect ) {" . "\$( '.' + toggle ).find( 'select.cbSelect2' ).each( function() {" . "\$( this ).cbselect( 'set', '' );" . "});" . "}" . "} else {" . "\$( '.' + toggle ).find( 'input,textarea,select' ).each( function() {" . "var value = null;" . "if ( \$( this ).hasClass( 'cbSelect2' ) ) {" . "if ( \$.fn.cbselect ) {" . "value = \$( this ).cbselect( 'get' );" . "} else {" . "value = \$( this ).val();" . "}" . "} else {" . "value = \$( this ).val();" . "}" . "if ( ( value != null ) && ( value != '' ) ) {" . "\$( '.cbTableHeaderClear' ).click(); return;" . "}" . "});" . "}" . "});" . "\$( '.cbTableHeader' ).on( 'click', '.cbTableHeaderClear', function() {" . "\$( '.cbTableHeader' ).find( 'input,textarea,select' ).val( '' );" . "if ( \$.fn.cbselect ) {" . "\$( '.cbTableHeader' ).find( 'select.cbSelect2' ).each( function() {" . "\$( this ).cbselect( 'set', '' );" . "});" . "}" . $searchButtonJs . "});" . "\$( '.cbTableBrowserRowsHeader' ).on( 'click', '.cbTableBrowserSort', function() {" . "\$( '.cbTableHeader' ).find( '.cbTableBrowserSorting > select' ).val( \$( this ).data( 'table-sort' ) ).change();" . "});" . ($this->_filtered ? "\$( '.cbSearchToolsToggle' ).click();" : null);
$_CB_framework->outputCbJQuery($js);
}
$return = '<div class="table-responsive cbTableBrowserDiv' . ($name ? ' cbDIV' . htmlspecialchars($name) : null) . '">';
if ($tableLabel || $tableMenu || $controllerView->hasSearchFields() || $controllerView->hasOrderbyFields() || count($filtersArray) > 0 || count($batchArray) > 0) {
$return .= '<table class="table table-noborder cbTableBrowserHeader' . ($name ? ' cbTA' . htmlspecialchars($name) : null) . '">' . '<thead>' . '<tr class="cbTableHeader">';
if ($tableLabel || $tableMenu) {
$return .= '<th style="width: 10%;" class="text-left cbTableBrowserLabel' . ($name ? ' cbTH' . htmlspecialchars($name) : null) . '">' . ($tableLabel ? $tableLabel : null);
if ($tableMenu) {
$menuIndex = 1;
$return .= $tableLabel ? '<div><small>[ ' : null;
foreach ($tableMenu->children() as $menu) {
/** @var SimpleXMLElement $menu */
$menuAction = $menu->attributes('action');
$menuLabelHtml = trim(CBTxt::Th(htmlspecialchars($menu->attributes('label'))));
$menuDesc = $menu->attributes('description');
if ($menuDesc) {
$menuDesc = ' title="' . trim(htmlspecialchars(CBTxt::T($menuDesc))) . '"';
}
$return .= $menuIndex > 1 ? ' - ' : null;
if ($menuAction) {
$data = null;
$link = $controllerView->drawUrl($menuAction, $menu, $data, 0, true);
if ($link) {
$return .= '<a href="' . $link . '"' . $menuDesc . '>' . $menuLabelHtml . '</a>';
}
} elseif ($menuDesc) {
$return .= '<span' . $menuDesc . '>' . $menuLabelHtml . '</span>';
} else {
$return .= $menuLabelHtml;
}
$menuIndex++;
}
$return .= $tableLabel ? ' ]</small></div>' : null;
}
$return .= '</th>';
}
if ($controllerView->hasSearchFields() || $controllerView->hasOrderbyFields() || count($filtersArray) > 0 || count($batchArray) > 0) {
$return .= '<th class="cbTableHeaderTools">' . '<div class="text-left clearfix cbTableBrowserTools">';
if ($controllerView->hasSearchFields()) {
$return .= $controllerView->quicksearchfields();
}
if (count($filtersArray) > 0) {
if ($controllerView->hasSearchFields()) {
$return .= ' ';
}
$return .= '<button type="button" class="btn btn-default cbSearchToolsToggle cbTableHeaderExpand" data-toggle="cbSearchTools">' . CBTxt::Th('Search Tools') . ' <span class="fa fa-caret-down"></span></button>';
}
if (count($batchArray) > 0) {
if (count($filtersArray) > 0 || $controllerView->hasSearchFields()) {
$return .= ' ';
}
$return .= '<button type="button" class="btn btn-default cbBatchToolsToggle cbTableHeaderExpand" data-toggle="cbBatchTools">' . CBTxt::Th('Batch Tools') . ' <span class="fa fa-caret-down"></span></button>';
}
$return .= ' <button type="button" class="btn btn-default cbTableHeaderClear">' . CBTxt::Th('Clear') . '</button>';
if ($controllerView->hasOrderbyFields()) {
if (count($filtersArray) > 0 || count($batchArray) > 0 || $controllerView->hasSearchFields()) {
$return .= ' ';
}
$return .= '<span class="text-right pull-right cbTableBrowserSorting">' . $controllerView->orderbyfields() . '</span>';
}
$return .= '</div>';
if (count($filtersArray) > 0) {
$return .= '<fieldset class="cbFilters cbSearchTools cbFieldset">' . '<legend>' . CBTxt::Th('Search Tools') . '</legend>' . implode(' ', $filtersArray) . '</fieldset>';
}
if (count($batchArray) > 0) {
$return .= '<fieldset class="cbBatchProcess cbBatchTools cbFieldset">' . '<legend>' . CBTxt::Th('Batch Tools') . '</legend>' . implode(' ', $batchArray) . '</fieldset>';
}
$return .= '</th>';
//.........这里部分代码省略.........
示例8: finishInstallation
function finishInstallation($option)
{
global $_CB_framework, $ueConfig, $task;
// Try extending time, as unziping/ftping took already quite some... :
@set_time_limit(240);
_CBsecureAboveForm('finishInstallation');
$tgzFile = $_CB_framework->getCfg('absolute_path') . '/administrator/components/com_comprofiler/pluginsfiles.tgz';
$installerFile = $_CB_framework->getCfg('absolute_path') . '/administrator/components/com_comprofiler/';
if (file_exists($installerFile . 'comprofiler.xml')) {
$installerFile .= 'comprofiler.xml';
} elseif (file_exists($installerFile . 'comprofilej.xml')) {
$installerFile .= 'comprofilej.xml';
} elseif (file_exists($installerFile . 'comprofileg.xml')) {
$installerFile .= 'comprofileg.xml';
}
if (!file_exists($tgzFile)) {
echo CBTxt::T('UE_NOT_AUTHORIZED', 'You are not authorized to view this page!');
return;
}
$installer = new cbInstallerPlugin();
$client = 2;
// Check that the zlib is available
if (!extension_loaded('zlib')) {
cbInstaller::renderInstallMessage(CBTxt::T('The installer cannot continue before zlib is installed'), CBTxt::T('Installer - Error'), $installer->returnTo($option, $task, $client));
return;
}
if (!$installer->upload($tgzFile, true, false)) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Uncompressing %s failed.'), $tgzFile), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
$adminFS = cbAdminFileSystem::getInstance();
$installFrom = $installer->installDir();
$filesList = cbReadDirectory($installFrom, '.', true);
// check if core directories exist as are needed to install plugins:
$baseDir = $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler';
if (!$adminFS->is_dir($baseDir . '/plugin')) {
if (!$adminFS->mkdir($baseDir . '/plugin')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create directory "%s"'), $baseDir . '/plugin'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
if (!$adminFS->copy($baseDir . '/index.html', $baseDir . '/plugin/index.html')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create index "%s"'), $baseDir . '/plugin/index.html'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
}
if (!$adminFS->is_dir($baseDir . '/plugin/language')) {
if (!$adminFS->mkdir($baseDir . '/plugin/language')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create directory "%s"'), $baseDir . '/plugin/language'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
if (!$adminFS->copy($baseDir . '/index.html', $baseDir . '/plugin/language/index.html')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create index "%s"'), $baseDir . '/plugin/language/index.html'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
}
if (!$adminFS->is_dir($baseDir . '/plugin/templates')) {
if (!$adminFS->mkdir($baseDir . '/plugin/templates')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create directory "%s"'), $baseDir . '/plugin/templates'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
if (!$adminFS->copy($baseDir . '/index.html', $baseDir . '/plugin/templates/index.html')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create index "%s"'), $baseDir . '/plugin/templates/index.html'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
}
if (!$adminFS->is_dir($baseDir . '/plugin/user')) {
if (!$adminFS->mkdir($baseDir . '/plugin/user')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create directory "%s"'), $baseDir . '/plugin/user'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
if (!$adminFS->copy($baseDir . '/index.html', $baseDir . '/plugin/user/index.html')) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Failed to create index "%s"'), $baseDir . '/plugin/user/index.html'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
}
// install core plugins:
foreach ($filesList as $file) {
if (preg_match('/^.+\\.xml$/i', $file)) {
$plgPath = $installFrom . (substr($installFrom, -1, 1) == '/' ? '' : '/') . $file;
$plgXml = new \CBLib\Xml\SimpleXMLElement(trim(file_get_contents($plgPath)));
if ($plgXml->getName() == 'cbinstall') {
$plgDir = dirname($plgPath) . '/';
$plgInstaller = new cbInstallerPlugin();
if (!$plgInstaller->install($plgDir)) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Installing plugin failed with error: %s : %s'), $plgInstaller->i_elementname ? $plgInstaller->i_elementname : $file, $plgInstaller->getError()), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
return;
}
}
}
}
$result = $adminFS->deldir(_cbPathName($installFrom . '/'));
if ($result === false) {
cbInstaller::renderInstallMessage(CBTxt::T('Deleting expanded tgz file directory failed with an error.'), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
}
$tgzFileOS = _cbPathName($tgzFile, false);
$result = $adminFS->unlink($tgzFileOS);
if ($result === false) {
cbInstaller::renderInstallMessage(sprintf(CBTxt::T('Deleting file %s failed with an error.'), $tgzFileOS), CBTxt::T('Installer - Error'), $installer->returnTo($option, '', 2));
}
// adapt published fields to global CB config (regarding name type)
//.........这里部分代码省略.........
示例9: drawView
/**
* Handles the backend plugin edition
*
* @param string $option
* @param string $action
* @param SimpleXMLElement $element
* @param string $mode
* @return string HTML
*
* @throws \LogicException
*/
public function drawView($option, $action, $element, $mode)
{
global $_CB_Backend_Menu;
$ui = $this->clientId == 1 ? 2 : 1;
$context = new Context();
$pluginParams = $context->getParams();
$interfaceUi = $ui == 2 ? 'admin' : 'frontend';
$adminActionsModel = $element->getChildByNameAttr('actions', 'ui', $interfaceUi);
if (!$adminActionsModel) {
$adminActionsModel = $element->getChildByNameAttr('actions', 'ui', 'all');
}
if (!$adminActionsModel) {
throw new \LogicException('No ' . $interfaceUi . ' actions defined in XML');
}
// Check permission if specified:
if (!Access::authorised($adminActionsModel)) {
return CBTxt::T("Access to these actions is not authorized by the permissions of your user groups.");
}
// General-purpose extenders:
$extenders = $adminActionsModel->xpath('extend');
/** @var SimpleXMLElement[] $extenders */
foreach ($extenders as $k => $extends) {
$error = RegistryEditView::extendXMLnode($extenders[$k], $element, null, $context->getPluginObject());
if ($error) {
echo $error;
}
}
$found = false;
$actionPath = array();
if ($action) {
$actionsModel = $adminActionsModel->getChildByNameAttr('action', 'name', $action);
$found = $actionsModel != null;
if ($found) {
$requests = explode(' ', $actionsModel->attributes('request'));
$values = explode(' ', $actionsModel->attributes('action'));
$actionPath = array();
for ($i = 0, $n = count($requests); $i < $n; $i++) {
$actionPath[$requests[$i]] = $values[$i];
}
}
}
if (!$found) {
// EVENT: select the event from URL and compute the selected $actionPath
$found = false;
$actionsModel = null;
foreach ($adminActionsModel->children() as $actionsModel) {
/** @var SimpleXMLElement $actionsModel */
$request = $actionsModel->attributes('request');
if ($request) {
$requests = explode(' ', $request);
$values = explode(' ', $actionsModel->attributes('action'));
$actionPath = array();
for ($i = 0, $n = count($requests); $i < $n; $i++) {
$actionPath[$requests[$i]] = $this->input->get($requests[$i], null, GetterInterface::STRING);
// Temporary fix for older versions of CBSubs before CBSubs 4.0.0 stable to avoid warnings on ajax version checks:
if ($requests[$i] === 'view' && $actionPath['view'] === null) {
$actionPath['view'] = $this->input->get('task', null, GetterInterface::STRING);
}
if ($actionPath[$requests[$i]] != $values[$i]) {
break;
}
}
if ($i == $n) {
$found = true;
break;
}
}
}
}
if (!$found) {
$actionPath = array();
// try finding first default one:
if ($ui == 2) {
$actionsModel = $adminActionsModel->getChildByNameAttr('action', 'request', '');
}
if (!isset($actionsModel)) {
return CBTxt::T('AHAWOW_REQUESTED_ACTION_NOT_DEFINED_IN_XML', "Requested action '[ACTION]' not defined in XML.", array('[ACTION]' => htmlspecialchars($action)));
}
}
// Check permission if specified:
if (!isset($actionsModel) || !Access::authorised($actionsModel)) {
return CBTxt::T("This action is not authorized by the permissions of your user groups.");
}
if (!isset($actionPath['view'])) {
$actionPath['view'] = $ui == 2 ? 'editPlugin' : '';
//TODO: 2nd should come from target routing
} elseif ($actionPath['view'] != 'editPlugin') {
$actionPath['act'] = '';
}
//.........这里部分代码省略.........
示例10: renderMenuGroupHeader
/**
* Renders the header of the menu group
*
* @param SimpleXMLElement $param
* @param string $htmlFormatting
* @return string
*/
protected function renderMenuGroupHeader(&$param, $htmlFormatting)
{
$html = array();
$legend = $param->attributes('label');
$description = $param->attributes('description');
$cssclass = RegistryEditView::buildClasses($param);
if ($htmlFormatting == 'table') {
$html[] = '<tr><td colspan="3" style="width: 100%;"' . ($cssclass ? ' class="' . htmlspecialchars($cssclass) . '"' : '') . '>';
} elseif ($htmlFormatting == 'td') {
$html[] = '<td' . ($cssclass ? ' class="' . htmlspecialchars($cssclass) . '"' : '') . '>';
}
if ($legend) {
$html[] = '<h2>' . CBTxt::Th($legend) . '</h2>';
}
if ($htmlFormatting == 'table') {
$html[] = '<table class="table table-noborder">';
if ($description) {
$html[] = '<tr><td colspan="3" style="width: 100%;"><strong>' . CBTxt::Th($description) . '</strong></td></tr>';
}
} elseif ($htmlFormatting == 'td') {
if ($description) {
$html[] = '<td colspan="3" style="width: 100%;"><strong>' . CBTxt::Th($description) . '</strong></td>';
}
} else {
if ($description) {
$html[] = '<strong>' . CBTxt::Th($description) . '</strong>';
}
}
if (!in_array($htmlFormatting, array('table', 'td'))) {
$html[] = '<div class="cbButtonMenu' . ($cssclass ? ' ' . htmlspecialchars($cssclass) : '') . '">';
}
return implode('', $html);
}
示例11: showInviteEdit
/**
* @param cbinvitesInviteTable $row
* @param array $input
* @param UserTable $user
* @param cbPluginHandler $plugin
*/
static function showInviteEdit( $row, $input, $user, $plugin )
{
global $_CB_framework, $_PLUGINS;
cbValidator::loadValidation();
$cbModerator = Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();
$pageTitle = ( $row->get( 'to' ) ? CBTxt::T( 'Edit Invite' ) : CBTxt::T( 'Create Invite' ) );
$_CB_framework->setPageTitle( $pageTitle );
$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( 'Invites' ) ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbinvitesTab' ) );
$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'invites', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) : array( 'action' => 'invites', 'func' => 'new' ) ) ) );
initToolTip();
$return = '<div class="invitesEdit">'
. '<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'invites', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="invitesForm" id="invitesForm" class="cb_form invitesForm form-auto cbValidation">'
. ( $pageTitle ? '<div class="invitesTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
. '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
. '<label for="to" class="col-sm-3 control-label">' . CBTxt::T( 'To' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['to']
. getFieldIcons( 1, 1, null, ( $plugin->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.' ) ) )
. '</div>'
. '</div>'
. '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
. '<label for="subject" class="col-sm-3 control-label">' . CBTxt::T( 'Subject' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['subject']
. getFieldIcons( 1, 0, null, CBTxt::T( 'Input invite email subject; if left blank a subject will be applied.' ) )
. '</div>'
. '</div>'
. '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
. '<label for="body" class="col-sm-3 control-label">' . CBTxt::T( 'Body' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['body']
. getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input private message to include with invite email.' ) )
. '</div>'
. '</div>';
if ( $cbModerator ) {
$return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
. '<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['user_id']
. getFieldIcons( 1, 1, null, CBTxt::T( 'Input owner of invite as single integer user_id. This is the user who sent the invite.' ) )
. '</div>'
. '</div>'
. '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
. '<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'User' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['user']
. getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input user of invite as single integer user_id. This is the user who accepted the invite.' ) )
. '</div>'
. '</div>';
}
if ( $plugin->params->get( 'invite_captcha', 0 ) && ( ! $cbModerator ) ) {
$_PLUGINS->loadPluginGroup( 'user' );
$captcha = $_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );
if ( ! empty( $captcha ) ) {
$captcha = $captcha[0];
$return .= '<div class="form-group cb_form_line clearfix">'
. '<label class="col-sm-3 control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. ( isset( $captcha[0] ) ? $captcha[0] : null )
. '</div>'
. '</div>'
. '<div class="form-group cb_form_line clearfix">'
. '<div class="cb_field col-sm-offset-3 col-sm-9">'
. str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
. getFieldIcons( 1, 1, null )
. '</div>'
. '</div>';
}
}
$return .= '<div class="form-group cb_form_line clearfix">'
. '<div class="col-sm-offset-3 col-sm-9">'
. '<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Invite' ) : CBTxt::T( 'Send Invite' ) ) ) . '" class="invitesButton invitesButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' /> '
. ' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="invitesButton invitesButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbinvitesTab' ) . '\'; }" />'
. '</div>'
. '</div>'
. cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>';
echo $return;
}
示例12: manageConnections
/**
* @param array $connections
* @param array $actions
* @param int $total
* @param cbTabs $connMgmtTabs
* @param array $pagingParams
* @param int $perpage
* @param array|null $connecteds
*/
static function manageConnections($connections, $actions, $total, &$connMgmtTabs, &$pagingParams, $perpage, $connecteds = null)
{
global $_CB_framework, $ueConfig, $_PLUGINS, $_REQUEST;
$results = $_PLUGINS->trigger('onBeforeManageConnectionsFormDisplay', array(&$connections, &$actions, &$total, &$connMgmtTabs, &$pagingParams, &$perpage, &$connecteds));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
exit;
}
outputCbTemplate(1);
initToolTip(1);
cbValidator::loadValidation();
$js = "if ( typeof confirmSubmit != 'function' ) {" . "function confirmSubmit() {" . "if ( confirm( '" . addslashes(CBTxt::T('UE_CONFIRMREMOVECONNECTION', 'Are you sure you want to remove this connection?')) . "' ) ) {" . "return true;" . "} else {" . "return false;" . "}" . "};" . "}";
$_CB_framework->document->addHeadScriptDeclaration($js);
$connectionCategories = explode("\n", $ueConfig['connection_categories']);
$connectionTypes = array();
if ($connectionCategories) {
foreach ($connectionCategories as $connectionCategory) {
if (trim($connectionCategory) != null && trim($connectionCategory) != "") {
$connectionTypes[] = moscomprofilerHTML::makeOption(trim($connectionCategory), CBTxt::T(trim($connectionCategory)));
}
}
}
$tabs = new cbTabs(0, 1);
$pageClass = $_CB_framework->getMenuPageClass();
$return = '<div class="cbManageConnections cb_template cb_template_' . selectTemplate('dir') . ($pageClass ? ' ' . htmlspecialchars($pageClass) : null) . '">';
if (is_array($results)) {
$return .= implode('', $results);
}
$return .= '<div class="page-header"><h3>' . CBTxt::Th('UE_MANAGECONNECTIONS', 'Manage Connections') . '</h3></div>' . $tabs->startPane('myCon') . $tabs->startTab('myCon', CBTxt::Th('UE_MANAGEACTIONS', 'Manage Actions') . ' <span class="badge">' . count($actions) . '</span>', 'action');
if (!count($actions) > 0) {
$return .= '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_NOACTIONREQUIRED', 'No Pending Actions') . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>';
} else {
$return .= '<form action="' . $_CB_framework->viewUrl('processconnectionactions') . '" method="post" id="adminForm" name="adminForm" class="cb_form form-auto cbValidation">' . '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_CONNECT_ACTIONREQUIRED', 'Below you see users proposing to connect with you. You have the choice to accept or decline their request.') . '</div>' . '<div class="table">';
foreach ($actions as $action) {
$cbUser = CBuser::getInstance((int) $action->id, false);
$tipField = '<b>' . CBTxt::Th('UE_CONNECTIONREQUIREDON', 'Connection Required on') . '</b>: ' . $_CB_framework->getUTCDate(array($ueConfig['date_format'], 'Y-m-d'), $action->membersince);
if ($action->reason != null) {
$tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTIONMESSAGE', 'Personal message included') . '</b>: <br />' . htmlspecialchars($action->reason, ENT_QUOTES);
}
$tipTitle = CBTxt::Th('UE_CONNECTIONREQUESTDETAIL', 'Connection Request Details');
$htmlText = $cbUser->getField('avatar', null, 'html', 'none', 'list', 0, true);
$tooltip = cbTooltip(1, $tipField, $tipTitle, 300, null, $htmlText, null, 'style="display: inline-block; padding: 5px;"');
$return .= '<div class="containerBox img-thumbnail">' . '<div class="containerBoxInner" style="min-height: 130px; min-width: 90px;">' . $cbUser->getField('onlinestatus', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true) . '<br />' . $tooltip . '<br />' . '<span class="fa fa-check" title="' . htmlspecialchars(CBTxt::T('UE_ACCEPTCONNECTION', 'Accept Connection')) . '"></span>' . ' <input type="radio" name="' . (int) $action->id . 'action" value="a" checked="checked" />' . ' <span class="fa fa-times" title="' . htmlspecialchars(CBTxt::T('UE_DECLINECONNECTION', 'Decline Connection')) . '"></span>' . ' <input type="radio" name="' . (int) $action->id . 'action" value="d" />' . '<input type="hidden" name="uid[]" value="' . (int) $action->id . '" />' . '</div>' . '</div>';
}
$return .= '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="submit" class="btn btn-primary cbMngConnSubmit" value="' . htmlspecialchars(CBTxt::Th('UE_UPDATE', 'Update')) . '"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />' . ' <input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>' . cbGetSpoofInputTag('manageconnections') . '</form>';
}
$return .= $tabs->endTab() . $tabs->startTab('myCon', CBTxt::Th('UE_MANAGECONNECTIONS', 'Manage Connections'), 'connections');
if (!count($connections) > 0) {
$return .= '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_NOCONNECTIONS', 'This user has no current connections.') . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>';
} else {
$return .= '<form action="' . $_CB_framework->viewUrl('saveconnections') . '" method="post" id="adminForm" name="adminForm" class="cb_form form-auto cbValidation">' . '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_CONNECT_MANAGECONNECTIONS', 'Below you see users to whom you are connected directly. ') . '</div>' . '<table class="table table-hover table-responsive">' . '<thead>' . '<tr>' . '<th style="width: 25%;" class="text-center">' . CBTxt::Th('UE_CONNECTION', 'Connections') . '</th>' . '<th style="width: 35%;" class="text-center">' . CBTxt::Th('UE_CONNECTIONTYPE', 'Type') . '</th>' . '<th style="width: 40%;" class="text-center">' . CBTxt::Th('UE_CONNECTIONCOMMENT', 'Comment') . '</th>' . '</tr>' . '</thead>' . '<tbody>';
$i = 1;
foreach ($connections as $connection) {
$cbUser = CBuser::getInstance((int) $connection->id, false);
$tipField = '<b>' . CBTxt::Th('UE_CONNECTEDSINCE', 'Connected Since') . '</b>: ' . $_CB_framework->getUTCDate(array($ueConfig['date_format'], 'Y-m-d'), $connection->membersince);
if ($connection->type != null) {
$tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTIONTYPE', 'Type') . '</b>: ' . getConnectionTypes($connection->type);
}
if ($connection->description != null) {
$tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTEDCOMMENT', 'Comment') . '</b>: ' . htmlspecialchars($connection->description);
}
$tipTitle = CBTxt::Th('UE_CONNECTEDDETAIL', 'Connection Details');
$htmlText = $cbUser->getField('avatar', null, 'html', 'none', 'list', 0, true);
$tooltip = cbTooltip(1, $tipField, $tipTitle, 300, null, $htmlText, null, 'style="display: inline-block; padding: 5px;"');
if ($connection->accepted == 1 && $connection->pending == 1) {
$actionImg = '<span class="fa fa-clock-o" title="' . htmlspecialchars(CBTxt::T('UE_CONNECTIONPENDING', 'Connection Pending')) . '"></span>' . ' <a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
} elseif ($connection->accepted == 1 && $connection->pending == 0) {
$actionImg = '<a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
} elseif ($connection->accepted == 0) {
$actionImg = '<a href="' . $_CB_framework->viewUrl('acceptconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-check-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_ACCEPTCONNECTION', 'Accept Connection')) . '"></span>' . '</a>' . ' <a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
} else {
$actionImg = null;
}
$return .= '<tr>' . '<td class="text-center">' . $cbUser->getField('onlinestatus', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true) . '<br />' . $tooltip . '<br />' . $actionImg . ' <a href="' . $_CB_framework->userProfileUrl((int) $connection->memberid) . '">' . '<span class="fa fa-user" title="' . htmlspecialchars(CBTxt::T('UE_VIEWPROFILE', 'View Profile')) . '"></span>' . '</a>' . ' ' . $cbUser->getField('email', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('pm', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . '</td>' . '<td class="text-center">' . moscomprofilerHTML::selectList($connectionTypes, $connection->id . 'connectiontype[]', 'class="form-control" multiple="multiple" size="5"', 'value', 'text', explode('|*|', trim($connection->type)), 0) . '</td>' . '<td class="text-center">' . '<textarea cols="25" class="form-control" rows="5" name="' . (int) $connection->id . 'description">' . htmlspecialchars($connection->description) . '</textarea>' . '<input type="hidden" name="uid[]" value="' . (int) $connection->id . '" />' . '</td>' . '</tr>';
$i = $i == 1 ? 2 : 1;
}
$return .= '</tbody>' . '</table>';
if ($perpage < $total) {
$return .= '<div class="form-group cb_form_line text-center clearfix">' . $connMgmtTabs->_writePaging($pagingParams, 'connections_', $perpage, $total, 'manageconnections') . '</div>';
}
$return .= '<div class="form-group cb_form_line clearfix">' . '<input type="submit" class="btn btn-primary cbMngConnSubmit" value="' . htmlspecialchars(CBTxt::Th('UE_UPDATE', 'Update')) . '"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />' . ' <input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>' . cbGetSpoofInputTag('manageconnections') . '</form>';
}
$return .= $tabs->endTab();
if ($ueConfig['autoAddConnections'] == 0) {
$return .= $tabs->startTab('myCon', CBTxt::Th('UE_CONNECTEDWITH', 'Manage Connections With Me'), 'connected');
if (!count($connecteds) > 0) {
$return .= '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_NOCONNECTEDWITH', 'There are currently no users connected with you.') . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>';
} else {
$htmlConnectedWidth = CBTxt::Th('UE_CONNECT_CONNECTEDWITH', '');
$return .= ($htmlConnectedWidth ? '<div class="form-group cb_form_line clearfix tab_description">' . $htmlConnectedWidth . '</div>' : null) . '<div class="table">';
foreach ($connecteds as $connected) {
//.........这里部分代码省略.........
示例13: _renderBody
//.........这里部分代码省略.........
}
foreach ($this->columns as $index => $column) {
if ($formatting == 'divs') {
$return .= '<div class="cbColumn' . $column->size . ' col-sm-' . $column->size . ' cbUserListHeaderCol' . ($index + 1) . ($column->cssclass ? ' ' . $column->cssclass : null) . '">' . $column->titleRendered . '</div>';
} else {
$return .= '<th class="cbUserListHeaderCol' . ($index + 1) . ($column->cssclass ? ' ' . $column->cssclass : null) . '">' . $column->titleRendered . '</th>';
}
}
if ($formatting == 'divs') {
$return .= '</div>';
} else {
$return .= '</tr>';
}
}
$return .= '</thead>' . '<tbody>';
$i = 0;
if (is_array($this->users) && count($this->users) > 0) {
foreach ($this->users as $userIndex => $user) {
if ($this->allowProfileLink) {
$style = 'cursor: hand; cursor: pointer;';
} else {
$style = null;
}
if ($this->allowProfileLink) {
$attributes = ' id="cbU' . $i . '"';
} else {
$attributes = null;
}
$class = 'cbUserListRow';
if ($user->banned) {
$class .= ' cbUserListRowBanned';
}
if (!$user->confirmed) {
$class .= ' cbUserListRowUnconfirmed';
}
if (!$user->approved) {
$class .= ' cbUserListRowUnapproved';
}
if ($user->block) {
$class .= ' cbUserListRowBlocked';
}
if ($layout == 'grid') {
$class .= ' containerBox img-thumbnail';
} else {
$class .= ' sectiontableentry' . (1 + $i % 2);
if ($formatting == 'divs') {
$class .= ' cbColumns clearfix';
}
}
if ($columnCount) {
if ($formatting == 'divs') {
$return .= '<div class="' . $class . '"' . ($style ? ' style="' . $style . '"' : null) . $attributes . '>';
} else {
$return .= '<tr class="' . $class . '"' . ($style ? ' style="' . $style . '"' : null) . $attributes . '>';
}
if ($layout == 'grid') {
$return .= '<div class="containerBoxInner"' . ($gridStyle ? ' style="' . $gridStyle . '"' : null) . '>';
}
foreach ($this->columns as $columnIndex => $column) {
$cellFields = $this->tableContent[$userIndex][$columnIndex];
if ($formatting == 'divs') {
$return .= '<div class="cbUserListRowColumn cbUserListRowCol' . ($columnIndex + 1) . ($layout != 'grid' ? ' cbColumn' . $column->size . ' col-sm-' . $column->size : null) . ($column->cssclass ? ' ' . $column->cssclass : null) . '">' . $this->_getUserListCell($cellFields) . '</div>';
} else {
$return .= '<td class="cbUserListRowColumn cbUserListRowCol' . ($columnIndex + 1) . ($column->cssclass ? ' ' . $column->cssclass : null) . '">' . $this->_getUserListCell($cellFields) . '</td>';
}
}
if ($layout == 'grid') {
$return .= '</div>';
}
if ($formatting == 'divs') {
$return .= '</div>';
} else {
$return .= '</tr>';
}
}
$i++;
}
} else {
if ($formatting == 'divs') {
if ($layout != 'grid') {
$return .= '<div class="cbUserListRow cbColumns clearfix">';
}
$return .= '<div class="sectiontableentry1' . ($layout != 'grid' ? ' cbColumn12 col-sm-12' : null) . '">' . CBTxt::Th('UE_NO_USERS_IN_LIST', 'No users in this list') . '</div>';
if ($layout != 'grid') {
$return .= '</div>';
}
} else {
$return .= '<tr class="sectiontableentry1">' . '<td colspan="' . $columnCount . '">' . CBTxt::Th('UE_NO_USERS_IN_LIST', 'No users in this list') . '</td>' . '</tr>';
}
}
if ($layout == 'grid') {
$return .= '<div class="clearfix"></div>';
}
if ($formatting == 'divs') {
$return .= '</div>';
} else {
$return .= '<tbody>' . '</table>';
}
echo $return;
}
示例14: cbNotAuth
/**
* Displays "Not authorized", and if not logged-in "you need to login"
*
*/
function cbNotAuth($enqueue = false)
{
global $_CB_framework;
if ($enqueue) {
$_CB_framework->enqueueMessage(CBTxt::T('UE_NOT_AUTHORIZED', 'You are not authorized to view this page!') . ($_CB_framework->myId() < 1 ? ' ' . CBTxt::T('You need to log in.') : null), 'error');
} else {
$return = '<div class="cbNotAuth cb_template cb_template_' . selectTemplate('dir') . '">' . '<div class="error">' . CBTxt::Th('UE_NOT_AUTHORIZED', 'You are not authorized to view this page!') . '</div>';
if ($_CB_framework->myId() < 1) {
$return .= '<div class="error">' . CBTxt::Th('UE_DO_LOGIN', 'You need to log in.') . '</div>';
}
$return .= '</div>';
echo $return;
}
}
示例15: showUsers
/**
* Outputs legacy user mass mailer and user reconfirm email display
*
* @param string $option
* @param string $task
* @param int[] $cid
* @return bool
* @deprecated 2.0
*/
public function showUsers($option, $task, $cid)
{
global $_CB_framework, $_CB_database, $ueConfig, $_PLUGINS;
cbimport('language.all');
cbimport('cb.tabs');
cbimport('cb.params');
cbimport('cb.pagination');
cbimport('cb.lists');
// We just need the user rows as we've already filtered down the IDs in user management:
$query = 'SELECT *' . "\n FROM " . $_CB_database->NameQuote('#__comprofiler') . " AS c" . "\n INNER JOIN " . $_CB_database->NameQuote('#__users') . " AS u" . ' ON u.' . $_CB_database->NameQuote('id') . ' = c.' . $_CB_database->NameQuote('id') . "\n WHERE u." . $_CB_database->NameQuote('id') . " IN ( " . implode(', ', cbArrayToInts($cid)) . " )";
$_CB_database->setQuery($query);
$rows = $_CB_database->loadObjectList(null, '\\CB\\Database\\Table\\UserTable', array($_CB_database));
$total = count($rows);
if ($task == 'resendconfirmationemails') {
if (!$rows) {
cbRedirect($_CB_framework->backendViewUrl('showusers', false), CBTxt::T('SELECT_A_ROW_TO_TASK', 'Select a row to [task]', array('[task]' => $task)), 'error');
}
$count = 0;
/** @var UserTable[] $rows */
foreach ($rows as $row) {
if ($row->confirmed == 0) {
if ($row->cbactivation == '') {
// Generate a new confirmation code if the user doesn't have one (requires email confirmation to be enabled):
$row->store();
}
$cbNotification = new cbNotification();
$cbNotification->sendFromSystem($row->id, CBTxt::T($ueConfig['reg_pend_appr_sub']), CBTxt::T($ueConfig['reg_pend_appr_msg']), true, isset($ueConfig['reg_email_html']) ? (int) $ueConfig['reg_email_html'] : 0);
++$count;
}
}
cbRedirect($_CB_framework->backendViewUrl('showusers', false), CBTxt::T('SENT_CONFIRMATION_EMAILS_TO_NUM_USERS_USERS', 'Sent confirmation emails to [NUM_USERS] users', array('[NUM_USERS]' => $count)));
} else {
$emailSubject = stripslashes(cbGetParam($_POST, 'emailsubject', ''));
$emailBody = stripslashes(rawurldecode(cbGetParam($_POST, 'emailbody', '', _CB_ALLOWRAW | _CB_NOTRIM)));
$emailAttach = stripslashes(cbGetParam($_POST, 'emailattach', ''));
$emailsPerBatch = stripslashes(cbGetParam($_POST, 'emailsperbatch', 50));
$emailsBatch = stripslashes(cbGetParam($_POST, 'emailsbatch', 0));
$emailFromName = stripslashes(cbGetParam($_POST, 'emailfromname', ''));
$emailFromAddr = stripslashes(cbGetParam($_POST, 'emailfromaddr', ''));
$emailReplyName = stripslashes(cbGetParam($_POST, 'emailreplyname', ''));
$emailReplyAddr = stripslashes(cbGetParam($_POST, 'emailreplyaddr', ''));
$emailPause = stripslashes(cbGetParam($_POST, 'emailpause', 30));
$simulationMode = stripslashes(cbGetParam($_POST, 'simulationmode', ''));
// B/C trigger variables:
if (count($cid) > 0 && count($cid) < $total) {
$total = count($cid);
}
$pageNav = new cbPageNav($total, 0, 10);
$search = '';
$lists = array();
$inputTextExtras = null;
$select_tag_attribs = null;
if ($task == 'emailusers') {
if (!$rows) {
cbRedirect($_CB_framework->backendViewUrl('showusers', false), CBTxt::T('SELECT_A_ROW_TO_TASK', 'Select a row to [task]', array('[task]' => $task)), 'error');
}
$pluginRows = $_PLUGINS->trigger('onBeforeBackendUsersEmailForm', array(&$rows, &$pageNav, &$search, &$lists, &$cid, &$emailSubject, &$emailBody, &$inputTextExtras, &$select_tag_attribs, $simulationMode, $option, &$emailAttach, &$emailFromName, &$emailFromAddr, &$emailReplyName, &$emailReplyAddr));
$usersView = _CBloadView('users');
/** @var CBView_users $usersView */
$usersView->emailUsers($rows, $emailSubject, $emailBody, $emailAttach, $emailFromName, $emailFromAddr, $emailReplyName, $emailReplyAddr, $emailsPerBatch, $emailsBatch, $emailPause, $simulationMode, $pluginRows);
} elseif ($task == 'startemailusers') {
$pluginRows = $_PLUGINS->trigger('onBeforeBackendUsersEmailStart', array(&$rows, $total, $search, $lists, $cid, &$emailSubject, &$emailBody, &$inputTextExtras, $simulationMode, $option, &$emailAttach, &$emailFromName, &$emailFromAddr, &$emailReplyName, &$emailReplyAddr));
$usersView = _CBloadView('users');
/** @var CBView_users $usersView */
$usersView->startEmailUsers($rows, $emailSubject, $emailBody, $emailAttach, $emailFromName, $emailFromAddr, $emailReplyName, $emailReplyAddr, $emailsPerBatch, $emailsBatch, $emailPause, $simulationMode, $pluginRows);
} elseif ($task == 'ajaxemailusers') {
cbSpoofCheck('cbadmingui');
cbRegAntiSpamCheck();
$cbNotification = new cbNotification();
$mode = 1;
// html
$errors = 0;
$success = array();
$failed = array();
$users = array_slice($rows, $emailsBatch, $emailsPerBatch);
if ($simulationMode) {
$success = array('<div class="alert alert-info">' . CBTxt::T('Emails do not send in simulation mode') . '</div>');
} else {
foreach ($users as $user) {
$extraStrings = array();
$_PLUGINS->trigger('onBeforeBackendUserEmail', array(&$user, &$emailSubject, &$emailBody, $mode, &$extraStrings, $simulationMode, &$emailAttach, &$emailFromName, &$emailFromAddr, &$emailReplyName, &$emailReplyAddr));
$attachments = cbReplaceVars($emailAttach, $user, $mode, true, $extraStrings);
if ($attachments) {
$attachments = preg_split(' *, *', $attachments);
} else {
$attachments = null;
}
if (!$cbNotification->sendFromSystem($user, $emailSubject, $this->makeLinksAbsolute($emailBody), true, $mode, null, null, $attachments, $extraStrings, false, $emailFromName, $emailFromAddr, $emailReplyName, $emailReplyAddr)) {
$failed[] = '<div class="alert alert-danger">' . '<strong>' . htmlspecialchars($user->name . ' <' . $user->email . '>') . '</strong>: ' . CBTxt::Th('ERROR_SENDING_EMAIL_ERRORMSG', 'Error sending email: [ERROR_MSG]', array('[ERROR_MSG]' => $cbNotification->errorMSG)) . '</div>';
++$errors;
} else {
//.........这里部分代码省略.........