Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Advanced Order Numbers for WooCommerce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
WooCommerce
Advanced Order Numbers for WooCommerce
Commits
08141960
Commit
08141960
authored
Jan 05, 2016
by
Reinhold Kainhofer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dashicons to the credentials link
parent
ba7216b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
assets/js/opentools-updatecheck.js
assets/js/opentools-updatecheck.js
+3
-0
opentools-update-checker.php
opentools-update-checker.php
+10
-4
ordernumbers_woocommerce_basic.php
ordernumbers_woocommerce_basic.php
+3
-1
No files found.
assets/js/opentools-updatecheck.js
View file @
08141960
...
...
@@ -42,10 +42,13 @@ var submitUpdateCredentials = function(btn) {
jQuery
(
tr
).
find
(
'
div.update-credentials-message
'
).
html
(
json
[
'
message
'
]);
jQuery
(
tr
).
find
(
'
div.update-credentials
'
).
removeClass
(
'
message-fail
'
).
addClass
(
'
message-success
'
)
jQuery
(
tr
).
find
(
'
div.update-credentials-form
'
).
fadeOut
(
500
,
function
()
{
jQuery
(
this
).
remove
();
});
jQuery
(
tr
).
closest
(
'
table
'
).
find
(
'
a.otup_credentials_link_
'
+
slug
).
removeClass
(
'
dashicons-no
'
).
addClass
(
'
dashicons-yes
'
);
jQuery
(
tr
).
delay
(
5000
).
fadeOut
(
1000
,
function
()
{
jQuery
(
this
).
remove
();
});
}
else
{
jQuery
(
tr
).
find
(
'
div.update-credentials-message
'
).
html
(
json
[
'
message
'
]);
jQuery
(
tr
).
find
(
'
div.update-credentials
'
).
addClass
(
'
message-fail
'
).
removeClass
(
'
message-success
'
);
jQuery
(
tr
).
closest
(
'
table
'
).
find
(
'
a.otup_credentials_link_
'
+
slug
).
removeClass
(
'
dashicons-yes
'
).
addClass
(
'
dashicons-no
'
);
}
},
error
:
function
()
{
...
...
opentools-update-checker.php
View file @
08141960
...
...
@@ -26,7 +26,9 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
add_action
(
'admin_print_styles-plugins.php'
,
array
(
$this
,
'addCredentialCheckStyles'
));
add_filter
(
'plugin_row_meta'
,
array
(
$this
,
'displayUpdateCredentialsLink'
),
10
,
2
);
// add_filter('plugin_row_meta', array($this, 'displayUpdateCredentialsLink'), 9, 2);
add_filter
(
'plugin_action_links_'
.
$this
->
pluginFile
,
array
(
$this
,
'displayUpdateCredentialsLink'
),
9
,
2
);
add_action
(
'wp_ajax_getUpdateCredentialsRow'
,
array
(
&
$this
,
'getUpdateCredentialsRow'
)
);
add_action
(
'wp_ajax_submitUpdateCredentials'
,
array
(
&
$this
,
'submitUpdateCredentials'
)
);
...
...
@@ -99,17 +101,21 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
* @param string $pluginFile
* @return array
*/
public
function
displayUpdateCredentialsLink
(
$
pluginMeta
,
$pluginFile
)
{
public
function
displayUpdateCredentialsLink
(
$
links
,
$pluginFile
)
{
$isRelevant
=
(
$pluginFile
==
$this
->
pluginFile
)
||
(
!
empty
(
$this
->
muPluginFile
)
&&
$pluginFile
==
$this
->
muPluginFile
);
if
(
$isRelevant
&&
current_user_can
(
'update_plugins'
)
)
{
$credentials
=
$this
->
getCredentials
(
$this
->
slug
);
$linkText
=
apply_filters
(
'otup_enter_update_credentials-'
.
$this
->
slug
,
__
(
'Update Credentials'
,
'oton-updates'
));
if
(
!
empty
(
$linkText
)
)
{
$pluginMeta
[]
=
sprintf
(
'<a href="#" onClick=\'return showUpdateCredentialsRow(this, "%s", "%s");\' >%s</a>'
,
esc_attr
(
$this
->
slug
),
esc_attr
(
wp_create_nonce
(
'otup_enter_update_credentials'
)),
$linkText
);
$iconyesno
=
$credentials
[
'validated'
]
?
'yes'
:
'no'
;
$link
=
sprintf
(
'<a href="#" onClick=\'return showUpdateCredentialsRow(this, "%s", "%s");\' class="dashicons-before dashicons-'
.
$iconyesno
.
' otup_credentials_link_'
.
$this
->
slug
.
'">%s</a>'
,
esc_attr
(
$this
->
slug
),
esc_attr
(
wp_create_nonce
(
'otup_enter_update_credentials'
)),
$linkText
);
array_unshift
(
$links
,
$link
);
}
}
return
$
pluginMeta
;
return
$
links
;
}
...
...
ordernumbers_woocommerce_basic.php
View file @
08141960
...
...
@@ -172,7 +172,9 @@ class OpenToolsOrdernumbersBasic {
*/
public
function
ordernumber_add_settings_link
(
$links
)
{
$link
=
'<a href="admin.php?page=wc-settings&tab=checkout§ion=ordernumber">'
.
$this
->
helper
->
__
(
'Settings'
)
.
'</a>'
;
array_push
(
$links
,
$link
);
// Prepend the settings link:
array_unshift
(
$links
,
$link
);
// $links['settings'] = $link;
return
$links
;
}
public
function
ordernumber_plugin_row_meta
(
$links
,
$file
)
{
...
...
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