# final class \SmartViewHtmlHelpers
{ } ::

Class: SmartViewHtmlHelpers - Easy to use HTML ViewHelper Components.

- Language: PHP
- Located at: lib/core/plugins/lib_viewhelpers.php
- Package: Application:Plugins:ViewComponents
- Namespace: \
- Class Name: SmartViewHtmlHelpers
- Version: v.20240119
- Depends: classes: Smart
- Usage: static object: Class::method() - This class provides only STATIC methods

## class Methods

public static function html_js_preview_iframe ( string $yid, string $y_contents, string $y_width = "720px", string $y_height = "300px", bool $y_maximized = false, string $y_sandbox = "allow-popups allow-same-origin" ) {} :: STRING
public static function html_jsload_hilitecodesyntax ( string $dom_selector, string $theme = "", bool $use_absolute_url = false ) {} :: STRING
@return: {STRING} [HTML Code]
@param: {STRING} $dom_selector: A valid jQuery HTML-DOM Selector as container(s) for Pre>Code (see jQuery ...) ; Can be: 'body', '#id-element', ...
@param: {ENUM} $theme: The Visual CSS Theme to Load ; By default is set to '' which loads the default theme ; List of Available Themes: 'light', 'dark'
@param: {BOOL} $use_absolute_url: If TRUE will use full URL prefix to load CSS and Javascripts ; Default is FALSE
Return the HTML / CSS / Javascript code to Load the required Javascripts for the prism.js
If a valid DOM Selector is specified all code areas in that dom selector will be highlighted
This function should not be rendered more than once in a HTML page
public static function html_jsload_editarea ( bool $y_use_absolute_url = false, array $custom_themes = [] ) {} :: STRING
@return: {STRING} [HTML Code]
@param: {BOOL} $y_use_absolute_url: If TRUE will use full URL prefix to load CSS and Javascripts ; Default is FALSE
@param: {ARRAY} $custom_themes: An array with custom themes to load from available themes like [ 'theme1', 'theme2', ... ]
Return the HTML / Javascript code to Load the required Javascripts for the Code Editor (Edit Area).
Should be called just once, before calling one or many ::html_js_editarea()
public static function html_js_editarea ( string $yid, string $yvarname, string $yvalue = "", string $y_mode = "text", bool $y_editable = true, string $y_width = "720px", string $y_height = "300px", bool $y_line_numbers = true, string $custom_theme = "" ) {} :: STRING
@return: {STRING} [HTML Code]
@param: {STRING} $yid: [Unique HTML Page Element ID]
@param: {STRING} $yvarname: [HTML Form Variable Name]
@param: {STRING} $yvalue: [HTML Data]
@param: {ENUM} $y_mode: [Parser mode: css, javascript, json, json-ld, html, xml, yaml, markdown, sql, php, ini, shell, go, text, gpg]
@param: {BOOLEAN} $y_editable: [Editable: true / Not Editable: false]
@param: {INTEGER+} $ywidth: [Area Width: (Example) 720px or 75%]
@param: {INTEGER+} $yheight: [Area Height (Example) 480px or 50%]
@param: {BOOLEAN} $y_line_numbers: [Display line numbers: true ; Hide line numbersL false]
@param: {STRING} $custom_theme: A custom theme to load from the available themes
Return the HTML / Javascript code with a special TextArea with a built-in javascript Code Editor (Edit Area).
Supported syntax parsers: CSS, Javascript, Json, HTML, XML, YAML, Markdown, SQL, PHP, Text (default).
public static function html_navpager ( string $link, int $total, int $limit, int $current, bool $display_if_empty = false, int $adjacents = 3, array $options = [] ) {} :: STRING
@hints: $link = 'some-script.php?ofs={{{offset}}}';
@return: {STRING} [HTML Code]
Creates a navigation pager
The style of the pager can be set overall in: $configs['nav']['pager'], and can be: arrows or numeric
public static function html_js_limited_text_area ( string $y_field_id, string $y_var_name, string $y_var_value, string $y_limit, string $y_css_w = "125px", string $y_css_h = "50px", string $y_placeholder = "", string $y_wrap = "physical", string $y_rawval = "no" ) {} :: STRING
Function: Draw Limited Text Area
public static function html_selector_true_false ( string $y_var, string $y_val ) {} :: STRING
@return: {STRING} HTML Code
@param: {STRING} $y_var: HTML Var Name
@param: {STRING} $y_val: '' | '0' | '1'
HTML Selector: TRUE / FALSE
Display True=1/False=0 Selector
public static function html_selector_yes_no ( string $y_var, string $y_val ) {} :: STRING
@return: {STRING} HTML Code
@param: {STRING} $y_var: HTML Var Name
@param: {STRING} $y_val: '' | 'y' | 'n'
HTML Selector: YES / NO
Display Yes=y/No=n Selector
public static function js_code_wnd_redirect ( string $y_redir_url, int $delay = -1 ) {} :: STRING
@return: {STRING} JS Code
@param: {STRING} $y_redir_url: URL to redirect page to
@param: {INTEGER} $delay: *optional* ; if > 0 will use Delayed Redirect, otherwise Instant Redirect
Redirect to URL
public static function js_code_wnd_refresh_parent ( string $y_redir_url = "" ) {} :: STRING
@return: {STRING} JS Code
@param: {STRING} $y_redir_url: *optional* URL to redirect by refresh page to
Refresh Parent
public static function js_code_wnd_close_modal_popup ( int $y_delay = -1 ) {} :: STRING
@return: {STRING} JS Code
@param: {INTEGER} $y_delay: *optional* ; if > 0 will use Delayed Close, otherwise Instant Close
(Delayed) close Pop-Up / Modal
public static function js_code_notification_add ( string $y_title, string $y_text, string $y_image, string $y_time = "5000", string $y_sticky = "false", string $y_class = "" ) {} :: STRING
@return: {STRING} JS Code
@param: {STRING} $y_title: The Growl Title (Plain Text)
@param: {STRING} $y_text: The Growl Body (HTML code)
@param: {STRING} $y_image: The Growl Image (can be empty)
@param: {INTEGER+} $y_time: *optional* ; default is 5000 (5 seconds) ; The Display Time in microseconds
@param: {ENUM} $y_sticky: *optional* ; default is 'false' ; If set to 'false' will be not sticky ; if set to 'true' will be sticky
@param: {STRING} $y_class: *optional* the CSS class
Returns the JS Code to add (raise) a Growl Notification (sticky or not)
Must be enclosed in a <script>...</script> html tag or can be used for a JS action (ex: onClick="...")
public static function js_code_notification_remove ( string $y_id = "" ) {} :: STRING
@return: {STRING} JS Code
@param: {STRING} $y_id: *optional* the Growl ID ; default is '' ; if non empty will remove just the Growl that match the ID ; otherwise will remove ALL Growl instances
Returns the JS Code to remove a Growl Notification (sticky or not)
Must be enclosed in a <script>...</script> html tag or can be used for a JS action (ex: onClick="...")
public static function js_ajax_submit_html_form ( string $y_form_id, string $y_script_url, string $y_confirm_question = "", string $y_js_evcode = "", string $y_js_everrcode = "", string $y_js_evfailcode = "", bool $y_failalertable = false ) {} :: STRING
@return: {STRING} [javascript code]
Return the JS Code to Submit a HTML Form by Ajax
Expects a standardized (json) reply created with SmartViewHtmlHelpers::js_ajax_replyto_html_form()
Must be enclosed in a <script>...</script> html tag or can be used for a JS action (ex: onClick="...")
public static function js_ajax_replyto_html_form ( string $y_status, string $y_title, string $y_message, string $y_redirect_url = "", string $y_replace_div = "", string $y_replace_html = "", string $y_js_evcode = "", bool $y_hide_form_on_success = false ) {} :: STRING
@return: {STRING} [JSON data string]
Reply back to the HTML Form submited by Ajax by returning a Json answer
Creates a standardized (json) reply for SmartViewHtmlHelpers::js_ajax_submit_html_form()
NOTICE:
- if OK: and redirect URL have been provided, the replace div is not handled
- if ERROR: no replace div or redirect is handled

## class Properties

## class Constants

documentation generated on: 2024-12-16 16:53:46 +0000

Smart.Framework © 2009-2024 unix-world.org