function on_cms_check_restrictions_C($data) { global $tables, $cat; if (isset($cat)) { $allowed_categoryids = cw_ab_get_cms_categories($data['contentsection_id']); if (!empty($allowed_categoryids) && is_array($allowed_categoryids)) { if (!in_array(intval($cat), $allowed_categoryids)) { return false; } } } return true; }
if (!$is_image_uploaded_and_saved) { cw_add_top_message(cw_get_langvar_by_name('msg_ab_err_banner_image_not_uploaded_or_saved'), 'E'); cw_header_location('index.php?target=cms&mode=add'); } } break; } cw_event('on_cms_update', array($contentsection_id, $content_section)); $presaved_content_section = array(); cw_header_location('index.php?target=cms&mode=update&contentsection_id=' . $contentsection_id); } break; } cw_header_location('index.php?target=cms&mode=add'); } $categories = cw_ab_get_cms_categories($contentsection_id); $products = cw_ab_get_cms_products($contentsection_id); $manufacturers = cw_ab_get_cms_manufacturers($contentsection_id); $clean_urls = cw_ab_get_cms_clean_urls($contentsection_id); $restricted_attributes = cw_ab_get_cms_restrict_attributes($contentsection_id); $skins = cw_files_get_dir($app_dir . '/skins/addons/cms/skins', 2); $skins = array_map('basename', $skins); $presaved_content_section['image'] = 0; //cw_image_get('cms_images', intval($presaved_content_section['contentsection_id'])); $attributes = cw_func_call('cw_attributes_get', array('item_id' => 0, 'item_type' => 'AB', 'language' => $edited_language)); if (!empty($contentsection_id)) { $query = "SELECT *, service_code as service_code FROM {$tables['cms']} WHERE contentsection_id = '" . intval($contentsection_id) . "'"; $content_section = cw_query_first($query); if (!empty($content_section) && is_array($content_section) && $mode != 'add') { $content_section_alt_languages = cw_query_first("SELECT name, alt, url, content FROM {$tables['cms_alt_languages']} WHERE contentsection_id = '" . intval($contentsection_id) . "' AND code = '" . $current_language . "'"); if (!empty($content_section_alt_languages) && is_array($content_section_alt_languages)) {