CAT_Helper_Page::adminAddHeaderComponent('css', $plugin . '/' . $file, $page_id); } $ajax = array('message' => $success ? 'ok' : 'error', 'success' => $success); print json_encode($ajax); exit; } elseif ($val->sanitizePost('del_plugin') != '') { $plugin = $val->sanitizePost('del_plugin'); // find JS files $js = CAT_Helper_Directory::getInstance()->maxRecursionDepth(5)->setSuffixFilter(array('js'))->scanDirectory(CAT_PATH . '/modules/lib_jquery/plugins/' . $plugin, true, true, CAT_PATH . '/modules/lib_jquery/plugins/' . $plugin); // find CSS files $css = CAT_Helper_Directory::getInstance()->maxRecursionDepth(5)->setSuffixFilter(array('css'))->scanDirectory(CAT_PATH . '/modules/lib_jquery/plugins/' . $plugin, true, true, CAT_PATH . '/modules/lib_jquery/plugins/' . $plugin); foreach ($js as $file) { CAT_Helper_Page::adminDelHeaderComponent('js', '/modules/lib_jquery/plugins/' . $plugin . $file, $page_id); } foreach ($css as $file) { CAT_Helper_Page::adminDelHeaderComponent('css', '/modules/lib_jquery/plugins/' . $plugin . $file, $page_id); } print json_encode(array('success' => true, 'message' => 'ok')); exit; } elseif ($val->sanitizePost('order') != '') { if (is_array($val->sanitizePost('order'))) { $type = $val->sanitizePost('type'); $q = sprintf('UPDATE `%spages_headers` SET `page_%s_files` = \'%s\' WHERE `page_id`="%d"', CAT_TABLE_PREFIX, $type, serialize($val->sanitizePost('order')), $page_id); $database->query($q); print json_encode(array('success' => $database->is_error() ? false : true, 'message' => $database->is_error() ? $database->get_error() : 'Success')); exit; } } elseif ($val->sanitizePost('save') != '') { $data = CAT_Helper_Page::getExtraHeaderFiles($page_id); if (count($data)) { $q = 'UPDATE `:prefix:pages_headers` SET `use_core`=:use_core, `use_ui`=:use_ui WHERE `page_id`=:page_id';