本文整理汇总了PHP中_pgettext函数的典型用法代码示例。如果您正苦于以下问题:PHP _pgettext函数的具体用法?PHP _pgettext怎么用?PHP _pgettext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_pgettext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_RTE_getFooterLinks
/**
* Creates a fieldset for adding a new item, if the user has the privileges.
*
* @param string $docu String used to create a link to the MySQL docs
* @param string $priv Privilege to check for adding a new item
* @param string $name MySQL name of the item
*
* @return string An HTML snippet with the link to add a new item
*/
function PMA_RTE_getFooterLinks($docu, $priv, $name)
{
global $db, $url_query, $ajax_class;
$icon = 'b_' . strtolower($name) . '_add.png';
$retval = "";
$retval .= "<!-- ADD " . $name . " FORM START -->\n";
$retval .= "<fieldset class='left'>\n";
$retval .= " <legend>" . _pgettext('Create new procedure', 'New') . "</legend>\n";
$retval .= " <div class='wrap'>\n";
if (PMA_Util::currentUserHasPrivilege($priv, $db)) {
$retval .= " <a {$ajax_class['add']} ";
$retval .= "href='db_" . strtolower($name) . "s.php";
$retval .= "?{$url_query}&add_item=1'>";
$retval .= PMA_Util::getIcon($icon);
$retval .= PMA_RTE_getWord('add') . "</a>\n";
} else {
$retval .= " " . PMA_Util::getIcon($icon);
$retval .= PMA_RTE_getWord('no_create') . "\n";
}
$retval .= " " . PMA_Util::showMySQLDocu('SQL-Syntax', $docu) . "\n";
$retval .= " </div>\n";
$retval .= "</fieldset>\n";
$retval .= "<!-- ADD " . $name . " FORM END -->\n\n";
return $retval;
}
示例2: testShowPHPDocu
/**
* Test for showPHPDocu
*
* @return void
*/
function testShowPHPDocu()
{
$target = "docu";
$lang = _pgettext('PHP documentation language', 'en');
$expected = '<a href="./url.php?url=http%3A%2F%2Fphp.net%2Fmanual%2F' . $lang . '%2F' . $target . '" target="documentation">' . '<img src="themes/dot.gif" title="' . __('Documentation') . '" alt="' . __('Documentation') . '" class="icon ic_b_help" /></a>';
$this->assertEquals($expected, PMA\libraries\Util::showPHPDocu($target));
}
示例3: PMA_RTE_getFooterLinks
/**
* Creates a fieldset for adding a new item, if the user has the privileges.
*
* @param string $docu String used to create a link to the MySQL docs
* @param string $priv Privilege to check for adding a new item
* @param string $name MySQL name of the item
*
* @return string An HTML snippet with the link to add a new item
*/
function PMA_RTE_getFooterLinks($docu, $priv, $name)
{
global $db, $table, $url_query, $ajax_class;
$icon = mb_strtolower($name) . '_add.png';
$retval = "";
$retval .= "<!-- ADD " . $name . " FORM START -->\n";
$retval .= "<fieldset class='left'>\n";
$retval .= "<legend>" . _pgettext('Create new procedure', 'New') . "</legend>\n";
$retval .= " <div class='wrap'>\n";
if (PMA\libraries\Util::currentUserHasPrivilege($priv, $db, $table)) {
$retval .= " <a {$ajax_class['add']} ";
$retval .= "href='db_" . mb_strtolower($name) . "s.php";
$retval .= "{$url_query}&add_item=1' ";
$retval .= "onclick='\$.datepicker.initialized = false;'>";
$icon = 'b_' . $icon;
$retval .= PMA\libraries\Util::getIcon($icon);
$retval .= PMA_RTE_getWord('add') . "</a>\n";
} else {
$icon = 'bd_' . $icon;
$retval .= PMA\libraries\Util::getIcon($icon);
$retval .= PMA_RTE_getWord('add') . "\n";
}
$retval .= " " . PMA\libraries\Util::showMySQLDocu($docu) . "\n";
$retval .= " </div>\n";
$retval .= "</fieldset>\n";
$retval .= "<!-- ADD " . $name . " FORM END -->\n\n";
return $retval;
}
示例4: testGettext
public function testGettext()
{
$this->assertEquals('Typ', _gettext('Type'));
$this->assertEquals('Typ', __('Type'));
$this->assertEquals('%d sekundy', _ngettext('%d second', '%d seconds', 2));
$this->assertEquals('%d seconds', _npgettext('context', '%d second', '%d seconds', 2));
$this->assertEquals('Tabulka', _pgettext('Display format', 'Table'));
}
示例5: testShwoPHPDocuNotReplaceHelpImg
function testShwoPHPDocuNotReplaceHelpImg()
{
$GLOBALS['cfg']['ReplaceHelpImg'] = false;
$target = "docu";
$lang = _pgettext('PHP documentation language', 'en');
$expected = '[<a href="./url.php?url=http%3A%2F%2Fphp.net%2Fmanual%2F' . $lang . '%2F' . $target . '&server=99&lang=en&token=token' . '" target="documentation">' . __('Documentation') . '</a>]';
$this->assertEquals($expected, PMA_showPHPDocu($target));
}
示例6: __construct
/**
* Initialises the class
*
* @param string $name An identifier for the new node
*
* @return Node_Database_Container
*/
public function __construct($name)
{
parent::__construct($name, Node::CONTAINER);
$new = PMA_NodeFactory::getInstance('Node', _pgettext('Create new database', 'New'));
$new->isNew = $GLOBALS['is_create_db_priv'];
$new->icon = PMA_Util::getImage('b_newdb.png', '');
$new->links = array('text' => 'server_databases.php?server=' . $GLOBALS['server'] . '&token=' . $GLOBALS['token'], 'icon' => 'server_databases.php?server=' . $GLOBALS['server'] . '&token=' . $GLOBALS['token']);
$new->classes = 'new_database italics';
$this->addChild($new);
}
示例7: testPMAGetHtmlForChartTypeOptions
/**
* Tests for PMA_getHtmlForChartTypeOptions() method.
*
* @return void
* @test
*/
public function testPMAGetHtmlForChartTypeOptions()
{
$html = PMA_getHtmlForChartTypeOptions();
$this->assertContains(_pgettext('Chart type', 'Bar'), $html);
$this->assertContains(_pgettext('Chart type', 'Column'), $html);
$this->assertContains(_pgettext('Chart type', 'Line'), $html);
$this->assertContains(_pgettext('Chart type', 'Spline'), $html);
$this->assertContains(_pgettext('Chart type', 'Area'), $html);
$this->assertContains(_pgettext('Chart type', 'Pie'), $html);
$this->assertContains(_pgettext('Chart type', 'Timeline'), $html);
}
示例8: __construct
/**
* Initialises the class
*
* @param string $name An identifier for the new node
*/
public function __construct($name)
{
parent::__construct($name, Node::CONTAINER);
if ($GLOBALS['is_create_db_priv'] && $GLOBALS['cfg']['ShowCreateDb'] !== false) {
$new = NodeFactory::getInstance('Node', _pgettext('Create new database', 'New'));
$new->isNew = true;
$new->icon = PMA\libraries\Util::getImage('b_newdb.png', '');
$new->links = array('text' => 'server_databases.php?server=' . $GLOBALS['server'], 'icon' => 'server_databases.php?server=' . $GLOBALS['server']);
$new->classes = 'new_database italics';
$this->addChild($new);
}
}
示例9: __construct
/**
* Initialises the class
*
* @return Node_Column_Container
*/
public function __construct()
{
parent::__construct(__('Columns'), Node::CONTAINER);
$this->icon = PMA_Util::getImage('pause.png', '');
$this->links = array('text' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&token=' . $GLOBALS['token'], 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&token=' . $GLOBALS['token']);
$this->real_name = 'columns';
$new = PMA_NodeFactory::getInstance('Node', _pgettext('Create new column', 'New'));
$new->isNew = true;
$new->icon = PMA_Util::getImage('b_column_add.png', '');
$new->links = array('text' => 'tbl_addfield.php?server=' . $GLOBALS['server'] . '&db=%3$s&table=%2$s' . '&field_where=last&after_field=' . '&token=' . $GLOBALS['token'], 'icon' => 'tbl_addfield.php?server=' . $GLOBALS['server'] . '&db=%3$s&table=%2$s' . '&field_where=last&after_field=' . '&token=' . $GLOBALS['token']);
$new->classes = 'new_column italics';
$this->addChild($new);
}
示例10: __construct
/**
* Initialises the class
*
* @return Node_Column_Container
*/
public function __construct()
{
parent::__construct(__('Functions'), Node::CONTAINER);
$this->icon = PMA_Util::getImage('b_routines.png');
$this->links = array('text' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $GLOBALS['token'], 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $GLOBALS['token']);
$this->real_name = 'functions';
$new = PMA_NodeFactory::getInstance('Node', _pgettext('Create new function', 'New'));
$new->isNew = true;
$new->icon = PMA_Util::getImage('b_routine_add.png', '');
$new->links = array('text' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&token=' . $GLOBALS['token'] . '&add_item=1&item_type=FUNCTION', 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] . '&db=%2$s&token=' . $GLOBALS['token'] . '&add_item=1&item_type=FUNCTION');
$new->classes = 'new_function italics';
$this->addChild($new);
}
示例11: testShowPHPDocu
function testShowPHPDocu()
{
$target = "docu";
$lang = _pgettext('PHP documentation language', 'en');
$expected = '<a href="./url.php?url=http%3A%2F%2Fphp.net%2Fmanual%2F' . $lang
. '%2F' . $target . '&server=99&lang=en&token=token'
. '" target="documentation"><img src="themes/dot.gif" title="'
. __('Documentation') . '" alt="' . __('Documentation') . '" class="icon ic_b_help" /></a>';
$this->assertEquals(
$expected, PMA_CommonFunctions::getInstance()->showPHPDocu($target)
);
}
示例12: __construct
/**
* Initialises the class
*
* @return Node_Event_Container
*/
public function __construct()
{
parent::__construct(__('Events'), Node::CONTAINER);
$this->icon = PMA_Util::getImage('b_events.png', '');
$this->links = array('text' => 'db_events.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $_SESSION[' PMA_token '], 'icon' => 'db_events.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $_SESSION[' PMA_token ']);
$this->real_name = 'events';
$new = PMA_NodeFactory::getInstance('Node', _pgettext('Create new event', 'New'));
$new->isNew = true;
$new->icon = PMA_Util::getImage('b_event_add.png', '');
$new->links = array('text' => 'db_events.php?server=' . $GLOBALS['server'] . '&db=%2$s&token=' . $_SESSION[' PMA_token '] . '&add_item=1', 'icon' => 'db_events.php?server=' . $GLOBALS['server'] . '&db=%2$s&token=' . $_SESSION[' PMA_token '] . '&add_item=1');
$new->classes = 'new_event italics';
$this->addChild($new);
}
示例13: __construct
/**
* Initialises the class
*
* @return Node_View_Container
*/
public function __construct()
{
parent::__construct(__('Views'), Node::CONTAINER);
$this->icon = PMA_Util::getImage('b_views.png', '');
$this->links = array('text' => 'db_structure.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $GLOBALS['token'], 'icon' => 'db_structure.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $GLOBALS['token']);
$this->real_name = 'views';
$new = PMA_NodeFactory::getInstance('Node', _pgettext('Create new view', 'New'));
$new->isNew = true;
$new->icon = PMA_Util::getImage('b_view_add.png', '');
$new->links = array('text' => 'view_create.php?server=' . $GLOBALS['server'] . '&db=%2$s&token=' . $GLOBALS['token'], 'icon' => 'view_create.php?server=' . $GLOBALS['server'] . '&db=%2$s&token=' . $GLOBALS['token']);
$new->classes = 'new_view italics';
$this->addChild($new);
}
示例14: __construct
/**
* Initialises the class
*
* @return Node_Index_Container
*/
public function __construct()
{
parent::__construct(__('Indexes'), Node::CONTAINER);
$this->icon = PMA_Util::getImage('b_index.png', '');
$this->links = array('text' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&token=' . $GLOBALS['token'], 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&token=' . $GLOBALS['token']);
$this->real_name = 'indexes';
$new = PMA_NodeFactory::getInstance('Node', _pgettext('Create new index', 'New'));
$new->isNew = true;
$new->icon = PMA_Util::getImage('b_index_add.png', '');
$new->links = array('text' => 'tbl_indexes.php?server=' . $GLOBALS['server'] . '&create_index=1&added_fields=2' . '&db=%3$s&table=%2$s&token=' . $GLOBALS['token'], 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server'] . '&create_index=1&added_fields=2' . '&db=%3$s&table=%2$s&token=' . $GLOBALS['token']);
$new->classes = 'new_index italics';
$this->addChild($new);
}
示例15: __construct
/**
* Initialises the class
*/
public function __construct()
{
parent::__construct(__('Triggers'), Node::CONTAINER);
$this->icon = PMA\libraries\Util::getImage('b_triggers.png');
$this->links = array('text' => 'db_triggers.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s', 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s');
$this->real_name = 'triggers';
$new = NodeFactory::getInstance('Node', _pgettext('Create new trigger', 'New'));
$new->isNew = true;
$new->icon = PMA\libraries\Util::getImage('b_trigger_add.png', '');
$new->links = array('text' => 'db_triggers.php?server=' . $GLOBALS['server'] . '&db=%3$s&add_item=1', 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] . '&db=%3$s&add_item=1');
$new->classes = 'new_trigger italics';
$this->addChild($new);
}