Skip to content

Commit 6c927d6

Browse files
committed
Fix local
1 parent 498c3f0 commit 6c927d6

File tree

4 files changed

+40
-38
lines changed

4 files changed

+40
-38
lines changed

languages/d_vuefront-ru_RU.mo

0 Bytes
Binary file not shown.

languages/d_vuefront-ru_RU.po

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: d_vuefront\n"
4-
"POT-Creation-Date: 2019-06-11 11:30+0300\n"
5-
"PO-Revision-Date: 2019-06-11 11:31+0300\n"
4+
"POT-Creation-Date: 2019-06-11 11:42+0300\n"
5+
"PO-Revision-Date: 2019-06-11 11:42+0300\n"
66
"Last-Translator: \n"
77
"Language-Team: \n"
88
"Language: ru\n"
@@ -16,15 +16,15 @@ msgstr ""
1616
"X-Poedit-KeywordsList: __;_e\n"
1717
"X-Poedit-SearchPath-0: .\n"
1818

19-
#: plugin.php:19 plugin.php:57
19+
#: plugin.php:19 plugin.php:56
2020
msgid "Settings"
2121
msgstr "Настройки"
2222

23-
#: plugin.php:37
23+
#: plugin.php:36
2424
msgid "CMS Connect URL"
2525
msgstr "CMS Connect URL"
2626

27-
#: plugin.php:38
27+
#: plugin.php:37
2828
msgid ""
2929
"This is your CMS Connect URL link that shares your Blog data via GraphQL. "
3030
"When installing VueFront via the command line, you will be prompted to enter "
@@ -41,15 +41,15 @@ msgstr ""
4141
"     Узнайте больше о <a href=\"https://vuefront.com/cms/wordpress.html\" "
4242
"target=\"_blank\"> CMS Connect для Wordpress </a>"
4343

44-
#: plugin.php:41
44+
#: plugin.php:40
4545
msgid "WooCommerce"
4646
msgstr "WooCommerce"
4747

48-
#: plugin.php:42
48+
#: plugin.php:41
4949
msgid "WooCommerce active"
5050
msgstr "WooCommerce активен"
5151

52-
#: plugin.php:43
52+
#: plugin.php:42
5353
#, php-format
5454
msgid ""
5555
"VueFront relies on the free <a href=\"%s\" target=\"_blank\">WooCommerce</a> "
@@ -60,15 +60,15 @@ msgstr ""
6060
"реализации магазина. Функция магазина является необязательной, и VueFront "
6161
"будет работать без нее. Вы можете установить его через Wordpress."
6262

63-
#: plugin.php:44
63+
#: plugin.php:43
6464
msgid "WooCommerce missing. Click to download"
6565
msgstr "Плагин WooCommerce отсутствует. Нажмите, чтобы скачать"
6666

67-
#: plugin.php:45
67+
#: plugin.php:44
6868
msgid "copy"
6969
msgstr "копировать"
7070

71-
#: plugin.php:46
71+
#: plugin.php:45
7272
msgid "copied!"
7373
msgstr "скопировано!"
7474

resolver/startup/startup.php

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,40 @@
44

55
class ResolverStartupStartup extends Resolver
66
{
7+
public function index()
8+
{
9+
if (is_plugin_active('d_vuefront/plugin.php')) {
10+
if (! empty($_GET['cors'])) {
11+
if (! empty($_SERVER['HTTP_ORIGIN'])) {
12+
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
13+
} else {
14+
header('Access-Control-Allow-Origin: *');
15+
}
16+
header('Access-Control-Allow-Methods: POST, OPTIONS');
17+
header('Access-Control-Allow-Credentials: true');
18+
header('Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Token,token,Cookie,cookie,content-type');
19+
}
720

8-
public function index() {
9-
10-
if ( ! empty( $_GET['cors'] ) ) {
11-
if ( ! empty( $_SERVER['HTTP_ORIGIN'] ) ) {
12-
header( 'Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN'] );
13-
} else {
14-
header( 'Access-Control-Allow-Origin: *' );
15-
}
16-
header( 'Access-Control-Allow-Methods: POST, OPTIONS' );
17-
header( 'Access-Control-Allow-Credentials: true' );
18-
header( 'Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Token,token,Cookie,cookie,content-type' );
19-
}
20-
21-
$this->load->model('startup/startup');
21+
$this->load->model('startup/startup');
2222

23-
try {
24-
$resolvers = $this->model_startup_startup->getResolvers();
25-
$schema = BuildSchema::build(file_get_contents(DIR_PLUGIN.'schema.graphql'));
26-
$rawInput = file_get_contents('php://input');
27-
$input = json_decode($rawInput, true);
28-
$query = $input['query'];
23+
try {
24+
$resolvers = $this->model_startup_startup->getResolvers();
25+
$schema = BuildSchema::build(file_get_contents(DIR_PLUGIN.'schema.graphql'));
26+
$rawInput = file_get_contents('php://input');
27+
$input = json_decode($rawInput, true);
28+
$query = $input['query'];
2929

30-
$variableValues = isset($input['variables']) ? $input['variables'] : null;
31-
$result = GraphQL::executeQuery($schema, $query, $resolvers, null, $variableValues);
32-
} catch (\Exception $e) {
33-
$result = [
30+
$variableValues = isset($input['variables']) ? $input['variables'] : null;
31+
$result = GraphQL::executeQuery($schema, $query, $resolvers, null, $variableValues);
32+
} catch (\Exception $e) {
33+
$result = [
3434
'error' => [
3535
'message' => $e->getMessage()
3636
]
3737
];
38-
}
38+
}
3939

40-
echo json_encode($result);
40+
echo json_encode($result);
41+
}
4142
}
42-
}
43+
}

resolver/startup/wordpress.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
class ResolverStartupWordpress extends Resolver {
44
public function index() {
5+
include_once realpath( DIR_PLUGIN . '../../../wp-admin/includes/plugin.php' );
56
require_once realpath( DIR_PLUGIN . '../../../wp-load.php' );
67
// require_once realpath(DIR_PLUGIN.'system/helpers/load.php');
78
}

0 commit comments

Comments
 (0)