2 * JavaScript for core functions
3 * --------------------------------------------------------------------
4 * Copyright (c) 2003 - 2009 by Roland Haeder
5 * Copyright (c) 2009 - 2015 by Mailer Developer Team
6 * For more information visit: http://mxchange.org
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
24 // Function similar to PHP's function, except it checks only numeric indexes
25 function in_array (needle, heystack) {
26 // By default it is not found
27 var isInArray = false;
30 for (var i = 0; i < heystack.length; i++) {
31 // Is the element found?
32 if (heystack[i] === needle) {
43 // Function similar to PHP's urldecode() function
44 function decodeUrlEncoding (content) {
45 // Replace plus signs with spaces
46 var removedPlus = (content + '').replace(/\+/g, '%20');
49 var decoded = decodeURIComponent(removedPlus);
55 // "Getter" for total elements in given object
56 function getTotalCountFromObject (object) {
61 $.each(object, function (i, j) {