當前位置: 首頁>>代碼示例>>PHP>>正文


PHP I18n::export方法代碼示例

本文整理匯總了PHP中I18n::export方法的典型用法代碼示例。如果您正苦於以下問題:PHP I18n::export方法的具體用法?PHP I18n::export怎麽用?PHP I18n::export使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在I18n的用法示例。


在下文中一共展示了I18n::export方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 *         field: '#images',
 *         preview: '#preview'
 *     });
 *
 * This helper stores the list of images in the following format
 * in the input field, so you can easily split them into an array:
 *
 *     /files/file1.jpg|/files/file2.jpg|/files/file3.png
 *
 * Options:
 *
 * - field:   The selector of an input field to update with the list.
 * - preview: The selector of an element to use to contain the list preview.
 */

echo $this->run ('filemanager/util/browser');

$page->add_style ('/apps/filemanager/css/multi-image.css');
$page->add_script (
	sprintf (
		'<script>var filemanager_path = "%s";</script>',
		conf('Paths','filemanager_path')
	)
);
$page->add_script ('/js/jquery-ui/jquery-ui.min.js');
$page->add_script ('/apps/filemanager/js/jquery.multi-image.js');
$page->add_script (I18n::export (
	'Click to remove, drag to re-order',
	'Browse images'
));
開發者ID:R-J,項目名稱:elefant,代碼行數:30,代碼來源:multi-image.php

示例2: conf

 *
 *      $.filebrowser ({
 *          allowed: ['jpg', 'jpeg', 'png', 'gif'],
 *          set_value: '#field-id',
 *          title: 'Choose an image',
 *          thumbs: true,
 *          callback: function (file) {
 *              console.log ('You chose: '  + file);
 *          }
 *     });
 *
 * Options:
 *
 * - `allowed`   - An array of allowed file extensions.
 * - `callback`  - A function to call with the chosen file link.
 * - `set_value` - The selector of an input field to update with the
 *   chosen file link.
 * - `thumbs`    - Whether to show thumbnails instead of file names.
 *   Note: also automatically sets allowed list to jpeg, png, and
 *   gif formats so you don't have to set allowed explicitly.
 * - `title`     - A custom title for the dialog window.
 */
echo $this->run('admin/util/modal');
$page->add_style('/apps/filemanager/css/filebrowser.css');
$page->add_script(sprintf('<script>var filemanager_path = "%s", filemanager_upload = %d;</script>', conf('Paths', 'filemanager_path'), (int) User::require_acl('admin', 'filemanager')));
$page->add_script('/apps/filemanager/js/jquery.filedrop.js');
$page->add_script('/apps/filemanager/js/filemanager.js');
$page->add_script('/apps/filemanager/js/jquery.filebrowser.js');
$page->add_script(sprintf('<script>var filebrowser_max_filesize = %s;</script>', (int) ini_get('upload_max_filesize')));
$page->add_script(I18n::export(array('Choose a file', 'New file', 'Please upload one of the following file types', 'Your browser does not support drag and drop file uploads.', 'Please upload fewer files at a time.', 'The following file is too large to upload', 'Uploading...', 'Select')));
開發者ID:Selwyn-b,項目名稱:elefant,代碼行數:30,代碼來源:browser.php

示例3: array

    $o->parts = array();
    $o->lastpath = '';
    foreach ($tmp as $part) {
        $joined .= $sep . $part;
        $sep = '/';
        $o->parts[$part] = $joined;
        $o->lastpath = $part;
    }
    $page->window_title = __('Files') . '/' . $o->path;
} else {
    $o->path = '';
    $o->fullpath = $root;
    $o->parts = array();
    $o->lastpath = '';
    $page->window_title = __('Files');
}
if ($appconf['General']['aviary_key']) {
    $page->add_script('https://dme0ih8comzn4.cloudfront.net/imaging/v1/editor.js');
    $o->aviary_key = $appconf['General']['aviary_key'];
} else {
    $o->aviary_key = false;
}
$page->add_style('/apps/filemanager/css/filemanager.css');
$page->add_script(sprintf('<script>var conf_root = "%s";</script>', conf('Paths', 'filemanager_path')));
$page->add_script('/js/jquery-ui/jquery-ui.min.js');
$page->add_script('/js/urlify.js');
$page->add_script('/apps/filemanager/js/jquery.filedrop.js');
$page->add_script('/apps/filemanager/js/jquery.tmpl.beta1.min.js');
$page->add_script('/apps/filemanager/js/jquery.filemanager.js');
$page->add_script(I18n::export('New folder name:', 'Rename:', 'Are you sure you want to delete this file?', 'Are you sure you want to delete this folder and all of its contents?', 'Your browser does not support drag and drop file uploads.', 'Please upload fewer files at a time.', 'The following file is too large to upload'));
echo $tpl->render('filemanager/index', $o);
開發者ID:Selwyn-b,項目名稱:elefant,代碼行數:31,代碼來源:index.php

示例4:

 *
 *      {! admin/util/dynamicobjects !}
 *
 * ### 2. Use the `$.dynamicobjects()` function to open the dialog window:
 *
 *      $.dynamicobjects ({
 *          set_value: '#field-id',
 *          callback: function (embed_code, handler, params, label) {
 *              console.log (embed_code);
 *              console.log (handler);
 *              console.log (params);
 *              console.log (label);
 *          }
 *     });
 *
 * Options:
 *
 * - `callback` - A function to call with the resulting embed code.
 * - `set_value` - The selector of an input field to update with the
 *   resulting embed code.
 * - `current` - Current embed code, for updating existing values.
 */
$this->run('admin/util/fontawesome');
$this->run('admin/util/modal');
$this->run('filemanager/util/browser');
$page->add_style('/apps/admin/css/dynamicobjects.css');
$page->add_script('/js/jquery.verify_values.js');
$page->add_script('/js/jquery.quickpager.js');
$page->add_script('/apps/admin/js/jquery.dynamicobjects.js');
$page->add_script(I18n::export('Dynamic Objects', 'Unable to load the dynamic object list. Please try again in a few seconds.', 'Embed', 'Back'));
開發者ID:Selwyn-b,項目名稱:elefant,代碼行數:30,代碼來源:dynamicobjects.php

示例5:

 * ### 2. User the `$.userchooser()` function to open the dialog window:
 *
 *     $.userchooser ({
 *         set_id_value: '#field-id',
 *         set_name_value: '#display-name',
 *         callback: function (id, name, email) {
 *             console.log (id);
 *             console.log (name);
 *             console.log (email);
 *         }
 *     });
 *
 * Options:
 *
 * - `callback`        - A function to call with the user id, name, and email.
 * - `chosen`          - A list of users that shouldn't be selectable.
 * - `chosen_visible`  - Whether to display the disabled chosen users or hide them.
 * - `set_id_value`    - The selector of an input or element to update with the user id.
 * - `set_name_value`  - The selector of an input or element to update with the user name.
 * - `set_email_value` - The selector of an input or element to update with the user email.
 * - `set_mailto`      - The selector of a link to set the mailto: value for.
 */
$this->run('admin/util/fontawesome');
$this->run('admin/util/modal');
$page->add_style('/apps/user/css/userchooser.css');
$page->add_script('/js/jquery.quickpager.js');
$page->add_script('/js/jquery.verify_values.js');
$page->add_script('/apps/user/js/jquery.adduser.js');
$page->add_script('/apps/user/js/jquery.userchooser.js');
$page->add_script(I18n::export('Add Member', 'Choose a Member', 'Search', 'Unable to load the member list. Please try again in a few seconds.'));
開發者ID:Selwyn-b,項目名稱:elefant,代碼行數:30,代碼來源:userchooser.php

示例6: elseif

<?php

/**
 * Outputs the admin toolbar if the user is an admin,
 * otherwise simply loads jQuery for other scripts that
 * may rely on it.
 */
if ($appconf['Scripts']['jquery_source'] === 'local') {
    $page->add_script('/js/jquery-1.8.3.min.js');
} elseif ($appconf['Scripts']['jquery_source'] === 'google') {
    $page->add_script('<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>');
} else {
    $page->add_script('<script src="' . $appconf['Scripts']['jquery_source'] . '"></script>');
}
if (User::require_admin() && $page->preview == false) {
    $page->add_style('/apps/admin/css/jquery.jgrowl.css');
    $page->add_style('/apps/admin/css/modal.css');
    $page->add_style(Product::toolbar_stylesheet());
    $page->add_script("<script>\$(function(){\$.elefant_version='" . ELEFANT_VERSION . "';});</script>\n");
    $page->add_script("<script>\$(function(){\$.elefant_updates=" . (int) conf('General', 'check_for_updates') . ";});</script>\n");
    $page->add_script('/apps/admin/js/modal.js');
    $page->add_script('/apps/admin/js/jquery.jgrowl.min.js');
    $page->add_script('/apps/admin/js/jquery.triggers.js');
    $page->add_script('/js/jquery.cookie.js');
    $page->add_script('/apps/admin/js/jquery.i18n.js');
    $page->add_script('/apps/admin/js/top-bar.js');
    $page->add_script(I18n::export('List keyboard shortcuts', 'Keyboard shortcuts'));
}
開發者ID:R-J,項目名稱:elefant,代碼行數:28,代碼來源:head.php

示例7:

 *         preview: '#preview'
 *     });
 *
 * This helper stores the list of files in the following format
 * in the input field, so you can easily split them into an array:
 *
 *     /files/file1.txt|/files/file2.doc|/files/file3.txt
 *
 * Options:
 *
 * - field:   The selector of an input field to update with the list.
 * - preview: The selector of an element to use to contain the list preview.
 */

echo $this->run ('filemanager/util/browser');
echo $this->run ('admin/util/fontawesome');

$page->add_style ('/apps/filemanager/css/multi-file.css');
$page->add_script (
	sprintf (
		'<script>var filemanager_path = "%s";</script>',
		conf('Paths','filemanager_path')
	)
);
$page->add_script ('/js/jquery-ui/jquery-ui.min.js');
$page->add_script ('/apps/filemanager/js/jquery.multi-file.js');
$page->add_script (I18n::export (
	'Click to remove',
	'Browse files'
));
開發者ID:R-J,項目名稱:elefant,代碼行數:30,代碼來源:multi-file.php

示例8:

 *     
 *     if ($_POST['type'] === 'select') {
 *         echo Template::sanitize ($_POST['label']);
 *         return;
 *     }
 *     echo Template::sanitize ($_POST['value']);
 *
 * To send an error message, use the following code:
 *
 *     $this->add_notification (__ ('Unable to save changes.'));
 *     echo $this->error (500, 'Error message');
 *     return;
 *
 * To add a notification upon successful requests, you can also use the
 * [[Controller]]'s `add_notification()` method:
 *
 *     $this->add_notification (__ ('Changes saved.'));
 *     echo Template::sanitize ($_POST['value']);
 */
$this->run('admin/util/i18n');
$page->add_style('/apps/admin/css/editable.css');
$page->add_script('/apps/admin/js/jquery.autogrow.min.js');
$page->add_script('/apps/admin/js/jquery.jeditable.min.js');
$page->add_script('/apps/admin/js/jquery.jeditable.autogrow.js');
$page->add_script('/apps/admin/js/editable.js');
$page->add_script('/apps/admin/js/jquery.jeditable.deletable.js');
if (isset($data['url'])) {
    $page->add_script('<script>var editable_default_url = \'' . $data['url'] . '\';</script>');
}
$page->add_script(I18n::export('Saving...', 'Cancel', 'Save', 'Delete', 'Click to edit', 'Unable to save changes.', 'Are you sure you want to delete this item?'));
開發者ID:Selwyn-b,項目名稱:elefant,代碼行數:30,代碼來源:editable.php

示例9: test_export

 function test_export()
 {
     $expected = "<script>\$(function(){\$.i18n_append({\n\t'One': 'One',\n\t'Don\\'t': 'Don\\'t'\n});});</script>\n";
     $this->assertEquals($expected, I18n::export(array('One', 'Don\'t')));
     $this->assertEquals($expected, I18n::export('One', 'Don\'t'));
 }
開發者ID:Selwyn-b,項目名稱:elefant,代碼行數:6,代碼來源:I18nTest.php


注:本文中的I18n::export方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。