本文整理汇总了PHP中___函数的典型用法代码示例。如果您正苦于以下问题:PHP ___函数的具体用法?PHP ___怎么用?PHP ___使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了___函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addDefaultPages
public function addDefaultPages()
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$id = $request->getInt('id', $request->getInt('user_id'));
if (!$id && $request->getInt('_u_id')) {
$id = $request->getInt('_u_id');
}
if (!$id && $request->getParam('_u_a') == 'insert') {
$id = 'insert';
}
if (!$id) {
throw new Am_Exception_InputError("Could not find out [id]");
}
$userUrl = REL_ROOT_URL . '/admin-users?';
if ($action = $request->getFiltered('_u_a', 'edit')) {
$userUrl .= "_u_a={$action}&";
}
if ($a = $request->getFiltered('_u_id', $id)) {
$userUrl .= "_u_id={$a}";
}
$this->addPage(array('id' => 'users', 'uri' => $userUrl, 'label' => ___('User Info'), 'order' => 0, 'disabled' => $id <= 0, 'active' => $request->getFiltered('_u_id', false)))->addPage(array('id' => 'payments', 'label' => ___('Payments'), 'controller' => 'admin-user-payments', 'params' => array('user_id' => $id), 'order' => 100, 'resource' => 'grid_payment'))->addPage(array('id' => 'access-log', 'label' => ___('Access Log'), 'controller' => 'admin-users', 'action' => 'access-log', 'params' => array('user_id' => $id), 'order' => 200, 'resource' => Am_Auth_Admin::PERM_LOGS));
$event = new Am_Event_UserTabs($this, $id <= 0, (int) $id);
$event->run();
/// workaround against using the current route for generating urls
foreach (new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST) as $child) {
if ($child instanceof Zend_Navigation_Page_Mvc && $child->getRoute() === null) {
$child->setRoute('default');
}
if ($id <= 0) {
$child->set('disabled', true);
}
}
}
示例2: getTitle
public function getTitle()
{
if ($this->fn == self::FN_FREE) {
return ___('Free Access');
}
if ($this->fn == self::FN_FREE_WITHOUT_LOGIN) {
return ___('Free Access without log-in');
}
$pr = null;
if ($this->id) {
if ($this->fn == self::FN_PRODUCT) {
$pr = $this->getDi()->productTable->load($this->id, false);
} elseif ($this->fn == self::FN_CATEGORY) {
if ($this->id == self::ANY_PRODUCT) {
return ___('Any product');
} else {
$pr = $this->getDi()->productCategoryTable->load($this->id, false);
}
}
}
if (!$pr) {
return sprintf('(%s #%d)', $this->getClass(), $this->getId());
}
return sprintf('(%d) %s', $pr->pk(), $pr->title);
}
示例3: getDownloadBlockForLocale
/**
* Overload parent function. See parent for details.
*
*/
function getDownloadBlockForLocale($locale, $options = array())
{
$options['product'] = array_key_exists('product', $options) ? $options['product'] : 'thunderbird';
# Used on the sidebar only
$options['download_title'] = ___('Get Thunderbird');
return parent::getDownloadBlockForLocale($locale, $options);
}
示例4: initFromSavedForm
public function initFromSavedForm(SavedForm $record)
{
foreach ($record->getBricks() as $brick) {
$brick->insertBrick($this);
}
$this->addSubmit('_submit_', array('value' => ___('Save Profile')));
}
示例5: __construct
public function __construct(Am_Di $di, array $config)
{
$this->defaultTitle = ___("ClickBank");
$this->defaultDescription = ___("pay using credit card or PayPal");
parent::__construct($di, $config);
$di->billingPlanTable->customFields()->add(new Am_CustomFieldText('clickbank_product_id', 'ClickBank Product#', 'you have to create similar product in ClickBank and enter its number here', array()));
}
示例6: createForm
function createForm()
{
$f = new Am_Form();
$f->addHidden('s')->setValue($this->getFiltered('s'));
$f->addHidden('e')->setValue($this->getParam('e'));
$g = $f->addGroup('newsletter', array('id' => 'newsletter-group'))->setLabel(___('Untick checkbox to cancel subscription'));
$g->setSeparator("<br />\n");
$ids = $this->view->guest->getLists();
foreach ($this->lists as $l) {
$title = $l->title;
if ($l->desc) {
$title .= " - " . $l->desc;
}
$el = $g->addCheckbox($l->pk())->setContent($title);
if (in_array($l->list_id, $ids) && !$this->_request->isPost()) {
$el->setAttribute('checked');
}
// checked by default
}
if (count($this->lists) > 1) {
$f->addCheckbox('unsubscribe')->setLabel(___('Cancel all Subscriptions'));
$f->addScript()->setScript(<<<CUT
jQuery(document).ready(function(\$) {
\$("input#unsubscribe-0").change(function(){
\$("#row-newsletter-group").toggle(!this.checked);
});
});
CUT
);
}
$f->addSubmit('do', array('value' => ___('Change Subscription')));
return $f;
}
示例7: securityIni
/**
* This method does the actual security check, other security checks are done on a per call basis to this method in specific scripts.
* Improved version reduces the cost of queries by 3, I also believe that this is a more secure method.
*
* @param boolean $validate_crypt_key Set if you would like the system to verify an encryption before accepting global $_POST variables. Use with method send_crypt_key_validation in your form.
* @return string
* @author Jason Schoeman
*/
public function securityIni($validate_token = false)
{
if (isset($_SESSION['user_id'])) {
$this->_log(sprintf(___('Security check for user id %s'), $_SESSION['user_id']));
}
if ($this->configuration['system_down'] == true) {
if ($this->configuration['user_role'] == $this->configuration['root_role']) {
if ($this->configuration['system_down_bypass'] == false) {
$this->template->warning(___('System is switched off for normal users, only root can access the system.'), false, false);
}
} else {
if ($this->configuration['system_down_bypass'] == false) {
$settings_message = $this->db->getSettings(array('system_down_message'));
$this->core->skipLogin = true;
$this->core->haltController = sprintf($settings_message['system_down_message'], $this->configuration['scripts_name_version']);
}
}
}
if (!empty($_POST)) {
$this->post = $this->sqlWatchdog($_POST);
}
if (!empty($_GET)) {
$this->get = $this->sqlWatchdog($_GET);
}
if (!empty($_COOKIE)) {
$this->cookie = $this->sqlWatchdog($_COOKIE);
}
if (!empty($_SESSION)) {
$this->session = $_SESSION;
}
if (!empty($_REQUEST)) {
$this->request = array_merge((array) $this->post, (array) $this->get);
}
}
示例8: indexAction
function indexAction()
{
$this->getDi()->auth->requireLogin($this->_request->getRequestUri());
//$this->getModule()->checkAndUpdate($this->getDi()->user);
$subusers_count = $this->getDi()->user->data()->get('subusers_count');
if (empty($subusers_count)) {
throw new Am_Exception_Security(___('Resellers-only page'));
}
$this->view->headScript()->prependFile(REL_ROOT_URL . "/js.php?js=admin");
$this->view->subusers_count = $subusers_count;
$grid = Am_Grid_Editable_Subusers::factory($this->getDi()->user, $this->getRequest(), $this->view, $this->getDi());
$pending = 0;
foreach ($subusers_count as $v) {
if ($v['pending_count']) {
$pending += $v['pending_count'];
}
}
if ($pending) {
$this->view->message = ___('You have too many subusers assigned to this account. You may choose to remove %d users from your account', $pending);
} else {
if ($this->getDi()->config->get('subusers_cannot_delete') == 2) {
// no pending accounts, user cannot delete
$grid->actionDelete('delete');
}
}
$grid->runWithLayout('member/subusers.phtml');
}
示例9: chain
public function chain($item = null)
{
list($item) = self::_wrapArgs(func_get_args(), 1);
$__ = isset($this) && isset($this->_chained) && $this->_chained ? $this : ___($item);
$__->_chained = true;
return $__;
}
示例10: validate
/**
* Validate if given coupon is applicable to a customer
* @param int (optional)$user_id
* @return string|null error message or null if all OK
*/
function validate($user_id = null)
{
$batch = $this->getBatch();
if ($batch->is_disabled) {
return ___('Coupon code disabled');
}
if ($batch->use_count && $batch->use_count <= $this->used_count) {
return ___('Coupon usage limit exceeded');
}
if ($batch->user_id && $user_id && $batch->user_id != $user_id) {
return ___('This coupon belongs to another customer');
}
$tm = $this->getDi()->time;
if ($batch->begin_date && strtotime($batch->begin_date) > $tm) {
return ___('Coupon is not yet active');
}
if ($batch->expire_date && strtotime($batch->expire_date . ' 23:59:59') < $tm) {
return ___('Coupon code expired');
}
if ($batch->user_use_count && $user_id) {
$member_used_count = $this->getDi()->invoiceTable->findPaidCountByCouponId($this->coupon_id, $user_id);
if ($batch->user_use_count <= $member_used_count) {
return ___('Coupon usage limit exceeded');
}
}
return null;
}
示例11: addSaveButton
function addSaveButton($title = null)
{
if ($title === null) {
$title = ___("Save");
}
return $this->addSubmit('save', array('value' => $title));
}
示例12: _afterInitSetupForm
function _afterInitSetupForm(Am_Form_Setup $form)
{
$url = Am_Controller::escape(REL_ROOT_URL) . '/default/admin-content/p/newsletter/index';
$text = ___("Once the plugin configuration is finished on this page, do not forget to add\n" . "a record on %saMember CP -> Protect Content -> Newsletters%s page", '<a href="' . $url . '" target="_blank" class="link">', '</a>');
$form->addProlog(<<<CUT
<div class="warning_box">
{$text}
</div>
CUT
);
if ($this->canGetLists()) {
$lists = array();
try {
foreach ($this->getLists() as $k => $v) {
$lists[$k] = $v['title'];
}
} catch (Exception $e) {
//just log
$this->getDi()->errorLogTable->logException($e);
}
$gr = $form->addGroup()->setLabel(___('Unsubscribe customer from selected newsletter threads'));
$gr->addSelect('unsubscribe_after_signup')->loadOptions(array('' => ___('Please Select'), self::UNSUBSCRIBE_AFTER_ADDED => ___('After the user has been added'), self::UNSUBSCRIBE_AFTER_PAID => ___('After first payment has been completed')));
$gr->addStatic()->setContent('<br><br>');
$gr->addMagicSelect('unsubscribe_after_signup_lists')->loadOptions($lists);
}
parent::_afterInitSetupForm($form);
}
示例13: run
public function run(Am_Paysystem_Result $result)
{
$this->result = $result;
$log = $this->getInvoiceLog();
$log->add($this->request);
$this->response = $this->request->send();
$log->add($this->response);
$this->validateResponseStatus($this->result);
if ($this->result->isFailure()) {
return;
}
try {
$this->parseResponse();
// validate function must set success status
$this->validate();
if ($this->result->isSuccess()) {
$this->processValidated();
}
} catch (Exception $e) {
if ($e instanceof PHPUnit_Framework_Error) {
throw $e;
}
if ($e instanceof PHPUnit_Framework_Asser) {
throw $e;
}
if (!$result->isFailure()) {
$result->setFailed(___("Payment failed"));
}
$log->add($e);
}
}
示例14: validate
public function validate()
{
if ($this->vars['err']) {
return $this->result->setFailed(___('Payment failed'));
}
$this->result->setSuccess($this);
}
示例15: renderConfig
public function renderConfig(&$output, $grid)
{
$type = substr($grid->getId(), 1);
$url = $this->escape($this->getUrl(null, 'config-save'));
$checked1 = $checked2 = "";
if ($this->getDi()->config->get('ban.' . $type . '_action') == 'die') {
$checked2 = 'selected="selected"';
} else {
$checked1 = 'selected="selected"';
}
$text = ___("Choose action when locked %s used by customer during signup", '[' . $type . ']');
$opt1 = ___("Display error message");
$opt2 = ___("Die and show ugly error message");
$output .= <<<CUT
<br /><br />
<form method="post" action="{$url}">
{$text}
<input type="hidden" name="c" value="{$type}">
<select name="a" id="{$type}-action" onchange="this.form.submit()">
<option value="error" {$checked1}>{$opt1}</option>
<option value="die" {$checked2}>{$opt2}</option>
</select>
</form>
</script>
CUT;
}