Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
59f86b07
authored
2015-02-13 11:27:15 -0500
by
Marty Penner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add an icon to indicate translation status of notifications
1 parent
f440737b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
17 deletions
com/Notifications/views/admin.php
com/Notifications/views/admin.php
View file @
59f86b0
...
...
@@ -2,6 +2,7 @@
use
Tz\WordPress\Tools
;
use
Tz\WordPress\Tools\Notifications
;
use
Tz\WordPress\Tools\Notifications\Settings
;
?>
<link
rel=
"stylesheet"
href=
"
<?php
echo
Tools\url
(
'assets/css/notifications.css'
,
__FILE__
)
?>
"
/>
...
...
@@ -34,21 +35,28 @@ use Tz\WordPress\Tools\Notifications\Settings;
?>
<tr>
<td>
<?php
echo
$entry
->
post_title
;
?>
</td>
<td>
<?php
echo
date
(
"M j, Y @ h:i A"
,
strtotime
(
$entry
->
execute_date
));
?>
</td>
<td>
<?php
echo
date
(
'M j, Y @ h:i A'
,
strtotime
(
$entry
->
execute_date
));
?>
</td>
<td>
<?php
echo
ucwords
(
$sendto
);
?>
</td>
<td>
<?php
if
(
$entry
->
is_email
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td>
<?php
if
(
$entry
->
is_system
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td>
<?php
if
(
$entry
->
is_email
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td>
<?php
if
(
$entry
->
is_system
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td>
<?php
if
(
strtotime
(
$entry
->
execute_date
)
>
current_time
(
'timestamp'
))
:?>
<
a
href
=
"/wp-admin/admin.php?page=notifications&action=edit&page_id=<?php echo
$entry->ID
; ?>"
>
edit
</
a
>
<
a
href
=
"/wp-admin/admin.php?page=notifications&action=edit&page_id=<?php echo
$entry->ID
; ?>"
>
edit
</
a
>
|
<
a
href
=
"/wp-admin/admin.php?page=notifications&action=delete&page_id=<?php echo
$entry->ID
; ?>"
onclick
=
"return confirm('Are you sure?');"
>
delete
</
a
></
td
>
onclick
=
"return confirm('Are you sure?');"
>
delete
</
a
>
</
td
>
<?
php
else
:
?>
<a
href=
"/wp-admin/admin.php?page=notifications&action=edit&page_id=
<?php
echo
$entry
->
ID
;
?>
"
>
edit
</a>
|
...
...
@@ -59,12 +67,12 @@ use Tz\WordPress\Tools\Notifications\Settings;
</tbody>
</table>
<h3
class=
"table-caption"
>
System Triggered Notifications
</h3>
<table
cellspacing=
"0"
class=
"widefat post fixed"
style=
"margin-top:15px;"
>
<thead>
<tr>
<th
scope=
"col"
class=
"manage-column"
>
Description
</th>
<th
scope=
"col"
>
</th>
<?php
if
(
current_user_can
(
Settings\MANAGE_SYSTEM_NOTIFICATIONS
))
:
?>
<th
scope=
"col"
width=
"200"
class=
"manage-column"
>
Trigger/Slug
</th>
<?php
endif
;
?>
...
...
@@ -78,16 +86,62 @@ use Tz\WordPress\Tools\Notifications\Settings;
<?php
foreach
(
$notifications
[
'triggered'
]
as
$entry
)
:
?>
<tr>
<td>
<?php
echo
$entry
->
post_title
;
?>
</td>
<td>
<a
href=
"/wp-admin/admin.php?page=notifications&action=edit&page_id=
<?php
echo
$entry
->
ID
;
?>
#tab-2"
title=
"Add translation to French"
>
<?php
$emailData
=
$entry
->
email
;
$systemData
=
$entry
->
system
;
$isTranslated
=
false
;
foreach
([
'subject'
,
'text'
,
'html'
]
as
$field
)
{
if
(
isset
(
$emailData
[
'fr_'
.
$field
])
&&
!
empty
(
$emailData
[
'fr_'
.
$field
]))
{
$isTranslated
=
true
;
break
;
}
}
if
(
!
$isTranslated
&&
isset
(
$systemData
[
'fr_message'
])
&&
!
empty
(
$systemData
[
'fr_message'
])
)
{
$isTranslated
=
true
;
}
if
(
$isTranslated
)
:
?>
<img
style=
"padding: 1px; margin: 2px;"
src=
"/wp-content/plugins/sitepress-multilingual-cms/res/img/edit_translation.png"
alt=
"Add translation to French"
>
<?php
else
:
?>
<img
style=
"padding: 1px; margin: 2px;"
src=
"/wp-content/plugins/sitepress-multilingual-cms/res/img/add_translation.png"
alt=
"Add translation to French"
>
<?php
endif
;
?>
</a>
</td>
<?php
if
(
current_user_can
(
Settings\MANAGE_SYSTEM_NOTIFICATIONS
))
:
?>
<td>
<?php
echo
$entry
->
trigger
;
?>
</td>
<?php
endif
;
?>
<td>
<?php
if
(
$entry
->
is_email
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td>
<?php
if
(
$entry
->
is_system
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td>
<?php
if
(
$entry
->
is_email
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td>
<?php
if
(
$entry
->
is_system
)
:
?>
<img
src=
"
<?php
echo
Tools\url
(
'assets/images/accept.png'
,
__FILE__
)
?>
"
/>
<?php
endif
;
?>
</td>
<td><a
href=
"/wp-admin/admin.php?page=notifications&action=edit&page_id=
<?php
echo
$entry
->
ID
;
?>
"
>
edit
</a>
<td>
<a
href=
"/wp-admin/admin.php?page=notifications&action=edit&page_id=
<?php
echo
$entry
->
ID
;
?>
"
>
edit
</a>
<?php
if
(
current_user_can
(
Settings\MANAGE_SYSTEM_NOTIFICATIONS
))
:
?>
|
<a
href=
"/wp-admin/admin.php?page=notifications&action=delete&page_id=
<?php
echo
$entry
->
ID
;
?>
"
...
...
@@ -98,6 +152,4 @@ use Tz\WordPress\Tools\Notifications\Settings;
<?php
endforeach
;
?>
</tbody>
</table>
</div>
...
...
Please
register
or
sign in
to post a comment