Same name in other branches
- 5.0.x advagg_validator/src/Form/CssLintForm.php \Drupal\advagg_validator\Form\CssLintForm
- 6.0.x advagg_validator/src/Form/CssLintForm.php \Drupal\advagg_validator\Form\CssLintForm
- 8.x-3.x advagg_validator/src/Form/CssLintForm.php \Drupal\advagg_validator\Form\CssLintForm
- 8.x-4.x advagg_validator/src/Form/CssLintForm.php \Drupal\advagg_validator\Form\CssLintForm
Configure form for CSSHint validation of CSS files.
Hierarchy
- class \Drupal\advagg\Form\AdvaggFormBase extends \Drupal\Core\Form\ConfigFormBase
- class \Drupal\advagg_validator\Form\BaseValidatorForm extends \Drupal\advagg\Form\AdvaggFormBase
- class \Drupal\advagg_validator\Form\CssLintForm extends \Drupal\advagg_validator\Form\BaseValidatorForm
- class \Drupal\advagg_validator\Form\BaseValidatorForm extends \Drupal\advagg\Form\AdvaggFormBase
Expanded class hierarchy of CssLintForm
1 string reference to 'CssLintForm'
- advagg_validator.routing.yml dans advagg_validator/
advagg_validator.routing.yml - advagg_validator/advagg_validator.routing.yml
Fichier
-
advagg_validator/
src/ Form/ CssLintForm.php, line 10
Namespace
Drupal\advagg_validator\FormView source
class CssLintForm extends BaseValidatorForm {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'advagg_validator_csslint';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::generateForm('css');
if (file_exists(DRUPAL_ROOT . '/.csslintrc')) {
$json_string = file_get_contents(DRUPAL_ROOT . '/.csslintrc');
if (!empty($json_string)) {
$json_data = json_decode($json_string, TRUE);
}
}
$form['#attached']['library'][] = 'advagg_validator/csslint';
if (!empty($json_data)) {
$form['#attached']['drupalSettings']['csslint'] = [
'rules' => $json_data,
];
}
$form = parent::buildForm($form, $form_state);
unset($form['actions']);
return $form;
}
}
Members
Titre Trier par ordre décroissant | Modifiers | Object type | Résumé | Overrides |
---|---|---|---|---|
AdvaggFormBase::$advaggAggregates | protected | property | The AdvAgg aggregates state information storage service. | |
AdvaggFormBase::$advaggFiles | protected | property | The AdvAgg file status state information storage service. | |
AdvaggFormBase::$requestStack | protected | property | The request stack. | |
AdvaggFormBase::create | public static | function | 1 | |
AdvaggFormBase::isAjax | protected | function | Checks if the form was submitted by AJAX. | |
AdvaggFormBase::__construct | public | function | Constructs a SettingsForm object. | 1 |
BaseValidatorForm::domExtractor | protected | function | Extract info from the DOMNode Object. | |
BaseValidatorForm::generateForm | public | function | Generate a heirachical form sorted by path from asset files. | |
BaseValidatorForm::getEditableConfigNames | protected | function | ||
BaseValidatorForm::getElement | protected | function | Get array element that corresponds to directory. | |
BaseValidatorForm::hideGoodFiles | protected | function | Do not display info on a file if it is valid. | |
BaseValidatorForm::scanAllDirs | protected | function | Recursively scan the drupal webroot for files matching the given extension. | |
BaseValidatorForm::scanDirectory | protected | function | Finds all files that match a given mask in a given directory. | |
BaseValidatorForm::testFiles | protected | function | Perform server side test(s) on all given files. | 1 |
CssLintForm::buildForm | public | function | ||
CssLintForm::getFormId | public | function |