PhoenixKit.Modules.Publishing.Web.Editor.Helpers (phoenix_kit v1.7.38)

Copy Markdown View Source

Shared helper functions for the publishing editor.

Contains utilities for URL building, language handling, virtual post creation, and other common operations.

Summary

Functions

Assigns current language with enabled/known status.

Builds language data for the publishing_language_switcher component.

Builds the public URL for a post.

Builds a virtual post for new post creation.

Builds a virtual translation for a new language.

Gets the editor language from assigns.

Gets the preview URL for a featured image.

Formats a list of language codes for display.

Gets the URL for a file from storage.

Gets the language name for a language code.

Gets post directory path for primary language status check.

Sanitizes a featured image ID value.

Gets the base directory for a slug-mode post.

Functions

assign_current_language(socket, language_code)

Assigns current language with enabled/known status.

build_editor_languages(post, blog_slug, enabled_languages, current_language)

Builds language data for the publishing_language_switcher component.

build_public_url(post, language)

Builds the public URL for a post.

build_virtual_post(blog_slug, arg2, primary_language, now)

Builds a virtual post for new post creation.

build_virtual_translation(post, blog_slug, new_language, new_path, socket)

Builds a virtual translation for a new language.

editor_language(assigns)

Gets the editor language from assigns.

format_language_list(language_codes)

Formats a list of language codes for display.

get_file_url(file_id)

Gets the URL for a file from storage.

get_language_name(language_code)

Gets the language name for a language code.

get_post_directory(arg1)

Gets post directory path for primary language status check.

slug_base_dir(post, blog_slug)

Gets the base directory for a slug-mode post.