CRM-14486 - ts and link for empowered by image
[civicrm-core.git] / templates / CRM / common / enableDisableApi.tpl
index 7dd9811a00da9686bfd766c91e79138e8fc8c58e..83a9964c39e27e9e75e596aba4c42a2f66d361ed 100644 (file)
@@ -1,8 +1,8 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -26,8 +26,8 @@
 {* handle common enable/disable actions *}
 {literal}
 <script type="text/javascript">
-  cj(function($) {
-    var $row, $table, info, enabled, fieldLabel;
+  CRM.$(function($) {
+    var $row, info, enabled, fieldLabel;
 
     function successMsg() {
       {/literal} {* client-side variable substitutions in smarty are AWKWARD! *}
     }
 
     function refresh() {
-      // Call native refresh method on ajax datatables
-      if ($.fn.DataTable.fnIsDataTable($table[0]) && $table.dataTable().fnSettings().sAjaxSource) {
-        $.each($.fn.dataTable.fnTables(), function() {
-          $(this).dataTable().fnSettings().sAjaxSource && $(this).unblock().dataTable().fnDraw();
-        });
-      }
-      // Otherwise refresh the content area using crmSnippet
-      else {
-        $row.closest('.crm-ajax-container, #crm-main-content-wrapper').crmSnippet().crmSnippet('refresh');
-      }
+      CRM.refreshParent($row);
     }
 
     function save() {
-      $table = $row.closest('table');
-      $table.block();
+      $row.closest('table').block();
       CRM.api3(info.entity, 'setvalue', {id: info.id, field: 'is_active', value: enabled ? 0 : 1}, {success: successMsg}).done(refresh);
       if (enabled) {
         $(this).dialog('close');
       fieldLabel = info.label || info.title || info.name || {/literal}'{ts escape="js"}Record{/ts}'{literal};
       enabled = !$row.hasClass('disabled');
       if (enabled) {
-        CRM.confirm({}, {{/literal}
+        CRM.confirm({{/literal}
           message: '<div class="crm-loading-element">{ts escape="js"}Loading{/ts}...</div>',
           {* client-side variable substitutions in smarty are AWKWARD! *}
           title: ts('{ts escape="js" 1='%1'}Disable %1{/ts}{literal}', {1: fieldLabel}),
           width: 300,
+          options: null,
           open: confirmation
         });
       } else {