Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Advanced Order Numbers for WooCommerce
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WooCommerce
Advanced Order Numbers for WooCommerce
Commits
08141960
Commit
08141960
authored
9 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Add dashicons to the credentials link
parent
ba7216b1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
assets/js/opentools-updatecheck.js
+3
-0
3 additions, 0 deletions
assets/js/opentools-updatecheck.js
opentools-update-checker.php
+10
-4
10 additions, 4 deletions
opentools-update-checker.php
ordernumbers_woocommerce_basic.php
+3
-1
3 additions, 1 deletion
ordernumbers_woocommerce_basic.php
with
16 additions
and
5 deletions
assets/js/opentools-updatecheck.js
+
3
−
0
View file @
08141960
...
@@ -42,10 +42,13 @@ var submitUpdateCredentials = function(btn) {
...
@@ -42,10 +42,13 @@ var submitUpdateCredentials = function(btn) {
jQuery
(
tr
).
find
(
'
div.update-credentials-message
'
).
html
(
json
[
'
message
'
]);
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
'
).
removeClass
(
'
message-fail
'
).
addClass
(
'
message-success
'
)
jQuery
(
tr
).
find
(
'
div.update-credentials-form
'
).
fadeOut
(
500
,
function
()
{
jQuery
(
this
).
remove
();
});
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
();
});
jQuery
(
tr
).
delay
(
5000
).
fadeOut
(
1000
,
function
()
{
jQuery
(
this
).
remove
();
});
}
else
{
}
else
{
jQuery
(
tr
).
find
(
'
div.update-credentials-message
'
).
html
(
json
[
'
message
'
]);
jQuery
(
tr
).
find
(
'
div.update-credentials-message
'
).
html
(
json
[
'
message
'
]);
jQuery
(
tr
).
find
(
'
div.update-credentials
'
).
addClass
(
'
message-fail
'
).
removeClass
(
'
message-success
'
);
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
()
{
error
:
function
()
{
...
...
This diff is collapsed.
Click to expand it.
opentools-update-checker.php
+
10
−
4
View file @
08141960
...
@@ -26,7 +26,9 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
...
@@ -26,7 +26,9 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
add_action
(
'admin_print_styles-plugins.php'
,
array
(
$this
,
'addCredentialCheckStyles'
));
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_getUpdateCredentialsRow'
,
array
(
&
$this
,
'getUpdateCredentialsRow'
)
);
add_action
(
'wp_ajax_submitUpdateCredentials'
,
array
(
&
$this
,
'submitUpdateCredentials'
)
);
add_action
(
'wp_ajax_submitUpdateCredentials'
,
array
(
&
$this
,
'submitUpdateCredentials'
)
);
...
@@ -99,17 +101,21 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
...
@@ -99,17 +101,21 @@ class OpenToolsPluginUpdateChecker extends PluginUpdateChecker_2_1 {
* @param string $pluginFile
* @param string $pluginFile
* @return array
* @return array
*/
*/
public
function
displayUpdateCredentialsLink
(
$
pluginMeta
,
$pluginFile
)
{
public
function
displayUpdateCredentialsLink
(
$
links
,
$pluginFile
)
{
$isRelevant
=
(
$pluginFile
==
$this
->
pluginFile
)
$isRelevant
=
(
$pluginFile
==
$this
->
pluginFile
)
||
(
!
empty
(
$this
->
muPluginFile
)
&&
$pluginFile
==
$this
->
muPluginFile
);
||
(
!
empty
(
$this
->
muPluginFile
)
&&
$pluginFile
==
$this
->
muPluginFile
);
if
(
$isRelevant
&&
current_user_can
(
'update_plugins'
)
)
{
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'
));
$linkText
=
apply_filters
(
'otup_enter_update_credentials-'
.
$this
->
slug
,
__
(
'Update Credentials'
,
'oton-updates'
));
if
(
!
empty
(
$linkText
)
)
{
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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
ordernumbers_woocommerce_basic.php
+
3
−
1
View file @
08141960
...
@@ -172,7 +172,9 @@ class OpenToolsOrdernumbersBasic {
...
@@ -172,7 +172,9 @@ class OpenToolsOrdernumbersBasic {
*/
*/
public
function
ordernumber_add_settings_link
(
$links
)
{
public
function
ordernumber_add_settings_link
(
$links
)
{
$link
=
'<a href="admin.php?page=wc-settings&tab=checkout§ion=ordernumber">'
.
$this
->
helper
->
__
(
'Settings'
)
.
'</a>'
;
$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
;
return
$links
;
}
}
public
function
ordernumber_plugin_row_meta
(
$links
,
$file
)
{
public
function
ordernumber_plugin_row_meta
(
$links
,
$file
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment