
Follow along with http://davereid.github.io/portland2013-core-convo
file_entity_access('view', $file, $account); function hook_file_entity_access($op, $file, $account) { $type = is_string($file) ? $file : $file->type; if ($op !== 'create' && (REQUEST_TIME - $file->timestamp) < 3600) { // If the file was uploaded in the last hour, deny access to it. return FILE_ENTITY_ACCESS_DENY; } // Returning nothing from this function would have the same effect. return FILE_ENTITY_ACCESS_IGNORE; } function hook_query_file_entity_access_alter(QueryAlterableInterface $query) { // Only show files that have been uploaded more than an hour ago. $query->condition('timestamp', REQUEST_TIME - 3600, '<='); }
Non-editable data in key/value storage. Remove metadata from field storage.
Image dimensions example:
// Before $file->image_dimensions['width'] = 300; $file->image_dimensions['height'] = 200; // After $file->data['width'] = 300; $file->data['height'] = 200; hook_file_metadata_info() { $info['width'] = array('label' => t('Width')); $info['height'] = array('label' => t('Height')); return $info; }
A list where items build:
Another list, but items fade as they build:
target="_self"
to the link.Press 'h' to highlight important sections of code (wrapped in <b>
).
<script type='text/javascript'> // Say hello world until the user starts questioning // the meaningfulness of their existence. function helloWorld(world) { for (var i = 42; --i >= 0;) { alert('Hello ' + String(world)); } } </script>
// Say hello world until the user starts questioning // the meaningfulness of their existence. function helloWorld(world) { for (var i = 42; --i >= 0;) { alert('Hello ' + String(world)); } }
<style> p { color: pink } b { color: blue } </style>
// This is a test of PHP code. function testPHP(/Drupal/entity $argument = NULL) { return $argument->isPHP(); }
Press 'p' to toggle speaker notes.
Add ?presentme=true
to the URL to enabled presenter mode.
This setting is sticky, meaning refreshing the page will persist presenter
mode.
Hit ?presentme=false
to disable presenter mode.
Column 1 | Column 2 | Column 3 | Column 4 | |
---|---|---|---|---|
Row 1 | placeholder | placeholder | placeholder | placeholder |
Row 2 | placeholder | placeholder | placeholder | placeholder |
Row 3 | placeholder | placeholder | placeholder | placeholder |
Row 4 | placeholder | placeholder | placeholder | placeholder |
Row 5 | placeholder | placeholder | placeholder | placeholder |
Column 1 | Column 2 | Column 3 | Column 4 | |
---|---|---|---|---|
Row 1 | placeholder | placeholder | placeholder | placeholder |
Row 2 | placeholder | placeholder | placeholder | placeholder |
Row 3 | placeholder | placeholder | placeholder | placeholder |
Row 4 | placeholder | placeholder | placeholder | placeholder |
Row 5 | placeholder | placeholder | placeholder | placeholder |
Header 1 | placeholder | placeholder | placeholder |
---|---|---|---|
Header 2 | placeholder | placeholder | placeholder |
Header 3 | placeholder | placeholder | placeholder |
Header 4 | placeholder | placeholder | placeholder |
Header 5 | placeholder | placeholder | placeholder |
This is an example of quote text.
Evaluate this session at: portland2013.drupal.org/node/3873