Auto-fix line endings in a few files
Showing
2 changed files
with
332 additions
and
332 deletions
| 1 | <?php | 1 | <?php |
| 2 | namespace Tz\WordPress\Tools\Branding; | 2 | namespace Tz\WordPress\Tools\Branding; |
| 3 | use Tz\WordPress\Tools; | 3 | use Tz\WordPress\Tools; |
| 4 | 4 | ||
| 5 | require_once('wp-admin-menu-classes.php'); | 5 | require_once('wp-admin-menu-classes.php'); |
| 6 | 6 | ||
| 7 | call_user_func(function() { | 7 | call_user_func(function() { |
| 8 | Tools\add_actions(__NAMESPACE__ . '\Actions'); | 8 | Tools\add_actions(__NAMESPACE__ . '\Actions'); |
| 9 | }); | 9 | }); |
| 10 | 10 | ||
| 11 | class Actions { | 11 | class Actions { |
| 12 | 12 | ||
| 13 | public static function admin_print_styles() { | 13 | public static function admin_print_styles() { |
| 14 | _enqueue_style('branding-style', Tools\url('css/tenzing.css', __FILE__)); | 14 | _enqueue_style('branding-style', Tools\url('css/tenzing.css', __FILE__)); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | public static function admin_print_scripts() { | 17 | public static function admin_print_scripts() { |
| 18 | _enqueue_script('jquery-alerts', Tools\url('jquery_alerts/jquery.alerts.js', __FILE__), Array('jquery'), '1.1'); | 18 | _enqueue_script('jquery-alerts', Tools\url('jquery_alerts/jquery.alerts.js', __FILE__), Array('jquery'), '1.1'); |
| 19 | _enqueue_script('colorbox', Tools\url('scripts/jquery.colorbox.js', __FILE__), Array('jquery')); | 19 | _enqueue_script('colorbox', Tools\url('scripts/jquery.colorbox.js', __FILE__), Array('jquery')); |
| 20 | 20 | ||
| 21 | _enqueue_script('date', Tools\url('scripts/date.js', __FILE__)); | 21 | _enqueue_script('date', Tools\url('scripts/date.js', __FILE__)); |
| 22 | _enqueue_script('jquery-datepicker', Tools\url('scripts/jquery.datePicker.js', __FILE__), Array('jquery','date')); | 22 | _enqueue_script('jquery-datepicker', Tools\url('scripts/jquery.datePicker.js', __FILE__), Array('jquery','date')); |
| 23 | _enqueue_script('jquery-admin-uploadify', Tools\url('uploadify/jquery.uploadify.v2.1.4.js', __FILE__), Array('jquery','swfobject')); | 23 | _enqueue_script('jquery-admin-uploadify', Tools\url('uploadify/jquery.uploadify.v2.1.4.js', __FILE__), Array('jquery','swfobject')); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | public static function admin_head() { | 26 | public static function admin_head() { |
| 27 | ?> | 27 | ?> |
| 28 | <style type="text/css" media="screen"> | 28 | <style type="text/css" media="screen"> |
| 29 | #toplevel_page_cbvreport .wp-menu-image a img { display:none; } | 29 | #toplevel_page_cbvreport .wp-menu-image a img { display:none; } |
| 30 | #toplevel_page_cbvreport .wp-menu-image { | 30 | #toplevel_page_cbvreport .wp-menu-image { |
| 31 | background: url(<?php echo Tools\url('cpt-icons/table.png', __FILE__) ?>) no-repeat 6px -17px !important; | 31 | background: url(<?php echo Tools\url('cpt-icons/table.png', __FILE__) ?>) no-repeat 6px -17px !important; |
| 32 | } | 32 | } |
| 33 | #toplevel_page_cbvreport:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { | 33 | #toplevel_page_cbvreport:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { |
| 34 | background-position:6px 7px!important; | 34 | background-position:6px 7px!important; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | #toplevel_page_cbv_options .wp-menu-image a img { display:none; } | 37 | #toplevel_page_cbv_options .wp-menu-image a img { display:none; } |
| 38 | #toplevel_page_cbv_options .wp-menu-image { | 38 | #toplevel_page_cbv_options .wp-menu-image { |
| 39 | background: url(<?php echo Tools\url('cpt-icons/switch.png', __FILE__) ?>) no-repeat 6px -17px !important; | 39 | background: url(<?php echo Tools\url('cpt-icons/switch.png', __FILE__) ?>) no-repeat 6px -17px !important; |
| 40 | } | 40 | } |
| 41 | #toplevel_page_cbv_options:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { | 41 | #toplevel_page_cbv_options:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { |
| 42 | background-position:6px 7px!important; | 42 | background-position:6px 7px!important; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | 46 | ||
| 47 | </style> | 47 | </style> |
| 48 | <?php | 48 | <?php |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | /* | 51 | /* |
| 52 | global $current_user; | 52 | global $current_user; |
| 53 | get_currentuserinfo(); | 53 | get_currentuserinfo(); |
| 54 | 54 | ||
| 55 | include('views/header.php'); | 55 | include('views/header.php'); |
| 56 | */ | 56 | */ |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | public static function admin_footer_text() { | 59 | public static function admin_footer_text() { |
| 60 | echo '© ' . date('Y') . ' Tenzing Communications Inc.'; | 60 | echo '© ' . date('Y') . ' Tenzing Communications Inc.'; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | public static function login_head() { | 63 | public static function login_head() { |
| 64 | echo '<link rel="stylesheet" type="text/css" href="' . Tools\url('css/tz_login.css', __FILE__) . '" />'; | 64 | echo '<link rel="stylesheet" type="text/css" href="' . Tools\url('css/tz_login.css', __FILE__) . '" />'; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | public static function admin_menu() { | 67 | public static function admin_menu() { |
| 68 | rename_admin_menu_section('Posts','Publications'); | 68 | rename_admin_menu_section('Posts','Publications'); |
| 69 | swap_admin_menu_sections('CBV Options','Publications'); | 69 | swap_admin_menu_sections('CBV Options','Publications'); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | //Tools\add_actions(__NAMESPACE__ . '\Actions'); | 75 | //Tools\add_actions(__NAMESPACE__ . '\Actions'); |
| 76 | 76 | ||
| 77 | ?> | 77 | ?> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | use Tz\WordPress\Tools\Notifications\Settings; | 2 | use Tz\WordPress\Tools\Notifications\Settings; |
| 3 | use Tz\WordPress\Tools\Notifications; | 3 | use Tz\WordPress\Tools\Notifications; |
| 4 | use Tz\WordPress\Tools; | 4 | use Tz\WordPress\Tools; |
| 5 | ?> | 5 | ?> |
| 6 | 6 | ||
| 7 | <link type="text/css" href="<?php echo Tools\url('assets/css/smoothness/jquery-ui-1.8.4.custom.css', __FILE__)?>" rel="stylesheet" /> | 7 | <link type="text/css" href="<?php echo Tools\url('assets/css/smoothness/jquery-ui-1.8.4.custom.css', __FILE__)?>" rel="stylesheet" /> |
| 8 | <script type="text/javascript" src="<?php echo Tools\url('assets/scripts/jquery-1.4.2.min.js', __FILE__)?>"></script> | 8 | <script type="text/javascript" src="<?php echo Tools\url('assets/scripts/jquery-1.4.2.min.js', __FILE__)?>"></script> |
| 9 | <script type="text/javascript" src="<?php echo Tools\url('assets/scripts/jquery-ui-1.8.4.custom.min.js', __FILE__)?>"></script> | 9 | <script type="text/javascript" src="<?php echo Tools\url('assets/scripts/jquery-ui-1.8.4.custom.min.js', __FILE__)?>"></script> |
| 10 | <script type="text/javascript" src="<?php echo Tools\url('assets/scripts/datetimepicker.js', __FILE__)?>"></script> | 10 | <script type="text/javascript" src="<?php echo Tools\url('assets/scripts/datetimepicker.js', __FILE__)?>"></script> |
| 11 | <link rel="stylesheet" href="<?php echo Tools\url('assets/css/notifications.css', __FILE__)?>" /> | 11 | <link rel="stylesheet" href="<?php echo Tools\url('assets/css/notifications.css', __FILE__)?>" /> |
| 12 | 12 | ||
| 13 | <div id="" class="wrap"> | 13 | <div id="" class="wrap"> |
| 14 | 14 | ||
| 15 | <h2>Notifications - Edit</h2> | 15 | <h2>Notifications - Edit</h2> |
| 16 | 16 | ||
| 17 | <?php if (isset($flash) && $flash !=""): ?> | 17 | <?php if (isset($flash) && $flash !=""): ?> |
| 18 | <div class="post-success"> | 18 | <div class="post-success"> |
| 19 | <?php echo $flash; ?> | 19 | <?php echo $flash; ?> |
| 20 | </div> | 20 | </div> |
| 21 | <?php endif; ?> | 21 | <?php endif; ?> |
| 22 | <?php if($validation->validation_errors() != "" || isset($form_error)):?> | 22 | <?php if($validation->validation_errors() != "" || isset($form_error)):?> |
| 23 | <div class="post-errors"> | 23 | <div class="post-errors"> |
| 24 | <div class="post-errors-title"><strong>Oops.</strong> There was an error saving your notification.</div> | 24 | <div class="post-errors-title"><strong>Oops.</strong> There was an error saving your notification.</div> |
| 25 | <?php if (isset($form_error)):?> | 25 | <?php if (isset($form_error)):?> |
| 26 | <p class="post-errors-content">You must include either an Email, System or SMS message.</p> | 26 | <p class="post-errors-content">You must include either an Email, System or SMS message.</p> |
| 27 | <?php endif; ?> | 27 | <?php endif; ?> |
| 28 | </div> | 28 | </div> |
| 29 | <?php endif;?> | 29 | <?php endif;?> |
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | <form enctype="multipart/form-data" method="post" action="/wp-admin/admin.php?page=notifications&action=edit&page_id=<?php echo $_GET['page_id']?>"> | 35 | <form enctype="multipart/form-data" method="post" action="/wp-admin/admin.php?page=notifications&action=edit&page_id=<?php echo $_GET['page_id']?>"> |
| 36 | 36 | ||
| 37 | <input type="hidden" name="_POSTED_" value="yes" /> | 37 | <input type="hidden" name="_POSTED_" value="yes" /> |
| 38 | 38 | ||
| 39 | <table cellspacing="0" class="widefat post fixed" style="margin-top:15px;"> | 39 | <table cellspacing="0" class="widefat post fixed" style="margin-top:15px;"> |
| 40 | <thead> | 40 | <thead> |
| 41 | <tr> | 41 | <tr> |
| 42 | <th width="150">Notification Details</th> | 42 | <th width="150">Notification Details</th> |
| 43 | <th> </th> | 43 | <th> </th> |
| 44 | </tr> | 44 | </tr> |
| 45 | </thead> | 45 | </thead> |
| 46 | <tbody> | 46 | <tbody> |
| 47 | <tr> | 47 | <tr> |
| 48 | <td width="150">Notification Type</td> | 48 | <td width="150">Notification Type</td> |
| 49 | <td> | 49 | <td> |
| 50 | <select name="type" id="notif_type" class="wide-input-field" onchange="updateNotificationType();"> | 50 | <select name="type" id="notif_type" class="wide-input-field" onchange="updateNotificationType();"> |
| 51 | <option value="scheduled" <?php echo ($validation->set_value('type',$entry->details['type'])=="scheduled") ? 'selected="selected"' : "";?>>Scheduled Notification</option> | 51 | <option value="scheduled" <?php echo ($validation->set_value('type',$entry->details['type'])=="scheduled") ? 'selected="selected"' : "";?>>Scheduled Notification</option> |
| 52 | <?php if (current_user_can(Settings\MANAGE_SYSTEM_NOTIFICATIONS) || ($_GET['action']=="edit" && $entry->details['type']=="triggered")): ?> | 52 | <?php if (current_user_can(Settings\MANAGE_SYSTEM_NOTIFICATIONS) || ($_GET['action']=="edit" && $entry->details['type']=="triggered")): ?> |
| 53 | <option value="triggered" <?php echo ($validation->set_value('type',$entry->details['type'])=="triggered") ? 'selected="selected"' : "";?>>System Triggered Notification</option> | 53 | <option value="triggered" <?php echo ($validation->set_value('type',$entry->details['type'])=="triggered") ? 'selected="selected"' : "";?>>System Triggered Notification</option> |
| 54 | <?php endif; ?> | 54 | <?php endif; ?> |
| 55 | </select> | 55 | </select> |
| 56 | <?php echo $validation->form_error('type');?> | 56 | <?php echo $validation->form_error('type');?> |
| 57 | </td> | 57 | </td> |
| 58 | </tr> | 58 | </tr> |
| 59 | <tr> | 59 | <tr> |
| 60 | <td width="150">Notification Description</td> | 60 | <td width="150">Notification Description</td> |
| 61 | <td><input type="text" name="title" class="wide-input-field" value="<?php echo $validation->set_value('title',$entry->post_title);?>" /><?php echo $validation->form_error('title');?></td> | 61 | <td><input type="text" name="title" class="wide-input-field" value="<?php echo $validation->set_value('title',$entry->post_title);?>" /><?php echo $validation->form_error('title');?></td> |
| 62 | </tr> | 62 | </tr> |
| 63 | <tr class="scheduled_sendto"> | 63 | <tr class="scheduled_sendto"> |
| 64 | <td>Sent To:</td> | 64 | <td>Sent To:</td> |
| 65 | <td> | 65 | <td> |
| 66 | 66 | ||
| 67 | <?php | 67 | <?php |
| 68 | if ($entry->details['sendto'] == "report" ): ?> | 68 | if ($entry->details['sendto'] == "report" ): ?> |
| 69 | <input type="hidden" name="sendto" value="<?php echo $entry->details['sendto']; ?>"/> | 69 | <input type="hidden" name="sendto" value="<?php echo $entry->details['sendto']; ?>"/> |
| 70 | <span style="color:#999;"><em>Report Generated</em></span> | 70 | <span style="color:#999;"><em>Report Generated</em></span> |
| 71 | <?php else: ?> | 71 | <?php else: ?> |
| 72 | <select name="sendto" class="wide-input-field"> | 72 | <select name="sendto" class="wide-input-field"> |
| 73 | <option value="allusers" <?php echo ($validation->set_value('sendto',$entry->details['sendto'])=="allusers") ? 'selected="selected"' : "";?>>All Users</option> | 73 | <option value="allusers" <?php echo ($validation->set_value('sendto',$entry->details['sendto'])=="allusers") ? 'selected="selected"' : "";?>>All Users</option> |
| 74 | <optgroup label="By Group:"> | 74 | <optgroup label="By Group:"> |
| 75 | <?php foreach(Notifications\getGroups() as $group_id => $group_name):?> | 75 | <?php foreach(Notifications\getGroups() as $group_id => $group_name):?> |
| 76 | <option value="<?php echo $group_id?>" <?php echo ($validation->set_value('sendto',$entry->details['sendto'])==$group_id) ? 'selected="selected"' : "";?>><?php echo $group_name;?></option> | 76 | <option value="<?php echo $group_id?>" <?php echo ($validation->set_value('sendto',$entry->details['sendto'])==$group_id) ? 'selected="selected"' : "";?>><?php echo $group_name;?></option> |
| 77 | <?php endforeach; ?> | 77 | <?php endforeach; ?> |
| 78 | </optgroup> | 78 | </optgroup> |
| 79 | </select> | 79 | </select> |
| 80 | <?php endif; ?> | 80 | <?php endif; ?> |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | <?php echo $validation->form_error('sendto');?> | 83 | <?php echo $validation->form_error('sendto');?> |
| 84 | </td> | 84 | </td> |
| 85 | </tr> | 85 | </tr> |
| 86 | 86 | ||
| 87 | <tr class="scheduled-extended"> | 87 | <tr class="scheduled-extended"> |
| 88 | <td>Execute Date / Time</td> | 88 | <td>Execute Date / Time</td> |
| 89 | <td><input type="text" name="execute_date" id="execute_date" class="wide-input-field date-pick" readonly="readonly" value="<?php echo $validation->set_value('execute_date',$entry->details['execute_date']);?>" /><?php echo $validation->form_error('execute_date');?></td> | 89 | <td><input type="text" name="execute_date" id="execute_date" class="wide-input-field date-pick" readonly="readonly" value="<?php echo $validation->set_value('execute_date',$entry->details['execute_date']);?>" /><?php echo $validation->form_error('execute_date');?></td> |
| 90 | </tr> | 90 | </tr> |
| 91 | 91 | ||
| 92 | <tr class="trigger-extended"> | 92 | <tr class="trigger-extended"> |
| 93 | <td>Trigger</td> | 93 | <td>Trigger</td> |
| 94 | <td><input type="text" name="trigger" id="trigger" class="wide-input-field" value="<?php echo $validation->set_value('trigger',$entry->details['trigger']);?>" /><?php echo $validation->form_error('trigger');?></td> | 94 | <td><input type="text" name="trigger" id="trigger" class="wide-input-field" value="<?php echo $validation->set_value('trigger',$entry->details['trigger']);?>" /><?php echo $validation->form_error('trigger');?></td> |
| 95 | </tr> | 95 | </tr> |
| 96 | 96 | ||
| 97 | </tbody> | 97 | </tbody> |
| 98 | </table> | 98 | </table> |
| 99 | 99 | ||
| 100 | <table cellspacing="0" class="widefat post fixed expandable" style="margin-top:15px;"> | 100 | <table cellspacing="0" class="widefat post fixed expandable" style="margin-top:15px;"> |
| 101 | <thead> | 101 | <thead> |
| 102 | <tr> | 102 | <tr> |
| 103 | <th width="150" class="toggle"><h6>Email</h6></th> | 103 | <th width="150" class="toggle"><h6>Email</h6></th> |
| 104 | <th class="action-bar"> </th> | 104 | <th class="action-bar"> </th> |
| 105 | </tr> | 105 | </tr> |
| 106 | </thead> | 106 | </thead> |
| 107 | <tbody style="<?php echo ($validation->set_value('subject',$entry->email['subject'])!="" || $validation->set_value('text',$entry->email['text'])!="" || $validation->set_value('html',$entry->email['html'])!="") ? "" : "display:none";?>;"> | 107 | <tbody style="<?php echo ($validation->set_value('subject',$entry->email['subject'])!="" || $validation->set_value('text',$entry->email['text'])!="" || $validation->set_value('html',$entry->email['html'])!="") ? "" : "display:none";?>;"> |
| 108 | <tr> | 108 | <tr> |
| 109 | <td width="150">Subject Line</td> | 109 | <td width="150">Subject Line</td> |
| 110 | <td><input type="text" name="subject" class="wide-input-field" style="width:100%;" value="<?php echo $validation->set_value('subject',$entry->email['subject']);?>" /><?php echo $validation->form_error('subject');?></td> | 110 | <td><input type="text" name="subject" class="wide-input-field" style="width:100%;" value="<?php echo $validation->set_value('subject',$entry->email['subject']);?>" /><?php echo $validation->form_error('subject');?></td> |
| 111 | </tr> | 111 | </tr> |
| 112 | <tr> | 112 | <tr> |
| 113 | <td>Text Version</td> | 113 | <td>Text Version</td> |
| 114 | <td><textarea name="text" class="wide-input-field" rows="10" style="width:100%;" ><?php echo $validation->set_value('text',$entry->email['text']);?></textarea><?php echo $validation->form_error('text');?></td> | 114 | <td><textarea name="text" class="wide-input-field" rows="10" style="width:100%;" ><?php echo $validation->set_value('text',$entry->email['text']);?></textarea><?php echo $validation->form_error('text');?></td> |
| 115 | </tr> | 115 | </tr> |
| 116 | <tr> | 116 | <tr> |
| 117 | <td>HTML Version (optional)</td> | 117 | <td>HTML Version (optional)</td> |
| 118 | <td><textarea name="html" id="htmlversion" class="wide-input-field" rows="10" style="width:100%;"><?php echo $validation->set_value('html',$entry->email['html']);?></textarea><?php echo $validation->form_error('html');?></td> | 118 | <td><textarea name="html" id="htmlversion" class="wide-input-field" rows="10" style="width:100%;"><?php echo $validation->set_value('html',$entry->email['html']);?></textarea><?php echo $validation->form_error('html');?></td> |
| 119 | </tr> | 119 | </tr> |
| 120 | 120 | ||
| 121 | <tr> | 121 | <tr> |
| 122 | <td width="150">Attachments</td> | 122 | <td width="150">Attachments</td> |
| 123 | <td> </td> | 123 | <td> </td> |
| 124 | </tr> | 124 | </tr> |
| 125 | 125 | ||
| 126 | <?php | 126 | <?php |
| 127 | $attachements = $entry->email['attachments']; | 127 | $attachements = $entry->email['attachments']; |
| 128 | $allowed_attachments = 3; | 128 | $allowed_attachments = 3; |
| 129 | foreach($attachements as $attachment): ?> | 129 | foreach($attachements as $attachment): ?> |
| 130 | <tr> | 130 | <tr> |
| 131 | <td> </td> | 131 | <td> </td> |
| 132 | <td><?php echo $attachment; ?> (<a href="#" entry_id="<?php echo $_GET['page_id']?>" class="attachment" rel="<?php echo $attachment; ?>">remove</a>)</td> | 132 | <td><?php echo $attachment; ?> (<a href="#" entry_id="<?php echo $_GET['page_id']?>" class="attachment" rel="<?php echo $attachment; ?>">remove</a>)</td> |
| 133 | </tr> | 133 | </tr> |
| 134 | <?php $allowed_attachments--; endforeach; ?> | 134 | <?php $allowed_attachments--; endforeach; ?> |
| 135 | 135 | ||
| 136 | <?php for($a = 1; $a <= $allowed_attachments; $a++): ?> | 136 | <?php for($a = 1; $a <= $allowed_attachments; $a++): ?> |
| 137 | 137 | ||
| 138 | <tr> | 138 | <tr> |
| 139 | <td> </td> | 139 | <td> </td> |
| 140 | <td><input type="file" name="attachment[]" /></td> | 140 | <td><input type="file" name="attachment[]" /></td> |
| 141 | </tr> | 141 | </tr> |
| 142 | <?php endfor; ?> | 142 | <?php endfor; ?> |
| 143 | 143 | ||
| 144 | </tbody> | 144 | </tbody> |
| 145 | </table> | 145 | </table> |
| 146 | 146 | ||
| 147 | <table cellspacing="0" class="widefat post fixed expandable" style="margin-top:15px;"> | 147 | <table cellspacing="0" class="widefat post fixed expandable" style="margin-top:15px;"> |
| 148 | <thead> | 148 | <thead> |
| 149 | <tr> | 149 | <tr> |
| 150 | <th width="150" class="toggle"><h6>System Message</h6></th> | 150 | <th width="150" class="toggle"><h6>System Message</h6></th> |
| 151 | <th class="action-bar"> </th> | 151 | <th class="action-bar"> </th> |
| 152 | </tr> | 152 | </tr> |
| 153 | </thead> | 153 | </thead> |
| 154 | <tbody style="<?php echo ($validation->set_value('system',$entry->system['message'])=="") ? "display:none" : "";?>;"> | 154 | <tbody style="<?php echo ($validation->set_value('system',$entry->system['message'])=="") ? "display:none" : "";?>;"> |
| 155 | <tr> | 155 | <tr> |
| 156 | <td>Message Type</td> | 156 | <td>Message Type</td> |
| 157 | <td> | 157 | <td> |
| 158 | <select name="system_message_type" class="wide-input-field"> | 158 | <select name="system_message_type" class="wide-input-field"> |
| 159 | <option value="none" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="none") ? 'selected="selected"' : "";?>>General Message</option> | 159 | <option value="none" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="none") ? 'selected="selected"' : "";?>>General Message</option> |
| 160 | <option value="action_required" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="action_required") ? 'selected="selected"' : "";?>>Action Required</option> | 160 | <option value="action_required" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="action_required") ? 'selected="selected"' : "";?>>Action Required</option> |
| 161 | <option value="e-flash" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="e-flash") ? 'selected="selected"' : "";?>>E-Flash</option> | 161 | <option value="e-flash" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="e-flash") ? 'selected="selected"' : "";?>>E-Flash</option> |
| 162 | <option value="new_event" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="new_event") ? 'selected="selected"' : "";?>>New Event</option> | 162 | <option value="new_event" <?php echo ($validation->set_value('system_message_type',$entry->system['system_message_type'])=="new_event") ? 'selected="selected"' : "";?>>New Event</option> |
| 163 | </select> | 163 | </select> |
| 164 | </td> | 164 | </td> |
| 165 | </tr> | 165 | </tr> |
| 166 | <tr> | 166 | <tr> |
| 167 | <td>Message (Text/HTML)</td> | 167 | <td>Message (Text/HTML)</td> |
| 168 | <td><textarea name="system" class="wide-input-field" rows="4" style="width:100%;" ><?php echo $validation->set_value('system',isset($entry->system['message']) ? $entry->system['message'] : "");?></textarea><?php echo $validation->form_error('system');?></td> | 168 | <td><textarea name="system" class="wide-input-field" rows="4" style="width:100%;" ><?php echo $validation->set_value('system',isset($entry->system['message']) ? $entry->system['message'] : "");?></textarea><?php echo $validation->form_error('system');?></td> |
| 169 | </tr> | 169 | </tr> |
| 170 | </tbody> | 170 | </tbody> |
| 171 | </table> | 171 | </table> |
| 172 | 172 | ||
| 173 | 173 | ||
| 174 | 174 | ||
| 175 | <p> | 175 | <p> |
| 176 | <input type="submit" value=" Update " /><input type="button" value=" Cancel " onclick="document.location.href='/wp-admin/admin.php?page=notifications';" /> | 176 | <input type="submit" value=" Update " /><input type="button" value=" Cancel " onclick="document.location.href='/wp-admin/admin.php?page=notifications';" /> |
| 177 | </p> | 177 | </p> |
| 178 | 178 | ||
| 179 | </form> | 179 | </form> |
| 180 | 180 | ||
| 181 | </div> | 181 | </div> |
| 182 | 182 | ||
| 183 | <script type="text/javascript"> | 183 | <script type="text/javascript"> |
| 184 | 184 | ||
| 185 | 185 | ||
| 186 | jQuery(document).ready(function($) { | 186 | jQuery(document).ready(function($) { |
| 187 | 187 | ||
| 188 | $('#execute_date').datetimepicker({ | 188 | $('#execute_date').datetimepicker({ |
| 189 | stepMinute: 30 | 189 | stepMinute: 30 |
| 190 | , dateFormat: 'yy-mm-dd' | 190 | , dateFormat: 'yy-mm-dd' |
| 191 | , timeFormat: 'hh:mm:ss' | 191 | , timeFormat: 'hh:mm:ss' |
| 192 | }); | 192 | }); |
| 193 | 193 | ||
| 194 | updateNotificationType(); | 194 | updateNotificationType(); |
| 195 | 195 | ||
| 196 | $('.attachment').live('click', function(e) { | 196 | $('.attachment').live('click', function(e) { |
| 197 | e.preventDefault(); | 197 | e.preventDefault(); |
| 198 | var $link = $(this); | 198 | var $link = $(this); |
| 199 | var options = { | 199 | var options = { |
| 200 | action: 'remove_attachment' | 200 | action: 'remove_attachment' |
| 201 | , ajax: 'yes' | 201 | , ajax: 'yes' |
| 202 | , id: $link.attr('entry_id') | 202 | , id: $link.attr('entry_id') |
| 203 | , file: $link.attr('rel') | 203 | , file: $link.attr('rel') |
| 204 | }; | 204 | }; |
| 205 | 205 | ||
| 206 | 206 | ||
| 207 | 207 | ||
| 208 | var file_element = '<input type="file" name="attachment[]" />'; | 208 | var file_element = '<input type="file" name="attachment[]" />'; |
| 209 | 209 | ||
| 210 | var c = confirm('Are you sure you want to remove this attachment?'); | 210 | var c = confirm('Are you sure you want to remove this attachment?'); |
| 211 | if (c) { | 211 | if (c) { |
| 212 | $.ajax({ | 212 | $.ajax({ |
| 213 | url: '/wp-admin/admin-ajax.php' | 213 | url: '/wp-admin/admin-ajax.php' |
| 214 | , data: (options) | 214 | , data: (options) |
| 215 | , type: 'POST' | 215 | , type: 'POST' |
| 216 | , dataType: 'json' | 216 | , dataType: 'json' |
| 217 | , success: function(data) { | 217 | , success: function(data) { |
| 218 | if (data.success=="true") { | 218 | if (data.success=="true") { |
| 219 | $link.parent().html(file_element); | 219 | $link.parent().html(file_element); |
| 220 | } | 220 | } |
| 221 | } | 221 | } |
| 222 | }); | 222 | }); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | return false; | 225 | return false; |
| 226 | }); | 226 | }); |
| 227 | 227 | ||
| 228 | 228 | ||
| 229 | //jQuery('table.expandable tbody').hide(); | 229 | //jQuery('table.expandable tbody').hide(); |
| 230 | jQuery('table.expandable thead th').click(function() { | 230 | jQuery('table.expandable thead th').click(function() { |
| 231 | var $table = jQuery(this).parent().parent().parent(); | 231 | var $table = jQuery(this).parent().parent().parent(); |
| 232 | if ( jQuery('tbody',$table).is(":visible") ) { | 232 | if ( jQuery('tbody',$table).is(":visible") ) { |
| 233 | jQuery('thead',$table).removeClass("open"); | 233 | jQuery('thead',$table).removeClass("open"); |
| 234 | jQuery('tbody',$table).fadeOut(); | 234 | jQuery('tbody',$table).fadeOut(); |
| 235 | } else { | 235 | } else { |
| 236 | jQuery('thead',$table).addClass("open"); | 236 | jQuery('thead',$table).addClass("open"); |
| 237 | jQuery('tbody',$table).fadeIn(); | 237 | jQuery('tbody',$table).fadeIn(); |
| 238 | } | 238 | } |
| 239 | }); | 239 | }); |
| 240 | 240 | ||
| 241 | }); | 241 | }); |
| 242 | 242 | ||
| 243 | function updateNotificationType() { | 243 | function updateNotificationType() { |
| 244 | var type = jQuery('#notif_type').val(); | 244 | var type = jQuery('#notif_type').val(); |
| 245 | 245 | ||
| 246 | if (type=="triggered") { | 246 | if (type=="triggered") { |
| 247 | jQuery('.scheduled-extended').hide(); | 247 | jQuery('.scheduled-extended').hide(); |
| 248 | jQuery('.trigger-extended').show(); | 248 | jQuery('.trigger-extended').show(); |
| 249 | jQuery('.scheduled_sendto').hide(); | 249 | jQuery('.scheduled_sendto').hide(); |
| 250 | } else { | 250 | } else { |
| 251 | jQuery('.scheduled-extended').show(); | 251 | jQuery('.scheduled-extended').show(); |
| 252 | jQuery('.trigger-extended').hide(); | 252 | jQuery('.trigger-extended').hide(); |
| 253 | jQuery('.scheduled_sendto').show(); | 253 | jQuery('.scheduled_sendto').show(); |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | } | 256 | } |
| 257 | </script> | 257 | </script> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment