Source
2162
2162
* @param string $parentid parent ID, is used as sessionStorage suffix
2163
2163
* @param array $keepids checked rows ids
2164
2164
*/
2165
2165
function uncheckTableRows($parentid = null, $keepids = []) {
2166
2166
$key = implode('_', array_filter(['cb', basename($_SERVER['SCRIPT_NAME'], '.php'), $parentid]));
2167
2167
2168
2168
if ($keepids) {
2169
2169
// If $keepids will not have same key as value, it will create mess, when new checkbox will be checked.
2170
2170
$keepids = array_combine($keepids, $keepids);
2171
2171
2172
-
insert_js('sessionStorage.setItem("'.$key.'", JSON.stringify('.json_encode($keepids).'))');
2172
+
insert_js('sessionStorage.setItem('.json_encode($key).', JSON.stringify('.json_encode($keepids).'));');
2173
2173
}
2174
2174
else {
2175
-
insert_js('sessionStorage.removeItem("'.$key.'")');
2175
+
insert_js('sessionStorage.removeItem('.json_encode($key).');');
2176
2176
}
2177
2177
}
2178
2178
2179
2179
/**
2180
2180
* Trim each element of the script path. For example, " a / b / c d " => "a/b/c d"
2181
2181
*
2182
2182
* @param string $name
2183
2183
*
2184
2184
* @return string
2185
2185
*/