当前位置: 首页>>代码示例>>PHP>>正文


PHP _N函数代码示例

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


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

示例1: pdfForItem

 static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item)
 {
     global $DB, $CFG_GLPIG;
     if (!Session::haveRight("contract", "r")) {
         return false;
     }
     $type = $item->getType();
     $ID = $item->getField('id');
     $con = new Contract();
     $query = "SELECT *\n                FROM `glpi_contracts_items`\n                WHERE `glpi_contracts_items`.`items_id` = '" . $ID . "'\n                      AND `glpi_contracts_items`.`itemtype` = '" . $type . "'";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     $i = $j = 0;
     $pdf->setColumnsSize(100);
     if ($number > 0) {
         $pdf->displayTitle('<b>' . _N('Associated contract', 'Associated contracts', 2) . '</b>');
         $pdf->setColumnsSize(19, 19, 19, 16, 11, 16);
         $pdf->displayTitle(__('Name'), _x('phone', 'Number'), __('Contract type'), __('Supplier'), __('Start date'), __('Initial contract period'));
         $i++;
         while ($j < $number) {
             $cID = $DB->result($result, $j, "contracts_id");
             $assocID = $DB->result($result, $j, "id");
             if ($con->getFromDB($cID)) {
                 $pdf->displayLine(empty($con->fields["name"]) ? "(" . $con->fields["id"] . ")" : $con->fields["name"], $con->fields["num"], Html::clean(Dropdown::getDropdownName("glpi_contracttypes", $con->fields["contracttypes_id"])), str_replace("<br>", " ", $con->getSuppliersNames()), Html::convDate($con->fields["begin_date"]), sprintf(_n('%d month', '%d months', $con->fields["duration"]), $con->fields["duration"]));
             }
             $j++;
         }
     } else {
         $pdf->displayTitle("<b>" . __('No item found') . "</b>");
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:32,代码来源:contract_item.class.php

示例2: sprintf

</h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="enable-confirm">
        <?php 
echo sprintf(__('Are you sure you want to <b>enable</b> %s?'), _N('selected site page', 'selected site pages', 2));
?>
    </p>
    <p class="confirm-action" style="display:none;" id="disable-confirm">
        <?php 
echo sprintf(__('Are you sure you want to <b>disable</b> %s?'), _N('selected site page', 'selected site pages', 2));
?>
    </p>
    <p class="confirm-action" style="display:none;" id="delete-confirm">
        <font color="red"><strong><?php 
echo sprintf(__('Are you sure you want to DELETE %s?'), _N('selected site page', 'selected site pages', 2));
?>
</strong></font>
        <br><br><?php 
echo __('Deleted data CANNOT be recovered.');
?>
    </p>
    <div><?php 
echo __('Please confirm to continue.');
?>
</div>
    <hr style="margin-top:1em"/>
    <p class="full-width">
        <span class="buttons pull-left">
            <input type="button" value="No, Cancel" class="close">
        </span>
开发者ID:gizur,项目名称:osticket,代码行数:31,代码来源:pages.inc.php

示例3: sprintf

</h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="enable-confirm">
        <?php 
echo sprintf(__('Are you sure you want to <b>enable</b> %s?'), _N('selected canned response', 'selected canned responses', 2));
?>
    </p>
    <p class="confirm-action" style="display:none;" id="disable-confirm">
        <?php 
echo sprintf(__('Are you sure you want to <b>disable</b> %s?'), _N('selected canned response', 'selected canned responses', 2));
?>
    </p>
    <p class="confirm-action" style="display:none;" id="delete-confirm">
        <font color="red"><strong><?php 
echo sprintf(__('Are you sure you want to DELETE %s?'), _N('selected canned response', 'selected canned responses', 2));
?>
</strong></font>
        <br><br><?php 
echo __('Deleted data CANNOT be recovered, including any associated attachments.');
?>
    </p>
    <div><?php 
echo __('Please confirm to continue.');
?>
</div>
    <hr style="margin-top:1em"/>
    <p class="full-width">
        <span class="buttons pull-left">
            <input type="button" value="<?php 
echo __('No, Cancel');
开发者ID:gizur,项目名称:osticket,代码行数:31,代码来源:cannedresponses.inc.php

示例4: __

<div style="display:none;" class="dialog" id="confirm-action">
    <h3><?php echo __('Please Confirm');?></h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="make_public-confirm">
        <?php echo sprintf(__('Are you sure you want to make %s <b>public</b>?'),
            _N('selected department', 'selected departments', 2));?>
    </p>
    <p class="confirm-action" style="display:none;" id="make_private-confirm">
        <?php echo sprintf(__('Are you sure you want to make %s <b>private</b> (internal)?'),
            _N('selected department', 'selected departments', 2));?>
    </p>
    <p class="confirm-action" style="display:none;" id="delete-confirm">
        <font color="red"><strong><?php echo sprintf(__('Are you sure you want to DELETE %s?'),
            _N('selected department', 'selected departments', 2));?></strong></font>
        <br><br><?php echo __('Deleted data CANNOT be recovered.'); ?>
    </p>
    <div><?php echo __('Please confirm to continue.');?></div>
    <hr style="margin-top:1em"/>
    <p class="full-width">
        <span class="buttons pull-left">
            <input type="button" value="<?php echo __('No, Cancel');?>" class="close">
        </span>
        <span class="buttons pull-right">
            <input type="button" value="<?php echo __('Yes, Do it!');?>" class="confirm">
        </span>
     </p>
    <div class="clear"></div>
</div>
开发者ID:KingsleyGU,项目名称:osticket,代码行数:29,代码来源:departments.inc.php

示例5: __

echo __('Delete');
?>
">
</p>
</form>

<div style="display:none;" class="dialog" id="confirm-action">
    <h3><?php 
echo __('Please Confirm');
?>
</h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="delete-confirm">
        <font color="red"><strong><?php 
echo sprintf(__('Are you sure you want to DELETE %s?'), _N('selected custom list', 'selected custom lists', 2));
?>
</strong></font>
        <br><br><?php 
echo __('Deleted data CANNOT be recovered.');
?>
    </p>
    <div><?php 
echo __('Please confirm to continue.');
?>
</div>
    <hr style="margin-top:1em"/>
    <p class="full-width">
        <span class="buttons pull-left">
            <input type="button" value="No, Cancel" class="close">
        </span>
开发者ID:dmiguel92,项目名称:osTicket-1.8,代码行数:31,代码来源:dynamic-lists.inc.php

示例6: count

         } else {
             $count = count($_POST['ids']);
             switch (strtolower($_POST['a'])) {
                 case 'delete':
                     $i = 0;
                     foreach ($_POST['ids'] as $k => $v) {
                         if (($t = DynamicForm::lookup($v)) && $t->delete()) {
                             $i++;
                         }
                     }
                     if ($i && $i == $count) {
                         $msg = sprintf(__('Successfully deleted %s'), _N('selected custom form', 'selected custom forms', $count));
                     } elseif ($i > 0) {
                         $warn = sprintf(__('%1$d of %1$d %3$s deleted'), $i, $count, _N('selected custom form', 'selected custom forms', $count));
                     } elseif (!$errors['err']) {
                         $errors['err'] = sprintf(__('Unable to delete %s'), _N('selected custom form', 'selected custom forms', $count));
                     }
                     break;
             }
         }
         break;
 }
 if ($form) {
     for ($i = 0; isset($_POST["sort-new-{$i}"]); $i++) {
         if (!$_POST["label-new-{$i}"]) {
             continue;
         }
         $field = DynamicFormField::create(array('sort' => $_POST["sort-new-{$i}"] ? $_POST["sort-new-{$i}"] : ++$max_sort, 'label' => $_POST["label-new-{$i}"], 'type' => $_POST["type-new-{$i}"], 'name' => trim($_POST["name-new-{$i}"])));
         $field->setRequirementMode($_POST["visibility-new-{$i}"]);
         $field->setForm($form);
         if (in_array($field->get('name'), $names)) {
开发者ID:tirix,项目名称:osTicket-1.8,代码行数:31,代码来源:forms.php

示例7: sprintf

echo sprintf(__('Are you sure you want to DELETE %s?'), _N('selected plugin', 'selected plugins', 2));
?>
</strong></font>
        <br><br><?php 
echo __('Configuration for deleted plugins CANNOT be recovered.');
?>
    </p>
    <p class="confirm-action" style="display:none;" id="enable-confirm">
        <font color="green"><?php 
echo sprintf(__('Are you sure you want to <b>enable</b> %s?'), _N('selected plugin', 'selected plugins', 2));
?>
</font>
    </p>
    <p class="confirm-action" style="display:none;" id="disable-confirm">
        <font color="red"><?php 
echo sprintf(__('Are you sure you want to <b>disable</b> %s?'), _N('selected plugin', 'selected plugins', 2));
?>
</font>
    </p>
    <div><?php 
echo __('Please confirm to continue.');
?>
</div>
    <hr style="margin-top:1em"/>
    <p class="full-width">
        <span class="buttons pull-left">
            <input type="button" value="<?php 
echo __('No, Cancel');
?>
" class="close">
        </span>
开发者ID:gizur,项目名称:osticket,代码行数:31,代码来源:plugins.inc.php

示例8: __

    echo '<div>&nbsp;'.__('Page').':'.$pageNav->getPageLinks().'&nbsp;</div>';
?>

<p class="centered" id="actions">
    <input class="button" type="submit" name="delete" value="<?php echo __('Delete'); ?>">
</p>
</form>

<div style="display:none;" class="dialog" id="confirm-action">
    <h3><?php echo __('Please Confirm'); ?></h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="delete-confirm">
        <font color="red"><strong><?php echo sprintf(
        __('Are you sure you want to DELETE %s?'),
        _N('selected custom list', 'selected custom lists', 2)); ?></strong></font>
        <br><br><?php echo __('Deleted data CANNOT be recovered.'); ?>
    </p>
    <div><?php echo __('Please confirm to continue.'); ?></div>
    <hr style="margin-top:1em"/>
    <p class="full-width">
        <span class="buttons pull-left">
            <input type="button" value="No, Cancel" class="close">
        </span>
        <span class="buttons pull-right">
            <input type="button" value="Yes, Do it!" class="confirm">
        </span>
    </p>
    <div class="clear"></div>
</div>
开发者ID:KingsleyGU,项目名称:osticket,代码行数:30,代码来源:dynamic-lists.inc.php

示例9: sprintf

}
?>
    </table>
    <div class="clear"></div>
    <hr>
    <form method="post" class="user"
        action="#users/<?php echo $user->getId(); ?>/delete">
        <input type="hidden" name="id" value="<?php echo $user->getId(); ?>" />

    <?php
    if (($num=$user->tickets->count())) {
        echo '<div><input type="checkbox" name="deletetickets" value="1" > <strong>'
            .sprintf(__('Delete %1$s %2$s %3$s and any associated attachments and data.'),
                sprintf('<a href="tickets.php?a=search&uid=%d" target="_blank">',
                    $user->getId()),
                sprintf(_N('one ticket', '%d tickets', $num), $num),
                '</a>'
            )
            .'</strong></div><hr>';
    }
    ?>
        <p class="full-width">
        <span class="buttons pull-left">
            <input type="reset" value="<?php echo __('Reset'); ?>">
            <input type="button" name="cancel" class="close"
                value="<?php echo __('No, Cancel'); ?>">
        </span>
        <span class="buttons pull-right">
            <input type="submit" value="<?php echo __('Yes, Delete User'); ?>">
        </span>
        </p>
开发者ID:KingsleyGU,项目名称:osticket,代码行数:31,代码来源:user-delete.tmpl.php

示例10: switch

                switch(strtolower($_POST['a'])) {
                    case 'delete':
                        $i=0;
                        foreach($_POST['ids'] as $k=>$v) {
                            if(($t=DynamicList::lookup($v)) && $t->delete())
                                $i++;
                        }
                        if ($i && $i==$count)
                            $msg = sprintf(__('Successfully deleted %s'),
                                _N('selected custom list', 'selected custom lists', $count));
                        elseif ($i > 0)
                            $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count,
                                _N('selected custom list', 'selected custom lists', $count));
                        elseif (!$errors['err'])
                            $errors['err'] = sprintf(__('Unable to delete %s — they may be in use on a custom form'),
                                _N('selected custom list', 'selected custom lists', $count));
                        break;
                }
            }
            break;
    }

    if ($list && $list->allowAdd()) {
        for ($i=0; isset($_POST["sort-new-$i"]); $i++) {
            if (!$_POST["value-new-$i"])
                continue;

            $list->addItem(array(
                        'value' => $_POST["value-new-$i"],
                        'abbrev' =>$_POST["abbrev-new-$i"],
                        'sort' => $_POST["sort-new-$i"] ?: ++$max_isort,
开发者ID:KingsleyGU,项目名称:osticket,代码行数:31,代码来源:lists.php

示例11: sprintf

                        } else {
                            $errors['err'] = sprintf(__('Unable to disable %s'), _N('selected team', 'selected teams', $count));
                        }
                        break;
                    case 'delete':
                        foreach ($_POST['ids'] as $k => $v) {
                            if (($t = Team::lookup($v)) && $t->delete()) {
                                $i++;
                            }
                        }
                        if ($i && $i == $count) {
                            $msg = sprintf(__('Successfully deleted %s'), _N('selected team', 'selected teams', $count));
                        } elseif ($i > 0) {
                            $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected team', 'selected teams', $count));
                        } elseif (!$errors['err']) {
                            $errors['err'] = sprintf(__('Unable to delete %s'), _N('selected team', 'selected teams', $count));
                        }
                        break;
                    default:
                        $errors['err'] = __('Unknown action - get technical help.');
                }
            }
            break;
        default:
            $errors['err'] = __('Unknown action');
            break;
    }
}
$page = 'teams.inc.php';
$tip_namespace = 'staff.team';
if ($team || $_REQUEST['a'] && !strcasecmp($_REQUEST['a'], 'add')) {
开发者ID:dmiguel92,项目名称:osTicket-1.8,代码行数:31,代码来源:teams.php

示例12: switch

                switch(strtolower($_POST['a'])) {
                    case 'delete':
                        $i=0;
                        foreach($_POST['ids'] as $k=>$v) {
                            if(($t=DynamicForm::lookup($v)) && $t->delete())
                                $i++;
                        }
                        if ($i && $i==$count)
                            $msg = sprintf(__('Successfully deleted %s'),
                                _N('selected custom form', 'selected custom forms', $count));
                        elseif ($i > 0)
                            $warn = sprintf(__('%1$d of %1$d %3$s deleted'), $i, $count,
                                _N('selected custom form', 'selected custom forms', $count));
                        elseif (!$errors['err'])
                            $errors['err'] = sprintf(__('Unable to delete %s'),
                                _N('selected custom form', 'selected custom forms', $count));
                        break;
                }
            }
            break;
    }

    if ($form) {
        for ($i=0; isset($_POST["sort-new-$i"]); $i++) {
            if (!$_POST["label-new-$i"])
                continue;
            $field = DynamicFormField::create(array(
                'sort'=>$_POST["sort-new-$i"] ? $_POST["sort-new-$i"] : ++$max_sort,
                'label'=>$_POST["label-new-$i"],
                'type'=>$_POST["type-new-$i"],
                'name'=>trim($_POST["name-new-$i"]),
开发者ID:KingsleyGU,项目名称:osticket,代码行数:31,代码来源:forms.php

示例13: __

    ?>
</form>
<?php 
}
?>

<div style="display:none;" class="dialog" id="confirm-action">
    <h3><?php 
echo __('Please Confirm');
?>
</h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="remove-users-confirm">
        <?php 
echo sprintf(__('Are you sure you want to <b>REMOVE</b> %1$s from <strong>%2$s</strong>?'), _N('selected user', 'selected users', 2), $org->getName());
?>
    </p>
    <div><?php 
echo __('Please confirm to continue.');
?>
</div>
    <hr style="margin-top:1em"/>
    <p class="full-width">
        <span class="buttons pull-left">
            <input type="button" value="<?php 
echo __('No, Cancel');
?>
" class="close">
        </span>
        <span class="buttons pull-right">
开发者ID:dmiguel92,项目名称:osTicket-1.8,代码行数:31,代码来源:users.tmpl.php

示例14: __

 </thead>
 <tbody>
     <tr>
         <th colspan="2">
             <em><b><?php echo __('Agent Authentication Settings'); ?></b></em>
         </th>
     </tr>
     <tr><td><?php echo __('Password Expiration Policy'); ?>:</th>
         <td>
             <select name="passwd_reset_period">
                <option value="0"> &mdash; <?php echo __('No expiration'); ?> &mdash;</option>
               <?php
                 for ($i = 1; $i <= 12; $i++) {
                     echo sprintf('<option value="%d" %s>%s</option>',
                             $i,(($config['passwd_reset_period']==$i)?'selected="selected"':''),
                             sprintf(_N('Monthly', 'Every %d months', $i), $i));
                 }
                 ?>
             </select>
             <font class="error"><?php echo $errors['passwd_reset_period']; ?></font>
             <i class="help-tip icon-question-sign" href="#password_expiration_policy"></i>
         </td>
     </tr>
     <tr><td><?php echo __('Allow Password Resets'); ?>:</th>
         <td>
           <input type="checkbox" name="allow_pw_reset" <?php echo $config['allow_pw_reset']?'checked="checked"':''; ?>>
           &nbsp;<i class="help-tip icon-question-sign" href="#allow_password_resets"></i>
         </td>
     </tr>
     <tr><td><?php echo __('Reset Token Expiration'); ?>:</th>
         <td>
开发者ID:KingsleyGU,项目名称:osticket,代码行数:31,代码来源:settings-access.inc.php

示例15: authstrike

 function authstrike($credentials)
 {
     global $ost;
     $cfg = $ost->getConfig();
     $authsession =& $_SESSION['_auth']['staff'];
     $username = $credentials['username'];
     $authsession['strikes'] += 1;
     if ($authsession['strikes'] > $cfg->getStaffMaxLogins()) {
         $authsession['laststrike'] = time();
         $timeout = $cfg->getStaffLoginTimeout() / 60;
         $alert = _S('Excessive login attempts by an agent?') . "\n" . _S('Username') . ": {$username}\n" . _S('IP') . ": {$_SERVER['REMOTE_ADDR']}\n" . _S('Time') . ": " . date('M j, Y, g:i a T') . "\n\n" . _S('Attempts') . ": {$authsession['strikes']}\n" . _S('Timeout') . ": " . sprintf(_N('%d minute', '%d minutes', $timeout), $timeout) . "\n\n";
         $ost->logWarning(sprintf(_S('Excessive login attempts (%s)'), $username), $alert, $cfg->alertONLoginError());
         return new AccessDenied(__('Forgot your login info? Contact Admin.'));
         //Log every other third failed login attempt as a warning.
     } elseif ($authsession['strikes'] % 3 == 0) {
         $alert = _S('Username') . ": {$username}\n" . _S('IP') . ": {$_SERVER['REMOTE_ADDR']}\n" . _S('Time') . ": " . date('M j, Y, g:i a T') . "\n\n" . _S('Attempts') . ": {$authsession['strikes']}";
         $ost->logWarning(sprintf(_S('Failed agent login attempt (%s)'), $username), $alert, false);
     }
 }
开发者ID:KingsleyGU,项目名称:osticket,代码行数:19,代码来源:class.auth.php


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