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


PHP gp_link_get函数代码示例

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


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

示例1: test_gp_link_get_escape

 function test_gp_link_get_escape()
 {
     $this->assertEquals('<a href="http://dir.bg/">Baba & Dyado</a>', gp_link_get('http://dir.bg/', 'Baba & Dyado'));
     // clean_url() is too restrictive, so it isn't called
     //$this->assertEquals( '<a href="http://dir.bg/?x=5&#038;y=11">Baba</a>', gp_link_get( 'http://dir.bg/?x=5&y=11', 'Baba' ) );
     $this->assertEquals('<a href="http://dir.bg/" a="&quot;">Baba</a>', gp_link_get('http://dir.bg/', 'Baba', array('a' => '"')));
 }
开发者ID:pedro-mendonca,项目名称:GlotPress-WP,代码行数:7,代码来源:test_links.php

示例2: gp_project_actions

 public function gp_project_actions($actions, $project)
 {
     $project_settings = (array) get_option('gp_auto_extract', array());
     if ('none' != $project_settings[$project->id]['type']) {
         $actions[] .= gp_link_get(gp_url('auto-extract/' . $project->slug), __('Auto Extract'));
     }
     return $actions;
 }
开发者ID:toolstack,项目名称:gp-auto-extract,代码行数:8,代码来源:gp-auto-extract.php

示例3: gp_pagination

 public function gp_pagination($page, $per_page, $objects)
 {
     $surrounding = 2;
     $prev = $first = $prev_dots = $prev_pages = $current = $next_pages = $next_dots = $last = $next = '';
     $page = intval($page) ? intval($page) : 1;
     $pages = ceil($objects / $per_page);
     if ($page > $pages) {
         return '';
     }
     if ($page > 1) {
         $prev = gp_link_get(add_query_arg(array('page' => $page - 1)), '&larr;', array('class' => 'previous', 'before' => '<li>', 'after' => '</li>'));
     } else {
         $prev = '<li class="disabled"><span>&larr;</span></li>';
     }
     if ($page < $pages) {
         $next = gp_link_get(add_query_arg(array('page' => $page + 1)), '&rarr;', array('class' => 'next', 'before' => '<li>', 'after' => '</li>'));
     } else {
         $next = '<li class="disabled"><span>&rarr;</span></li>';
     }
     $current = '<li class="active"><span>' . $page . '</span></li>';
     if ($page > 1) {
         $prev_pages = array();
         foreach (range(max(1, $page - $surrounding), $page - 1) as $prev_page) {
             $prev_pages[] = gp_link_get(add_query_arg(array('page' => $prev_page)), $prev_page, array('before' => '<li>', 'after' => '</li>'));
         }
         $prev_pages = implode(' ', $prev_pages);
         if ($page - $surrounding > 1) {
             $prev_dots = '<li><span class="dots">&hellip;</span></li>';
         }
     }
     if ($page < $pages) {
         $next_pages = array();
         foreach (range($page + 1, min($pages, $page + $surrounding)) as $next_page) {
             $next_pages[] = gp_link_get(add_query_arg(array('page' => $next_page)), $next_page, array('before' => '<li>', 'after' => '</li>'));
         }
         $next_pages = implode(' ', $next_pages);
         if ($page + $surrounding < $pages) {
             $next_dots = '<li><span class="dots">&hellip;</span></li>';
         }
     }
     if ($prev_dots) {
         $first = gp_link_get(add_query_arg(array('page' => 1)), 1, array('before' => '<li>', 'after' => '</li>'));
     }
     if ($next_dots) {
         $last = gp_link_get(add_query_arg(array('page' => $pages)), $pages, array('before' => '<li>', 'after' => '</li>'));
     }
     $html = '<ul class="pagination">';
     $html .= "\n\t\t\t{$prev}\n\t\t\t{$first}\n\t\t\t{$prev_dots}\n\t\t\t{$prev_pages}\n\t\t\t{$current}\n\t\t\t{$next_pages}\n\t\t\t{$next_dots}\n\t\t\t{$last}\n\t\t\t{$next}";
     $html .= '</ul>';
     return apply_filters('gp_pagination', $html, $page, $per_page, $objects);
 }
开发者ID:WeFoster,项目名称:translate.wefoster.co,代码行数:51,代码来源:hacks.php

示例4: gp_title

<?php

gp_title(sprintf(__('Projects translated to %s &lt; GlotPress'), esc_html($locale->english_name)));
gp_breadcrumb(array(gp_link_get('/languages', __('Locales')), esc_html($locale->english_name)));
gp_tmpl_header();
?>

	<h2><?php 
printf(__('Active Projects translated to %s'), '<span>' . esc_html($locale->english_name) . '</span>');
?>
</h2>

	<?php 
if (empty($projects_data)) {
    _e('No active projects found.');
}
?>

	<?php 
foreach ($projects_data as $project_id => $sub_projects) {
    ?>
		<div class="locale-project">
			<h3><?php 
    echo $projects[$project_id]->name;
    ?>
</h3>

			<table class="locale-sub-projects table table-striped">
				<thead>
				<tr>
					<th class="header" <?php 
开发者ID:WeFoster,项目名称:translate.wefoster.co,代码行数:31,代码来源:locale.php

示例5: test_gp_link_get_escape

 function test_gp_link_get_escape()
 {
     $this->assertEquals('<a href="http://dir.bg/">Baba & Dyado</a>', gp_link_get('http://dir.bg/', 'Baba & Dyado'));
     $this->assertEquals('<a href="http://dir.bg/?x=5&#038;y=11">Baba</a>', gp_link_get('http://dir.bg/?x=5&y=11', 'Baba'));
     $this->assertEquals('<a href="http://dir.bg/" a="&quot;">Baba</a>', gp_link_get('http://dir.bg/', 'Baba', array('a' => '"')));
 }
开发者ID:akirk,项目名称:GlotPress,代码行数:6,代码来源:test_links.php

示例6: foreach

foreach ($translations as $t) {
    gp_tmpl_load('translation-row', get_defined_vars());
    ?>
	
<?php 
}
if (!$translations) {
    ?>
	<tr><td colspan="4">No translations were found!</td></tr>
<?php 
}
?>
</table>
<?php 
echo gp_pagination($page, $per_page, $total_translations_count);
?>
<p class="clear actionlist secondary">
	<?php 
$footer_links = array();
if ($can_approve) {
    $footer_links[] = gp_link_get(gp_url_project($project, array($locale->slug, $translation_set->slug, 'import-translations')), __('Import translations'));
}
if (GP::$user->logged_in()) {
    $footer_links[] = gp_link_get(gp_url_project($project, array($locale->slug, $translation_set->slug, 'export-translations')), __('Export as PO file'));
}
$footer_links[] = gp_link_get(gp_url_project($project, array($locale->slug, $translation_set->slug, '_permissions')), 'Permissions');
echo implode(' &bull; ', $footer_links);
?>
</p>
<?php 
gp_tmpl_footer();
开发者ID:rmccue,项目名称:GlotPress,代码行数:31,代码来源:translations.php

示例7: gp_project_actions

function gp_project_actions($project, $translation_sets)
{
    $actions = array(gp_link_get(gp_url_project($project, 'import-originals'), __('Import originals')), gp_link_get(gp_url_project($project, array('-permissions')), __('Permissions')), gp_link_get(gp_url_project('', '-new', array('parent_project_id' => $project->id)), __('New Sub-Project')), gp_link_get(gp_url('/sets/-new', array('project_id' => $project->id)), __('New Translation Set')), gp_link_get(gp_url_project($project, array('-mass-create-sets')), __('Mass-create Translation Sets')), gp_link_get(gp_url_project($project, '-branch'), __('Branch Project')), gp_link_with_ays_get(gp_url_project($project, '-delete'), __('Delete Project'), array('ays-text' => 'Do you really want to delete this project?')));
    $actions = apply_filters('gp_project_actions', $actions, $project);
    echo '<ul>';
    foreach ($actions as $action) {
        echo '<li>' . $action . '</li>';
    }
    if ($translation_sets) {
        echo '<li>' . gp_project_options_form($project) . '</li>';
    }
    echo '</ul>';
}
开发者ID:rmccue,项目名称:glotpress-plugin,代码行数:13,代码来源:template.php

示例8: gp_title

<?php

gp_title(__('View Glossary &lt; GlotPress', 'glotpress'));
gp_breadcrumb(array(gp_project_links_from_root($project), gp_link_get(gp_url_project_locale($project->path, $locale->slug, $translation_set->slug), $translation_set->name), __('Glossary', 'glotpress')));
$ge_delete_ays = __('Are you sure you want to delete this entry?', 'glotpress');
$delete_url = $url . '/-delete';
$glossary_options = compact('can_edit', 'url', 'delete_url', 'ge_delete_ays');
gp_enqueue_script('gp-glossary');
wp_localize_script('gp-glossary', '$gp_glossary_options', $glossary_options);
gp_tmpl_header();
?>

<h2><?php 
printf(_x('Glossary for %1$s translation of %2$s', '{language} / { project name}', 'glotpress'), esc_html($translation_set->name), esc_html($project->name));
?>
	<?php 
gp_link_glossary_edit($glossary, $translation_set, __('(edit)', 'glotpress'));
?>
</h2>

<?php 
if ($glossary->description) {
    echo '<p class="description">' . make_clickable(nl2br(wp_kses_post($glossary->description))) . '</p>';
}
?>

<table class="glossary" id="glossary">
	<thead>
		<tr>
			<th style="width:20%"><?php 
_ex('Item', 'glossary entry', 'glotpress');
开发者ID:johnjamesjacoby,项目名称:GlotPress-WP,代码行数:31,代码来源:glossary-view.php

示例9: gp_pagination

function gp_pagination($page, $per_page, $objects)
{
    $surrounding = 2;
    $prev = $first = $prev_dots = $prev_pages = $current = $next_pages = $next_dots = $last = $next = '';
    $page = intval($page) ? intval($page) : 1;
    $pages = ceil($objects / $per_page);
    if ($page > $pages) {
        return '';
    }
    if ($page > 1) {
        $prev = gp_link_get(add_query_arg(array('page' => $page - 1)), '&larr;', array('class' => 'previous'));
    } else {
        $prev = '<span class="previous disabled">&larr;</span>';
    }
    if ($page < $pages) {
        $next = gp_link_get(add_query_arg(array('page' => $page + 1)), '&rarr;', array('class' => 'next'));
    } else {
        $next = '<span class="next disabled">&rarr;</span>';
    }
    $current = '<span class="current">' . $page . '</span>';
    if ($page > 1) {
        $prev_pages = array();
        foreach (range(max(1, $page - $surrounding), $page - 1) as $prev_page) {
            $prev_pages[] = gp_link_get(add_query_arg(array('page' => $prev_page)), $prev_page);
        }
        $prev_pages = implode(' ', $prev_pages);
        if ($page - $surrounding > 1) {
            $prev_dots = '<span class="dots">&hellip</span>';
        }
    }
    if ($page < $pages) {
        $next_pages = array();
        foreach (range($page + 1, min($pages, $page + $surrounding)) as $next_page) {
            $next_pages[] = gp_link_get(add_query_arg(array('page' => $next_page)), $next_page);
        }
        $next_pages = implode(' ', $next_pages);
        if ($page + $surrounding < $pages) {
            $next_dots = '<span class="dots">&hellip</span>';
        }
    }
    if ($prev_dots) {
        $first = gp_link_get(add_query_arg(array('page' => 1)), 1);
    }
    if ($next_dots) {
        $last = gp_link_get(add_query_arg(array('page' => $pages)), $pages);
    }
    $html = <<<HTML
\t<div class="paging">
\t\t{$prev}
\t\t{$first}
\t\t{$prev_dots}
\t\t{$prev_pages}
\t\t{$current}
\t\t{$next_pages}
\t\t{$next_dots}
\t\t{$last}
\t\t{$next}
\t</div>
HTML;
    return apply_filters('gp_pagination', $html, $page, $per_page, $objects);
}
开发者ID:rmccue,项目名称:GlotPress,代码行数:61,代码来源:template.php

示例10: gp_title

<?php

gp_title(sprintf(__('Projects translated to %s &lt; GlotPress'), esc_html($locale->english_name)));
$breadcrumb = array();
$breadcrumb[] = gp_link_get('/languages', __('Locales'));
if ('default' == $current_set_slug) {
    $breadcrumb[] = esc_html($locale->english_name);
} else {
    $breadcrumb[] = gp_link_get(gp_url_join('/languages', $locale->slug), esc_html($locale->english_name));
    $breadcrumb[] = $set_list[$current_set_slug];
}
gp_breadcrumb($breadcrumb);
gp_tmpl_header();
?>

	<h2><?php 
printf(__('Active Projects translated to %s'), '<span>' . esc_html($locale->english_name) . '</span>');
?>
</h2>

	<?php 
if (count($set_list) > 1) {
    ?>
		<p class="actionlist secondary">
			<?php 
    echo implode(' &bull;&nbsp;', $set_list);
    ?>
		</p>
	<?php 
}
?>
开发者ID:BoweFrankema,项目名称:WP-Translate-Theme,代码行数:31,代码来源:locale.php

示例11: gp_link_glossary_delete_get

/**
 * Creates a HTML link to the delete page for translations sets.
 *
 * Does the heavy lifting for gp_link_glossary_delete.
 *
 * @since 2.0.0
 *
 * @param GP_Glossary        $glossary The glossary to link to.
 * @param GP_Translation_Set $set      The translation set the glossary is for.
 * @param string             $text     The text to use for the link.
 * @param array              $attrs    Additional attributes to use to determine the classes for the link.
 * @return string The HTML link.
 */
function gp_link_glossary_delete_get($glossary, $set, $text = false, $attrs = array())
{
    if (!GP::$permission->current_user_can('delete', 'translation-set', $set->id)) {
        return '';
    }
    $text = $text ? $text : __('Delete', 'glotpress');
    return gp_link_get(gp_url(gp_url_join('/glossaries', $glossary->id, '-delete')), $text, gp_attrs_add_class($attrs, 'action edit'));
}
开发者ID:ramiy,项目名称:GlotPress-WP,代码行数:21,代码来源:template-links.php

示例12: gp_project_actions

 public function gp_project_actions($actions, $project)
 {
     $actions[] .= gp_link_get(gp_url('bulk-translate/' . $project->slug), __('Bulk Google Translate'));
     return $actions;
 }
开发者ID:Tucev,项目名称:Glot-O-Matic,代码行数:5,代码来源:google-translate.php

示例13: gp_link_login_get

function gp_link_login_get()
{
    return gp_link_get(gp_url('/login'), __('Login'), array('title' => __('Sign into GlotPress')));
}
开发者ID:rmccue,项目名称:GlotPress,代码行数:4,代码来源:template-links.php

示例14: sprintf

<?php

if ('originals' == $kind) {
    $title = sprintf(__('Import Originals &lt; %s &lt; GlotPress', 'glotpress'), esc_html($project->name));
    $return_link = gp_url_project($project);
    gp_breadcrumb_project($project);
} else {
    $title = sprintf(__('Import Translations &lt; %s &lt; GlotPress', 'glotpress'), esc_html($project->name));
    $return_link = gp_url_project_locale($project, $locale->slug, $translation_set->slug);
    gp_breadcrumb(array(gp_project_links_from_root($project), gp_link_get($return_link, $translation_set->name)));
}
gp_title($title);
gp_tmpl_header();
?>

<h2><?php 
echo $kind == 'originals' ? __('Import Originals', 'glotpress') : __('Import Translations', 'glotpress');
?>
</h2>
<form action="" method="post" enctype="multipart/form-data">
	<dl>
	<dt><label for="import-file"><?php 
_e('Import File:', 'glotpress');
?>
</label></dt>
	<dd><input type="file" name="import-file" id="import-file" /></dd>
<?php 
$format_options = array();
$format_options['auto'] = __('Auto Detect', 'glotpress');
foreach (GP::$formats as $slug => $format) {
    $format_options[$slug] = $format->name;
开发者ID:ramiy,项目名称:GlotPress-WP,代码行数:31,代码来源:project-import.php

示例15: gp_title

<?php

/**
 * Templates: Delete Translation Set
 *
 * @package GlotPress
 * @subpackage Templates
 * @since 2.0.0
 */
gp_title(sprintf(__('Delete Translation Set &lt; %s &lt; %s &lt; GlotPress', 'glotpress'), $set->name, $project->name));
gp_breadcrumb(array(gp_project_links_from_root($project), gp_link_get($url, $locale->english_name . ('default' !== $set->slug ? ' ' . $set->name : ''))));
gp_tmpl_header();
?>
<h2><?php 
_e('Delete Translation Set', 'glotpress');
?>
</h2>
<form action="" method="post">
	<p>
		<?php 
_e('Note this will delete all translations associated with this set!', 'glotpress');
?>
	</p>
	<p>
		<input type="submit" name="submit" value="<?php 
esc_attr_e('Delete', 'glotpress');
?>
" id="submit" />
		<span class="or-cancel"><?php 
_e('or', 'glotpress');
?>
开发者ID:ramiy,项目名称:GlotPress-WP,代码行数:31,代码来源:translation-set-delete.php


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