![]() |
Tina4Stack
v1.0.1
The Tina4 Stack
|
Public Member Functions | |
bootStrapTextArea ($name, $caption="Test Input", $placeholder="Type in here", $defaultValue="", $colWidth="col-md-12", $noFormGroup=false) | |
bootStrapButton ($name="button", $caption="Button", $onclick="", $style="btn btn-primary pull-right", $colWidth="col-md-12", $noFormGroup=false) | |
bootStrapCheckbox ($name, $elements, $colWidth="col-md-12") | |
bootStrapInput ($name="text", $caption="Label", $placeHolder="", $defaultValue="", $type="text", $required="required", $colWidth="col-md-12", $options="", $step=1) | |
getPageTemplate ($title="Default") | |
getTemplate ($name="", $type="form") | |
createTableForm ($action, $object, $record, $db="") | |
__construct ($DEB="") | |
bootStrapAlert ($alertType="success", $caption="", $content="", $dismissible=false) | |
bootStrapTable ($sql="select * from user_detail", $buttons="", $hideColumns="", $toolbar="My Grid", $customFields=null, $name="grid", $tableInfo="", $formHideFields="", $events="", $class="table table-striped", $rowLimit=20, $paginate=true, $searchable=true, $checked=false, $selected_page=1, $checkedPostURL="", $checkSingleSelect=true, $checkEvent="", $mobiletooltip="") | |
populateDropDownItems ($dropDownSql, $onClick, $parent) | |
bootStrapTabs ($tabs=array()) | |
bootStrapForm ($sql="", $hideColumns="", $custombuttons=null, $customFields=null, $submitAction="", $formId="formId", $prefix="txt", $noForm=false) | |
getFieldInfo ($sql) | |
select ($name="txt", $alttext="", $selecttype="array", $lookup="", $value="", $event="", $cssid="", $readonly=false, $nochoose=true) | |
validateForm ($rules, $messages="", $formId="formInput") | |
bootStrapPanel ($title, $content, $class="panel panel-default", $footerContent="", $icon="") | |
bootStrapMessageBox ($title, $linkTitle="Click Here", $url="#", $number="", $panelClass="panel panel-primary", $glyphClass="fa fa-comments fa-5x") | |
bootStrapModal ($header, $body, $footer, $closeCode="$('.modal').removeClass('show');", $icon="", $modalsize="") | |
bootStrapView ($sql="", $hideColumns="", $custombuttons=null, $customFields=null, $submitAction="") | |
codeHandler ($action) | |
codeBuilder () | |
GetCallingMethodName () | |
getCodeWindow ($id, $code) | |
getFileExplorer () | |
getFileTree ($path="", $callBack="", $root=false) | |
getCodeNavigator () | |
getParseScript ($name) | |
ajaxRouter ($responseTarget="", $name="callRouter", $defaultMethod="post") | |
ajaxHandler ($route="/test_ajax", $target="", $name="callAjax", $fixedValues="", $method="post", $runNow=false) | |
bootStrapMenuTree () | |
bootStrapLookup ($name, $caption, $elements, $value="", $onclick="", $readonly="", $colWidth="col-md-12", $nochoose=false) | |
IsDate ($Str) | |
Cody::__construct | ( | $DEB = "" | ) |
Cody::ajaxHandler | ( | $route = "/test_ajax" , |
|
$target = "" , |
|||
$name = "callAjax" , |
|||
$fixedValues = "" , |
|||
$method = "post" , |
|||
$runNow = false |
|||
) |
A function which encapulates the passing of form infomation with or without ids to a route and targeting the response to an html element.
string | $route | - Path to the route which must be called - default is post request |
string | $target | - target of the HTML element which receives the ajax response, if null then nothing will be passed back |
string | $name | - Name you want the AJAX method to be called |
string | $fixedValues | - A json string of values you want to be passed each time to the |
string | $method | - POST or GET |
bool | $runNow | - false or true - immediately execute the AJAX call as well |
Cody::ajaxRouter | ( | $responseTarget = "" , |
|
$name = "callRouter" , |
|||
$defaultMethod = "post" |
|||
) |
Ajax Router for directing form inputs and general things from an html segment.
string | $responseTarget | This is the targetted HTML Tag or element |
Cody::bootStrapAlert | ( | $alertType = "success" , |
|
$caption = "" , |
|||
$content = "" , |
|||
$dismissible = false |
|||
) |
string | $alertType | uses "success","info","warning","danger" |
string | $caption | this is the text that will be displayed before the message is "WARNING!..." |
string | $content | this is the content of the message to be displayed |
bool | $dismissible | true/false. this will set the alert to be dismissable |
Cody::bootStrapButton | ( | $name = "button" , |
|
$caption = "Button" , |
|||
$onclick = "" , |
|||
$style = "btn btn-primary pull-right" , |
|||
$colWidth = "col-md-12" , |
|||
$noFormGroup = false |
|||
) |
Cody::bootStrapCheckbox | ( | $name, | |
$elements, | |||
$colWidth = "col-md-12" |
|||
) |
Cody::bootStrapForm | ( | $sql = "" , |
|
$hideColumns = "" , |
|||
$custombuttons = null , |
|||
$customFields = null , |
|||
$submitAction = "" , |
|||
$formId = "formId" , |
|||
$prefix = "txt" , |
|||
$noForm = false |
|||
) |
A function to create a valid Bootstrap Form
String | $sql | A valid SQL statement for the selected database |
Cody::bootStrapInput | ( | $name = "text" , |
|
$caption = "Label" , |
|||
$placeHolder = "" , |
|||
$defaultValue = "" , |
|||
$type = "text" , |
|||
$required = "required" , |
|||
$colWidth = "col-md-12" , |
|||
$options = "" , |
|||
$step = 1 |
|||
) |
Cody::bootStrapLookup | ( | $name, | |
$caption, | |||
$elements, | |||
$value = "" , |
|||
$onclick = "" , |
|||
$readonly = "" , |
|||
$colWidth = "col-md-12" , |
|||
$nochoose = false |
|||
) |
Cody::bootStrapMenuTree | ( | ) |
Cody::bootStrapMessageBox | ( | $title, | |
$linkTitle = "Click Here" , |
|||
$url = "#" , |
|||
$number = "" , |
|||
$panelClass = "panel panel-primary" , |
|||
$glyphClass = "fa fa-comments fa-5x" |
|||
) |
This is a function to create a dashboard type message box
String | $title | Main title of the message box |
String | $linkTitle | Title of the link |
String | $url | The url/href of the link |
String | $number | value for the amount of comments or etc.. |
type | $panelClass | Class for the panel to determine the color or style |
type | $glyphClass | Class for the glyph to determine which glyph and size |
Cody::bootStrapModal | ( | $header, | |
$body, | |||
$footer, | |||
$closeCode = "$('.modal').removeClass('show');" , |
|||
$icon = "" , |
|||
$modalsize = "" |
|||
) |
Cody::bootStrapPanel | ( | $title, | |
$content, | |||
$class = "panel panel-default" , |
|||
$footerContent = "" , |
|||
$icon = "" |
|||
) |
Boot strap panel formatter
String | $title | |
String | $content | |
String | $class |
Cody::bootStrapTable | ( | $sql = "select * from user_detail" , |
|
$buttons = "" , |
|||
$hideColumns = "" , |
|||
$toolbar = "My Grid" , |
|||
$customFields = null , |
|||
$name = "grid" , |
|||
$tableInfo = "" , |
|||
$formHideFields = "" , |
|||
$events = "" , |
|||
$class = "table table-striped" , |
|||
$rowLimit = 20 , |
|||
$paginate = true , |
|||
$searchable = true , |
|||
$checked = false , |
|||
$selected_page = 1 , |
|||
$checkedPostURL = "" , |
|||
$checkSingleSelect = true , |
|||
$checkEvent = "" , |
|||
$mobiletooltip = "" |
|||
) |
An easy way to make a paginated bootStrapTable
String | $sql | |
Array | $buttons | |
String | $hideColumns | |
String | $toolbar | |
Integer | $rowLimit | |
Integer | $selected_page | |
Array | $customFields | |
String | $name | |
String | $tableInfo | - Array of information about the table ["table" => "tablename", "primarykey" => "field1,field2[,...]", "fields" => "field1,field2[,...]"] |
String | $formHideFields | field1,field2[,...] |
String | $events | Array on events that could happen ["onupdate" => "javascript", "oninsert" => "javascript", "ondelete" => "javascript", "beforeinsert" => "javascript", "beforeupdate" => "javascript", "beforedelete" => "javascript"] |
String | $class | |
Boolean | $paginate | |
Boolean | $searchable | |
Boolean | $checked | |
String | $checkPostURL |
Cody::bootStrapTabs | ( | $tabs = array() | ) |
array | $tabs |
USAGE $tabs = array( "Tab 1" => div("HTML/Shape tags", p("paragraph content")), "Tab 2" => "Any Content", "Tab 3" => "Tab 3 Content", ); echo (new Cody($this->DEB))->bootStrapTabs($tabs);
Filter through tabs, creating additional values
Cody::bootStrapTextArea | ( | $name, | |
$caption = "Test Input" , |
|||
$placeholder = "Type in here" , |
|||
$defaultValue = "" , |
|||
$colWidth = "col-md-12" , |
|||
$noFormGroup = false |
|||
) |
Cody::bootStrapView | ( | $sql = "" , |
|
$hideColumns = "" , |
|||
$custombuttons = null , |
|||
$customFields = null , |
|||
$submitAction = "" |
|||
) |
type | $sql | |
type | $hideColumns | |
type | $custombuttons | |
type | $customFields | |
type | $submitAction |
Cody::codeBuilder | ( | ) |
Cody::codeHandler | ( | $action | ) |
Cody::createTableForm | ( | $action, | |
$object, | |||
$record, | |||
$db = "" |
|||
) |
Cody::GetCallingMethodName | ( | ) |
Cody::getCodeNavigator | ( | ) |
Cody::getCodeWindow | ( | $id, | |
$code | |||
) |
Cody::getFieldInfo | ( | $sql | ) |
This function gets the fields from an SQL statement
String | $sql | A valid SQL statement for the selected database |
Cody::getFileExplorer | ( | ) |
Cody::getFileTree | ( | $path = "" , |
|
$callBack = "" , |
|||
$root = false |
|||
) |
Cody::getPageTemplate | ( | $title = "Default" | ) |
The default page template for maggy
type | $title | String A title to name the page by |
Cody::getParseScript | ( | $name | ) |
Cody::getTemplate | ( | $name = "" , |
|
$type = "form" |
|||
) |
Cody::IsDate | ( | $Str | ) |
Cody::populateDropDownItems | ( | $dropDownSql, | |
$onClick, | |||
$parent | |||
) |
Helper function to populate the li of the dropdown items
type | $dropDownSql |
Cody::select | ( | $name = "txt" , |
|
$alttext = "" , |
|||
$selecttype = "array" , |
|||
$lookup = "" , |
|||
$value = "" , |
|||
$event = "" , |
|||
$cssid = "" , |
|||
$readonly = false , |
|||
$nochoose = true |
|||
) |
The select tag creator
String | $name | The name of the select drop down |
String | $alttext | The hover text to be displayed |
String | $selecttype | Can be array, sql, multiarray, multisql |
String | $lookup | An SQL statement or pipe delimited key value set - eg 0,None|1,Yes|2,No |
String | $value | A value key to be set as the default in the drop down |
String | $event | An event for the select box - eg onchange="window.alert('hello');" |
String | $cssid | The name of the id for styling purposes |
Boolean | $readonly | Is the component readonly |
Boolean | $nochoose | Removes a dummy choose from option |
Cody::validateForm | ( | $rules, | |
$messages = "" , |
|||
$formId = "formInput" |
|||
) |
The Validation of forms
The form validator is an easy way to validate forms in the system using jQuery
String | $rules | A JSON object which matches the form inputs we need to use |
String | $messages | A JSON object which matches the form inputs for the messaging |