Smart.Framework Logo

final class \SmartViewHtmlHelpers
{ } ::

Class: SmartViewHtmlHelpers - Easy to use HTML ViewHelper Components.


class Methods

public static function html_js_preview_iframe ( $yid, $y_contents, $y_width = "720px", $y_height = "300px", $y_maximized = false, $y_sandbox = "allow-popups allow-same-origin" ) {} :: 
public static function html_jsload_hilitecodesyntax ( STRING $dom_selector, ENUM $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 ( $link, $total, $limit, $current, $display_if_empty = false, $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 ( $y_field_id, $y_var_name, $y_var_value, $y_limit, $y_css_w = "125px", $y_css_h = "50px", $y_placeholder = "", $y_wrap = "physical", $y_rawval = "no" ) {} :: 
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 html_hidden_formvars ( MIXED $y_var, STRING $y_html_var ) {} :: STRING
@return: {STRING} HTML Code
@param: {MIXED} $y_var: ARRAY or STRING :: PHP variable
@param: {STRING} $y_html_var: HTML Variable Name
Function: HTML Form Vars
public static function js_code_wnd_redirect ( STRING $y_redir_url, INTEGER $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 ( INTEGER $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, INTEGER+ $y_time = 5000, ENUM $y_sticky = "false", STRING $y_class = "" ) {} :: STRING
@return: {STRING} JS Code
@param: {STRING} $y_title: The Growl Title
@param: {STRING} $y_text: The Growl Text
@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 ( $y_form_id, $y_script_url, $y_confirm_question = "", $y_js_evcode = "", $y_js_everrcode = "", $y_js_evfailcode = "", $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 ( $y_status, $y_title, $y_message, $y_redirect_url = "", $y_replace_div = "", $y_replace_html = "", $y_js_evcode = "", $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: 2023-10-19 23:15:52 +0000


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