Same name in other branches
  1. 5.0.x advagg_validator/src/Form/CssLintForm.php \Drupal\advagg_validator\Form\CssLintForm
  2. 6.0.x advagg_validator/src/Form/CssLintForm.php \Drupal\advagg_validator\Form\CssLintForm
  3. 8.x-3.x advagg_validator/src/Form/CssLintForm.php \Drupal\advagg_validator\Form\CssLintForm
  4. 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

Expanded class hierarchy of CssLintForm

1 string reference to 'CssLintForm'
advagg_validator.routing.yml in advagg_validator/advagg_validator.routing.yml
advagg_validator/advagg_validator.routing.yml

File

advagg_validator/src/Form/CssLintForm.php, line 10

Namespace

Drupal\advagg_validator\Form
View 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

Title Sort descending Modifiers Object type Summary 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