} // else fail silently } // else fail silently } $url_to_go = 'access_urls.php'; $message = get_lang('URLEdited'); } else { $num = UrlManager::url_exist($url); if ($num == 0) { // checking url if (substr($url, strlen($url) - 1, strlen($url)) == '/') { UrlManager::add($url, $description, $active); } else { //create UrlManager::add($url . '/', $description, $active); } $message = get_lang('URLAdded'); $url_to_go = 'access_urls.php'; } else { $url_to_go = 'access_url_edit.php'; $message = get_lang('URLAlreadyAdded'); } // URL Images $url .= substr($url, strlen($url) - 1, strlen($url)) == '/' ? '' : '/'; $url_id = UrlManager::get_url_id($url); $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/'; $image_fields = array("url_image_1", "url_image_2", "url_image_3"); foreach ($image_fields as $image_field) { if ($_FILES[$image_field]['error'] == 0) { // Hardcoded: only PNG files allowed
} // else fail silently } */ $url_to_go = 'index.php'; $message = get_lang('URLEdited'); } else { error_log(__LINE__); $num = UrlManager::url_exist($url); if ($num == 0) { //checking url if (substr($url, -1) == '/') { $url .= '/'; } error_log(__LINE__); UrlManager::add($url, $description, $active, $url_type, $url_array); $message = get_lang('URLAdded'); $url_to_go = 'index.php'; } else { $url_to_go = 'index.php'; $message = get_lang('URLAlreadyAdded'); } // URL Images $url .= substr($url, -1) == '/' ? '' : '/'; $url_id = UrlManager::get_url_id($url); /* $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; $image_fields = array("url_image_1", "url_image_2", "url_image_3"); foreach ($image_fields as $image_field) { if ($_FILES[$image_field]['error'] == 0) { // Hardcoded: only PNG files allowed