コード例 #1
0
/**
 * Create alias for the last inserted webform
 */
function osha_update_webform_alias($last_id)
{
    $languages = osha_language_list();
    $source = 'node/' . $last_id;
    $query = db_query("SELECT * FROM url_alias WHERE source = '{$source}'")->fetchField();
    if (!$query) {
        foreach ($languages as $key => $language) {
            $data = array('source' => $source, 'alias' => 'inside-eu-osha/governance-eu-osha/internal_documents/document_request_form', 'language' => $key);
            drupal_write_record('url_alias', $data);
        }
    }
}
コード例 #2
0
                        $blogs[] = $node;
                    } else {
                        if ($last_section == 'News') {
                            $news[] = $node;
                        } else {
                            if ($last_section == 'Events') {
                                $events[] = $node;
                            } else {
                                $elements[] = $node;
                            }
                        }
                    }
                }
            }
        }
        $languages = osha_language_list();
        usort($languages, function ($a, $b) {
            return strcmp($a->name, $b->name);
        });
        print theme_render_template($module_templates_path . '/newsletter_header.tpl.php', array('languages' => $languages, 'newsletter_title' => $newsletter_title, 'newsletter_id' => $newsletter_id, 'newsletter_date' => $newsletter_date));
        print theme_render_template($module_templates_path . '/newsletter_body.tpl.php', array('items' => $elements, 'blogs' => $blogs, 'news' => $news, 'events' => $events));
        print theme_render_template($module_templates_path . '/newsletter_footer.tpl.php', array());
    }
} else {
    ?>
  <div class="<?php 
    print $classes;
    ?>
">
    <?php 
    print render($title_prefix);
コード例 #3
0
                        $blogs[] = $node;
                    } else {
                        if ($last_section == 'News') {
                            $news[] = $node;
                        } else {
                            if ($last_section == 'Events') {
                                $events[] = $node;
                            } else {
                                $elements[] = $node;
                            }
                        }
                    }
                }
            }
        }
        $languages = osha_language_list(TRUE);
        print theme_render_template($module_templates_path . '/newsletter_header.tpl.php', array('languages' => $languages, 'newsletter_title' => $newsletter_title, 'newsletter_id' => $newsletter_id, 'newsletter_date' => $newsletter_date, 'campaign_id' => $campaign_id));
        print theme_render_template($module_templates_path . '/newsletter_body.tpl.php', array('items' => $elements, 'blogs' => $blogs, 'news' => $news, 'events' => $events, 'campaign_id' => $campaign_id));
        print theme_render_template($module_templates_path . '/newsletter_footer.tpl.php', array('campaign_id' => $campaign_id));
    }
} else {
    ?>
  <div class="<?php 
    print $classes;
    ?>
">
    <?php 
    print render($title_prefix);
    ?>
    <?php 
    if ($show_title) {