本文整理匯總了PHP中CAppUI::tr方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAppUI::tr方法的具體用法?PHP CAppUI::tr怎麽用?PHP CAppUI::tr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CAppUI
的用法示例。
在下文中一共展示了CAppUI::tr方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CDoObjectAddEdit
/**
* Constructor
*
* @param string $className Class name
* @param int $objectKey Object key name
*/
function CDoObjectAddEdit($className, $objectKey = null)
{
if (CAppUI::conf("readonly")) {
CAppUI::stepAjax("Mode-readonly-title", UI_MSG_ERROR);
return;
}
global $m;
$this->className = $className;
$this->postRedirect = null;
$this->redirect = "m={$m}";
$this->redirectStore = null;
$this->redirectError = null;
$this->redirectDelete = null;
$this->createMsg = CAppUI::tr("{$className}-msg-create");
$this->modifyMsg = CAppUI::tr("{$className}-msg-modify");
$this->deleteMsg = CAppUI::tr("{$className}-msg-delete");
$this->request =& $_POST;
$this->_logIt = true;
// @todo : à supprimer cf déplacement dans le doBind()
$this->_obj = new $this->className();
$this->_old = new $this->className();
$this->onAfterInstanciation();
// Lancer ceci apres chaque instanciation de _obj et _old !!
$this->objectKey = $objectKey ? $objectKey : $this->_obj->_spec->key;
$this->objectKeys = $this->objectKey . "s";
}
示例2: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
if ($object->color) {
return "<div style=\"background-color: #{$object->color}; min-width:30px; height:1em; border: solid 1px #afafaf;\"></div>";
}
return CAppUI::tr("Undefined");
}
示例3: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
if ($this->class) {
return CMbString::htmlSpecialChars(CAppUI::tr($object->{$this->fieldName}));
}
return parent::getValue($object, $smarty, $params);
}
示例4: stepAjax
public function stepAjax($type = UI_MSG_WARNING)
{
$args = func_get_args();
$msg = CAppUI::tr($this->getMessage(), array_slice($args, 1));
CAppUI::$localize = false;
CAppUI::stepAjax($msg, $type);
CAppUI::$localize = true;
}
示例5: doStore
/**
* @see parent::doStore()
*/
function doStore()
{
if (isset($_FILES['attachment'])) {
$mail_id = CValue::post('mail_id');
$mail = new CUserMail();
$mail->load($mail_id);
$files = array();
foreach ($_FILES['attachment']['error'] as $key => $file_error) {
if (isset($_FILES['attachment']['name'][$key])) {
$files[] = array('name' => $_FILES['attachment']['name'][$key], 'tmp_name' => $_FILES['attachment']['tmp_name'][$key], 'error' => $_FILES['attachment']['error'][$key], 'size' => $_FILES['attachment']['size'][$key]);
}
}
foreach ($files as $_key => $_file) {
if ($_file['error'] == UPLOAD_ERR_NO_FILE) {
continue;
}
if ($_file['error'] != 0) {
CAppUI::setMsg(CAppUI::tr("CFile-msg-upload-error-" . $_file["error"]), UI_MSG_ERROR);
continue;
}
$attachment = new CMailAttachments();
$attachment->name = $_file['name'];
$content_type = mime_content_type($_file['tmp_name']);
$attachment->type = $attachment->getTypeInt($content_type);
$attachment->bytes = $_file['size'];
$attachment->mail_id = $mail_id;
$content_type = explode('/', $content_type);
$attachment->subtype = strtoupper($content_type[1]);
$attachment->disposition = 'ATTACHMENT';
$attachment->extension = substr(strrchr($attachment->name, '.'), 1);
$attachment->part = $mail->countBackRefs('mail_attachments') + 1;
$attachment->store();
$file = new CFile();
$file->setObject($attachment);
$file->author_id = CAppUI::$user->_id;
$file->file_name = $attachment->name;
$file->file_date = CMbDT::dateTime();
$file->fillFields();
$file->updateFormFields();
$file->doc_size = $attachment->bytes;
$file->file_type = mime_content_type($_file['tmp_name']);
$file->moveFile($_file, true);
if ($msg = $file->store()) {
CAppUI::setMsg(CAppUI::tr('CMailAttachments-error-upload-file') . ':' . CAppUI::tr($msg), UI_MSG_ERROR);
CApp::rip();
}
$attachment->file_id = $file->_id;
if ($msg = $attachment->store()) {
CAppUI::setMsg($msg, UI_MSG_ERROR);
CApp::rip();
}
}
CAppUI::setMsg('CMailAttachments-msg-added', UI_MSG_OK);
} else {
parent::doStore();
}
}
示例6: getCommentError
/**
* get the comment error
*
* @return string
*/
function getCommentError()
{
$comment_error = CAppUI::tr("CHPrimSanteEvent-{$this->sous_type}-{$this->type}-{$this->code_error}");
if ($this->comment) {
$comment_error .= " : {$this->comment}";
}
$comment_error = str_replace("\r", "", $comment_error);
return $comment_error;
}
示例7: updateFormFields
/**
* @see parent::updateFormFields()
*/
function updateFormFields()
{
parent::updateFormFields();
$this->_value = $this->value;
if (array_key_exists($this->type, self::$_style_values)) {
$this->_value = CAppUI::tr("{$this->_class}.value.{$this->type}.{$this->value}");
}
$this->_view = $this->getFormattedValue("type") . ": {$this->value}";
}
示例8: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
$fieldName = $this->fieldName;
$propValue = $this->getListValues($object->{$fieldName});
$ret = array();
foreach ($propValue as $_value) {
$ret[] = CMbString::htmlSpecialChars(CAppUI::tr("{$object->_class}.{$fieldName}.{$_value}"));
}
return implode(", ", $ret);
}
示例9: storeObject
/**
* Fonction utilitaire pour la sauvegarde rapide d'un object avec génération du message
*
* @param CMbObject $object Objet à enregister
*
* @return void
*/
function storeObject($object)
{
$title = $object->_id ? "-msg-modify" : "-msg-create";
if ($msg = $object->store()) {
CAppUI::setMsg($msg, UI_MSG_ERROR);
echo CAppUI::getMsg();
CApp::rip();
}
CAppUI::setMsg(CAppUI::tr(get_class($object) . $title), UI_MSG_OK);
}
示例10: dispatch
/**
* Dispatch message
*
* @param string $data Data
* @param CInteropSender $actor Actor data
* @param int $exchange_id Identifier exchange
* @param bool $to_treatment Treat the exchange
*
* @return string Dispatch response
*/
static function dispatch($data, CInteropSender $actor = null, $exchange_id = null, $to_treatment = true)
{
$contexts = null;
// Dicom a besoin des contextes de présentation afin de pouvoir déchiffrer le message
if (is_array($data)) {
$contexts = $data["pres_contexts"];
$data = $data["msg"];
}
if (substr($data, 0, 3) === "") {
$data = substr($data, 3);
}
if ($actor && isset($actor->_configs["encoding"]) && $actor->_configs["encoding"] == "UTF-8") {
$data = utf8_decode($data);
}
self::$errors = array();
// Accepte t-on des utilisateurs acteurs non enregistrés ?
if (!$actor) {
CEAIDispatcher::$errors[] = CAppUI::tr("CEAIDispatcher-no_actor");
return self::dispatchError($data, $actor);
}
// est-ce que je comprend la famille de messages ?
/** @var CExchangeDataFormat $data_format */
if (($data_format = self::understand($data, $actor, $contexts)) === null) {
self::$errors[] = CAppUI::tr("CEAIDispatcher-no_understand");
return self::dispatchError($data, $actor);
}
// est-ce que je supporte cette famille de messages ?
$supported = false;
$family_message_class = !$data_format->_family_message_class ? get_class($data_format->_family_message) : $data_format->_family_message_class;
$msg_supported_classes = $data_format->getMessagesSupported($actor->_guid, false, null, true);
foreach ($msg_supported_classes as $_msg_supported_class => $_msg_supported) {
if ($family_message_class == $_msg_supported_class) {
$supported = true;
}
}
if (!$supported) {
self::$errors[] = CAppUI::tr("CEAIDispatcher-_family_message_no_supported_for_this_actor", $family_message_class);
return self::dispatchError($data, $actor);
}
$actor->_data_format = $data_format;
$data_format->sender_id = $actor->_id;
$data_format->sender_class = $actor->_class;
$data_format->group_id = $actor->group_id;
$data_format->_ref_sender = $actor;
$data_format->_message = $data;
$data_format->_exchange_id = $exchange_id;
$data_format->_to_treatment = $to_treatment;
// Traitement par le handler du format
try {
return $data_format->handle();
} catch (CMbException $e) {
self::$errors[] = $e->getMessage();
return self::dispatchError($data, $actor);
}
}
示例11: viewMsg
/**
* $Id$
*
* @package Mediboard
* @subpackage Urgences
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
function viewMsg($msg, $action, $txt = "")
{
global $m, $tab;
$action = CAppUI::tr($action);
if ($msg) {
CAppUI::setMsg("{$action}: {$msg}", UI_MSG_ERROR);
CAppUI::redirect("m={$m}&tab={$tab}");
return;
}
CAppUI::setMsg("{$action} {$txt}", UI_MSG_OK);
}
示例12: storeObject
/**
* Fonction utilitaire pour la sauvegarde rapide d'un object avec génération du message
*
* @param CMbObject $object Objet à enregister
*
* @return void
*/
function storeObject($object)
{
$title = $object->_id ? "-msg-modify" : "-msg-create";
if ($msg = $object->store()) {
CAppUI::setMsg($msg, UI_MSG_ERROR);
echo CAppUI::getMsg();
// Il peut y avoir un msg de retour postérieur à la création de l'objet
// On continue donc le processus de création de la naissance
//CApp::rip();
}
CAppUI::setMsg(CAppUI::tr(get_class($object) . $title), UI_MSG_OK);
}
示例13: canDeleteEx
function canDeleteEx()
{
$query = "SELECT COUNT(DISTINCT repas.repas_id) AS number\r\n FROM repas WHERE (`{$this->type}` IS NOT NULL AND `{$this->type}` = '{$this->plat_id}')";
$obj = null;
if (!$this->_spec->ds->loadObject($query, $obj)) {
return $this->_spec->ds->error();
}
if ($obj->number) {
return CAppUI::tr("CMbObject-msg-nodelete-backrefs") . ": " . $obj->number . " repas";
}
return null;
}
示例14: updateFormFields
/**
* @see parent::updateFormFields()
*/
function updateFormFields()
{
parent::updateFormFields();
$this->_view = $this->loadRefUser()->_view . " - ";
$params = $this->getParams();
if (isset($params["m"])) {
$module = $params["m"];
$this->_view .= CAppUI::tr("module-{$module}-court");
if (isset($params["a"])) {
$action = $params["a"];
$this->_view .= " - " . CAppUI::tr("mod-{$module}-tab-{$action}");
}
}
}
示例15: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
if ($smarty) {
include_once $smarty->_get_plugin_filepath('modifier', 'date_format');
}
$propValue = $object->{$this->fieldName};
$format = CMbArray::extract($params, "format", CAppUI::conf("datetime"));
if ($format === "relative") {
$relative = CMbDate::relative($propValue, CMbDT::dateTime());
return $relative["count"] . " " . CAppUI::tr($relative["unit"] . ($relative["count"] > 1 ? "s" : ""));
}
$date = CMbArray::extract($params, "date");
if ($date && CMbDT::date($propValue) == $date) {
$format = CAppUI::conf("time");
}
return $propValue && $propValue != "0000-00-00 00:00:00" ? smarty_modifier_date_format($propValue, $format) : "";
}