Beispiel #1
0
<?php

/**
 * msginit locale selection screen
 */
$nav = array(Loco::__('Packages') => array('href' => LocoAdmin::uri()), Loco::__('Settings') => array('href' => LocoAdmin::uri(array(), 'settings'), 'icon' => 'admin-settings'), $title => array('icon' => 'welcome-add-page'));
/* @var $package LocoPackage */
$argpair = $package->get_query();
?>
<div class="wrap loco-admin loco-init"><?php 
// Main navigation
Loco::render('admin-nav', compact('nav'));
?>
 
    
    <h2><?php 
Loco::h(Loco::__('Initialize new translations in %s'), $domain);
?>
 
    </h2>
    
    
    <form action="" method="get" class="wp-core-ui" id="loco-msginit">
        <input type="hidden" name="page" value="<?php 
Loco::h(Loco::NS);
?>
" />
        <input type="hidden" name="msginit" value="<?php 
Loco::h($domain);
?>
" /><?php 
<?php

/**
 * Admin options screen - changes loco plugin settings
 */
$nav = array(Loco::__('Packages') => array('href' => LocoAdmin::uri()), Loco::__('Settings') => array('icon' => 'admin-settings'));
?>

<div class="wrap loco-admin loco-settings">
    
    <?php 
Loco::render('admin-nav', compact('nav'));
?>
 
    
    <div>&nbsp;</div>
    <div class="icon32 icon-settings"><br /></div>
    <h2>
        <?php 
Loco::h(Loco::__('Configure Loco Translate'));
?>
 
    </h2>
    
    <?php 
isset($success) and LocoAdmin::success($success);
?>
 

    <form action="" method="post">
        <table class="form-table">
Beispiel #3
0
        Loco::h($error);
        ?>
</span>
        </li><?php 
    }
    ?>
 
    </ul><?php 
}
?>
 
    
    
    <p class="submit">
        <a class="button-primary" href="<?php 
Loco::h(LocoAdmin::uri());
?>
"><?php 
Loco::h(Loco::__('Back'));
?>
</a>
        <a class="button" href="http://wordpress.org/support/plugin/<?php 
echo Loco::NS;
?>
" target="_blank"><?php 
Loco::h(Loco::__('Get help'));
?>
</a>
    </p>

    
Beispiel #4
0
/**
 * extra visibility of settings link
 */
function _loco_hook__plugin_row_meta($links, $file = '')
{
    if (false !== strpos($file, '/loco.php')) {
        $links[] = '<a href="' . Loco::html(LocoAdmin::uri(array(), '')) . '"><strong>' . Loco::__('Manage translations') . '</strong></a>';
        $links[] = '<a href="' . Loco::html(LocoAdmin::uri(array(), 'settings')) . '"><strong>' . Loco::__('Settings') . '</strong></a>';
    }
    return $links;
}
Beispiel #5
0
    ?>
 
        <form action="#" class="loco-switcher">
            <select onchange="void function(u){ u && location.assign(u) }( this.options[this.options.selectedIndex].value);">
                <option value="">
                    <?php 
    Loco::h(Loco::_x('Switch to...', 'Dropdown label'));
    ?>
 
                </option><?php 
    // drop down of files in package
    $poname = str_replace('.mo', '.po', basename($path));
    foreach ($pofiles as $_path) {
        $label = str_replace('.mo', '.po', basename($_path));
        $poedit = LocoAdmin::trim_path($_path);
        $url = LocoAdmin::uri($package->get_query() + compact('poedit'));
        ?>
 
                <option value="<?php 
        Loco::h($url);
        ?>
" <?php 
        $poname === $label and print 'selected';
        ?>
>
                    <?php 
        Loco::h($label);
        ?>
 
                </option><?php 
    }
Beispiel #6
0
<?php

/**
 * Root admin screen - lists available themes and plugins
 */
$nav = array(Loco::__('Packages') => '', Loco::__('Settings') => LocoAdmin::uri(array(), 'settings'));
?>
 

<div class="wrap loco-admin loco-lists"><?php 
// show upgrade notice if available
if (isset($update)) {
    ?>
 
    <div class="loco-message updated loco-warning">
        <p>
            <strong>
                <?php 
    Loco::h(Loco::__('New version available'));
    ?>
:
            </strong>
            <a href="http://wordpress.org/extend/plugins/<?php 
    echo Loco::NS;
    ?>
">
                <?php 
    Loco::h(Loco::__('Upgrade to version %s of Loco Translate'), $update);
    ?>
            </a>
        </p>
Beispiel #7
0
<?php

/**
 * PO file editor screen
 */
$nav = array(Loco::__('Packages') => array('href' => LocoAdmin::uri()), Loco::__('Settings') => array('href' => LocoAdmin::uri(array(), 'settings'), 'icon' => 'admin-settings'), $name => array('icon' => 'POT' === $type ? 'edit' : 'translation'));
$phpbase = Loco::html(Loco::baseurl()) . '/php';
$argpair = $package->get_query();
// whether to show file switcher
$pofiles = $package->get_gettext_files();
$modified or $pofiles[] = $path;
?>
 
<div class="wrap loco-admin loco-edit"><?php 
// Main navigation
Loco::render('admin-nav', compact('nav'));
?>
 
    
    <h3 class="title"><?php 
// print flag or template indicator
if ($locale) {
    ?>
 
        <span class="<?php 
    echo $locale->icon_class();
    ?>
"></span> <?php 
    Loco::h($locale->get_name());
    ?>
:<?php 
Beispiel #8
0
 public function testDefaultPageWithParameters()
 {
     $args = array('foo' => 'bar-baz');
     $uri = LocoAdmin::uri($args);
     $this->assertEquals('http://test/wp-admin/admin.php?foo=bar-baz&page=loco-translate', $uri);
 }
Beispiel #9
0
<?php

/**
 * Admin options screen - changes loco plugin settings
 */
$nav = array(Loco::__('Packages') => LocoAdmin::uri(), Loco::__('Settings') => '');
?>

<div class="wrap loco-admin loco-settings">
    
    <?php 
Loco::render('admin-nav', compact('nav'));
?>
 
    
    <div>&nbsp;</div>
    <div class="icon32 icon-settings"><br /></div>
    <h2>
        <?php 
Loco::h(Loco::__('Configure Loco Translate'));
?>
 
    </h2>
    
    <?php 
isset($success) and LocoAdmin::success($success);
?>
 

    <form action="" method="post">
        <table class="form-table">