Skip to content

Instantly share code, notes, and snippets.

@jfinstrom
Created May 26, 2021 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfinstrom/b274ce4694405188e5093e7877694842 to your computer and use it in GitHub Desktop.
Save jfinstrom/b274ce4694405188e5093e7877694842 to your computer and use it in GitHub Desktop.
Snippits for FreePBX in vscode
{
// (c)2021 James Finstrom
// License: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
"FreePBX Text Input":{
"scope": "php,html",
"prefix": "f-texti",
"body": [
"<!--${1:LABEL}-->",
"<div class=\"element-container\">",
"\t<div class=\"row\">",
"\t\t<div class=\"form-group\">",
"\t\t\t<div class=\"col-md-3\">",
"\t\t\t\t<label class=\"control-label\" for=\"${2:VarName}\"><?php echo _(\"${1:LABEL}\") ?></label>",
"\t\t\t\t<i class=\"fa fa-question-circle fpbx-help-icon\" data-for=\"${2:VarName}\"></i>",
"\t\t\t</div>",
"\t\t<div class=\"col-md-9\">",
"\t\t\t<input type=\"text\" class=\"form-control\" id=\"${2:VarName}\" name=\"${2:VarName}\" value=\"\\$${2:VarName}\">",
"\t\t</div>",
"\t</div>",
"</div>",
"\t<div class=\"row\">",
"\t\t<div class=\"col-md-12\">",
"\t\t\t<span id=\"${2:VarName}-help\" class=\"help-block fpbx-help-block\"><?php echo _(\"${3:HelpText}\")?></span>",
"\t\t</div>",
"\t</div>",
"</div>",
"<!--END ${1:LABEL}-->"
],
"description": "Text input for FreePBX"
},
"FreePBX Toggle Input":{
"scope": "php,html",
"prefix": "f-togglei",
"body": [
"<!--${1:LABEL}-->",
"<div class=\"element-container\">",
"\t<div class=\"row\">",
"\t\t<div class=\"form-group\">",
"\t\t\t<div class=\"col-md-3\">",
"\t\t\t\t<label class=\"control-label\" for=\"${2:VarName}\"><?php echo _(\"${1:LABEL}\") ?></label>",
"\t\t\t\t<i class=\"fa fa-question-circle fpbx-help-icon\" data-for=\"${2:VarName}\"></i>",
"\t\t\t</div>",
"\t\t<div class=\"col-md-9\">",
"\t\t\t<input type=\"text\" class=\"form-control\" id=\"${2:VarName}\" name=\"${2:VarName}\" value=\"\\$${2:VarName}\">",
"\t\t\t<span class=\"radioset\">",
"\t\t\t\t<input type=\"radio\" name=\"toggle\" id=\"${2:VarName}yes\" value=\"yes\" <?php echo \\$${2:VarName} == \"yes\"?\"CHECKED\": \"\") ?>>",
"\t\t\t\t<label for=\"${2:VarName}yes\"><?php echo _(\"Yes\");?></label>",
"\t\t\t\t<input type=\"radio\" name=\"toggle\" id=\"${2:VarName}no\" value=\"no\" <?php echo (\\$${2:VarName} == \"no\"?\"\": \"CHECKED\") ?>>",
"\t\t\t\t<label for=\"toggleno\"><?php echo _(\"No\");?></label>",
"\t\t\t</span>",
"\t\t</div>",
"\t</div>",
"</div>",
"\t<div class=\"row\">",
"\t\t<div class=\"col-md-12\">",
"\t\t\t<span id=\"${2:VarName}-help\" class=\"help-block fpbx-help-block\"><?php echo _(\"${3:HelpText}\")?></span>",
"\t\t</div>",
"\t</div>",
"</div>",
"<!--END ${1:LABEL}-->"
],
"description": "Text input for FreePBX"
},
"FreePBX Table":{
"scope": "php,html",
"prefix": "f-table",
"body": [
"<?php",
"\\$dataurl = \"ajax.php?module=${1:modulename}&command=${2:command}\";",
"?>",
"<div id=\"toolbar-all\">",
"\t<button id=\"remove-all\" class=\"btn btn-danger btn-remove\" data-type=\"mymodule\" disabled data-section=\"all\">",
"\t\t<i class=\"glyphicon glyphicon-remove\"></i> <span><?php echo _('Delete')?></span>",
"\t</button>",
"</div>",
"<table id=\"mygrid\" ",
"\tdata-url=\"<?php echo \\$dataurl?>\" ",
"\tdata-cache=\"false\" ",
"\tdata-toolbar=\"#toolbar-all\" ",
"\tdata-maintain-selected=\"true\" ",
"\tdata-show-columns=\"true\" ",
"\tdata-show-toggle=\"true\" ",
"\tdata-toggle=\"table\" ",
"\tdata-pagination=\"true\" ",
"\tdata-search=\"true\" ",
"\tclass=\"table table-striped\">",
"\t<thead>",
"\t\t<tr>",
"\t\t\t<th data-field=\"name\"><?php echo _(\"Items\")?></th>",
"\t\t\t<th data-field=\"link\" data-formatter=\"linkFormatter\"><?php echo _(\"Actions\")?></th>",
"\t\t</tr>",
"\t</thead>",
"</table>"
],
"description": "Text input for FreePBX"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment