vscode snippets

On OSX: Code>preferences>User Snippits>Language html

php.json

{  "FreePBX Input": {  "prefix": "fpbxTXTI",  "body": [  "<!--${1:label}-->",  "<div class=\"element-container\">",  " <div class=\"row\">",  " <div class=\"form-group\">",  " <div class=\"col-md-3\">",  " <label class=\"control-label\" for=\"${2:var}\"><?php echo _(\"${1:label}\") ?></label>",  " <i class=\"fa fa-question-circle fpbx-help-icon\" data-for=\"${2:var}\"></i>",  " </div>",  " <div class=\"col-md-9\">",  " <input type=\"text\" class=\"form-control\" id=\"${2:var}\" name=\"${2:var}\" value=\"$${2:var}\">",  " </div>",  " </div>",  " </div>",  " <div class=\"row\">",  " <div class=\"col-md-12\">",  " <span id=\"${2:var}-help\" class=\"help-block fpbx-help-block\"><?php echo _(\"${3:helptext}\")?></span>",  " </div>",  " </div>",  "</div>",  "<!--${1:name}-->"  ],  "description": "Text input for FreePBX"  },  "FreePBX Form Toggle Input": {  "prefix": "fpbxToggleI",  "body": [  "",  "<!--${1:label}-->",  "<div class=\"element-container\">",  " <div class=\"row\">",  " <div class=\"form-group\">",  " <div class=\"col-md-3\">",  " <label class=\"control-label\" for=\"${2:var}\"><?php echo _(\"${1:label}\") ?></label>",  " <i class=\"fa fa-question-circle fpbx-help-icon\" data-for=\"${2:var}\"></i>",  " </div>",  " <div class=\"col-md-9\">",  " <span class=\"radioset\">",  " <input type=\"radio\" name=\"${2:var}\" id=\"${2:var}yes\" value=\"yes\" <?php echo $${2:var} == \"yes\"?\"CHECKED\": \"\") ?>>",  " <label for=\"${2:var}yes\"><?php echo _(\"Yes\");?></label>",  " <input type=\"radio\" name=\"${2:var}\" id=\"${2:var}no\" value=\"no\" <?php echo ($${2:var} == \"no\"?\"\": \"CHECKED\") ?>>",  " <label for=\"${2:var}no\"><?php echo _(\"No\");?></label>",  " </span>",  " </div>",  " </div>",  " </div>",  " <div class=\"row\">",  " <div class=\"col-md-12\">",  " <span id=\"${2:var}-help\" class=\"help-block fpbx-help-block\"><?php echo _(\"${3:helptext}\")?></span>",  " </div>",  " </div>",  "</div>",  "<!--${1:label}-->"  ],  "description": "FreePBX Form Toggle Input"  },  "FreePBX Grid": {  "prefix": "fpbxGrid",  "body": [  "<?php",  "$dataurl = \"ajax.php?module=${1:modulename}&command=getJSON&jdata=grid\";",  "?>",  "<div id=\"toolbar-all\">",  " <button id=\"remove-all\" class=\"btn btn-danger btn-remove\" data-type=\"mymodule\" disabled data-section=\"all\">",  " <i class=\"glyphicon glyphicon-remove\"></i> <span><?php echo _('Delete')?></span>",  " </button>",  "</div>",  "<table id=\"mygrid\" ",  " data-url=\"<?php echo $dataurl?>\" ",  " data-cache=\"false\" ",  " data-toolbar=\"#toolbar-all\" ",  " data-maintain-selected=\"true\" ",  " data-show-columns=\"true\" ",  " data-show-toggle=\"true\" ",  " data-toggle=\"table\" ",  " data-pagination=\"true\" ",  " data-search=\"true\" ",  " class=\"table table-striped\">",  " <thead>",  " <tr>",  " <th data-field=\"name\"><?php echo _(\"Items\")?></th>",  " <th data-field=\"link\" data-formatter=\"linkFormatter\"><?php echo _(\"Actions\")?></th>",  " </tr>",  " </thead>",  "</table>"  ],  "description": "FreePBX Grid"  },  "FreePBX Backup class": {  "prefix": "fpbxBackup",  "body": [  "<?php",  "namespace FreePBX\\modules\\\\${1:class};",  "use FreePBX\\modules\\Backup as Base;",  "class Backup Extends Base\\BackupBase{",  " public function runBackup(\\$id,\\$transaction){",  " \\$configs = [];",  " \\$files = [];",  " \\$dirs = [];",  " \\$this->addDirectories(\\$dirs);",  " \\$this->addDependency('');",  " \\$this->addConfigs(\\$configs);",  " }",  "}"  ],  "description": "FreePBX Backup class"  },  "FreePBX Restore class": {  "prefix": "fpbxRestore",  "body": [  "namespace FreePBX\\modules\\\\${1:class};",  "use FreePBX\\modules\\Backup as Base;",  "class Restore Extends Base\\RestoreBase{",  " public function runRestore(\\$restoreid){",  " \\$configs = \\$this->getConfigs();",  " \\$files = \\$this->getFiles();",  " foreach(\\$configs as \\$config){",  " //do something",  " }",  " foreach(\\$files as \\$file){",  " //do something",  " }",  " }",  "}"  ],  "description": "FreePBX Restore class"  } }

Return to Documentation Home I Return to Sangoma Support