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


PHP gp_url_current函数代码示例

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


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

示例1: plugins_loaded

 public function plugins_loaded()
 {
     // Check to see if we're connected via https, if not, redirect.
     if (!is_ssl()) {
         gp_redirect(gp_url_ssl(gp_url_current()));
     }
 }
开发者ID:Tucev,项目名称:Glot-O-Matic,代码行数:7,代码来源:force-ssl.php

示例2: gp_nav_menu_items

function gp_nav_menu_items($location = 'main')
{
    $items = array();
    if ('main' === $location) {
        $items[gp_url('/projects')] = __('Projects', 'glotpress');
        $items[gp_url('/languages')] = __('Locales', 'glotpress');
    } elseif ('side' === $location) {
        if (is_user_logged_in()) {
            $items[gp_url('/profile')] = __('Profile', 'glotpress');
            $items[esc_url(wp_logout_url(gp_url_current()))] = __('Log out', 'glotpress');
        } else {
            $items[esc_url(wp_login_url(gp_url_current()))] = __('Log in', 'glotpress');
        }
    }
    return apply_filters('gp_nav_menu_items', $items, $location);
}
开发者ID:akirk,项目名称:GlotPress,代码行数:16,代码来源:template.php

示例3: esc_html

        ?>
</span>
			<span class="user"><?php 
        echo esc_html($permission->locale_slug);
        ?>
</span>
			<span class="permission-action"><?php 
        _e('and slug');
        ?>
</span>
			<span class="user"><?php 
        echo esc_html($permission->set_slug);
        ?>
</span>
			<a href="<?php 
        echo gp_url_join(gp_url_current(), '-delete/' . $permission->id);
        ?>
" class="action delete"><?php 
        _e('Remove');
        ?>
</a>
		</li>
	<?php 
    }
    ?>
</ul>
	<?php 
}
?>
	<?php 
if ($parent_permissions) {
开发者ID:pedro-mendonca,项目名称:GlotPress-WP,代码行数:31,代码来源:project-permissions.php

示例4: foreach

	<?php 
    if ($can_write) {
        ?>
	<select name="bulk[priority]" id="bulk-priority">
	<?php 
        foreach (GP::$original->get_static('priorities') as $value => $label) {
            $selected = $value == 'normal' ? " selected='selected'" : '';
            echo "\t<option value='" . esc_attr($value) . "' {$selected}>" . esc_html($label) . "</option>\n";
        }
        ?>
	</select>
	<?php 
    }
    ?>
	<input type="hidden" name="bulk[redirect_to]" value="<?php 
    echo esc_attr(gp_url_current());
    ?>
" id="bulk[redirect_to]" />
	<input type="hidden" name="bulk[row-ids]" value="" id="bulk[row-ids]" />
	<input type="submit" class="button" value="<?php 
    esc_attr_e('Apply', 'glotpress');
    ?>
" />
	</div>
</form>
<?php 
}
echo gp_pagination($page, $per_page, $total_translations_count);
?>
<form id="upper-filters-toolbar" class="filters-toolbar" action="" method="get" accept-charset="utf-8">
	<div>
开发者ID:akirk,项目名称:GlotPress,代码行数:31,代码来源:translations.php

示例5: gp_title

<?php

gp_title(sprintf(__('Branch Project %s &lt; GlotPress', 'glotpress'), $project->name));
gp_breadcrumb_project($project);
gp_tmpl_header();
?>
<h2><?php 
echo wptexturize(sprintf(__('Branch project "%s"', 'glotpress'), esc_html($project->name)));
?>
</h2>
<p><?php 
_e('Here you can branch out this project: everything will be duplicated into a new project for you.', 'glotpress');
?>
</p>
<form action="<?php 
echo esc_url(gp_url_current());
?>
" method="post">
	<dt><label for="project[name]"><?php 
_e('New branch name', 'glotpress');
?>
</label></dt>
	<dd><input type="text" name="project[name]" value="" placeholder="type tag project name here" id="project[name]"></dd>

	<!-- TODO: make slug edit WordPress style -->
	<dt><label for="project[slug]"><?php 
_e('New Slug', 'glotpress');
?>
</label></dt>
	<dd>
		<input type="text" name="project[slug]" value="" id="project[slug]">
开发者ID:akirk,项目名称:GlotPress,代码行数:31,代码来源:project-branch.php

示例6: test_gp_url_current_should_return_non_standard_port_url

 function test_gp_url_current_should_return_non_standard_port_url()
 {
     $server_vars = $_SERVER;
     $_SERVER['HTTPS'] = 0;
     $_SERVER['HTTP_HOST'] = 'glotpress.org:8888';
     $_SERVER['REQUEST_URI'] = '/';
     $_SERVER['SERVER_PORT'] = 8888;
     $this->assertEquals('http://glotpress.org:8888/', gp_url_current());
     $_SERVER = $server_vars;
 }
开发者ID:chantalcoolsma,项目名称:GlotPress-WP,代码行数:10,代码来源:test_urls.php

示例7: permissions_post

 public function permissions_post($project_path)
 {
     $project = GP::$project->by_path($project_path);
     if (!$project) {
         return $this->die_with_404();
     }
     if ($this->cannot_and_redirect('write', 'project', $project->id)) {
         return;
     }
     if ('add-validator' == gp_post('action')) {
         $user = get_user_by('login', gp_post('user_login'));
         if (!$user) {
             $this->redirect_with_error(__('User wasn&#8217;t found!', 'glotpress'), gp_url_current());
             return;
         }
         $new_permission = new GP_Validator_Permission(array('user_id' => $user->ID, 'action' => 'approve', 'project_id' => $project->id, 'locale_slug' => gp_post('locale'), 'set_slug' => gp_post('set-slug')));
         if ($this->invalid_and_redirect($new_permission, gp_url_current())) {
             return;
         }
         $permission = GP::$validator_permission->create($new_permission);
         $permission ? $this->notices[] = __('Validator was added.', 'glotpress') : ($this->errors[] = __('Error in adding validator.', 'glotpress'));
     }
     $this->redirect(gp_url_current());
 }
开发者ID:chantalcoolsma,项目名称:GlotPress-WP,代码行数:24,代码来源:project.php

示例8: foreach

		<tbody>
		<?php 
foreach ($locales as $locale) {
    ?>
			<tr class="<?php 
    echo $parity();
    ?>
">
				<?php 
    echo "<td>" . gp_link_get(gp_url_join(gp_url_current(), $locale->slug), $locale->english_name) . "</td>";
    ?>
				<?php 
    echo "<td>" . gp_link_get(gp_url_join(gp_url_current(), $locale->slug), $locale->native_name) . "</td>";
    ?>
				<?php 
    echo "<td>" . gp_link_get(gp_url_join(gp_url_current(), $locale->slug), $locale->slug) . "</td>";
    ?>
			</tr>
		<?php 
}
?>
		</tbody>
	</table>

	<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function($) {
			$('.locales').tablesorter({
				headers: {
					0: {
						sorter: 'text'
					}
开发者ID:Tucev,项目名称:Glot-O-Matic,代码行数:31,代码来源:locales.php

示例9: esc_html

        ?>
</td>
					<td><?php 
        echo esc_html($permission->action);
        ?>
</td>
					<td><?php 
        echo esc_html($permission->locale_slug);
        ?>
</td>
					<td><?php 
        echo esc_html($permission->set_slug);
        ?>
</td>
					<td><a href="<?php 
        echo esc_url(gp_route_nonce_url(gp_url_join(gp_url_current(), '-delete/' . $permission->id), 'delete-project-permission_' . $permission->id));
        ?>
" class="action delete"><?php 
        _e('Delete', 'glotpress');
        ?>
</a></td>
				</tr>
			<?php 
    }
    ?>
		</tbody>
	</table>
	<?php 
}
?>
	<?php 
开发者ID:ramiy,项目名称:GlotPress-WP,代码行数:31,代码来源:project-permissions.php

示例10: gp_nav_menu_items

function gp_nav_menu_items($location = 'main')
{
    $items = array();
    if ('main' === $location) {
        $items[gp_url('/projects')] = __('Projects', 'glotpress');
        $items[gp_url('/languages')] = __('Locales', 'glotpress');
    } elseif ('side' === $location) {
        if (is_user_logged_in()) {
            $items[gp_url('/profile')] = __('Profile', 'glotpress');
            $items[esc_url(wp_logout_url(gp_url_current()))] = __('Log out', 'glotpress');
        } else {
            $items[esc_url(wp_login_url(gp_url_current()))] = __('Log in', 'glotpress');
        }
    }
    /**
     * Filter the list of navigation menu items.
     *
     * @since 1.0.0
     *
     * @param array  $items    Menu items. URL as the key, menu label as the value.
     * @param string $location Location of the menu.
     */
    return apply_filters('gp_nav_menu_items', $items, $location);
}
开发者ID:chantalcoolsma,项目名称:GlotPress-WP,代码行数:24,代码来源:template.php

示例11: permissions_post

 function permissions_post($project_path, $locale_slug, $translation_set_slug)
 {
     $project = GP::$project->by_path($project_path);
     $locale = GP_Locales::by_slug($locale_slug);
     $translation_set = GP::$translation_set->by_project_id_slug_and_locale($project->id, $translation_set_slug, $locale_slug);
     if (!$project || !$locale || !$translation_set) {
         gp_tmpl_404();
     }
     $this->can_or_redirect('write', 'project', $project->id);
     if ('add-approver' == gp_post('action')) {
         $user = GP::$user->by_login(gp_post('user_login'));
         if ($user) {
             $res = GP::$permission->create(array('user_id' => $user->id, 'action' => 'approve', 'object_type' => 'translation-set', 'object_id' => $translation_set->id));
             $res ? $this->notices[] = 'Validator was added.' : ($this->errors[] = 'Error in adding validator.');
         } else {
             $this->errors[] = 'User wasn&#8217;t found!';
         }
     }
     gp_redirect(gp_url_current());
 }
开发者ID:rmccue,项目名称:GlotPress,代码行数:20,代码来源:translation.php

示例12: gp_title

<?php

gp_title(sprintf(__('%s &lt; GlotPress'), __('Login')));
gp_breadcrumb(array(__('Login')));
gp_tmpl_header();
?>

		<form action="<?php 
echo gp_url_ssl(gp_url_current());
?>
" method="post" class="form-signin" role="form">
			<h2 class="form-signin-heading"><?php 
_e('Login');
?>
</h2>

			<?php 
do_action('before_login_form');
?>

			<input name="user_login" type="text" class="form-control" placeholder="<?php 
_e('Username');
?>
" required="" autofocus="">
			<input name="user_pass" type="password" class="form-control" placeholder="<?php 
_e('Password');
?>
" required="">

			<input type="hidden" value="<?php 
echo esc_attr(gp_get('redirect_to'));
开发者ID:BoweFrankema,项目名称:WP-Translate-Theme,代码行数:31,代码来源:login.php

示例13: foreach

foreach ($locales as $locale) {
    $class = 'odd' === $class ? 'even' : 'odd';
    ?>
			<tr class="<?php 
    echo $class;
    // WPCS: XSS ok.
    ?>
">
				<?php 
    echo '<td>' . gp_link_get(gp_url_join(gp_url_current(), $locale->slug), $locale->english_name) . '</td>';
    ?>
				<?php 
    echo '<td>' . gp_link_get(gp_url_join(gp_url_current(), $locale->slug), $locale->native_name) . '</td>';
    ?>
				<?php 
    echo '<td>' . gp_link_get(gp_url_join(gp_url_current(), $locale->slug), $locale->slug) . '</td>';
    ?>
			</tr>
		<?php 
}
?>
		</tbody>
	</table>

	<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function($) {
			$('.locales').tablesorter({
				theme: 'glotpress',
				sortList: [[0,0]],
				headers: {
					0: {
开发者ID:GlotPress,项目名称:GlotPress-WP,代码行数:31,代码来源:locales.php

示例14: gp_url_login

function gp_url_login($redirect_to = null)
{
    return gp_url('/login', array('redirect_to' => $redirect_to ? $redirect_to : gp_url_current()));
}
开发者ID:rmccue,项目名称:GlotPress,代码行数:4,代码来源:url.php


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