• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tr函数的典型用法代码示例。如果您正苦于以下问题:PHP tr函数的具体用法?PHP tr怎么用?PHP tr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了tr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wikiplugin_trackerstat_info

function wikiplugin_trackerstat_info()
{
    return array('name' => tra('Tracker Stats'), 'documentation' => 'PluginTrackerStat', 'description' => tra('Display statistics about a tracker.'), 'prefs' => array('feature_trackers', 'wikiplugin_trackerstat'), 'body' => tra('Title'), 'iconname' => 'chart', 'introduced' => 2, 'params' => array('trackerId' => array('required' => true, 'name' => tra('Tracker ID'), 'description' => tra('Numeric value representing the tracker ID'), 'since' => '2.0', 'filter' => 'digits', 'default' => '', 'profile_reference' => 'tracker'), 'fields' => array('required' => false, 'name' => tra('Fields'), 'description' => tra('Colon-separated list of field IDs to be displayed. Example:') . ' <code>2:4:5</code>' . tra('. ') . tra('Leave it empty to display all fields from this tracker.'), 'since' => '2.0', 'default' => '', 'separator' => ':', 'profile_reference' => 'tracker_field'), 'show_count' => array('required' => false, 'name' => tra('Show Count'), 'description' => tra('Choose whether to show the count of votes each option received (shown by default)'), 'since' => '10.3', 'filter' => 'alpha', 'default' => 'y', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'show_percent' => array('required' => false, 'name' => tra('Show Percentage'), 'description' => tra('Choose whether to show the percentage of the vote each option received (not shown
					by default)'), 'since' => '2.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'show_bar' => array('required' => false, 'name' => tra('Show Bar'), 'description' => tra('Choose whether to show a bar representing the number of votes each option received
					(not shown by default)'), 'since' => '2.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'status' => array('required' => false, 'name' => tra('Status Filter'), 'description' => tra('Only show items matching certain status filters'), 'since' => '2.0', 'filter' => 'alpha', 'default' => 'o', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Open'), 'value' => 'o'), array('text' => tra('Pending'), 'value' => 'p'), array('text' => tra('Closed'), 'value' => 'c'), array('text' => tra('Open & Pending'), 'value' => 'op'), array('text' => tra('Open & Closed'), 'value' => 'oc'), array('text' => tra('Pending & Closed'), 'value' => 'pc'), array('text' => tra('Open, Pending & Closed'), 'value' => 'opc'))), 'show_link' => array('required' => false, 'name' => tra('Show Link'), 'description' => tra('Add a link to the tracker'), 'since' => '3.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'show_lastmodif' => array('required' => false, 'name' => tra('Last Modification Date'), 'description' => tr('Show last modification date of a tracker. Set to Yes (%0) to use site setting for
					the short date format or use PHP\'s format (www.php.net/strftime). Example:', '<code>y</code>', '<code>%A %d of %B, %Y</code>'), 'since' => '5.0', 'filter' => 'text', 'default' => '')));
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:7,代码来源:wikiplugin_trackerstat.php


示例2: smarty_function_favorite

function smarty_function_favorite($params, $smarty)
{
    global $prefs, $user;
    // Disabled, do nothing
    if (empty($user) || $prefs['user_favorites'] != 'y') {
        return;
    }
    $servicelib = TikiLib::lib('service');
    $smarty = TikiLib::lib('smarty');
    $smarty->loadPlugin('smarty_modifier_escape');
    $url = $servicelib->getUrl(array('controller' => 'favorite', 'action' => 'toggle', 'type' => $params['type'], 'object' => $params['object']));
    $url = smarty_modifier_escape($url, 'url');
    $e_user = smarty_modifier_escape($user);
    if (isset($params['label'])) {
        $label = $params['label'];
    } else {
        $label = tr('Favorite');
    }
    if (isset($params['button_classes'])) {
        $button_classes = $params['button_classes'];
    } else {
        $button_classes = "btn btn-default";
    }
    return '<a class="' . $button_classes . ' favorite-toggle" href="' . $url . '" data-key="favorite_' . $e_user . '"> ' . $label . '</a>';
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:25,代码来源:function.favorite.php


示例3: iconset_orange

function iconset_orange()
{
    /* This and themes/fivealive-lite/options/orange/icons/information.png are
     * just a demo of how to override an icon in a theme option
     * probably should be removed before release? */
    return array('name' => tr('Theme icons'), 'description' => tr('Icons to be used for this theme'), 'tag' => 'span', 'icons' => array('information' => array('id' => 'eye')));
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:7,代码来源:orange.php


示例4: gen_reseller_table

/**
 * @todo check if it's useful to have the table admin two times in the same query
 * @param EasySCP_TemplateEngine $tpl
 */
function gen_reseller_table($tpl)
{
    $cfg = EasySCP_Registry::get('Config');
    $sql = EasySCP_Registry::get('Db');
    $query = "\n\t\tSELECT\n\t\t\tt1.`admin_id`, t1.`admin_name`, t2.`admin_name` AS created_by\n\t\tFROM\n\t\t\t`admin` AS t1,\n\t\t\t`admin` AS t2\n\t\tWHERE\n\t\t\tt1.`admin_type` = 'reseller'\n\t\tAND\n\t\t\tt1.`created_by` = t2.`admin_id`\n\t\tORDER BY\n\t\t\t`created_by`,\n\t\t\t`admin_id`\n\t";
    $rs = exec_query($sql, $query);
    $i = 0;
    if ($rs->recordCount() == 0) {
        set_page_message(tr('Reseller list is empty!'), 'info');
    } else {
        while (!$rs->EOF) {
            $admin_id = $rs->fields['admin_id'];
            $admin_id_var_name = "admin_id_" . $admin_id;
            $tpl->append(array('NUMBER' => $i + 1, 'RESELLER_NAME' => tohtml($rs->fields['admin_name']), 'OWNER' => tohtml($rs->fields['created_by']), 'CKB_NAME' => $admin_id_var_name));
            $rs->moveNext();
            $i++;
        }
        $tpl->assign('PAGE_MESSAGE', '');
    }
    $query = "\n\t\tSELECT\n\t\t\t`admin_id`, `admin_name`\n\t\tFROM\n\t\t\t`admin`\n\t\tWHERE\n\t\t\t`admin_type` = 'admin'\n\t\tORDER BY\n\t\t\t`admin_name`\n\t";
    $rs = exec_query($sql, $query);
    while (!$rs->EOF) {
        if (isset($_POST['uaction']) && $_POST['uaction'] === 'reseller_owner' && (isset($_POST['dest_admin']) && $_POST['dest_admin'] == $rs->fields['admin_id'])) {
            $selected = $cfg->HTML_SELECTED;
        } else {
            $selected = '';
        }
        $tpl->append(array('OPTION' => tohtml($rs->fields['admin_name']), 'VALUE' => $rs->fields['admin_id'], 'SELECTED' => $selected));
        $rs->moveNext();
    }
    $tpl->assign('PAGE_MESSAGE', '');
}
开发者ID:gOOvER,项目名称:EasySCP,代码行数:36,代码来源:manage_reseller_owners.php


示例5: module_forums_last_posts_info

function module_forums_last_posts_info()
{
	return array(
		'name' => tra('Newest Forum Posts'),
		'description' => tra('Displays the latest forum posts.'),
		'prefs' => array('feature_forums'),
		'params' => array(
			'topics' => array(
				'name' => tra('Topics only'),
				'description' => tra('If set to "y", only displays topics.') . " " . tr('Not set by default.')
				),
			'forumId' => array(
				'name' => tra('List of forum identifiers'),
				'description' => tra('If set to a list of forum identifiers, restricts the posts to those in the identified forums. Identifiers are separated by colons (":").') . " " . tra('Example values:') . '"13", "31:49". ' . tra('Not set by default.'),
				'separator' => ':'
			),
			'date' => array(
				'name' => tra('Show date'),
				'description' => tra('If set to "y", show post date directly instead of as tooltip.') . ' ' . tra('Default:') . ' n',
			),
			'author' => array(
				'name' => tra('Show author'),
				'description' => tra('If set to "y", show post author directly instead of as tooltip.') . ' ' . tra('Default:') . ' n',
			),
		),
		'common_params' => array('nonums', 'rows')
	);
}
开发者ID:railfuture,项目名称:tiki-website,代码行数:28,代码来源:mod-func-forums_last_posts.php


示例6: smarty_function_error_report

function smarty_function_error_report($params, $smarty)
{
    $errorreportlib = TikiLib::lib('errorreport');
    $errors = $errorreportlib->get_errors();
    $pre = '<div id="error_report">';
    $post = '</div>';
    TikiLib::lib('header')->add_js('
	$("#error_report").ajaxComplete(function (e, jqxhr) {
		var error = jqxhr.getResponseHeader("X-Tiki-Error");
		if (error) {
			if ($("ul", this).length === 0) {
				$(this).append($(error)[0].childNodes);
			} else {
				$("ul", this).append($(error).find("li"));
			}
		}
	});
	$("#error_report .clear").live("click", function () {
		$("#error_report").empty();
		return false;
	});
	');
    if (count($errors)) {
        $smarty->loadPlugin('smarty_block_remarksbox');
        $repeat = false;
        return $pre . smarty_block_remarksbox(array('type' => 'errors', 'title' => tra('Error(s)')), '<a class="clear" style="float: right;" href="#">' . tr('Clear errors') . '</a><ul><li>' . implode('</li><li>', $errors) . '</li></ul>', $smarty, $repeat) . $post;
    } else {
        return $pre . $post;
    }
}
开发者ID:railfuture,项目名称:tiki-website,代码行数:30,代码来源:function.error_report.php


示例7: wikiplugin_adjustinventory

function wikiplugin_adjustinventory($data, $params)
{
    if (!isset($params['add'])) {
        $params['add'] = 'y';
    }
    if (!isset($params['subtract'])) {
        $params['subtract'] = 'y';
    }
    $smarty = TikiLib::lib('smarty');
    $smarty->assign('code', $params['code']);
    $smarty->assign('add', $params['add']);
    $smarty->assign('subtract', $params['subtract']);
    $form = $smarty->fetch('wiki-plugins/wikiplugin_adjustinventory.tpl');
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        global $jitPost;
        $access = TikiLib::lib('access');
        $add_quantity = $jitPost->add_quantity->int();
        $subtract_quantity = $jitPost->subtract_quantity->int();
        $quantity = $add_quantity - $subtract_quantity;
        if ($jitPost->code->text() == $params['code'] && $quantity != 0) {
            $cartlib = TikiLib::lib('cart');
            $cartlib->change_inventory($params['code'], $quantity);
        }
        $access->redirect($_SERVER['REQUEST_URI'], tr('Inventory was adjusted by %0', $quantity));
    }
    return $form;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:27,代码来源:wikiplugin_adjustinventory.php


示例8: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('Importing tracker...');
     $lib = \TikiLib::lib('tabular');
     $info = $lib->getInfo($input->getArgument('tabularId'));
     $perms = \Perms::get('tabular', $info['tabularId']);
     if (!$info || !$perms->tabular_import) {
         throw new \Exception('Tracker Import: Tabular Format not found');
     }
     $fileName = $input->getArgument('filename');
     if (!file_exists($fileName)) {
         throw new \Exception('Tracker Import: File not found');
     }
     // from \Services_Tracker_TabularController::getSchema TODO refactor?
     $tracker = \Tracker_Definition::get($info['trackerId']);
     if (!$tracker) {
         throw new \Exception('Tracker Import: Tracker not found');
     }
     $schema = new \Tracker\Tabular\Schema($tracker);
     $schema->loadFormatDescriptor($info['format_descriptor']);
     $schema->loadFilterDescriptor($info['filter_descriptor']);
     $schema->validate();
     if (!$schema->getPrimaryKey()) {
         throw new \Exception(tr('Primary Key required'));
     }
     // this will throw exceptions and not return if there's a problem
     $source = new \Tracker\Tabular\Source\CsvSource($schema, $fileName);
     $writer = new \Tracker\Tabular\Writer\TrackerWriter();
     $writer->write($source);
     $output->writeln('Import done');
     return 0;
 }
开发者ID:rjsmelo,项目名称:tiki,代码行数:32,代码来源:TrackerImportCommand.php


示例9: __get

 /**
  * {@inheritdoc}
  */
 public function __get($field)
 {
     if (isset($this->_fields[$field])) {
         return $this->_fields[$field];
     }
     throw new InvalidPropertyException(tr('Invalid property: %1', $field));
 }
开发者ID:jivoo,项目名称:jivoo,代码行数:10,代码来源:SchemaBuilder.php


示例10: scheduleBackupRestoration

/**
 * Schedule backup restoration.
 *
 * @param int $userId Customer unique identifier
 * @return void
 */
function scheduleBackupRestoration($userId)
{
    exec_query("UPDATE `domain` SET `domain_status` = ? WHERE `domain_admin_id` = ?", array('torestore', $userId));
    send_request();
    write_log($_SESSION['user_logged'] . ": scheduled backup restoration.", E_USER_NOTICE);
    set_page_message(tr('Backup has been successfully scheduled for restoration.'), 'success');
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:13,代码来源:backup.php


示例11: smarty_modifier_userlink

/**
 * \brief Smarty modifier plugin to create user links with optional mouseover info
 *
 * - type:     modifier
 * - name:     userlink
 * - purpose:  to return a user link
 *
 * @author
 * @param string class (optional)
 * @param string idletime (optional)
 * @param string fullname (optional)
 * @param integer max_length (optional)
 * @return string user link
 *
 * Syntax: {$foo|userlink[:"<class>"][:"<idletime>"][:"<fullname>"][:<max_length>]} (optional params in brackets)
 *
 * Example: {$userinfo.login|userlink:'link':::25}
 */
function smarty_modifier_userlink($other_user, $class = 'userlink', $idletime = 'not_set', $fullname = '', $max_length = 0, $popup = 'y')
{
    if (empty($other_user)) {
        return "";
    }
    if (is_array($other_user)) {
        if (count($other_user) > 1) {
            $other_user = array_map(function ($username) use($class, $idletime, $popup) {
                return smarty_modifier_userlink($username, $class, $idletime, '', 0, $popup);
            }, $other_user);
            $last = array_pop($other_user);
            return tr('%0 and %1', implode(', ', $other_user), $last);
        } else {
            $other_user = reset($other_user);
        }
    }
    if (!$fullname) {
        $fullname = TikiLib::lib('user')->clean_user($other_user);
    }
    if ($max_length) {
        TikiLib::lib('smarty')->loadPlugin('smarty_modifier_truncate');
        $fullname = smarty_modifier_truncate($fullname, $max_length, '...', true);
    }
    if ($popup === 'y') {
        return TikiLib::lib('user')->build_userinfo_tag($other_user, $fullname, $class);
    } else {
        return $fullname;
    }
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:47,代码来源:modifier.userlink.php


示例12: wikiplugin_mail_info

function wikiplugin_mail_info()
{
    global $prefs;
    return array('name' => tra('Mail'), 'documentation' => 'PluginMail', 'description' => tra('Mail other users or groups'), 'validate' => 'all', 'prefs' => array('wikiplugin_mail'), 'iconname' => 'envelope', 'introduced' => 3, 'params' => array('group' => array('required' => false, 'name' => tra('Group'), 'description' => tra('Limit the list of groups to the groups including each group'), 'filter' => 'groupname', 'since' => '5.0', 'default' => '', 'separator' => ':'), 'showgroupdd' => array('required' => false, 'name' => tra('Group Dropdown'), 'description' => tra('Show a dropdown list of groups (not shown by default)'), 'since' => '5.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'recurse' => array('required' => false, 'name' => tra('Recurse Groups'), 'description' => tra('Show each group and each group included in this group'), 'since' => '8.0', 'filter' => 'alpha', 'default' => 'y', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'recurseuser' => array('required' => false, 'name' => tra('Recurse Group Users'), 'description' => tr('Indicate how many times to recurse to collect the users of a selected group and
					the users of each included groups. If %00%1 do not recurse, if %01%1, recurse one time, %02%1 for
					two times....', '<code>', '</code>'), 'since' => '8.0', 'filter' => 'int', 'default' => '0'), 'showuserdd' => array('required' => false, 'name' => tra('User Dropdown'), 'description' => tra('Show a dropdown list of users (not shown by default)'), 'since' => '5.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'showuser' => array('required' => false, 'name' => tra('User Emails'), 'description' => tra('Show a box for user to enter email addresses'), 'since' => '5.0', 'filter' => 'alpha', 'default' => 'y', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'showrealnamedd' => array('required' => false, 'name' => tra('Real Name Dropdown'), 'description' => tra('Show a dropdown list of user real names (not shown by default)'), 'since' => '5.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'popup' => array('required' => false, 'name' => tra('Popup'), 'description' => tra('Show in popup instead of inline.'), 'since' => '14.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'label_name' => array('required' => false, 'name' => tra('Button Text'), 'description' => tr('Text to show on the button to send emails (default: %0Send mail%1)', '<code>', '</code>'), 'since' => '14.0', 'filter' => 'text', 'default' => tra('Send mail')), 'mail_subject' => array('required' => true, 'name' => tra('Email Subject'), 'description' => tra('Present Email subject content'), 'since' => '14.0', 'filter' => 'text', 'default' => ''), 'bypass_preview' => array('required' => false, 'name' => tra('Bypass Preview'), 'description' => tra('Send emails without first previewing'), 'since' => '14.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'debug' => array('required' => false, 'name' => tra('Debug mode (admins only)'), 'description' => tra('Show list of emails that are sent (admins only)'), 'since' => '14.0', 'filter' => 'alpha', 'default' => 'n', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n')))));
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:7,代码来源:wikiplugin_mail.php


示例13: getLanguage

 function getLanguage($type, $object)
 {
     $lang = null;
     switch ($type) {
         case 'wiki page':
             $info = TikiLib::lib('tiki')->get_page_info($object);
             $lang = $info['lang'];
             break;
         case 'article':
             $info = TikiLib::lib('art')->get_article($object);
             $lang = $info['lang'];
             break;
         case 'trackeritem':
             $info = TikiLib::lib('trk')->get_tracker_item($object);
             $definition = Tracker_Definition::get($info['trackerId']);
             if ($field = $definition->getLanguageField()) {
                 $lang = $info[$field];
             }
             break;
         case 'forum post':
             $object = TikiLib::lib('comments')->get_comment_forum_id($object);
             // no break: drop through to forum
         // no break: drop through to forum
         case 'forum':
             $info = TikiLib::lib('comments')->get_forum($object);
             $lang = $info['forumLanguage'];
             break;
     }
     if (!$lang) {
         throw new Services_Exception(tr('Object has no language and cannot be translated'), 400);
     }
     return $lang;
 }
开发者ID:ameoba32,项目名称:tiki,代码行数:33,代码来源:Utilities.php


示例14: css_edit_raw

function css_edit_raw()
{
    global $event, $step;
    $default_name = safe_field('css', 'txp_section', "name = 'default'");
    extract(gpsa(array('name', 'newname', 'copy', 'savenew')));
    if ($step == 'css_delete' || empty($name) && $step != 'pour' && !$savenew) {
        $name = $default_name;
    } elseif (($copy || $savenew) && trim(preg_replace('/[<>&"\']/', '', $newname))) {
        $name = $newname;
    }
    if (empty($name)) {
        $buttons = '<div class="edit-title">' . gTxt('name_for_this_style') . ': ' . fInput('text', 'newname', '', 'edit', '', '', 20) . hInput('savenew', 'savenew') . '</div>';
        $thecss = gps('css');
    } else {
        $buttons = '<div class="edit-title">' . gTxt('you_are_editing_css') . sp . strong(htmlspecialchars($name)) . '</div>';
        $thecss = fetch("css", 'txp_css', 'name', $name);
    }
    if (!empty($name)) {
        $copy = '<span class="copy-as"><label for="copy-css">' . gTxt('copy_css_as') . '</label>' . sp . fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-css') . sp . fInput('submit', 'copy', gTxt('copy'), 'smallerbox') . '</span>';
    } else {
        $copy = '';
    }
    $right = '<div id="content_switcher">' . hed(gTxt('all_stylesheets'), 2) . graf(sLink('css', 'pour', gTxt('create_new_css')), ' class="action-create smallerbox"') . css_list($name, $default_name) . '</div>';
    echo '<div id="' . $event . '_container" class="txp-container txp-edit">' . startTable('edit') . tr(td(form('<div id="main_content">' . $buttons . '<textarea id="css" class="code" name="css" cols="78" rows="32">' . htmlspecialchars($thecss) . '</textarea>' . br . fInput('submit', '', gTxt('save'), 'publish') . eInput('css') . sInput('css_save') . hInput('name', $name) . $copy . '</div>', '', '', 'post', 'edit-form', '', 'style_form'), '', 'column') . tdtl($right, ' class="column"')) . endTable() . '</div>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:25,代码来源:txp_css.php


示例15: padd_group

function padd_group($tpl, $sql, $dmn_id)
{
    $cfg = EasySCP_Registry::get('Config');
    if (isset($_POST['uaction']) && $_POST['uaction'] == 'add_group') {
        // we have to add the group
        if (isset($_POST['groupname'])) {
            if (!validates_username($_POST['groupname'])) {
                set_page_message(tr('Invalid group name!'), 'warning');
                return;
            }
            $groupname = $_POST['groupname'];
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`id`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_groups`\n\t\t\t\tWHERE\n\t\t\t\t\t`ugroup` = ?\n\t\t\t\tAND\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t";
            $rs = exec_query($sql, $query, array($groupname, $dmn_id));
            if ($rs->recordCount() == 0) {
                $change_status = $cfg->ITEM_ADD_STATUS;
                $query = "\n\t\t\t\t\tINSERT INTO `htaccess_groups`\n\t\t\t\t\t\t(`dmn_id`, `ugroup`, `status`)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(?, ?, ?)\n\t\t\t\t";
                exec_query($sql, $query, array($dmn_id, $groupname, $change_status));
                send_request();
                $admin_login = $_SESSION['user_logged'];
                write_log("{$admin_login}: add group (protected areas): {$groupname}");
                user_goto('protected_user_manage.php');
            } else {
                set_page_message(tr('Group already exists!'), 'error');
                return;
            }
        } else {
            set_page_message(tr('Invalid group name!'), 'error');
            return;
        }
    } else {
        return;
    }
}
开发者ID:gOOvER,项目名称:EasySCP,代码行数:33,代码来源:protected_group_add.php


示例16: evaluate

 function evaluate($element)
 {
     $default = 0;
     $allowed = ['qualifier', 'from', 'to'];
     if ($extra = $element->getExtraValues($allowed)) {
         $this->error(tr('Unexpected values: %0', implode(', ', $extra)));
     }
     $from = $element->from;
     $to = $element->to;
     $qualifier = $element->qualifier;
     if (!$qualifier || count($qualifier) != 1) {
         $this->error(tra('Qualifier must be provided and contain one argument: type'));
     }
     if (!$from || count($from) != 2) {
         $this->error(tra('From must be provided and contain two arguments: type, object-id'));
     }
     if (!$to || count($to) != 2) {
         $this->error(tra('To must be provided and contain two arguments: type, object-id'));
     }
     $qualifier = $this->evaluateChild($qualifier[0]);
     $typeFrom = $this->evaluateChild($from[0]);
     $objectFrom = $this->evaluateChild($from[1]);
     $typeTo = $this->evaluateChild($to[0]);
     $objectTo = $this->evaluateChild($to[1]);
     $lib = TikiLib::lib('relation');
     $id = $lib->get_relation_id($qualifier, $typeFrom, $objectFrom, $typeTo, $objectTo);
     return $id ? 1 : 0;
 }
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:28,代码来源:RelationPresent.php


示例17: payment_behavior_perform_trade

/**
 * Performs the second half of a trade - "offer mode" only and also cclite only
 * The payment system does the first half ($user to manager account), this does manager to destination
 *
 * Work in progress
 *
 * @param string $main_user
 * @param string $other_user
 * @param float $price
 * @param string $currency
 * @param string $wanted = 'n'
 */
function payment_behavior_perform_trade($params)
{
    global $userlib, $paymentlib, $prefs, $cclitelib, $smarty;
    require_once 'lib/payment/cclitelib.php';
    $default = array('wanted' => 'n', 'registry' => '', 'currency' => '');
    $params = array_merge($default, $params);
    $smarty->assign('ccresult_ok', false);
    if (!$userlib->user_exists($params['main_user'])) {
        $smarty->assign('ccresult2', "Perform Trade: Main user {$params['main_user']} not found");
    }
    if (!$userlib->user_exists($params['other_user'])) {
        $smarty->assign('ccresult2', "Perform Trade: Other user {$params['other_user']} not found");
    }
    if (!$params['price'] || (int) $params['price'] === 0) {
        $smarty->assign('ccresult2', "Perform Trade: price not set");
    }
    $result = $cclitelib->pay_user($params['price'], $params['currency'], $params['registry'], $params['other_user'], $params['main_user']);
    if (!empty($result)) {
        $smarty->assign('ccresult2', $result);
        $smarty->assign('ccresult_ok', strpos($result, 'Transaction Accepted') !== false);
    } else {
        $smarty->assign('ccresult2', tr('Payment sent but verification not currently available. (Work in progress)'));
    }
    return $result;
}
开发者ID:jkimdon,项目名称:cohomeals,代码行数:37,代码来源:perform_trade.php


示例18: display_customer_summary

function display_customer_summary($customer_record)
{
    global $table_style;
    $past1 = get_company_pref('past_due_days');
    $past2 = 2 * $past1;
    if ($customer_record["dissallow_invoices"] != 0) {
        echo "<center><font color=red size=4><b>" . tr("CUSTOMER ACCOUNT IS ON HOLD") . "</font></b></center>";
    }
    $nowdue = "1-" . $past1 . " " . tr('Days');
    $pastdue1 = $past1 + 1 . "-" . $past2 . " " . tr('Days');
    $pastdue2 = tr('Over') . " " . $past2 . " " . tr('Days');
    start_table("width=80% {$table_style}");
    $th = array(tr("Currency"), tr("Terms"), tr("Current"), $nowdue, $pastdue1, $pastdue2, tr("Total Balance"));
    table_header($th);
    start_row();
    label_cell($customer_record["curr_code"]);
    label_cell($customer_record["terms"]);
    amount_cell($customer_record["Balance"] - $customer_record["Due"]);
    amount_cell($customer_record["Due"] - $customer_record["Overdue1"]);
    amount_cell($customer_record["Overdue1"] - $customer_record["Overdue2"]);
    amount_cell($customer_record["Overdue2"]);
    amount_cell($customer_record["Balance"]);
    end_row();
    end_table();
}
开发者ID:ravenii,项目名称:guardocs,代码行数:25,代码来源:customer_inquiry.php


示例19: admin_generatePage

/**
 * Generate page
 *
 * @param  iMSCP_pTemplate $tpl
 * @return void
 */
function admin_generatePage($tpl)
{
    /** @var $cfg iMSCP_Config_Handler_File */
    $cfg = iMSCP_Registry::get('config');
    if (!isset($cfg['CHECK_FOR_UPDATES']) || !$cfg['CHECK_FOR_UPDATES']) {
        set_page_message(tr('i-MSCP version update checking is disabled'), 'static_warning');
    } else {
        /** @var iMSCP_Update_Version $updateVersion */
        $updateVersion = iMSCP_Update_Version::getInstance();
        if ($updateVersion->isAvailableUpdate()) {
            if ($updateInfo = $updateVersion->getUpdateInfo()) {
                $date = new DateTime($updateInfo['published_at']);
                $tpl->assign(array('TR_UPDATE_INFO' => tr('Update info'), 'TR_RELEASE_VERSION' => tr('Release version'), 'RELEASE_VERSION' => tohtml($updateInfo['tag_name']), 'TR_RELEASE_DATE' => tr('Release date'), 'RELEASE_DATE' => tohtml($date->format($cfg['DATE_FORMAT'])), 'TR_RELEASE_DESCRIPTION' => tr('Release description'), 'RELEASE_DESCRIPTION' => tohtml($updateInfo['body']), 'TR_DOWNLOAD_LINKS' => tr('Download links'), 'TR_DOWNLOAD_ZIP' => tr('Download ZIP'), 'TR_DOWNLOAD_TAR' => tr('Download TAR'), 'TARBALL_URL' => tohtml($updateInfo['tarball_url']), 'ZIPBALL_URL' => tohtml($updateInfo['zipball_url'])));
                return;
            } else {
                set_page_message($updateVersion->getError(), 'error');
            }
        } elseif ($updateVersion->getError()) {
            set_page_message($updateVersion, 'error');
        } else {
            set_page_message(tr('No update available'), 'static_info');
        }
    }
    $tpl->assign('UPDATE_INFO', '');
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:imscp_updates.php


示例20: wikiplugin_versions_info

function wikiplugin_versions_info()
{
    return array('name' => tra('Versions'), 'documentation' => 'PluginVersions', 'description' => tra('Create tabs for showing alternate versions of content'), 'prefs' => array('wikiplugin_versions'), 'body' => tra('Block of text separated by ---(version x)--- markers. Text before the first marker is used by
			default.'), 'iconname' => 'copy', 'introduced' => 1, 'tags' => array('basic'), 'params' => array('nav' => array('required' => false, 'name' => tra('Navigation'), 'description' => tra('Display a navigation box that allows users to select a specific version to display.'), 'since' => '1', 'default' => 'n', 'filter' => 'alpha', 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'title' => array('required' => false, 'name' => tra('Title'), 'description' => tr('Display the current version name as the title. No title shows when %0nav="y"%1;
					otherwise shows by default.', '<code>', '</code>'), 'since' => '1', 'default' => 'y', 'filter' => 'alpha', 'parent' => array('name' => 'nav', 'value' => 'n'), 'options' => array(array('text' => '', 'value' => ''), array('text' => tra('Yes'), 'value' => 'y'), array('text' => tra('No'), 'value' => 'n'))), 'default' => array('required' => false, 'name' => tra('Default Label'), 'description' => tra('Specifies version label to show when displaying the page for the first time.
					Default label is \'Default\''), 'since' => '1', 'default' => tra('Default'))));
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:7,代码来源:wikiplugin_versions.php



注:本文中的tr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tra函数代码示例发布时间:2022-05-23
下一篇:
PHP tpldir函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap