Needs the patch: https://www.drupal.org/node/1848686
Split "Administer vocabularies and terms" permission: Access the taxonomy overview page and Add terms in vocabulary name
File structure:
mymodule
|- src
| <?php | |
| /** | |
| * Plugin Name: Example Private Files | |
| * Author: Doug Cone | |
| * Description: Auth for Pantheon Private files | |
| * Version: 0.1.0 | |
| */ | |
| /** | |
| * This doesn't protect direct access, you must move your files to a folder not accessible to the public, but accessible to this script. |
| # Add HTTP Headers to improve site security. | |
| # https://owasp.org/www-project-secure-headers/#tab=Headers | |
| # X-Frame-Options: Stop people from loading your site in an iframe on their own site. | |
| # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options | |
| add_header X-Frame-Options "SAMEORIGIN"; | |
| # X-XSS-Protection: Stop pages from loading when the browser detects cross-site scripting (XSS) attacks. | |
| # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection | |
| add_header X-XSS-Protection "1; mode=block"; |
| # Purge the Heroku Build Cache using the terminal. This requires a new deployment FYI. | |
| # Replace appname with name of application on Heroku. | |
| heroku plugins:install heroku-repo | |
| heroku repo:purge_cache -a appname | |
| git commit --allow-empty -m "Purge cache" | |
| git push heroku master |
| class NameForm extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { name: '' }; | |
| } | |
| handleChange = (event) => { | |
| this.setState({[event.target.name]: event.target.value}); | |
| } |
| /* This will work for any text entry except the forms */ | |
| Qualtrics.SurveyEngine.addOnload(function() { | |
| var qid = this.questionId; | |
| var placeholderText = 'I am different text'; | |
| jQuery('#' + qid + ' input[type="text"], #' + qid + ' textarea').attr('placeholder',placeholderText); | |
| }); | |
| /* | |
| This will work on a Form question (where there are multiple inputs) |
| # Requirements: php, php-yaml (pecl extention) | |
| php -r 'echo print_r(yaml_parse_file(__DIR__ . "/app/config/parameters.yml"), 1);' |
| const puppeteer = require('puppeteer'); | |
| const escapeXpathString = str => { | |
| const splitedQuotes = str.replace(/'/g, `', "'", '`); | |
| return `concat('${splitedQuotes}', '')`; | |
| }; | |
| const clickByText = async (page, text) => { | |
| const escapedText = escapeXpathString(text); | |
| const linkHandlers = await page.$x(`//a[contains(text(), ${escapedText})]`); |
| <?php | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function buildForm(array $form, FormStateInterface $form_state) { | |
| $group_class = 'group-order-weight'; | |
| $items = [ | |
| 1 => [ | |
| 'id' => 2, |
Needs the patch: https://www.drupal.org/node/1848686
Split "Administer vocabularies and terms" permission: Access the taxonomy overview page and Add terms in vocabulary name
File structure:
mymodule
|- src
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\example_module\Controller\ExampleModuleController. | |
| */ | |
| // THIS FILE BELONGS AT /example_module/src/Controller/ExampleModuleController.php | |
| namespace Drupal\example_module\Controller; |