本文整理汇总了PHP中Text::getText方法的典型用法代码示例。如果您正苦于以下问题:PHP Text::getText方法的具体用法?PHP Text::getText怎么用?PHP Text::getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Text
的用法示例。
在下文中一共展示了Text::getText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
function delete() {
Category::requirePermission("DELETE");
$link = Database::getConnection();
$query = "DELETE FROM category WHERE id=".Database::sqlValue($this->id);
mysql_query($query) or die(Database::formatError($query, Text::getText("QueryFailed")));
Database::returnConnection($link);
}
示例2: printContent
function printContent() {
?>
<table border="0">
<tr bgcolor=<?=BGCOLOR_ALT?>>
<th>#</th>
<? if (SecurityGroup::havePermission("DELETE")) { ?>
<th></th>
<? } ?>
<th><?=Text::getText("Name")?></th>
<th> </th>
<th> </th>
</tr>
<? $bg = TRUE; ?>
<? foreach ($this->groups as $g) { ?>
<? $bg = !$bg; ?>
<tr<? if ($bg) { ?> bgcolor=<?=BGCOLOR_ALT?><? } ?>>
<td> <?=$g->getId()?> </td>
<? if (SecurityGroup::havePermission("DELETE")) { ?>
<td><a href="<?=$this->groupDeletePage?>?<?=$this->groupDeleteParamGroupId?>=<?=$g->getId()?>" onClick="return confirm('<?=Text::getText('ConfirmDeleteGroup')?>')"><img src="<?=$this->imgDeleteSrc?>" border="0" alt="<?=Text::getText('Delete')?>"></a></td>
<? } ?>
<td> <a href="<?=$this->groupEditPage?>?<?=$this->groupEditParamGroupId?>=<?=$g->getId()?>"><?=$g->getName()?></a> </td>
<td> <a href="<?=$this->groupMembersPage?>?<?=$this->groupMembersParamGroupId?>=<?=$g->getId()?>"><?=Text::getText("Members")?></a> </td>
<td> <a href="<?=$this->groupPermissionsPage?>?<?=$this->groupPermissionsParamGroupId?>=<?=$g->getId()?>"><?=Text::getText("Permissions")?></a> </td>
</tr>
<? } ?>
</table>
<?
}
示例3: printContent
function printContent() {
$action = $this->getAction();
?>
<form method="POST" action="<?=$action?>">
<input type="hidden" name="action" value="save">
<input type="hidden" name="submitted" value="yes">
<table border="0" cellpadding="2">
<tr>
<th><?=Text::getText("LoginName")?></th>
<td><input type="text" name="loginName" value=""></td>
</tr>
<tr>
<th><?=Text::getText("FullName")?></th>
<td><input type="text" name="fullName" value=""></td>
</tr>
<tr>
<th><?=Text::getText("Password")?></th>
<td><input type="password" name="password" value=""></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?=Text::getText("Add")?>">
</td>
</tr>
</table>
</form>
<?
}
示例4: printContent
function printContent() {
?>
<table border="0">
<tr bgcolor="<?=BGCOLOR_ALT?>">
<th>#</th>
<? if (SecurityUser::havePermission("DELETE")) { ?>
<th></th>
<? } ?>
<th><?=Text::getText("FullName")?></th>
<th><?=Text::getText("LoginName")?></th>
</tr>
<? $bg = TRUE; ?>
<? foreach ($this->users as $u) { ?>
<? $bg = !$bg; ?>
<tr<? if ($bg) { ?> bgcolor="<?=BGCOLOR_ALT?>"<? } ?>>
<td> <?=$u->getId()?> </td>
<? if (SecurityUser::havePermission("DELETE")) { ?>
<td><a href="<?=$this->userDeletePage?>?<?=$this->userDeleteUserParam?>=<?=$u->getId()?>" onClick="return confirm('<?=Text::getText('ConfirmDeleteUser')?>\n\n<?=$u->getLoginName()?>')"><img src="<?=IMAGE_TRASH?>" border="0" alt="<?=Text::getText('Delete')?>"></a></td>
<? } ?>
<td> <?=$u->getFullName()?> </td>
<td> <a href="<?=$this->getUserPage()?>?id=<?=$u->getId()?>"><?=$u->getLoginName()?></a> </td>
</tr>
<? } ?>
</table>
<?
}
示例5: getSubmitCaption
/**
*
*/
function getSubmitCaption()
{
if ($this->submitCaption == NULL) {
return Text::getText("Submit");
} else {
return $this->submitCaption;
}
}
示例6: insert
/**
* Takes an INSERT query and returns the inserted ID,
* or 0 if query does not generate an AUTO_INCREMENT
* value.
*/
function insert($sql) {
$con = Database::getConnection();
$result = mysql_query($sql) or die(Database::formatError($sql, Text::getText("QueryFailed")));
$record = new DatabaseRecord($result);
$id = mysql_insert_id($con);
Database::returnConnection($con);
return $id;
}
示例7: testConstruct_returnsElement_ifTextIsString
/**
* __construct() should return text element if text is string
*/
public function testConstruct_returnsElement_ifTextIsString()
{
$string = 'foo';
$text = new Text($string);
$this->assertTrue($text instanceof Text);
$this->assertEquals($string, $text->getText());
return;
}
示例8: testFormattedTextRetrieve
public function testFormattedTextRetrieve()
{
$string = "Hey %s, you have %d new messages";
$arg1 = "Joe";
$arg2 = 15;
$compare = "Hey Joe, you have 15 new messages";
$retrieved = Text::getText($string, $arg1, $arg2);
self::assertSame($compare, (string) $retrieved);
}
示例9: writeText
protected function writeText(Text $textChild, $level)
{
$newLine = $this->_pretty ? $this->_newLine : '';
$indent = $this->_pretty ? str_repeat($this->_tabString, $level) : '';
$text = $textChild->getText();
//TODO: Need some kind of mb_wordwrap here, maybe:
//http://stackoverflow.com/questions/3825226/multi-byte-safe-wordwrap-function-for-utf-8?
return $this->_pretty && mb_strlen($text, 'utf-8') > $this->_textWrap ? $indent . wordwrap(str_replace("\n", '', $text), $this->_textWrap, "{$newLine}{$indent}") : $text;
}
示例10: update
function update() {
SecurityGroup::requirePermission("CHANGE");
if ($this->id == NULL) {
die(Text::getText("GroupHasNoId"));
}
$query = "UPDATE security_group";
$query .= " SET name=".Database::sqlValue($this->name);
$query .= " WHERE id=".Database::sqlValue($this->id);
Database::query($query);
}
示例11: printContent
function printContent() {
$u = $this->getUser();
?>
<form method="POST">
<input type="hidden" name="action" value="save">
<table border="0" cellpadding="2">
<tr>
<td colspan="2" align="center">
<?=Text::getText("UserInfo")?>
</td>
</tr>
<tr>
<th><?=Text::getText("LoginName")?></th>
<td><input type="text" name="loginName" value="<?=$u->getLoginName()?>"></td>
</tr>
<tr>
<th><?=Text::getText("FullName")?></th>
<td><input type="text" name="fullName" value="<?=$u->getFullName()?>"></td>
</tr>
<tr>
<td colspan="2" align="center">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="checkbox" name="changePassword" value="true">
<?=Text::getText("ChangePassword")?>
</td>
</tr>
<tr>
<th><?=Text::getText("NewPassword")?></th>
<td><input type="password" name="password" value=""></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?=$this->getSubmitCaption()?>">
<input type="button" value="<?=Text::getText('Cancel')?>" onClick="document.location='<?=$this->cancelPage?>'">
</td>
</tr>
</table>
</form>
<?
}
示例12: printContent
function printContent() {
?>
<form method="POST" action="<?=$this->getAction()?>">
<input type="hidden" name="action" value="save">
<table border="0" cellpadding="2">
<tr>
<th><?=Text::getText("Name")?></th>
<td><input type="text" name="name" value=""></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?=Text::getText("Add")?>">
</td>
</tr>
</table>
</form>
<?
}
示例13: printContent
function printContent() {
$g = $this->group;
?>
<form action="<?=$this->getAction()?>" method="POST">
<input type="hidden" name="action" value="save">
<table border="0" cellpadding="2">
<tr>
<th><?=Text::getText("Name")?></th>
<td><input type="text" name="name" value="<?=$g->getName()?>"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?=Text::getText('Save')?>">
<input type="button" value="<?=Text::getText('Cancel')?>" onClick="document.location='<?=$this->cancelPage?>'">
</td>
</tr>
</table>
</form>
<?
}
示例14: printContent
function printContent() {
$g = $this->getGroup();
$allPermissions = SecurityPermission::getAll();
$allResources = SecurityResource::getAll();
$msg = $this->getMessage();
?>
<form action="<?=$this->getAction()?>" method="post">
<input type="hidden" name="group" value="<?=$g->getId()?>">
<? if (strlen($msg) > 0) { ?>
<p><b><?=$msg?></b></p>
<? } ?>
<p>
<table border="0">
<tr>
<td>
<table border="0">
<tr bgcolor="<?=BGCOLOR_ALT?>">
<th><?=Text::getText("Resource")?></th>
<? foreach ($allPermissions as $perm) { ?>
<th><?=$perm->getName()?></th>
<? } ?>
</tr>
<? $bg = TRUE; ?>
<? foreach ($allResources as $res) { ?>
<? $bg = !$bg; ?>
<tr<? if ($bg) { ?> bgcolor="<?=BGCOLOR_ALT?>"<? } ?>>
<td><?=$res->getName()?></td>
<? foreach ($allPermissions as $perm) { ?>
<?
$checked = "";
if ($g->hasPermission($res, $perm)) {
$checked = " checked";
}
?>
<td align="center"><input type="checkbox"<?=$checked?> name="res<?=$res->getId()?>_perm<?=$perm->getId()?>"></td>
<? } ?>
</tr>
<? } ?>
</table>
</td>
</tr>
<tr>
<td align="center">
<input type="submit" value="<?=Text::getText("Save")?>">
</td>
</tr>
</table>
</p>
</form>
<?
}
示例15:
</h2>
<form method="POST">
<input type="hidden" name="action" value="save">
<table border="0" cellpadding="2">
<tr>
<th><?php
echo Text::getText("Name");
?>
</th>
<td><input type="text" name="name" value="<?php
echo $g->getName();
?>
"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?php
echo Text::getText("Save");
?>
">
<input type="button" value="<?php
echo Text::getText("Cancel");
?>
" onClick="document.location='groups.php'">
</td>
</tr>
</table>
</form>