本文整理汇总了PHP中CBTxt::addStrings方法的典型用法代码示例。如果您正苦于以下问题:PHP CBTxt::addStrings方法的具体用法?PHP CBTxt::addStrings怎么用?PHP CBTxt::addStrings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBTxt
的用法示例。
在下文中一共展示了CBTxt::addStrings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// Facebook integration plugin: (updated for version 1.2 of Facebook plugin)
CBTxt::addStrings( array(
// 8 language strings from file plug_cbfacebookconnect/cb.facebookconnect.php
'View Facebook Profile' => 'View Facebook Profile',
'Logout of your Facebook account.' => 'Logout of your Facebook account.',
'Sign out' => 'Sign out',
'Login with your Facebook account.' => 'Login with your Facebook account.',
'Sign in' => 'Sign in',
'Unjoin this site' => 'Unjoin this site',
'Unauthorize this site from your Facebook account.' => 'Unauthorize this site from your Facebook account.',
'Are you sure you want to unjoin %s?' => 'Are you sure you want to unjoin %s?'
));
// Twitter integration plugin: (updated for version 1.1 of Twitter plugin)
CBTxt::addStrings( array(
// 3 language strings from file plug_cbtwitter/cb.twitter.php
'View Twitter Profile' => 'View Twitter Profile',
'Logout of your Twitter account.' => 'Logout of your Twitter account.',
'Login with your Twitter account.' => 'Login with your Twitter account.'
));
// imagetoolbox messages needed for CB Team plugins
CBTxt::addStrings( array(
// 1 language string from imagetoolbox
'The file exceeds the maximum size of %s kilobytes' => 'The file exceeds the maximum size of %s kilobytes'
));
// IMPORTANT WARNING: The closing tag, "?" and ">" has been intentionally omitted - CB works fine without it.
// This was done to avoid errors caused by custom strings being added after the closing tag. ]
// With such tags, always watchout to NOT add any line or space or anything after the "?" and the ">".
示例2: array
CBTxt::addStrings( array(
// XML files:
// cb.authortab.xml
'Provides an User Tab that shows all articles written by the user.' => 'Provides an User Tab that shows all articles written by the user.',
// cb.connections.xml
// some also used in other files (php and xml)
'Provides CB Core Connections functionality' => 'Provides CB Core Connections functionality',
'Display Settings' => 'Display Settings',
'User Profile Status :' => 'User Profile Status :',
'see Field: Connections: Parameters' => 'see Field: Connections: Parameters',
'Connections Status Settings :' => 'Connections Status Settings :',
'Show Title' => 'Show Title',
'Show a title' => 'Show a title',
'Show Summary' => 'Show Summary',
'Shows a small number of connections with a link to see them all in paginated form.' => 'Shows a small number of connections with a link to see them all in paginated form.',
'Entries shown in Summary' => 'Entries shown in Summary',
'If Show Summary is enabled, this is the number of connections displayed. Otherwise, this is ignored. Default is 4.' => 'If Show Summary is enabled, this is the number of connections displayed. Otherwise, this is ignored. Default is 4.',
'Enable Paging' => 'Enable Paging',
'Allow entries to automatically page when they exceed the number per page limit.' => 'Allow entries to automatically page when they exceed the number per page limit.',
'Max entries shown or per Page' => 'Max entries shown or per Page',
'If paging is enabled, this is the number of connections per page. Otherwise, this is the number of connections to show. Default is 10.' => 'If paging is enabled, this is the number of connections per page. Otherwise, this is the number of connections to show. Default is 10.',
// cb.core.xml
// some also used in other files (php and xml)
'Core CB Tabs and Events.' => 'Core CB Tabs and Events.',
'Display description' => 'Display description',
'To display "[edit photo]", type following into description: [menu style="color:green;" caption="&91;edit your photo&93;" img=""] _UE_MENU_EDIT : _UE_UPDATEAVATAR [/menu]' => 'To display "[edit photo]", type following into description: [menu style="color:green;" caption="&91;edit your photo&93;" img=""] _UE_MENU_EDIT : _UE_UPDATEAVATAR [/menu]',
'User Profile Title text' => 'User Profile Title text',
'Page title text. Enter text to be displayed as profile page title. %s will be replaced by user-name depending on global settings. Or use language-dependant _UE_PROFILE_TITLE_TEXT (default)' => 'Page title text. Enter text to be displayed as profile page title. %s will be replaced by user-name depending on global settings. Or use language-dependant _UE_PROFILE_TITLE_TEXT (default)',
'Check Box (Single)' => 'Check Box (Single)',
'Check Box (Multiple)' => 'Check Box (Multiple)',
'Display on profiles as' => 'Display on profiles as',
'How to display the values of this multi-valued field' => 'How to display the values of this multi-valued field',
'Comma ","-separated line' => 'Comma ","-separated line',
'Unnumbered list "ul"' => 'Unnumbered list "ul"',
'Ordered list "ol"' => 'Ordered list "ol"',
'CSS class of the list' => 'CSS class of the list',
'Enter the name of the list class (optional) for OL or UL tag' => 'Enter the name of the list class (optional) for OL or UL tag',
'Integer Number' => 'Integer Number',
'Field entry validation' => 'Field entry validation',
'Minimum value allowed' => 'Minimum value allowed',
'Enter the minimum integer value allowed. Default is 0.' => 'Enter the minimum integer value allowed. Default is 0.',
'Maximum value allowed' => 'Maximum value allowed',
'Enter the maximum value allowed. Default is 1000000.' => 'Enter the maximum value allowed. Default is 1000000.',
'Forbidden values at registration' => 'Forbidden values at registration',
'You can set a list of values (separated by comma ,) which are not allowed in this field for registration.' => 'You can set a list of values (separated by comma ,) which are not allowed in this field for registration.',
'Forbidden values in user profile edits' => 'Forbidden values in user profile edits',
'You can set a list of values (separated by comma ,) which are not allowed in this field when user updates his profile in profile edits.' => 'You can set a list of values (separated by comma ,) which are not allowed in this field when user updates his profile in profile edits.',
'Authorized input' => 'Authorized input',
'Type of input authorized.' => 'Type of input authorized.',
'Any string ( /.*/ )' => 'Any string ( /.*/ )',
'Custom PERL regular expression' => 'Custom PERL regular expression',
'Perl Regular Expression' => 'Perl Regular Expression',
'Any string: /^.*$/ , only digits: /^[0-9]*$/, only a-z + A-Z + digits: /^[0-9a-z]*$/i' => 'Any string: /^.*$/ , only digits: /^[0-9]*$/, only a-z + A-Z + digits: /^[0-9a-z]*$/i',
'Error in case of invalid input' => 'Error in case of invalid input',
'Enter a clear and helpful error message in case of validation pattern mismatch.' => 'Enter a clear and helpful error message in case of validation pattern mismatch.',
'Date' => 'Date',
'Minimum Year shown' => 'Minimum Year shown',
'Type +0 for this year, type-in 4-digits year, for example 1923, or just a number prefixed with + or - sign, for example +25 or -110, to set a value relative to current year, e.g. -99 for maximum age of 99 years' => 'Type +0 for this year, type-in 4-digits year, for example 1923, or just a number prefixed with + or - sign, for example +25 or -110, to set a value relative to current year, e.g. -99 for maximum age of 99 years',
'Maximum Year shown' => 'Maximum Year shown',
'Type +0 for this year, type-in 4-digits year, for example 1923, or just a number prefixed with + or - sign, for example +25 or -110, to set a value relative to current year, e.g. -12 for minimum age of 12 years' => 'Type +0 for this year, type-in 4-digits year, for example 1923, or just a number prefixed with + or - sign, for example +25 or -110, to set a value relative to current year, e.g. -12 for minimum age of 12 years',
'Whether you want users to see this date on profile as a date or as an age' => 'Whether you want users to see this date on profile as a date or as an age',
'Full date' => 'Full date',
'Age in years' => 'Age in years',
'time ago' => 'time ago',
'birthday only without year' => 'birthday only without year',
'Display N years text' => 'Display N years text',
'Whether you want to display just number N of years (e.g. Age: 20), or add \' years\' behind the age N (e.g. Age: 20 years). Uses language-string _UE_AGE_YEARS.' => 'Whether you want to display just number N of years (e.g. Age: 20), or add \' years\' behind the age N (e.g. Age: 20 years). Uses language-string _UE_AGE_YEARS.',
'Display just \'N\'' => 'Display just \'N\'',
'Display \'N years\'' => 'Display \'N years\'',
'Display T ago text' => 'Display T ago text',
'Whether you want to display just the time T ago (e.g. 3 months), or add \' ago\' behind the time T (e.g. 3 months ago). Uses language-string _UE_ANYTHING_AGO.' => 'Whether you want to display just the time T ago (e.g. 3 months), or add \' ago\' behind the time T (e.g. 3 months ago). Uses language-string _UE_ANYTHING_AGO.',
'Display just \'T\'' => 'Display just \'T\'',
'Display \'T ago\'' => 'Display \'T ago\'',
'If searchable, then search by' => 'If searchable, then search by',
'Whether you want users to search by date or by age' => 'Whether you want users to search by date or by age',
'Age' => 'Age',
'Alternate field title for age/time ago/birthday only display' => 'Alternate field title for age/time ago/birthday only display',
'Leave blank for using same title as in normal date display mode, or enter alternate text, e.g. \'Age\' (multilinguale: type just: _UE_AGE) or \'Birthday\' (_UE_Birthday) instead of normal birthdate title. CB translation strings, as well as fields-substitutions, e.g. \'[name]\'s age\' can be used.' => 'Leave blank for using same title as in normal date display mode, or enter alternate text, e.g. \'Age\' (multilinguale: type just: _UE_AGE) or \'Birthday\' (_UE_Birthday) instead of normal birthdate title. CB translation strings, as well as fields-substitutions, e.g. \'[name]\'s age\' can be used.',
'Display Date and time' => 'Display Date and time',
'Whether you want to display date and time' => 'Whether you want to display date and time',
'Yes date and also time if available' => 'Yes date and also time if available',
'Date only' => 'Date only',
'Date and time' => 'Date and time',
'Yes date and also time' => 'Yes date and also time',
'Drop Down (Single Select)' => 'Drop Down (Single Select)',
'Drop Down (Multi-select)' => 'Drop Down (Multi-select)',
'Email Address' => 'Email Address',
'Enable Email checker' => 'Enable Email checker',
'Whether you want to feedback to user if email is valid or not.' => 'Whether you want to feedback to user if email is valid or not.',
'No: no ajax email checking' => 'No: no ajax email checking',
'Yes: Check email address and server' => 'Yes: Check email address and server',
'Forbidden words at registration' => 'Forbidden words at registration',
'You can set a list of bad words (separated by comma ,) which are not allowed in this field for registration. Use comma twice (,,) to add comma as bad character.' => 'You can set a list of bad words (separated by comma ,) which are not allowed in this field for registration. Use comma twice (,,) to add comma as bad character.',
'Forbidden words in user profile edits' => 'Forbidden words in user profile edits',
'You can set a list of bad words (separated by comma ,) which are not allowed in this field when user updates his profile in profile edits. Use comma twice (,,) to add comma as bad character.' => 'You can set a list of bad words (separated by comma ,) which are not allowed in this field when user updates his profile in profile edits. Use comma twice (,,) to add comma as bad character.',
'Email address (main)' => 'Email address (main)',
//.........这里部分代码省略.........
示例3: getLanguage
/**
* includes frontend or backend language files based on location and language set
*/
static public function getLanguage() {
global $_CB_framework;
static $loaded = 0;
if ( ! $loaded++ ) {
$plugin = cbgjClass::getPlugin();
$langPath = $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/plugin/language';
$lang = $_CB_framework->getCfg( 'lang' );
$path = $langPath . '/' . $plugin->element . $lang . '/';
if ( ! file_exists( $path ) ) {
$path = $langPath . '/' . $plugin->element . strtolower( $_CB_framework->getCfg( 'lang_tag' ) ) . '/';
$lang = 'language';
}
if ( $_CB_framework->getUi() == 2 ) {
$filename = 'admin_' . $lang . '.php';
} else {
$filename = $lang . '.php';
}
if ( file_exists( $path . $filename ) ) {
$CBstrings = array();
include_once( $path . $filename );
CBTxt::addStrings( $CBstrings );
}
$plugins = 'integrations_' . $lang . '.php';
if ( file_exists( $path . $plugins ) ) {
$CBstrings = array();
include_once( $path . $plugins );
CBTxt::addStrings( $CBstrings );
}
}
}