本文整理匯總了PHP中TS_函數的典型用法代碼示例。如果您正苦於以下問題:PHP TS_函數的具體用法?PHP TS_怎麽用?PHP TS_使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了TS_函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// We pass NO params. This gives up the default Skins API v5 behavior.
add_js_headline('var touch_skin_switch_confirm_text = "' . TS_('Switch to regular view? \\n \\n You can switch back again in the footer.') . '";');
$this->require_js('js/core.js');
require_js('navigation.js', 'blog');
}
示例2: tagitem_edit_actions
function tagitem_edit_actions($Item)
{
global $current_User, $edited_ItemTag;
// Display the edit icon if current user has the rights:
$r = $Item->get_edit_link(array('before' => '', 'after' => ' ', 'text' => get_icon('edit'), 'title' => '#', 'class' => ''));
if ($current_User->check_perm('item_post!CURSTATUS', 'edit', false, $Item)) {
// Display the unlink icon if current user has the rights:
$r .= action_icon(T_('Unlink this tag from post!'), 'unlink', regenerate_url('tag_ID,action,tag_filter', 'tag_ID=' . $edited_ItemTag->ID . '&item_ID=' . $Item->ID . '&action=unlink&' . url_crumb('tag')), NULL, NULL, NULL, array('onclick' => 'return confirm(\'' . format_to_output(sprintf(TS_('Are you sure you want to remove the tag "%s" from "%s"?'), $edited_ItemTag->dget('name'), $Item->dget('title')) . '\');', 'htmlattr')));
}
return $r;
}
示例3: toggleCheckboxes
* @param string the form name
* @param string the checkbox(es) element(s) name
* @param string number/name of the checkall set to use. Defaults to 0 and is needed when there are several "checkall-sets" on one page.
*/
$toggleCheckboxes_script = "\n\t\t\t\tfunction toggleCheckboxes(the_form, the_elements, set_name )\n\t\t\t\t{\n\t\t\t\t\tif( typeof set_name == 'undefined' )\n\t\t\t\t\t{\n\t\t\t\t\t\tset_name = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif( allchecked[set_name] ) allchecked[set_name] = false;\n\t\t\t\t\telse allchecked[set_name] = true;\n\n\t\t\t\t\tvar elems = document.forms[the_form].elements[the_elements];\n\t\t\t\t\tif( !elems )\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar elems_cnt = (typeof(elems.length) != 'undefined') ? elems.length : 0;\n\t\t\t\t\tif (elems_cnt)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (var i = 0; i < elems_cnt; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telems[i].checked = allchecked[nr];\n\t\t\t\t\t\t} // end for\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\telems.checked = allchecked[nr];\n\t\t\t\t\t}\n\t\t\t\t\tsetcheckallspan( set_name );\n\t\t\t\t}\n";
add_headline($toggleCheckboxes_script);
break;
}
// --- general functions ----------------
/**
* replaces the text of the checkall-html-ID for set_name
*
* @param integer|string number or name of the checkall "set" to use
* @param boolean force setting to true/false
*/
$setcheckallspan_script = "\n\t\t\tfunction setcheckallspan( set_name, set )\n\t\t\t{\n\t\t\t\tif( typeof(allchecked[set_name]) == 'undefined' || typeof(set) != 'undefined' )\n\t\t\t\t{ // init\n\t\t\t\t\tallchecked[set_name] = set;\n\t\t\t\t}\n\n\t\t\t\tif( allchecked[set_name] )\n\t\t\t\t{\n\t\t\t\t\tvar replace = document.createTextNode('" . TS_('uncheck all') . "');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar replace = document.createTextNode('" . TS_('check all') . "');\n\t\t\t\t}\n\n\t\t\t\tif( document.getElementById( idprefix+'_'+String(set_name) ) )\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById( idprefix+'_'+String(set_name) ).replaceChild(replace, document.getElementById( idprefix+'_'+String(set_name) ).firstChild);\n\t\t\t\t}\n\t\t\t\t//else alert('no element with id '+idprefix+'_'+String(set_name));\n\t\t\t}\n";
add_headline($setcheckallspan_script);
/**
* inits the checkall functionality.
*
* @param string the prefix of the IDs where the '(un)check all' text should be set
* @param boolean initial state of the text (if there is no checkbox with ID htmlid + '_state_' + nr)
*/
$initcheckall_script = <<<JS
\t\t\tfunction initcheckall( htmlid, init )
\t\t\t{
\t\t\t\t// initialize array
\t\t\t\tallchecked = Array();
\t\t\t\tidprefix = typeof(htmlid) == 'undefined' ? 'checkallspan' : htmlid;
\t\t\t\tfor( var lform = 0; lform < document.forms.length; lform++ )
示例4: get_file_links
/**
* Get all links where file is used
*
* @param integer File ID
* @param array Params
* @return string The links to that posts, comments and users where the file is used
*/
function get_file_links($file_ID, $params = array())
{
global $DB, $current_User, $baseurl, $admin_url;
$params = array_merge(array('separator' => '<br />', 'post_prefix' => T_('Post') . ' - ', 'comment_prefix' => T_('Comment on') . ' - ', 'user_prefix' => T_('Profile picture') . ' - ', 'current_link_ID' => 0, 'current_before' => '<b>', 'current_after' => '</b>'), $params);
// Create result array
$attached_to = array();
// Get all links with posts and comments
$links_SQL = new SQL();
$links_SQL->SELECT('link_ID, link_itm_ID, link_cmt_ID, link_usr_ID');
$links_SQL->FROM('T_links');
$links_SQL->WHERE('link_file_ID = ' . $DB->quote($file_ID));
$links = $DB->get_results($links_SQL->get());
if (!empty($links)) {
// File is linked with some posts or comments
$ItemCache =& get_ItemCache();
$CommentCache =& get_CommentCache();
$UserCache =& get_UserCache();
$LinkCache =& get_LinkCache();
foreach ($links as $link) {
$link_object_ID = 0;
$r = '';
if ($params['current_link_ID'] == $link->link_ID) {
$r .= $params['current_before'];
}
if (!empty($link->link_itm_ID)) {
// File is linked to a post
if ($Item =& $ItemCache->get_by_ID($link->link_itm_ID, false)) {
$Blog = $Item->get_Blog();
if ($current_User->check_perm('item_post!CURSTATUS', 'view', false, $Item)) {
// Current user can edit the linked post
$r .= $params['post_prefix'] . '<a href="' . url_add_param($admin_url, 'ctrl=items&blog=' . $Blog->ID . '&p=' . $link->link_itm_ID) . '">' . $Item->get('title') . '</a>';
} else {
// No access to edit the linked post
$r .= $params['post_prefix'] . $Item->get('title');
}
$link_object_ID = $link->link_itm_ID;
}
} elseif (!empty($link->link_cmt_ID)) {
// File is linked to a comment
if ($Comment =& $CommentCache->get_by_ID($link->link_cmt_ID, false)) {
$Item = $Comment->get_Item();
if ($current_User->check_perm('comment!CURSTATUS', 'moderate', false, $Comment)) {
// Current user can edit the linked Comment
$r .= $params['comment_prefix'] . '<a href="' . url_add_param($admin_url, 'ctrl=comments&action=edit&comment_ID=' . $link->link_cmt_ID) . '">' . $Item->get('title') . '</a>';
} else {
// No access to edit the linked Comment
$r .= $params['comment_prefix'] . $Item->get('title');
}
$link_object_ID = $link->link_cmt_ID;
}
} elseif (!empty($link->link_usr_ID)) {
// File is linked to user
if ($User =& $UserCache->get_by_ID($link->link_usr_ID, false)) {
if ($current_User->ID != $User->ID && !$current_User->check_perm('users', 'view')) {
// No permission to view other users in admin form
$r .= $params['user_prefix'] . '<a href="' . url_add_param($baseurl, 'disp=user&user_ID=' . $User->ID) . '">' . $User->login . '</a>';
} else {
// Build a link to display a user in admin form
$r .= $params['user_prefix'] . '<a href="?ctrl=user&user_tab=profile&user_ID=' . $User->ID . '">' . $User->login . '</a>';
}
$link_object_ID = $link->link_usr_ID;
}
}
if (!empty($link_object_ID)) {
// Action icon to unlink file from object
if (($edited_Link =& $LinkCache->get_by_ID($link->link_ID, false, false)) !== false && ($LinkOwner =& $edited_Link->get_LinkOwner()) !== false && $LinkOwner->check_perm('edit', false)) {
// Allow to unlink only if current user has an permission
$r .= ' ' . action_icon(T_('Delete this link!'), 'unlink', $admin_url . '?ctrl=links&link_ID=' . $link->link_ID . '&link_type=item&link_object_ID=' . $link->link_usr_ID . '&action=unlink&redirect_to=' . rawurlencode(regenerate_url('blog', '', '', '&')) . '&' . url_crumb('link'), NULL, NULL, NULL, array('onclick' => 'return confirm(\'' . TS_('Are you sure want to unlink this file?') . '\');'));
}
}
if ($params['current_link_ID'] == $link->link_ID) {
$r .= $params['current_after'];
}
if (!empty($r)) {
$attached_to[] = $r;
}
}
}
return implode($params['separator'], $attached_to);
}
示例5: array
// Generate available blogs list:
$AdminUI->set_coll_list_params('blog_ismember', 'view', array('ctrl' => 'items', 'filter' => 'restore'));
switch ($action) {
case 'edit':
case 'edit_switchtab':
// this gets set as action by JS, when we switch tabs
// this gets set as action by JS, when we switch tabs
case 'update_edit':
case 'update':
// on error
// on error
case 'update_publish':
// on error
if ($current_User->check_perm('item_post!CURSTATUS', 'delete', false, $edited_Item)) {
// User has permissions to delete this post
$AdminUI->global_icon(T_('Delete this post'), 'delete', '?ctrl=items&action=delete&post_ID=' . $edited_Item->ID . '&' . url_crumb('item'), ' ' . T_('Delete'), 4, 3, array('onclick' => 'return confirm(\'' . TS_('You are about to delete this post!\\nThis cannot be undone!') . '\')', 'style' => 'margin-right: 3ex;'));
}
$AdminUI->global_icon(T_('Permanent link to full entry'), 'permalink', $edited_Item->get_permanent_url(), ' ' . T_('Permalink'), 4, 3, array('style' => 'margin-right: 3ex'));
break;
}
$AdminUI->global_icon(T_('Cancel editing!'), 'close', $redirect_to, T_('Cancel'), 4, 2);
init_tokeninput_js();
break;
case 'new_mass':
$AdminUI->set_coll_list_params('blog_post_statuses', 'edit', array('ctrl' => 'items', 'action' => 'new'), NULL, '', 'return b2edit_reload( document.getElementById(\'item_checkchanges\'), \'' . $dispatcher . '\', %s )');
// We don't check the following earlier, because we want the blog switching buttons to be available:
if (!blog_has_cats($blog)) {
$error_message = T_('Since this blog has no categories, you cannot post into it.');
if ($current_User->check_perm('blog_cats', 'edit', false, $blog)) {
// If current user has a permission to create a category
global $admin_url;
示例6: T_
$Form->hidden('tab3', 'tools');
$Form->hidden('tool', 'bankruptcy');
$Form->begin_form('fform', T_('Declare comment spam bankruptcy...'));
if (isset($delete_bankruptcy_blogs) && $delete_bankruptcy_blogs) {
$Form->begin_fieldset(T_('Deleting log'));
antispam_bankruptcy_delete($bankruptcy_blogs_IDs, $comment_status);
$Form->end_fieldset();
}
$visibility_statuses = get_visibility_statuses('', array());
$Form->begin_fieldset(T_('Filter comments by status'));
$Form->select_input_array('comment_status', $comment_status, $visibility_statuses, T_('Look at comments with status'), '');
$Form->buttons(array(array('submit', 'actionArray[bankruptcy_filter]', T_('Filter'))));
$Form->end_fieldset();
$Form->begin_fieldset(T_('Select blogs'));
$blogs_list = antispam_bankruptcy_blogs($comment_status);
if (empty($blogs_list)) {
// No blogs
echo '<p>' . sprintf(T_('No comments found with status %s...'), $visibility_statuses[$comment_status]) . '</p>';
} else {
// Print blogs list
foreach ($blogs_list as $blog) {
echo '<p><input type="checkbox" name="bankruptcy_blogs[]" value="' . $blog->blog_ID . '" id="bankruptcy_blog_' . $blog->blog_ID . '" /> ';
echo '<label for="bankruptcy_blog_' . $blog->blog_ID . '">' . $blog->blog_name . ' (' . sprintf(T_('<b>%s</b> comments with status %s'), $blog->comments_count, $visibility_statuses[$comment_status]) . ')</label></p>';
}
}
$Form->end_fieldset();
$buttons = array();
if (!empty($blogs_list)) {
$buttons[] = array('submit', 'actionArray[bankruptcy_delete]', sprintf(T_('Delete ALL comments with status %s from the selected blogs!'), $visibility_statuses[$comment_status]), 'RedButton', "return confirm('" . sprintf(TS_('ALL comments with status %s\\nincluding NON spam\\nwill be deleted from the selected blogs.\\nThis cannot be undone!\\nAre you sure?'), $visibility_statuses[$comment_status]) . "')");
}
$Form->end_form($buttons);
示例7: function
} );
$input.bind( 'blur', function()
{
var revert_changes = false;
var td_obj = jQuery( this ).parent();
if( td_obj.attr( 'rel' ) != jQuery( this ).val() )
{ // Value was changed, ask about saving
// fp>yura: please explain where and when this happens:
// yura>fp: 1. Go to in backoffice "Manual BLOG > Contents > Manual Pages" like this url: /admin.php?ctrl=items&tab=manual&filter=restore&blog=6
// 2. Click on the cell of the column "Order", You will see the input to change an order
// 3. Change to other value
// 4. Click outside input(to init event "blur") - and this message will be appeared
if( confirm( '<?php
echo TS_('Do you want discard your changes for this order field?');
?>
' ) )
{
revert_changes = true;
}
}
else
{
revert_changes = true;
}
if( revert_changes )
{ // Revert the changed value
td_obj.html( td_obj.attr( 'rel' ) );
}
示例8: delete_link
/**
* Displays button for deleting the Comment if user has proper rights
*
* @param string to display before link
* @param string to display after link
* @param string link text
* @param string link title
* @param string class name
* @param boolean true to make this a button instead of a link
* @param string glue between url params
* @param boolean save context?
* @param boolean true if create AJAX button
* @param string confirmation text
* @param string Redirect url
*/
function delete_link($before = ' ', $after = ' ', $text = '#', $title = '#', $class = '', $button = false, $glue = '&', $save_context = true, $ajax_button = false, $confirm_text = '#', $redirect_to = NULL)
{
global $current_User, $admin_url;
if (!is_logged_in(false)) {
return false;
}
if (empty($this->ID)) {
// Happens in Preview
return false;
}
$this->get_Item();
if (!$current_User->check_perm('comment!CURSTATUS', 'delete', false, $this)) {
// If User has no permission to delete a comments:
return false;
}
if ($text == '#') {
// Use icon+text as default, if not displayed as button (otherwise just the text)
$text = $this->status == 'trash' ? T_('Delete!') : T_('Recycle!');
if (!$button) {
$text = get_icon('delete') . ' ' . $text;
} else {
$text = $text;
}
}
if ($title == '#') {
$title = $this->status == 'trash' ? T_('Delete this comment') : T_('Recycle this comment');
}
$url = $admin_url . '?ctrl=comments' . $glue . 'action=delete' . $glue . 'comment_ID=' . $this->ID . $glue . url_crumb('comment');
if ($save_context) {
if ($redirect_to != NULL) {
$url .= $glue . 'redirect_to=' . $redirect_to;
} else {
$url .= $glue . 'redirect_to=' . rawurlencode(regenerate_url('', 'filter=restore', '', '&'));
}
}
echo $before;
if ($ajax_button && $this->status != 'trash') {
echo '<a href="' . $url . '" onclick="deleteComment(' . $this->ID . '); return false;" title="' . $title . '"';
if (!empty($class)) {
echo ' class="' . $class . '"';
}
echo '>' . $text . '</a>';
} else {
// JS confirm is required only when the comment is not in the recycle bin yet
$display_js_confirm = $this->status == 'trash';
if ($display_js_confirm && $confirm_text == '#') {
// Set js confirm text on comment delete action
$confirm_text = TS_('You are about to delete this comment!\\nThis cannot be undone!');
}
if ($button) {
// Display as button
echo '<input type="button"';
echo ' value="' . $text . '" title="' . $title . '"';
if ($display_js_confirm) {
echo ' onclick="if ( confirm(\'' . $confirm_text . '\') ) { document.location.href=\'' . $url . '\' }"';
}
if (!empty($class)) {
echo ' class="' . $class . '"';
}
echo '/>';
} else {
// Display as link
echo '<a href="' . $url . '" title="' . $title . '"';
if ($display_js_confirm) {
echo ' onclick="return confirm(\'' . $confirm_text . '\')"';
}
if (!empty($class)) {
echo ' class="' . $class . '"';
}
echo '>' . $text . '</a>';
}
}
echo $after;
return true;
}
示例9: perm_check_all
/**
* Return link to check/uncheck all permission in a row
*
* @param object db row
* @param string the prefix of the db row: 'bloguser_' or 'bloggroup_'
* @return string the link element
*/
function perm_check_all($row, $prefix)
{
global $permission_to_change_admin;
$row_id_coll = get_id_coll_from_prefix($prefix);
if (!$permission_to_change_admin && $row->{$prefix . 'perm_admin'}) {
return ' ';
}
$row_id_value = $row->{$row_id_coll};
return '<a href="javascript:toggleall_perm(document.getElementById(\'blogperm_checkchanges\'), ' . $row_id_value . ' );setcheckallspan(' . $row_id_value . ');" title="' . TS_('(un)selects all checkboxes using Javascript') . '">
<span id="checkallspan_' . $row_id_value . '">' . TS_('(un)check all') . '</span>
</a>';
}
示例10: perm_check_all
function perm_check_all($row)
{
global $permission_to_change_admin;
if (!$permission_to_change_admin && $row->bloggroup_perm_admin) {
return ' ';
}
return '<a href="javascript:toggleall_wide(document.getElementById(\'blogperm_checkchanges\'), ' . $row->grp_ID . ' );merge_from_wide( document.getElementById(\'blogperm_checkchanges\'), ' . $row->grp_ID . ' ); setcheckallspan(' . $row->grp_ID . ');" title="' . TS_('(un)selects all checkboxes using Javascript') . '">
<span id="checkallspan_' . $row->grp_ID . '">' . TS_('(un)check all') . '</span>
</a>';
}
示例11: ob_start
ob_start();
// UserSettings:
$plugin_user_settings = $loop_Plugin->GetDefaultUserSettings($tmp_params = array('for_editing' => true, 'user_ID' => $edited_User->ID));
if (is_array($plugin_user_settings)) {
foreach ($plugin_user_settings as $l_name => $l_meta) {
// Display form field for this setting:
autoform_display_field($l_name, $l_meta, $Form, 'UserSettings', $loop_Plugin, $edited_User);
}
}
// fp> what's a use case for this event? (I soooo want to nuke it...)
$Plugins->call_method($loop_Plugin->ID, 'PluginUserSettingsEditDisplayAfter', $tmp_params = array('Form' => &$Form, 'User' => $edited_User));
$has_contents = strlen(ob_get_contents());
$Form->end_fieldset();
if ($has_contents) {
ob_end_flush();
ob_end_flush();
} else {
// No content, discard output buffers:
ob_end_clean();
ob_end_clean();
}
}
}
/*************** Buttons **************/
if ($action != 'view') {
// Edit buttons
$Form->buttons(array(array('', 'actionArray[update]', T_('Save !'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton'), array('type' => 'submit', 'name' => 'actionArray[default_settings]', 'value' => T_('Restore defaults'), 'class' => 'ResetButton', 'onclick' => "return confirm('" . TS_('This will reset all your user settings.') . '\\n' . TS_('This cannot be undone.') . '\\n' . TS_('Are you sure?') . "');")));
}
$Form->end_form();
// End payload block:
$this->disp_payload_end();
示例12: echo_autocomplete_tags
/**
* Output Javascript for tags autocompletion.
* @todo dh> a more facebook like widget would be: http://plugins.jquery.com/project/facelist
* "ListBuilder" is being planned for jQuery UI: http://wiki.jqueryui.com/ListBuilder
*
* @param array Tags
*/
function echo_autocomplete_tags($tags = array())
{
global $htsrv_url;
// Initialize an array to pre-fill the tags input
$prefilled_tags = array();
if (!empty($tags)) {
foreach ($tags as $tag_name) {
$prefilled_tags[] = array('id' => $tag_name, 'title' => $tag_name);
}
}
//echo <<<EOD
?>
<script type="text/javascript">
(function($){
jQuery(function() {
jQuery( '#item_tags' ).tokenInput(
'<?php
echo $htsrv_url . 'async.php?action=get_tags';
?>
',
{
theme: 'facebook',
queryParam: 'term',
propertyToSearch: 'title',
tokenValue: 'title',
preventDuplicates: true,
prePopulate: <?php
echo evo_json_encode($prefilled_tags);
?>
,
hintText: '<?php
echo TS_('Type in a tag');
?>
',
noResultsText: '<?php
echo TS_('No results');
?>
',
searchingText: '<?php
echo TS_('Searching...');
?>
'
}
);
});
})(jQuery);
</script>
<?php
//EOD;
}
示例13: DisplayCodeToolbar
/**
* Display Toolbar
*
* @param object Blog
*/
function DisplayCodeToolbar($Blog = NULL, $params = array())
{
global $Hit;
if ($Hit->is_lynx()) {
// let's deactivate toolbar on Lynx, because they don't work there.
return false;
}
if (empty($Blog)) {
// Use FALSE by default because we don't have the settings for Message
$text_styles_enabled = false;
$links_enabled = false;
$images_enabled = false;
} else {
// Get plugin setting values depending on Blog
$text_styles_enabled = $this->get_coll_setting('text_styles', $Blog);
$links_enabled = $this->get_coll_setting('links', $Blog);
$images_enabled = $this->get_coll_setting('images', $Blog);
}
// Load js to work with textarea
require_js('functions.js', 'blog', true, true);
?>
<script type="text/javascript">
//<![CDATA[
var markdown_btns = new Array();
var markdown_open_tags = new Array();
function markdown_btn( id, text, title, tag_start, tag_end, style, open, grp_pos )
{
this.id = id; // used to name the toolbar button
this.text = text; // label on button
this.title = title; // title
this.tag_start = tag_start; // open tag
this.tag_end = tag_end; // close tag
this.style = style; // style on button
this.open = open; // set to -1 if tag does not need to be closed
this.grp_pos = grp_pos; // position in the group, e.g. 'last'
}
<?php
if ($text_styles_enabled) {
// Show thess buttons only when plugin setting "Italic & Bold styles" is enabled
?>
markdown_btns[markdown_btns.length] = new markdown_btn(
'mrkdwn_bold','bold', '<?php
echo TS_('Bold');
?>
',
'**','**',
'font-weight:bold'
);
markdown_btns[markdown_btns.length] = new markdown_btn(
'mrkdwn_italic','italic', '<?php
echo TS_('Italic');
?>
',
'*','*',
'font-style:italic', -1, 'last'
);
<?php
}
if ($links_enabled) {
// Show this button only when plugin setting "Links" is enabled
?>
markdown_btns[markdown_btns.length] = new markdown_btn(
'mrkdwn_link', 'link','<?php
echo TS_('Link');
?>
',
'','',
'text-decoration:underline', -1<?php
echo !$images_enabled ? ', \'last\'' : '';
?>
);
<?php
}
if ($images_enabled) {
// Show this button only when plugin setting "Images" is enabled
?>
markdown_btns[markdown_btns.length] = new markdown_btn(
'mrkdwn_img', 'img','<?php
echo TS_('Image');
?>
',
'','',
'', -1, 'last'
);
<?php
}
?>
markdown_btns[markdown_btns.length] = new markdown_btn(
'mrkdwn_h1','H1', '<?php
echo TS_('Header 1');
?>
',
//.........這裏部分代碼省略.........
示例14: td_file_duplicates_path
function td_file_duplicates_path($File, $file_root_type, $file_root_ID, $file_path)
{
if (is_object($File)) {
// Check if File object is correct
global $current_User;
$r = $File->get_view_link() . ' ' . $File->get_target_icon();
if ($current_User->check_perm('files', 'edit_allowed', false, $File->get_FileRoot())) {
// Allow to delete a file only if current user has an access
global $admin_url;
$r .= action_icon(T_('Delete'), 'file_delete', url_add_param($File->get_linkedit_url(), 'action=delete&confirmed=1&fm_selected[]=' . rawurlencode($File->get_rdfp_rel_path()) . '&redirect_to=' . rawurlencode(regenerate_url('blog', '', '', '&')) . '&' . url_crumb('file')), NULL, NULL, NULL, array('onclick' => 'return confirm(\'' . TS_('Are you sure want to delete this file?') . '\');'));
}
return $r;
} else {
// Broken File object
if (empty($file_path)) {
// No file data exist in DB
return T_('File no longer exists on disk.');
} else {
// Display file info from DB
return $file_root_type . '_' . $file_root_ID . ':' . $file_path;
}
}
}
示例15: round
$fuzzy++;
}
}
// $all=$translated+$fuzzy+$untranslated;
echo "\n\t" . '<td class="center">' . $all . '</td>';
$percent_done = $all > 0 ? round(($translated - $fuzzy / 2) / $all * 100) : 0;
$color = sprintf('%02x%02x00', 255 - round($percent_done * 2.55), round($percent_done * 2.55));
echo "\n\t<td class=\"center\" style=\"background-color:#" . $color . "\">" . $percent_done . " %</td>";
}
if ($current_User->check_perm('options', 'edit') && $allow_po_extraction) {
// Translator options:
if (is_file($po_file)) {
echo "\n\t" . '<td class="lastcol">[<a href="' . $pagenow . '?ctrl=locales&action=extract&edit_locale=' . $lkey . ($loc_transinfo ? '&loc_transinfo=1' : '') . '" title="' . T_('Extract .po file into b2evo-format') . '">' . T_('Extract') . '</a>]</td>';
}
}
}
// show message file percentage/extraction
echo '</tr>';
}
echo '</table>';
if ($current_User->check_perm('options', 'edit')) {
echo '<p class="center"><a href="' . $pagenow . '?ctrl=locales&action=edit' . ($loc_transinfo ? '&loc_transinfo=1' : '') . '&edit_locale=_new_">' . get_icon('new') . ' ' . T_('Create new locale') . '</a></p>';
if (isset($l_atleastonefromdb)) {
echo '<p class="center"><a href="' . $pagenow . '?ctrl=locales&action=reset' . ($loc_transinfo ? '&loc_transinfo=1' : '') . '" onclick="return confirm(\'' . TS_('Are you sure you want to reset?') . '\')">' . get_icon('delete') . ' ' . T_('Reset to defaults (delete database table)') . '</a></p>';
}
}
$Form->end_fieldset();
if ($current_User->check_perm('options', 'edit')) {
$Form->end_form(array(array('submit', '', T_('Save !'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
}
}