Your project uses non-strict array lookups 288
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- exit;
- }
- // Validate feedback_type
- $validTypes = ['positive', 'negative', 'correction'];
- if (!in_array($input['feedback_type'], $validTypes)) {
- echo json_encode([
- 'success' => false,
- 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
- ]);
- exit;
- $errors = [];
- // ============================================================================
- // 1. Reset Translation Cache
- // ============================================================================
- if (in_array('translations', $cacheTypes)) {
- try {
- $translationCache = new TranslationCache();
- // Count files before
- $cacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
- }
- // ============================================================================
- // 3. Reset Classification Cache
- // ============================================================================
- if (in_array('classification', $cacheTypes)) {
- try {
- $classificationCache = new ClassificationCache();
- // Get stats before
- $statsBefore = $classificationCache->getStatistics();
- }
- // ============================================================================
- // 3. Reset Database Query Cache
- // ============================================================================
- if (in_array('database', $cacheTypes)) {
- try {
- $db = Registry::get('Db');
- $prefix = CLICSHOPPING::getConfig('db_table_prefix');
- // Count entries before
- }
- // ============================================================================
- // 4. Reset Schema Query Cache (TASK 5 - ITEM 1)
- // ============================================================================
- if (in_array('schema', $cacheTypes)) {
- try {
- // Count schema cache files before (new location)
- $schemaCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SchemaQuery/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 5. Reset Intent Classification Cache (TASK 5.1.7.6)
- // ============================================================================
- if (in_array('intent', $cacheTypes)) {
- try {
- // Count intent cache files before (new location - all files)
- $intentCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Intent/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 6. Reset Ambiguity Cache (TASK 4 - Cache Migration)
- // ============================================================================
- if (in_array('ambiguity', $cacheTypes)) {
- try {
- // Count ambiguity cache files before (new location - all files)
- $ambiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Ambiguity/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 7. Reset Translation Ambiguity Cache
- // ============================================================================
- if (in_array('translation_ambiguity', $cacheTypes)) {
- try {
- // Count translation ambiguity cache files before (new location)
- $translationAmbiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 8. Reset Context Cache
- // ============================================================================
- if (in_array('context', $cacheTypes)) {
- try {
- // Count context cache files before (new location)
- $contextCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Context/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 8.5. Reset Memory Cache (file-based)
- // ============================================================================
- if (in_array('memory', $cacheTypes)) {
- try {
- $memoryCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Memory/';
- $filesBefore = 0;
- if (is_dir($memoryCacheDir)) {
- }
- // ============================================================================
- // 9. Reset Embedding Cache
- // ============================================================================
- if (in_array('embedding', $cacheTypes)) {
- try {
- // Count embedding cache files before (new location)
- $embeddingCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embedding/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 10. Reset EmbeddingSearch Cache
- // ============================================================================
- if (in_array('embedding_search', $cacheTypes)) {
- try {
- // Count embedding search cache files before (new location)
- $embeddingSearchCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/EmbeddingSearch/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 11. Reset Hybrid Query Cache (TASK 8: Multi-temporal query caching)
- // ============================================================================
- if (in_array('hybrid', $cacheTypes)) {
- try {
- // Count hybrid cache files before
- $hybridCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Hybrid/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 12. Reset Semantic Query Cache (TASK 8: Multi-temporal query caching)
- // ============================================================================
- if (in_array('semantic', $cacheTypes)) {
- try {
- // Count hybrid cache files before
- $semanticCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Semantic/';
- $filesBefore = 0;
- }
- // ============================================================================
- // 13. Reset Embeddings Cache (PHASE 2 - NewVector cache)
- // ============================================================================
- if (in_array('embeddings', $cacheTypes)) {
- try {
- $embeddingsCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embeddings/';
- $filesBefore = 0;
- if (is_dir($embeddingsCacheDir)) {
- }
- // ============================================================================
- // 14. Reset SQL Query Cache (PHASE 4)
- // ============================================================================
- if (in_array('sql', $cacheTypes)) {
- try {
- $sqlCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SQL/';
- $filesBefore = 0;
- if (is_dir($sqlCacheDir)) {
- }
- // ============================================================================
- // 15. Reset Security Cache
- // ============================================================================
- if (in_array('security', $cacheTypes)) {
- try {
- $securityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Security/';
- $filesBefore = 0;
- if (is_dir($securityCacheDir)) {
- }
- // ============================================================================
- // 16. Reset Reputation Cache
- // ============================================================================
- if (in_array('reputation', $cacheTypes)) {
- try {
- $reputationCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Reputation/';
- $filesBefore = 0;
- if (is_dir($reputationCacheDir)) {
- }
- // ============================================================================
- // 17. Reset Config Cache
- // ============================================================================
- if (in_array('config', $cacheTypes)) {
- try {
- $configCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Config/';
- $filesBefore = 0;
- if (is_dir($configCacheDir)) {
- unset($this->storage[$scopedKey]);
- unset($this->metadata[$scopedKey]);
- // Remove from the scope's key list
- $scopeKeys = $this->scopes[$this->currentScope] ?? [];
- $index = array_search($scopedKey, $scopeKeys);
- if ($index !== false) {
- array_splice($this->scopes[$this->currentScope], $index, 1);
- }
- // Use higher priority
- $priorities = ['low' => 1, 'medium' => 2, 'high' => 3, 'critical' => 4];
- $priority1 = $priorities[$obj1->getPriority()];
- $priority2 = $priorities[$obj2->getPriority()];
- $combinedPriority = array_search(max($priority1, $priority2), $priorities);
- // Estimate combined time (not just sum, as there may be synergies)
- $estimatedTime = (int)(($obj1->getEstimatedCompletionTime() + $obj2->getEstimatedCompletionTime()) * 0.8);
- return [
- private function translateMonthName(string $monthName, string $languageCode): string
- {
- $englishMonths = ['January', 'February', 'March', 'April', 'May', 'June',
- 'July', 'August', 'September', 'October', 'November', 'December'];
- $monthIndex = array_search(ucfirst(strtolower($monthName)), $englishMonths);
- if ($monthIndex === false) {
- return $monthName; // Return as-is if not found
- }
- $targetMonths = $this->getMonthNames($languageCode);
- if ($field === $idColumn) {
- return true;
- }
- // Exclude system timestamp fields
- if (in_array($field, ['created_at', 'updated_at', 'deleted_at'])) {
- return false;
- }
- // Get column type
- $type = $columnTypes[$field] ?? 'string';
- // Get column type
- $type = $columnTypes[$field] ?? 'string';
- // Include numeric columns (for aggregation)
- if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
- return true;
- }
- // Include date/timestamp columns (for temporal analysis)
- if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
- if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
- return true;
- }
- // Include date/timestamp columns (for temporal analysis)
- if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
- return true;
- }
- // Include text columns (for filtering and grouping)
- if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
- if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
- return true;
- }
- // Include text columns (for filtering and grouping)
- if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
- return true;
- }
- // Exclude everything else (binary, blob, json, etc.)
- return false;
- // Prefer 'normalized'; fall back to 'normalized_value' for forward-compat
- $scoreDescription = (float) ($factor['normalized'] ?? $factor['normalized_value'] ?? 0.0);
- }
- }
- $finalQuadrant = in_array($quadrant, ['Q1', 'Q2', 'Q3', 'Q4']) ? $quadrant : 'Q_intermediate';
- return [
- 'quadrant' => $finalQuadrant,
- 'score_x' => (float) ($scoreXResult['score'] ?? 0.0),
- 'score_y' => (float) ($scoreYResult['score'] ?? 0.0),
- $fields = DoctrineOrm::getTableColumns($tableName);
- // Exclude only ID and system timestamp fields
- return array_values(array_filter($fields, function($field) use ($idColumn) {
- return $field !== $idColumn
- && !in_array($field, ['created_at', 'updated_at', 'deleted_at']);
- }));
- } catch (\Exception $e) {
- return [];
- }
- $words = preg_split('/[\s,.:;!?"()]+/u', mb_strtolower($onlyText), -1, PREG_SPLIT_NO_EMPTY);
- $grammar = $this->grammar();
- $counts = [];
- foreach ($words as $w) {
- $w = preg_replace('/[^\p{L}\p{N}\-]/u', '', $w);
- if (mb_strlen($w) > 2 && !in_array($w, $grammar)) {
- $counts[$w] = ($counts[$w] ?? 0) + 1;
- }
- }
- arsort($counts);
- $report['wordcountmax'] = array_slice($counts, 0, 8, true);
- $productData = $this->getProductData($productId);
- if ($productData && !$productData['in_stock']) {
- $messages[] = [
- 'type' => 'error',
- 'code' => 'out_of_stock',
- 'param' => '$.line_items[' . array_search($lineItem, $lineItems) . ']',
- 'content_type' => 'plain',
- 'content' => 'Produit ' . $productData['title'] . ' temporairement indisponible'
- ];
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_ARCHIVE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_ARCHIVE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- // make sure no duplicate category IDs exist which could lock the server in a loop
- $tmp_array = [];
- $n = count($cPath_array);
- for ($i = 0; $i < $n; $i++) {
- if (!in_array($cPath_array[$i], $tmp_array)) {
- $tmp_array[] = $cPath_array[$i];
- }
- }
- return $tmp_array;
- $category_name = $this->getCategoryTreeTitle($category['name']);
- $categories_url = $this->getCategoryTreeUrl($category_link);
- if (($this->follow_cpath === true) && in_array($category_id, $this->cpath_array)) {
- $link_title = $this->cpath_start_string . $category_name . $this->cpath_end_string;
- } else {
- $link_title = $category_name;
- }
- $result .= $this->parent_end_string;
- }
- if (isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
- if ($this->follow_cpath === true) {
- if (in_array($category_id, $this->cpath_array)) {
- $result .= $this->_buildBranch($category_id, $level + 1);
- }
- } else {
- $result .= $this->_buildBranch($category_id, $level + 1);
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_CATEGORIES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_CATEGORIES_INSTALLED', implode(';', $installed));
- $categories_id = HTML::sanitize($this->Id);
- $new_parent_id = HTML::sanitize($this->moveToCategoryID);
- $path = explode('_', $this->categoriesAdmin->getGeneratedCategoryPathIds($new_parent_id));
- if (\in_array($this->Id, $path)) {
- $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
- $this->app->redirect('Categories&cPath=' . $this->cPath . '&cID=' . $categories_id);
- } else {
- $sql_array = [
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MANUFACTURERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MANUFACTURERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CATALOG_PRODUCTS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CATALOG_PRODUCTS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_ATTRIBUTES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_ATTRIBUTES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SUPPLIERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SUPPLIERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_EMAIL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_EMAIL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_NEWSLETTER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_NEWSLETTER_INSTALLED', implode(';', $installed));
- } else {
- $chosen = [];
- foreach ($_POST['chosen'] as $id) {
- if (is_numeric($id) && !\in_array($id, $chosen)) {
- $chosen[] = $id;
- }
- }
- $ids = array_map(function ($k) {
- }
- } else {
- $chosen = [];
- foreach ($_POST['chosen'] as $id) {
- if (is_numeric($id) && !\in_array($id, $chosen)) {
- $chosen[] = $id;
- }
- }
- $ids = array_map(function ($k) {
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $allowed = array_map(function ($v) {
- return basename($v, '.php');
- }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
- if (!\in_array($newsletter_module, $allowed)) {
- $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
- $newsletter_error = true;
- }
- if ($newsletters_accept_file == 'on') {
- $allowed = array_map(function ($v) {
- return basename($v, '.php');
- }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
- if (!\in_array($newsletter_module, $allowed)) {
- $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
- $newsletter_error = true;
- }
- if ($newsletters_accept_file == 'on') {
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PAGE_MANAGER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PAGE_MANAGER_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ADMINISTRATORS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ADMINISTRATORS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- foreach ($Qips as $allowedIp) {
- $ip = $allowedIp['ip'];
- if ($ip === '127.0.0.1' || $ip === 'localhost') {
- if (in_array($clientIp, ['127.0.0.1', '::1'])) {
- self::logSecurityEvent('Localhost access granted', [
- 'api_id' => $api_id,
- 'client_ip' => $clientIp
- ]);
- */
- public static function isLocalEnvironment(): bool
- {
- $ip = HTTP::getIpAddress();
- if (in_array($ip, ['127.0.0.1', '::1'])) {
- return true;
- }
- $serverName = $_SERVER['SERVER_NAME'] ?? '';
- $host = $_SERVER['HTTP_HOST'] ?? '';
- }
- $method = strtoupper($_SERVER["REQUEST_METHOD"]);
- $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
- if (!in_array($method, $allowedMethods)) {
- throw new Exception("Invalid HTTP method: " . $method);
- }
- return $method;
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_API_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_API_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CACHE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CACHE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- foreach ($models as $model) {
- $modelId = $model['id'];
- $provider = $model['provider'] ?? 'openai'; // Default to openai if missing
- // Validate provider name
- if (!in_array($provider, $validProviders)) {
- if (defined('CLICSHOPPING_APP_CHATGPT_CH_DEBUG') && CLICSHOPPING_APP_CHATGPT_CH_DEBUG === 'True') {
- error_log("WARNING: Invalid provider '$provider' for model '$modelId'. Using 'openai' as default.");
- }
- $provider = 'openai';
- }
- 'open-mistral-nemo',
- 'open-codestral-mamba',
- 'mistral-moderation-latest'
- ];
- if (empty($model) || !in_array($model, $valid_models)) {
- $model = 'mistral-large-latest';
- }
- $config = new MistralAIChat();
- $config->apiKey = $api_key;
- }
- // Validate type is one of expected values
- if (isset($response['type'])) {
- $validTypes = ['analytics', 'semantic', 'web_search', 'hybrid', 'error', 'clarification'];
- if (!in_array($response['type'], $validTypes)) {
- $warnings[] = "Unexpected type value: {$response['type']}";
- }
- }
- return [
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
- exit;
- }
- // Validate feedback_type
- $validTypes = ['positive', 'negative', 'correction'];
- if (!in_array($input['feedback_type'], $validTypes)) {
- echo json_encode([
- 'success' => false,
- 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
- ]);
- exit;
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_COUNTRIES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_COUNTRIES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CURRENCY_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CURRENCY_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_LANGUES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_LANGUES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- }
- foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
- $code = basename($dir);
- if (array_search($code, array_column($directories, 'id')) === false) {
- $directories[] = ['id' => $code,
- 'text' => $code
- ];
- }
- }
- }
- foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
- $code = basename($dir);
- if (array_search($code, array_column($directories, 'id')) === false) {
- $directories[] = ['id' => $code,
- 'text' => $code
- ];
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MODULES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MODULES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $module->install();
- $modules_installed = explode(';', \constant($module_key));
- if (!\in_array($class . $file_extension, $modules_installed)) {
- $modules_installed[] = $class . $file_extension;
- }
- Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
- ['configuration_key' => $module_key]
- $module->remove();
- $modules_installed = explode(';', \constant($module_key));
- if (\in_array($class . $file_extension, $modules_installed)) {
- unset($modules_installed[array_search($class . $file_extension, $modules_installed)]);
- }
- Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
- ['configuration_key' => $module_key]
- $module->remove();
- $modules_installed = explode(';', \constant($module_key));
- if (\in_array($class . $file_extension, $modules_installed)) {
- unset($modules_installed[array_search($class . $file_extension, $modules_installed)]);
- }
- Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
- ['configuration_key' => $module_key]
- );
- if ($dir = @dir($module_directory)) {
- while ($file = $dir->read()) {
- if (!is_dir($module_directory . $file)) {
- if (substr($file, strrpos($file, '.')) == $file_extension) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- } else {
- $new_modules_counter++;
- }
- }
- }
- if (isset($appModuleType)) {
- foreach (Apps::getModules($appModuleType) as $k => $v) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- } else {
- $new_modules_counter++;
- }
- }
- if ($dir = @dir($module_directory)) {
- while ($file = $dir->read()) {
- if (!is_dir($module_directory . $file)) {
- if (substr($file, strrpos($file, '.')) === $file_extension) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- }
- } else {
- if (\in_array($file, $modules_installed)) {
- $directory_array[] = $file;
- } else {
- $new_modules_counter++;
- }
- }
- }
- if (isset($appModuleType)) {
- foreach (Apps::getModules($appModuleType) as $k => $v) {
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
- if (!\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- }
- } else {
- if (\in_array($k, $modules_installed)) {
- $directory_array[] = $k;
- } else {
- $new_modules_counter++;
- }
- }
- <tr>
- <td><?php echo $module->title; ?></td>
- <td class="text-start"><?php echo $module->group; ?></td>
- <td class="text-end">
- <?php
- if (\in_array($module->code . $file_extension, $modules_installed) && is_numeric($module->sort_order)) {
- echo $module->sort_order;
- }
- ?>
- </td>
- <td class="text-center">
- $Qcheck = $CLICSHOPPING_Db->get('configuration', 'configuration_value', ['configuration_key' => 'TEMPLATE_BLOCK_GROUPS']);
- if ($Qcheck->fetch() !== false) {
- $tbgroups_array = explode(';', $Qcheck->value('configuration_value'));
- if (!\in_array($module_type, $tbgroups_array)) {
- $tbgroups_array[] = $module_type;
- sort($tbgroups_array);
- $CLICSHOPPING_Db->save('configuration', [
- 'configuration_value' => implode(';', $tbgroups_array),
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ORDERS_STATUS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_INVOICE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ORDERS_STATUS_INVOICE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PROUCTS_LENGTH_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PROUCTS_LENGTH_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_QUANTITY_UNIT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_QUANTITY_UNIT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SETTINGS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SETTINGS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TAX_CLASS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TAX_CLASS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TAX_GEO_ZONES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TAX_GEO_ZONES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TAX_RATES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TAX_RATES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_TEMPLATE_EMAIL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_TEMPLATE_EMAIL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_WEIGHT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_WEIGHT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ZONES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ZONES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_INFO_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_INFO_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_GDPR_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_GDPR_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_GROUPS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_GROUPS_INSTALLED', implode(';', $installed));
- for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
- if (str_contains($include_modules[$i]['class'], '\\')) {
- Registry::set('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
- $module = Registry::get('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']));
- if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $payments_unallowed))) {
- $content .= '<div class="row">';
- $content .= '<div class="col-md-5">';
- $content .= '<div class="form-group row">';
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
- for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
- if (str_contains($include_modules[$i]['class'], '\\')) {
- Registry::set('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
- $module = Registry::get('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']));
- if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
- $content .= '<span class="col-md-3">' . $module->title . '</span>';
- $content .= '</div>';
- } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
- if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
- $content .= '<span class="col-md-3">' . $module->title . '</span>';
- $content .= '</div>';
- } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
- $content .= '<div class="col-md-12">';
- $content .= '<span class="col-md-1"><i class="bi-check text-danger"></i></span>';
- $content .= '<span class="col-md-3">' . $module->title . '</span>';
- $content .= '</div>';
- } elseif ($cInfo->customers_group_id == 0) {
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- <div class="form-group row">
- <div class="col-md-12">
- <ul class="list-group-slider list-group-flush">
- <li class="list-group-item-slider">
- <label class="switch">
- <?php echo HTML::checkboxField('payment_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $payments_unallowed)) ? true : false, 'class="success"'); ?>
- <span class="slider"></span>
- </label>
- </li>
- <span class="text-slider"><?php echo $module->title; ?></span>
- </ul>
- <div class="form-group row">
- <div class="col-md-12">
- <ul class="list-group-slider list-group-flush">
- <li class="list-group-item-slider">
- <label class="switch">
- <?php echo HTML::checkboxField('shipping_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $shipping_unallowed)) ? true : false, 'class="success"'); ?>
- <span class="slider"></span>
- </label>
- </li>
- <span class="text-slider"><?php echo $module->title; ?></span>
- </ul>
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CUSTOMERS_MEMBERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_MEMBERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_REVIEWS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_REVIEWS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_BANNER_MANAGER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_BANNER_MANAGER_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_FAVORITES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_FAVORITES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_FEATURED_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_FEATURED_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_PRODUCT_RECOMMENDATIONS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_PRODUCT_RECOMMENDATIONS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SEO_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SEO_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_SPECIALS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_SPECIALS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ORDERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ORDERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_PRODUCTS_RETURN_ORDERS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_RETURN_ORDERS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_PAYMENT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_PAYMENT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_PAYMENT_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_STATS_PRODUCTS_NOTIFICATION_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_STATS_PRODUCTS_NOTIFICATION_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_SHIPPING_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_SHIPPING_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_SHIPPING_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_SHIPPING_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $CLICSHOPPING_Language = Registry::get('Language');
- $module = HTML::sanitize(str_replace(' ', '', $module));
- if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
- if (!is_null($module) && in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
- if (!class_exists($module)) {
- if (is_file($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
- $CLICSHOPPING_Language->loadDefinitions('modules/action_recorder/' . $module);
- include($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)));
- } else {
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ACTIONS_RECORDER_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ACTIONS_RECORDER_INSTALLED', implode(';', $installed));
- $modules_array[] = $Qmodules->value('module');
- }
- $expired_entries = 0;
- if (isset($_GET['module']) && \in_array($_GET['module'], $modules_array)) {
- $get_module_class = $CLICSHOPPING_ActionsRecorderClass->getClassModule($_GET['module']);
- if (\is_object($get_module_class)) {
- $expired_entries += $get_module_class->expireEntries();
- } else {
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- echo HTML::form('search', $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder'), 'post', '', ['session_id' => true]);
- echo HTML::selectField('module', $modules_list_array, null, 'onchange="this.form.submit();"');
- ?>
- </span>
- <span class="col-md-1 text-end">
- <?php echo HTML::button($CLICSHOPPING_ActionsRecorder->getDef('button_reset'), null, $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder&Expire' . (isset($_POST['module']) && \in_array($_POST['module'], $modules_array) ? '&module=' . $_POST['module'] : '')), 'danger'); ?>
- </span>
- </div>
- </form>
- </div>
- </div>
- </thead>
- <tbody>
- <?php
- $filter = [];
- if (isset($_POST['module']) && \in_array($_POST['module'], $modules_array)) {
- $filter[] = 'module = :module';
- }
- if (isset($_POST['search']) && !empty($_POST['search'])) {
- $filter[] = 'identifier like :identifier';
- $sql_query .= ' order by date_added desc limit :page_set_offset, :page_set_max_results';
- $Qactions = $CLICSHOPPING_ActionsRecorder->db->prepare($sql_query);
- if (!empty($filter)) {
- if (isset($_POST['module']) && \in_array($_POST['module'], $modules_array)) {
- $Qactions->bindValue(':module', $_POST['module']);
- }
- if (isset($_POST['search']) && !empty($_POST['search'])) {
- $Qactions->bindValue(':identifier', '%' . $_POST['search'] . '%');
- <div class="row">
- <div class="col-md-12">
- <div
- class="col-md-6 float-start pagenumber hidden-xs TextDisplayNumberOfLink"><?php echo $Qactions->getPageSetLabel($CLICSHOPPING_ActionsRecorder->getDef('text_display_number_of_link')); ?></div>
- <div
- class="float-end text-end"> <?php echo $Qactions->getPageSetLinks((isset($_POST['module']) && \in_array($_POST['module'], $modules_array) && \is_object($GLOBALS[$_POST['module']]) ? 'module=' . $_POST['module'] : null) . '&' . (isset($_POST['search']) && !empty($_POST['search']) ? 'search=' . $_POST['search'] : null)); ?></div>
- </div>
- </div>
- </div>
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_ADMINISTRATOR_MENU_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_ADMINISTRATOR_MENU_INSTALLED', implode(';', $installed));
- if (isset($this->Id) && ($this->Id != $this->moveToCategoryID)) {
- $new_parent_id = $this->moveToCategoryID;
- $path = explode('_', AdministratorMenu::getGeneratedAdministratorMenuPathIds($new_parent_id));
- if (\in_array($this->Id, $path)) {
- $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
- $this->app->redirect('AdministratorMenu&cPath=' . (int)$this->cPath . '&cID=' . (int)$this->Id);
- } else {
- $this->app->db->save('administrator_menu', [
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_APPS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_APPS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_BACKUP_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_BACKUP_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $dir = dir($backup_directory);
- $contents = [];
- while ($file = $dir->read()) {
- if (!is_dir($backup_directory . $file) && \in_array(substr($file, -3), array('zip', 'sql', '.gz'))) {
- $contents[] = $file;
- }
- }
- sort($contents);
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_CRONJOB_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_CRONJOB_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_DATA_BASE_TABLES_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_DATA_BASE_TABLES_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- ['id' => 'utf8',
- 'text' => $CLICSHOPPING_DataBaseTables->getDef('action_utf8_conversion')
- ]);
- if (isset($_POST['action'])) {
- if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
- if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
- $tables = Database::getDtTables();
- foreach ($_POST['id'] as $key => $value) {
- if (!\in_array($value, $tables)) {
- if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
- if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
- $tables = Database::getDtTables();
- foreach ($_POST['id'] as $key => $value) {
- if (!\in_array($value, $tables)) {
- unset($_POST['id'][$key]);
- }
- }
- if (!empty($_POST['id'])) {
- while ($Qaction->fetch()) {
- $table_data[] = [
- ($table != $current_table) ? HTML::outputProtected($table) : '',
- $Qaction->valueProtected('Msg_type'),
- $Qaction->valueProtected('Msg_text'),
- ($table != $current_table) ? HTML::checkboxField('id[]', $table, isset($_POST['id']) && \in_array($table, $_POST['id'])) : ''
- ];
- $current_table = $table;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_DEFINE_LANGUAGE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_DEFINE_LANGUAGE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory_selected));
- foreach ($file_array as $filename => $current) {
- $fileInfo = pathinfo($current->getFileName());
- if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $current->getFileName();
- }
- }
- if ($found) { // Check the $found array is not empty
- $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($filename_selected));
- foreach ($file_array as $filename => $current) {
- $fileInfo = pathinfo($current->getFileName());
- if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $current->getFileName();
- }
- }
- if ($found) { // Check the $found array is not empty
- $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($template_directory));
- foreach ($file_array as $filename => $current) {
- $fileInfo = pathinfo($current->getFileName());
- if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $current->getFileName();
- }
- }
- if ($found) { // Check the $found array is not empty
- /* if empty error is produced : Fatal error: Uncaught exception 'RuntimeException'*/
- foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($template_directory)) as $filename => $current) {
- $fileInfo = pathinfo($current->getFileName());
- if (array_key_exists('extension', $fileInfo) && \in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $current->getFileName();
- }
- }
- if ($found) { // Check the $found array is not empty
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_EDIT_DESIGN_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_EDIT_DESIGN_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_EDIT_LOG_ERROR_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_EDIT_LOG_ERROR_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- * @param array $checks An array of check results, each with a 'status' key.
- * @return string The overall status: 'error', 'warning', or 'healthy'.
- */
- private function determineOverallStatus(array $checks): string
- {
- if (in_array('error', array_column($checks, 'status'))) {
- return 'error';
- }
- if (in_array('warning', array_column($checks, 'status'))) {
- return 'warning';
- }
- private function determineOverallStatus(array $checks): string
- {
- if (in_array('error', array_column($checks, 'status'))) {
- return 'error';
- }
- if (in_array('warning', array_column($checks, 'status'))) {
- return 'warning';
- }
- return 'healthy';
- }
- foreach ($Qips as $allowedIp) {
- $ip = $allowedIp['ip'];
- if ($ip === '127.0.0.1' || $ip === 'localhost') {
- if (in_array($clientIp, ['127.0.0.1', '::1'])) {
- self::logSecurityEvent('Localhost access granted', [
- 'mcp_id' => $mcp_id,
- 'client_ip' => $clientIp
- ]);
- */
- public static function isLocalEnvironment(): bool
- {
- $ip = HTTP::getIpAddress();
- if (in_array($ip, ['127.0.0.1', '::1'])) {
- return true;
- }
- $serverName = $_SERVER['SERVER_NAME'] ?? '';
- $host = $_SERVER['HTTP_HOST'] ?? '';
- }
- $method = strtoupper($_SERVER["REQUEST_METHOD"]);
- $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
- if (!in_array($method, $allowedMethods)) {
- throw new Exception("Invalid HTTP method: " . $method);
- }
- return $method;
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MCP_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MCP_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- /**
- * Valide une clé d'API pour un niveau d'accès donné
- */
- public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
- if (!in_array($accessLevel, $this->accessLevels)) {
- return false;
- }
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- }
- return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
- }
- /**
- * Valide les headers de sécurité requis
- */
- 'ssl_enabled' => $sslEnabled,
- 'origin' => $origin
- ];
- // Add to allowed origins list
- if (!in_array($origin, $this->allowedOrigins)) {
- $this->allowedOrigins[] = $origin;
- }
- }
- // Fallback to localhost if no configurations found
- /**
- * Check if an origin is allowed
- */
- public function isOriginAllowed(string $origin): bool {
- return in_array($origin, $this->allowedOrigins);
- }
- /**
- * Valide une clé d'API pour un niveau d'accès donné
- */
- /**
- * Valide une clé d'API pour un niveau d'accès donné
- */
- public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
- if (!in_array($accessLevel, $this->accessLevels)) {
- return false;
- }
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- if (!isset($this->validMcpKeys[$accessLevel])) {
- return false;
- }
- return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
- }
- /**
- * Valide les headers de sécurité requis
- */
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_MODULES_HOOKS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_MODULES_HOOKS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SEC_DIR_PERMISSIONS_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SEC_DIR_PERMISSIONS_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- if ($handle = opendir($path)) {
- while (false !== ($filename = readdir($handle))) {
- if (!\in_array($filename, $exclude_array)) {
- $file = ['name' => $path . $filename,
- 'is_dir' => is_dir($path . $filename),
- 'writable' => FileSystem::isWritable($path . $filename)
- ];
- <th
- scope="row"><?php echo substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))); ?></th>
- <td
- class="text-center"><?php echo $file['writable'] === true ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'; ?></td>
- <td
- class="text-center"><?php echo(\in_array(substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))), $whitelist_array) ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'); ?></td>
- </tr>
- <?php
- }
- }
- ?>
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SECURITY_CHECK_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SECURITY_CHECK_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- <?php
- foreach ($modules as $module) {
- $secCheck = $GLOBALS[$module['class']];
- if (!\in_array($secCheck->type, $types)) {
- $secCheck->type = 'info';
- }
- $output = '';
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_SERVICE_APP_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_SERVICE_APP_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_UPGRADE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_UPGRADE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- public function uninstall()
- {
- parent::uninstall();
- $installed = explode(';', MODULE_MODULES_WHOS_ONLINE_INSTALLED);
- $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
- if ($installed_pos !== false) {
- unset($installed[$installed_pos]);
- $this->app->saveCfgParam('MODULE_MODULES_WHOS_ONLINE_INSTALLED', implode(';', $installed));
- $default_module = $m;
- break;
- }
- }
- $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
- }
- }
- continue;
- }
- $fullClass = self::NAMESPACE_PREFIX . $fileInfo->getBasename('.php');
- if (class_exists($fullClass) && in_array(ActionToolsInterface::class, class_implements($fullClass))) {
- try {
- /** @var ActionToolsInterface $toolInstance */
- $toolInstance = new $fullClass();
- $toolName = $toolInstance->getName();
- $this->tools[$toolName] = $fullClass;
- $details_string = preg_replace('/comment\(.+\)$/', '', $details_string);
- $details = array_filter(explode(' ', $details_string), fn($v) => $v !== null && $v !== '');
- $details = array_values($details);
- }
- $is_binary = array_search('binary', $details);
- if (is_int($is_binary)) {
- array_splice($details, $is_binary, 1);
- $schema['col'][$field_name]['binary'] = true;
- }
- if (is_int($is_binary)) {
- array_splice($details, $is_binary, 1);
- $schema['col'][$field_name]['binary'] = true;
- }
- $is_unsigned = array_search('unsigned', $details);
- if (is_int($is_unsigned)) {
- array_splice($details, $is_unsigned, 1);
- $schema['col'][$field_name]['unsigned'] = true;
- }
- if (is_int($is_unsigned)) {
- array_splice($details, $is_unsigned, 1);
- $schema['col'][$field_name]['unsigned'] = true;
- }
- $is_not_null = array_search('not_null', $details);
- if (is_int($is_not_null)) {
- array_splice($details, $is_not_null, 1);
- $schema['col'][$field_name]['not_null'] = true;
- }
- if (is_int($is_not_null)) {
- array_splice($details, $is_not_null, 1);
- $schema['col'][$field_name]['not_null'] = true;
- }
- $is_auto_increment = array_search('auto_increment', $details);
- if (preg_match('/on_update\(([^)]+)\)/', $details_string, $on_update_match)) {
- $schema['col'][$field_name]['on_update'] = $on_update_match[1];
- $details_string = preg_replace('/on_update\([^)]+\)/', '', $details_string);
- $details = array_values(array_filter(explode(' ', $details_string)));
- $this->result = $this->cache_data;
- } else {
- $fetch_argument = $args[0] ?? null;
- $ctor_args = $args[1] ?? [];
- if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument);
- } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
- } else {
- $this->result = parent::fetchAll($fetch_style);
- $fetch_argument = $args[0] ?? null;
- $ctor_args = $args[1] ?? [];
- if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument);
- } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
- $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
- } else {
- $this->result = parent::fetchAll($fetch_style);
- }
- */
- public function setExcludeEntries(?array $entries)
- {
- if (is_array($entries)) {
- foreach ($entries as $value) {
- if (!in_array($value, $this->exclude_entries)) {
- $this->exclude_entries[] = $value;
- }
- }
- } elseif (is_string($entries)) {
- if (!in_array($entries, $this->exclude_entries)) {
- if (!in_array($value, $this->exclude_entries)) {
- $this->exclude_entries[] = $value;
- }
- }
- } elseif (is_string($entries)) {
- if (!in_array($entries, $this->exclude_entries)) {
- $this->exclude_entries[] = $entries;
- }
- }
- }
- $this->listing = array();
- }
- if ($dir = @dir($directory)) {
- while (($entry = $dir->read()) !== false) {
- if (!in_array($entry, $this->exclude_entries)) {
- if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
- if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
- if ($this->adddirectory_to_filename === true) {
- if ($dir->path !== $this->directory) {
- $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
- if ($dir = @dir($directory)) {
- while (($entry = $dir->read()) !== false) {
- if (!in_array($entry, $this->exclude_entries)) {
- if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
- if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
- if ($this->adddirectory_to_filename === true) {
- if ($dir->path !== $this->directory) {
- $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
- }
- }
- * @param string $type The type of the module to check for.
- * @return bool Returns true if the module exists, false otherwise.
- */
- final public function hasModule(string $module, string $type): bool
- {
- return isset($this->modules[$type]) && in_array($module, $this->modules[$type]);
- }
- /**
- * Sets the app information by reflecting the current class and loading data
- * from a metafile. Assigns the app's code, vendor, title, version, and modules
- $field .= ' id="' . static::output(substr($parameters, $offset + 4, strpos($parameters, '"', $offset + 4) - ($offset + 4))) . '_' . $counter . '"';
- }
- $field .= ' value="' . static::output($selection_value) . '"';
- if (isset($default) && (($default === true) || (!is_array($default) && ((string)$default == (string)$selection_value)) || (is_array($default) && in_array($selection_value, $default)))) {
- $field .= ' checked="checked"';
- }
- if (!empty($parameters)) {
- $field .= ' ' . $parameters;
- if (!isset($params['type'])) {
- $params['type'] = 'submit';
- }
- if (!in_array($params['type'], $types)) {
- $params['type'] = 'submit';
- }
- if (($params['type'] == 'submit') && isset($link)) {
- $params['type'] = 'button';
- if (($params['type'] == 'submit') && isset($link)) {
- $params['type'] = 'button';
- }
- if (isset($style) && !in_array($style, $styles)) {
- unset($style);
- }
- if (isset($size) && !in_array($size, $size_button)) {
- unset($size);
- if (isset($style) && !in_array($style, $styles)) {
- unset($style);
- }
- if (isset($size) && !in_array($size, $size_button)) {
- unset($size);
- }
- $button = '';
- if (!isset($data['cafile'])) {
- $data['cafile'] = CLICSHOPPING::BASE_DIR . 'External/cacert.pem';
- }
- if (isset($data['format']) && !in_array($data['format'], ['json'])) {
- trigger_error('HttpRequest::getResponse(): Unknown "format": ' . $data['format']);
- unset($data['format']);
- }
- ];
- $domain = strtolower(substr(strrchr($email, "@"), 1));
- if (in_array($domain, $temp_domains)) {
- return true;
- }
- }
- return false;
- $stack = [
- 'text' => $message,
- 'type' => $type
- ];
- if (!$this->exists($group) || !in_array($stack, $this->data[$group])) {
- $this->data[$group][] = $stack;
- }
- }
- /**
- }
- }
- if (!empty($this->_upload)) {
- if (!empty($this->_extensions)) {
- if (!in_array(mb_strtolower(substr($this->_upload['name'], strrpos($this->_upload['name'], '.') + 1)), $this->_extensions)) {
- $CLICSHOPPING_MessageStack->add(CLICSHOPPING::getDef('error_filetype_not_allowed') . implode(', ', $this->_extensions), 'warning');
- return false;
- }
- }
- public function isInstalled()
- {
- $module = HTML::sanitize(str_replace(' ', '', $this->_module));
- if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
- if (!is_null($module) && \in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
- if (!class_exists($module)) {
- if (is_file(CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Core/modules/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
- $this->lang->loadDefinitions('Shop/Module/ActionRecorder/' . $module);
- $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
- foreach ($contents as $item) {
- $fileInfo = pathinfo($item);
- if (array_key_exists('extension', $fileInfo) && \in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $item;
- }
- }
- if ($found) { // Check the $found array is not empty
- sort($select_array);
- $values_array = explode(';', $values);
- $output = '';
- foreach ($select_array as $file) {
- $output .= HTML::checkboxField('ht_datepicker_jquery_file[]', $file, \in_array($file, $values_array)) . ' ' . HTML::outputProtected($file) . '<br />';
- }
- if (!empty($output)) {
- $output = '<br />' . substr($output, 0, -6);
- }
- */
- public static function checkExecEnabled(): bool
- {
- $disabled = explode(', ', ini_get('disable_functions'));
- return !in_array('exec', $disabled);
- }
- /**
- * Checks if Composer is installed and accessible in the current environment.
- *
- $Qproducts->bindInt(':language_id', (int)$CLICSHOPPING_Language->getId());
- $Qproducts->execute();
- while ($Qproducts->fetch()) {
- if (MODE_B2B_B2C == 'True') {
- if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
- $Qprice = $CLICSHOPPING_Db->prepare('select customers_group_price,
- customers_group_id
- from :table_products_groups
- where products_id = :products_id
- $price_string = '';
- $sde = 0;
- //while(list($sdek,$sdev)=each($all_groups)){
- foreach ($all_groups as $sdek => $sdev) {
- if (!in_array($Qproducts->valueInt('products_id') . ":" . (int)$sdek, $exclude)) {
- if ($sde)
- $price_string .= ' - ';
- $price_string .= $sdev . ' : ' . $CLICSHOPPING_Currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek] : $Qproducts->valueDecimal('products_price'));
- $sde = 1;
- }
- // Ajouter VISITOR_NAME . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) pour permettre d'afficher le prix des clients qui ne font pas partie d'un groupe B2B(
- $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . CLICSHOPPING::getDef('visitor_name') . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ' - ' . $price_string . ')</option>';
- }
- } else {
- if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
- $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ')</option>';
- }
- }
- // ####### END #######
- {
- if (is_dir($source) === true) {
- $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($files as $file) {
- if (in_array($file->getBasename(), array('.', '..')) !== true) {
- if ($file->isDir() === true) {
- rmdir($file->getPathName());
- } elseif (($file->isFile() === true) || ($file->isLink() === true)) {
- unlink($file->getPathname());
- }
- $fileTypes = ['php']; // Create an array of file types
- $found = []; // Traverse the folder, and add filename to $found array if type matches
- foreach ($contents as $item) {
- $fileInfo = pathinfo($item);
- if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
- $found[] = $item;
- }
- }
- if ($found) { // Check the $found array is not empty
- $QpaymentsNotAllowed->execute();
- $payments_not_allowed = $QpaymentsNotAllowed->fetch();
- $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
- $clearance = (in_array($pay_check, $payments_unallowed)) ? true : false;
- } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
- $clearance = true;
- } else {
- $clearance = false;
- $Qpayments->execute();
- $payments_not_allowed = $Qpayments->fetch();
- $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
- $clearance = (!in_array($pay_check, $payments_unallowed)) ? true : false;
- return $clearance;
- }
- }
- $QshippingNotAllowed->execute();
- $shipping_not_allowed = $QshippingNotAllowed->fetch();
- $shipping_unallowed = explode(",", $shipping_not_allowed['group_shipping_unallowed']);
- $shipping_clearance = (in_array($shipping_check, $shipping_unallowed)) ? true : false;
- } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
- $shipping_clearance = true;
- } else {
- $shipping_clearance = false;
- }
- $shipping_not_allowed = $Qshipping->fetch();
- if (!empty($shipping_not_allowed['group_payment_unallowed'])) {
- $shipping_unallowed = explode(',', $shipping_not_allowed['group_payment_unallowed']);
- $shipping_clearance = (!in_array($shipping_check, $shipping_unallowed)) ? true : false;
- } else {
- $shipping_clearance = false;
- }
- return $shipping_clearance;
- $string = '';
- if (is_array($array) && !empty($array)) {
- foreach ($array as $key => $value) {
- if (!in_array($key, $exclude)) {
- $string .= $key . '=' . $value . '&';
- }
- }
- $string = substr($string, 0, -1);
- $Qglobal->execute();
- $global = $Qglobal->fetch();
- if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] === $_SESSION['sessiontoken'])) {
- if (isset($_POST['product_global']) && is_numeric($_POST['product_global']) && in_array($_POST['product_global'], ['0', '1'])) {
- $product_global = (int)$_POST['product_global'];
- } else {
- $product_global = 0;
- }
- } elseif (count($products) > 0) {
- $products_parsed = [];
- foreach ($products as $value) {
- if (is_numeric($value) && !in_array($value, $products_parsed)) {
- $products_parsed[] = $value;
- }
- }
- if (count($products_parsed) > 0) {
- if (defined('MODULE_PAYMENT_INSTALLED') && !is_null(MODULE_PAYMENT_INSTALLED)) {
- $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
- $include_modules = [];
- if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
- $this->selected_module = $module;
- if (str_contains($module, '\\')) {
- $class = Apps::getModuleClass($module, 'Payment');
- if (($this->getCountPaymentModules() == 1) && (!isset($_SESSION['payment']) || ($_SESSION['payment'] != $include_modules[0]['class']))) {
- $_SESSION['payment'] = $include_modules[0]['class'];
- }
- if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
- if (str_contains($module, '\\')) {
- $CLICSHOPPING_PM = Registry::get('Payment_' . str_replace('\\', '_', $module));
- if (isset($CLICSHOPPING_PM->form_action_url)) {
- /**
- $code = $vendor . '\\' . $app . '\\' . $module;
- }
- }
- if (isset($code) && (in_array($code . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules) || in_array($code, $this->modules))) {
- if (str_contains($code, '\\')) {
- $class = Apps::getModuleClass($code, 'Shipping');
- $include_modules[] = [
- 'class' => $code,
- include($this->_directoryIncludes . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
- }
- }
- // exclude $modules_boxe and search if the modules exist
- if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
- $result = array_search($group, $this->getReadModulesDefaultDirectories());
- if (!is_null($result)) {
- if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
- include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
- }
- }
- // exclude $modules_boxe and search if the modules exist
- if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
- $result = array_search($group, $this->getReadModulesDefaultDirectories());
- if (!is_null($result)) {
- if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
- include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
- } elseif (is_file($this->getDefaultTemplateDirectory() . DIRECTORY_SEPARATOR . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
- $currentParent = $newParentId;
- $visitedCategories = [];
- // Traverse up the parent chain to check for circular reference
- while ($currentParent !== 0) {
- if (in_array($currentParent, $visitedCategories)) {
- return true; // Already visited, indicates circular reference
- }
- if ($currentParent === $categoryId) {
- return true; // Found the original category in the parent chain
- // Validate numeric fields
- if (isset($data['suppliers_country_id']) && !is_numeric($data['suppliers_country_id'])) {
- $errors[] = 'Country ID must be numeric';
- }
- if (isset($data['suppliers_status']) && !in_array($data['suppliers_status'], [0, 1])) {
- $errors[] = 'Supplier status must be 0 or 1';
- }
- if (isset($data['languages_id']) && !is_numeric($data['languages_id'])) {
- $errors[] = 'Language ID must be numeric';
- while ($file = $dir->read()) {
- if (!is_dir($backup_directory . $file)) {
- $ext = substr($file, strrpos($file, '.') + 1);
- if (in_array($ext, array('zip', 'sql', 'gz')) && !isset($contents[$ext])) {
- $contents[$ext] = $file;
- if ($ext != 'sql') { // zip and gz (binaries) are prioritized over sql (plain text)
- break;
- }
- }
- } else {
- $products_attributes_image = '';
- }
- $checked = \is_array($selected_attributes) && \in_array($value['id'], $selected_attributes) ? ' checked' : '';
- $chk_id = 'chk_' . $QproductsOptionsName->valueInt('products_options_id') . '_' . $value['id'];
- $products_options_content_display .= '<div class="col-md-12">';
- $products_options_content_display .= '<span class="ModuleProductsInfoOptionsPullDownMenu">';
- $products_options_content_display .= '<div class="custom-control custom-checkbox">';
- foreach ($dir_content as $key => $content) {
- $path = $root_dir . DIRECTORY_SEPARATOR . $content;
- if (is_file($path) && is_readable($path)) {
- // skip ignored files
- if (!\in_array($content, $ignore_files)) {
- if (preg_match($ignore_regex, $content) == 0) {
- $content_chunks = explode(".", $content);
- $ext = $content_chunks[\count($content_chunks) - 1];
- // only include files with desired extensions
- if (\in_array($ext, $allow_extensions)) {
- if (!\in_array($content, $ignore_files)) {
- if (preg_match($ignore_regex, $content) == 0) {
- $content_chunks = explode(".", $content);
- $ext = $content_chunks[\count($content_chunks) - 1];
- // only include files with desired extensions
- if (\in_array($ext, $allow_extensions)) {
- // save file name with path
- $all_data[] = $path;
- }
- }
- }
- }
- }
- } // if content is a directory and readable, add path and name
- elseif (is_dir($path) && is_readable($path)) {
- // skip any ignored dirs
- if (!\in_array($content, $ignore_dirs)) {
- // recursive callback to open new directory
- $all_data = get_files($path, $all_data);
- }
- }
- } // end foreach
Your project should not use deprecated PHP features 4
- Read doc
- Productivity
- Major
More information: https://insight.symfony.com/what-we-analyse/php.use_deprecated_function
- $result = curl_exec($curl);
- if (empty($result)) {
- $info = curl_getinfo($curl);
- curl_close($curl);
- } else {
- $info = 'error';
- }
- return $info;
- $result = curl_exec($curl);
- if (empty($result)) {
- $info = curl_getinfo($curl);
- curl_close($curl);
- } else {
- $info = 'error';
- }
- return $info;
- $result = curl_exec($curl);
- if (empty($result)) {
- $info = curl_getinfo($curl);
- curl_close($curl);
- } else {
- $info = 'error';
- }
- return $info;
- $result = curl_exec($curl);
- if (empty($result)) {
- $info = curl_getinfo($curl);
- curl_close($curl);
- } else {
- $info = 'error';
- }
- return $info;
Mutable DateTime should be avoided in favor of DateTimeImmutable 3
- Read doc
- Reliability
- Minor
More information: https://insight.symfony.com/what-we-analyse/php.prefer_date_time_immutable
- if (!empty($_POST['schdate'])) {
- $schdate = HTML::sanitize($_POST['schdate']);
- $date1 = new \DateTime(date('Y-m-d'));
- $date2 = new \DateTime($schdate);
- if ($date1 < $date2) {
- $status = 0;
- }
- } else {
- if (!empty($_POST['schdate'])) {
- $schdate = HTML::sanitize($_POST['schdate']);
- $date1 = new \DateTime(date('Y-m-d'));
- $date2 = new \DateTime($schdate);
- if ($date1 < $date2) {
- $status = 0;
- }
- } else {
- </div>
- <?php
- if ((ACCOUNT_DOB == 'true' && ($CLICSHOPPING_Customer->getCustomersGroupID() == 0)) || (ACCOUNT_DOB_PRO == 'true' && ($CLICSHOPPING_Customer->getCustomersGroupID() != 0))) {
- if (!empty($customers_dob)) {
- $customers_dob = DateTime::toShort($customers_dob);
- $dateObj = new \DateTime($customers_dob);
- $customers_dob = $dateObj->format('Y-m-d');
- } else {
- $customers_dob = null;
- }
- ?>