Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function mymodule_block_info()
- {
- $blocks = array();
- $add = db_select('mymodule_blocks_data', 'n')
- ->fields('n', array('delta', 'title', 'content_type'))
- ->condition('n.form_type', 'Add', '=')
- ->execute();
- foreach ($add as $row) {
- $blocks[$row->delta] = array(
- 'info' => t('@name (Add Form Block) Type: @type', array('@name' => $row->title, '@type' => $row->content_type)),
- 'cache' => DRUPAL_NO_CACHE,
- );
- }
- $edit = db_select('mymodule_blocks_data', 'n')
- ->fields('n', array('delta', 'title', 'content_type', 'nid'))
- ->condition('n.form_type', 'Edit', '=')
- ->execute();
- foreach ($edit as $row) {
- $blocks[$row->delta] = array(
- 'info' => t('@name (Edit Form Block) Nid: @nid', array('@name' => $row->title, '@nid' => $row->nid)),
- 'cache' => DRUPAL_NO_CACHE,
- );
- }
- return $blocks;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement