From 603887189c238c3fafa2c9fcba562d763e90155e Mon Sep 17 00:00:00 2001 From: Tim Baumgard Date: Tue, 14 Feb 2017 19:05:39 -0600 Subject: [PATCH 2/9] Renamed the ad_example submodule to ad_ui --- .../ad_example.drush.inc => ad_ui/ad_ui.drush.inc} | 28 ++++++++++----------- .../ad_example.ds.inc => ad_ui/ad_ui.ds.inc} | 10 ++++---- .../ad_ui.features.field_base.inc} | 4 +-- .../ad_ui.features.field_instance.inc} | 4 +-- .../ad_ui.features.inc} | 8 +++--- .../ad_ui.features.taxonomy.inc} | 4 +-- .../ad_ui.features.user_permission.inc} | 4 +-- .../ad_ui.features.user_role.inc} | 4 +-- .../ad_example.info => ad_ui/ad_ui.info} | 6 ++--- .../ad_example.module => ad_ui/ad_ui.module} | 10 ++++---- .../ad_ui.strongarm.inc} | 4 +-- .../ad_ui.views_default.inc} | 4 +-- modules/{ad_example => ad_ui}/images/160x120_1.gif | Bin modules/{ad_example => ad_ui}/images/160x120_2.jpg | Bin modules/{ad_example => ad_ui}/images/160x120_3.jpg | Bin modules/{ad_example => ad_ui}/images/160x600_1.jpg | Bin modules/{ad_example => ad_ui}/images/160x600_2.jpg | Bin modules/{ad_example => ad_ui}/images/160x600_3.jpg | Bin modules/{ad_example => ad_ui}/images/728x90_1.jpg | Bin modules/{ad_example => ad_ui}/images/728x90_2.gif | Bin modules/{ad_example => ad_ui}/images/728x90_3.gif | Bin 21 files changed, 45 insertions(+), 45 deletions(-) rename modules/{ad_example/ad_example.drush.inc => ad_ui/ad_ui.drush.inc} (86%) rename modules/{ad_example/ad_example.ds.inc => ad_ui/ad_ui.ds.inc} (97%) rename modules/{ad_example/ad_example.features.field_base.inc => ad_ui/ad_ui.features.field_base.inc} (96%) rename modules/{ad_example/ad_example.features.field_instance.inc => ad_ui/ad_ui.features.field_instance.inc} (98%) rename modules/{ad_example/ad_example.features.inc => ad_ui/ad_ui.features.inc} (77%) rename modules/{ad_example/ad_example.features.taxonomy.inc => ad_ui/ad_ui.features.taxonomy.inc} (78%) rename modules/{ad_example/ad_example.features.user_permission.inc => ad_ui/ad_ui.features.user_permission.inc} (92%) rename modules/{ad_example/ad_example.features.user_role.inc => ad_ui/ad_ui.features.user_role.inc} (80%) rename modules/{ad_example/ad_example.info => ad_ui/ad_ui.info} (96%) rename modules/{ad_example/ad_example.module => ad_ui/ad_ui.module} (88%) rename modules/{ad_example/ad_example.strongarm.inc => ad_ui/ad_ui.strongarm.inc} (98%) rename modules/{ad_example/ad_example.views_default.inc => ad_ui/ad_ui.views_default.inc} (99%) rename modules/{ad_example => ad_ui}/images/160x120_1.gif (100%) rename modules/{ad_example => ad_ui}/images/160x120_2.jpg (100%) rename modules/{ad_example => ad_ui}/images/160x120_3.jpg (100%) rename modules/{ad_example => ad_ui}/images/160x600_1.jpg (100%) rename modules/{ad_example => ad_ui}/images/160x600_2.jpg (100%) rename modules/{ad_example => ad_ui}/images/160x600_3.jpg (100%) rename modules/{ad_example => ad_ui}/images/728x90_1.jpg (100%) rename modules/{ad_example => ad_ui}/images/728x90_2.gif (100%) rename modules/{ad_example => ad_ui}/images/728x90_3.gif (100%) diff --git a/modules/ad_example/ad_example.drush.inc b/modules/ad_ui/ad_ui.drush.inc similarity index 86% rename from modules/ad_example/ad_example.drush.inc rename to modules/ad_ui/ad_ui.drush.inc index 4d30df6..47ca8fe 100644 --- a/modules/ad_example/ad_example.drush.inc +++ b/modules/ad_ui/ad_ui.drush.inc @@ -3,9 +3,9 @@ /** * Implements hook_drush_help(). */ -function ad_example_drush_help($section) { +function ad_ui_drush_help($section) { switch ($section) { - case 'drush:ad-example-install': + case 'drush:ad-ui-install': return dt("Install example terms and ads."); } } @@ -13,8 +13,8 @@ function ad_example_drush_help($section) { /** * Implements hook_drush_command(). */ -function ad_example_drush_command() { - $items['ad-example-install'] = array( +function ad_ui_drush_command() { + $items['ad-ui-install'] = array( 'description' => "Install example terms and ads.", ); return $items; @@ -23,19 +23,19 @@ function ad_example_drush_command() { /** * Callback to install examples ads and terms. */ -function drush_ad_example_install() { +function drush_ad_ui_install() { // Taxonomy vocabularies. - _ad_example_install_taxonomy(); + _ad_ui_install_taxonomy(); // Add example ads. - _ad_example_install_ads(); + _ad_ui_install_ads(); // Enable them. - _ad_example_install_blocks(); + _ad_ui_install_blocks(); } /** * Install taxonomy data. */ -function _ad_example_install_taxonomy() { +function _ad_ui_install_taxonomy() { $vocabularies = array( 'advertisement_size' => array( 'terms' => array( @@ -58,7 +58,7 @@ function _ad_example_install_taxonomy() { foreach ($vocabularies as $machine_name => $definition) { if (!empty($definition['terms'])) { $vocabulary = taxonomy_vocabulary_machine_name_load($machine_name); - _ad_example_install_taxonomy_terms($vocabulary, $definition['terms']); + _ad_ui_install_taxonomy_terms($vocabulary, $definition['terms']); } } } @@ -72,7 +72,7 @@ function _ad_example_install_taxonomy() { * An array of term definitions: a term name or a full term array data * structure. */ -function _ad_example_install_taxonomy_terms($vocabulary, $terms) { +function _ad_ui_install_taxonomy_terms($vocabulary, $terms) { $weight = 0; $tids = array(); $instances = field_info_instances('taxonomy_term', $vocabulary->machine_name); @@ -104,7 +104,7 @@ function _ad_example_install_taxonomy_terms($vocabulary, $terms) { } } -function _ad_example_install_ads() { +function _ad_ui_install_ads() { $ads = array( 'Rectangle' => array( '160x120_1.gif' => 'http://www.apple.com/', @@ -130,7 +130,7 @@ function _ad_example_install_ads() { $term = current(taxonomy_get_term_by_name($size, 'advertisement_size')); foreach ($ad as $image => $destination) { $n++; - $image_path = drupal_get_path('module', 'ad_example') . '/images/' . $image; + $image_path = drupal_get_path('module', 'ad_ui') . '/images/' . $image; $ad = entity_create('node', array( 'type' => 'ad_example', 'status' => 1, @@ -151,7 +151,7 @@ function _ad_example_install_ads() { /** * Display blocks. */ -function _ad_example_install_blocks() { +function _ad_ui_install_blocks() { $theme = variable_get('theme_default', 'bartik'); db_query("UPDATE {block} SET region = 'sidebar_first', status = 1 WHERE theme = :theme AND delta = 'rectangle_ad_block'", array(':theme' => $theme)); db_query("UPDATE {block} SET region = 'sidebar_second', status = 1 WHERE theme = :theme AND delta = 'skyscraper_ad_block'", array(':theme' => $theme)); diff --git a/modules/ad_example/ad_example.ds.inc b/modules/ad_ui/ad_ui.ds.inc similarity index 97% rename from modules/ad_example/ad_example.ds.inc rename to modules/ad_ui/ad_ui.ds.inc index e0615a2..1e48e5c 100644 --- a/modules/ad_example/ad_example.ds.inc +++ b/modules/ad_ui/ad_ui.ds.inc @@ -1,13 +1,13 @@ "1"); } @@ -19,14 +19,14 @@ function ad_example_ctools_plugin_api($module = NULL, $api = NULL) { /** * Implements hook_views_api(). */ -function ad_example_views_api($module = NULL, $api = NULL) { +function ad_ui_views_api($module = NULL, $api = NULL) { return array("api" => "3.0"); } /** * Implements hook_node_info(). */ -function ad_example_node_info() { +function ad_ui_node_info() { $items = array( 'ad_example' => array( 'name' => t('Ad Example'), diff --git a/modules/ad_example/ad_example.features.taxonomy.inc b/modules/ad_ui/ad_ui.features.taxonomy.inc similarity index 78% rename from modules/ad_example/ad_example.features.taxonomy.inc rename to modules/ad_ui/ad_ui.features.taxonomy.inc index 184ab18..a5b16fe 100644 --- a/modules/ad_example/ad_example.features.taxonomy.inc +++ b/modules/ad_ui/ad_ui.features.taxonomy.inc @@ -1,13 +1,13 @@ array( 'name' => 'Advertisement size', diff --git a/modules/ad_example/ad_example.features.user_permission.inc b/modules/ad_ui/ad_ui.features.user_permission.inc similarity index 92% rename from modules/ad_example/ad_example.features.user_permission.inc rename to modules/ad_ui/ad_ui.features.user_permission.inc index a1a94bc..d3e6760 100644 --- a/modules/ad_example/ad_example.features.user_permission.inc +++ b/modules/ad_ui/ad_ui.features.user_permission.inc @@ -1,13 +1,13 @@ t('Left Rectangle Ad block'), @@ -26,7 +26,7 @@ function ad_example_block_info() { /** * Implements hook_block_view(). */ -function ad_example_block_view($delta = '') { +function ad_ui_block_view($delta = '') { $block = array(); switch ($delta) { case 'rectangle_ad_block': @@ -50,7 +50,7 @@ function ad_example_block_view($delta = '') { /** * Implements hook_ad_info(). */ -function ad_example_ad_info() { +function ad_ui_ad_info() { return array( 'ad_example' => array( // Field used to store the destination. It can be a textfield or a link. diff --git a/modules/ad_example/ad_example.strongarm.inc b/modules/ad_ui/ad_ui.strongarm.inc similarity index 98% rename from modules/ad_example/ad_example.strongarm.inc rename to modules/ad_ui/ad_ui.strongarm.inc index a631d26..b6e5d58 100644 --- a/modules/ad_example/ad_example.strongarm.inc +++ b/modules/ad_ui/ad_ui.strongarm.inc @@ -1,13 +1,13 @@