Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-various-libraries
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-various-libraries
Commits
f3fc38f7
Commit
f3fc38f7
authored
May 28, 2018
by
Sergey Antonovich
🇯🇵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update class-synergy.php
parent
9ca54cdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
Classes/class-synergy.php
Classes/class-synergy.php
+6
-10
No files found.
Classes/class-synergy.php
View file @
f3fc38f7
...
@@ -15,8 +15,7 @@
...
@@ -15,8 +15,7 @@
self
::
$dataUUID
=
$dataUUID
;
self
::
$dataUUID
=
$dataUUID
;
return
$res
;
return
$res
;
}
}
public
static
function
getValue
()
public
static
function
getValue
(){
{
if
(
!
self
::
$formData
)
return
;
if
(
!
self
::
$formData
)
return
;
$args
=
func_get_args
();
$args
=
func_get_args
();
$data
=
null
;
$data
=
null
;
...
@@ -72,8 +71,7 @@
...
@@ -72,8 +71,7 @@
}
}
}
}
}
}
public
static
function
tableData
(
$tableID
)
public
static
function
tableData
(
$tableID
){
{
if
(
!
self
::
$formData
)
return
;
if
(
!
self
::
$formData
)
return
;
$data
=
self
::
getValue
(
$tableID
);
$data
=
self
::
getValue
(
$tableID
);
$convert
=
array
();
$convert
=
array
();
...
@@ -87,8 +85,7 @@
...
@@ -87,8 +85,7 @@
}
}
return
$convert
;
return
$convert
;
}
}
public
static
function
save
(
$callback
=
null
)
public
static
function
save
(
$callback
=
null
){
{
if
(
!
self
::
$formData
)
return
;
if
(
!
self
::
$formData
)
return
;
self
::
fixManualTags
();
self
::
fixManualTags
();
$save
=
self
::
api
(
'asforms/data/save'
,
'POST'
,
array
(
$save
=
self
::
api
(
'asforms/data/save'
,
'POST'
,
array
(
...
@@ -98,8 +95,7 @@
...
@@ -98,8 +95,7 @@
if
(
$save
[
'errorCode'
]
!=
13
&&
$callback
)
$callback
(
self
::
$dataUUID
);
if
(
$save
[
'errorCode'
]
!=
13
&&
$callback
)
$callback
(
self
::
$dataUUID
);
return
$save
;
return
$save
;
}
}
private
static
function
fixManualTags
(
$recursiveIndex
=
null
)
private
static
function
fixManualTags
(
$recursiveIndex
=
null
){
{
if
(
!
self
::
$formData
)
return
;
if
(
!
self
::
$formData
)
return
;
if
(
$recursiveIndex
)
{
if
(
$recursiveIndex
)
{
if
(
!
array_key_exists
(
'data'
,
self
::
$formData
[
'data'
][
$recursiveIndex
]))
return
;
if
(
!
array_key_exists
(
'data'
,
self
::
$formData
[
'data'
][
$recursiveIndex
]))
return
;
...
@@ -122,13 +118,13 @@
...
@@ -122,13 +118,13 @@
public
static
function
curl
(
$url
,
$type
=
'GET'
,
$params
=
false
,
&
$data
=
null
){
public
static
function
curl
(
$url
,
$type
=
'GET'
,
$params
=
false
,
&
$data
=
null
){
$ch
=
curl_init
();
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
(
$params
&&
strtoupper
(
$type
)
==
'GET'
?
$url
.=
'?'
.
http_build_query
(
$params
)
:
$url
));
curl_setopt
(
$ch
,
CURLOPT_URL
,
(
$params
&&
strtoupper
(
$type
)
==
'GET'
?
$url
.=
'?'
.
http_build_query
(
$params
)
:
$url
));
if
(
stristr
(
$url
,
'synergy/rest/api'
)
!==
false
)
{
if
(
stristr
(
$url
,
'synergy/rest/api'
)
!==
false
){
curl_setopt
(
$ch
,
CURLOPT_HTTPAUTH
,
CURLAUTH_BASIC
);
curl_setopt
(
$ch
,
CURLOPT_HTTPAUTH
,
CURLAUTH_BASIC
);
curl_setopt
(
$ch
,
CURLOPT_USERPWD
,
self
::
$superUser
);
curl_setopt
(
$ch
,
CURLOPT_USERPWD
,
self
::
$superUser
);
}
}
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
0
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
0
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
30
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
30
);
if
(
strtoupper
(
$type
)
==
'POST'
)
{
if
(
strtoupper
(
$type
)
==
'POST'
){
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
http_build_query
(
$params
));
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
http_build_query
(
$params
));
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
'Content-Type: application/x-www-form-urlencoded'
));
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
'Content-Type: application/x-www-form-urlencoded'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment