// use civicrm notifications when there are errors
params.invalidHandler = function(form, validator) {
var errors = validator.errorList;
- if (CRM && CRM.config && CRM.config.urlIsPublic === false) {
+ {/literal}{if !$urlIsPublic}{literal}
for (var i in errors) {
$(errors[i].element).crmError(errors[i].message);
}
- }
- else {
- alert({/literal}"{ts escape='js'}Please review and correct the highlighted fields before continuing.{/ts}"{literal});
- }
+ {/literal}{else}
+ alert("{ts escape='js'}Please review and correct the highlighted fields before continuing.{/ts}");
+ {/if}{literal}
};
CRM.validate.params = CRM.validate.params || {};
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
- +--------------------------------------------------------------------+
-*}
-
-<script type="text/javascript">
-{*/*
- * Here we define the CRM object,
- * A single global variable to hold everything that needs to be accessed from the global scope
- * Translated strings are stored in the CRM.strings object, and can be accessed via ts() in javascript
- * Very common strings are included here for convenience. Others should be added dynamically per-page.
- *
- * To extend this object from php:
- * CRM_Core_Resources::singleton()->addSetting(array('myNamespace' => array('foo' => 'bar')));
- * It can then be accessed client-side via CRM.myNamespace.foo
- */
- *}
- {literal}
- var CRM = CRM || {};
- CRM = cj.extend(true, {
- strings: {},
- config: {{/literal}
- urlIsPublic: {if $urlIsPublic}true{else}false{/if},
- search_autocomplete_count: {crmSetting name="search_autocomplete_count" group="Search Preferences"}
- {literal}},
- }, CRM);
- {/literal}
-</script>