本文整理汇总了PHP中drupal_get_form函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_get_form函数的具体用法?PHP drupal_get_form怎么用?PHP drupal_get_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drupal_get_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: aut_preprocess_page
function aut_preprocess_page(&$vars)
{
// Add page template suggestions based on the aliased path. For instance, if the current page has an alias of about/history/early, we'll have templates of:
// page-about-history-early.tpl.php, page-about-history.tpl.php, page-about.tpl.php
// Whichever is found first is the one that will be used.
if (module_exists('path')) {
$alias = drupal_get_path_alias(str_replace('/edit', '', $_GET['q']));
if ($alias != $_GET['q']) {
$template_filename = 'page';
foreach (explode('/', $alias) as $path_part) {
$template_filename = $template_filename . '-' . $path_part;
$vars['template_files'][] = $template_filename;
}
}
}
// Get the entire main menu tree
$main_menu_tree = menu_tree_all_data('main-menu');
// Add the rendered output to the $main_menu_expanded variables
//$vars['main_menu_expanded'] = menu_tree_output($main_menu_tree);
$vars['main_menu_expanded'] = aut_return_menu_markup('main-menu');
// Search Toggle
$vars['search'] = FALSE;
if (theme_get_setting('toggle_search') && module_exists('search')) {
$vars['search'] = drupal_get_form('aut_search_form');
}
}
示例2: connect_block_view
function connect_block_view($nid = 0)
{
$return = array();
$parent_node = node_load($nid);
if ($parent_node) {
$parent_node =& _connect_parent_node($parent_node);
// only display if the block option is turned on
//$parent_actions = connect_get_actions($nid);
if (!in_array('connect_action_provide_block', connect_get_actions($nid))) {
return;
}
// require a CAPTCHA on the form?
if (!_connect_captcha_test('connect_form_block')) {
return;
}
// visibility control
$visibility = connect_node_options($nid, 'provide_block_visibility');
if ($visibility > 0) {
$parent_path = "node/{$nid}";
$current_path = arg(0) . '/' . arg(1);
if ($visibility == CONNECT_BLOCK_NOT_PARENT && $parent_path == $current_path || $visibility == CONNECT_BLOCK_PARENT_ONLY && $parent_path != $current_path) {
return;
}
}
$form = drupal_get_form('connect_form_block', 'block', $nid);
$text = connect_node_options($nid, 'provide_block_text');
$link = empty($text) ? '' : '<p>» ' . l($text, "node/{$nid}") . '</p>';
$return['subject'] = $parent_node->title;
$return['content'] = $form . $link;
}
return $return;
}
示例3: storelocator_app_block_filter_opening
return $output;
}
function storelocator_app_block_filter_opening($language)
{
drupal_add_css(drupal_get_path('module', 'storelocator_app') . '/css/storelocator_app.form.css');
$output = theme_block_filter_opening(drupal_get_form('storelocator_app_block_filter_form_opening', $language), $language);
//theme_block_filter_opening(drupal_get_form('storelocator_app_block_filter_form_opening', $language), $language);
示例4: hook_bootstrap_modal_forms
/**
* Registers forms with Bootstrap to be displayed as modals.
*
* This example registers the sitewide "Contact Us" form.
*
* @return array
*/
function hook_bootstrap_modal_forms()
{
module_load_include('inc', 'contact', 'contact.pages');
$items = array();
$items['contact_modal_form'] = array('form' => drupal_get_form('contact_site_form'), 'title' => t('Contact Us'), 'action' => 'contact');
return $items;
}
示例5: iha_preprocess_page
function iha_preprocess_page(&$variables)
{
$search_box = drupal_render(drupal_get_form('search_form'));
$variables['search_box'] = $search_box;
if (drupal_is_front_page()) {
unset($variables['page']['content']['system_main']['default_message']);
//will remove message "no front page content is created"
drupal_set_title('');
//removes welcome message (page title)
}
if (arg(0) == 'node') {
$variables['node_content'] =& $variables['page']['content']['system_main']['nodes'][arg(1)];
}
if (isset($variables['node']->type)) {
$variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type;
}
// Prepare the mobile menu.
$user_menu = menu_tree('user-menu');
$main_menu = menu_tree('main-menu');
$menu_tree = array_merge($main_menu, $user_menu);
// FYI for future dev's - If need to add more menu items, then load the other menu through menu tree as well and do a
// array merge or for loop to attach the items to the $menu_tree.
$mobile_menu = '<ul class="list-unstyled main-menu">';
foreach ($menu_tree as $mlid => $mm) {
if (is_int($mlid)) {
$mobile_menu .= iha_render_mobile_menu($mm);
}
}
$mobile_menu .= '</ul>';
$variables['mobile_menu'] = $mobile_menu;
}
示例6: update_selection_page
function update_selection_page()
{
drupal_set_title('Drupal database update');
$output = drupal_render(drupal_get_form('update_script_selection_form'));
update_task_list('select');
return $output;
}
示例7: apigee_bootstrap_preprocess_page
function apigee_bootstrap_preprocess_page(&$vars)
{
if (isset($vars['node']->type)) {
$vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
}
$search_box = drupal_render(drupal_get_form('search_form'));
$vars['search_box'] = $search_box;
}
示例8: test_osha_workflow_workbench_project_managers_form
public function test_osha_workflow_workbench_project_managers_form()
{
$_GET['q'] = 'admin/config/workbench/access/managers';
module_load_include('inc', 'osha_workflow', 'osha_workflow.admin');
$form = drupal_get_form('osha_workflow_workbench_project_managers_form');
$this->assertNotNull($form);
$this->assertArrayHasKey('main-menu', $form['rows']);
}
示例9: getOutput
/**
* Implements CqQuestionAbstract::getOutput()
*/
public function getOutput()
{
$this->initialise();
$retval = drupal_get_form('closedquestion_get_form_for', $this->node);
$retval['#prefix'] = $this->prefix;
$retval['#suffix'] = $this->postfix;
return $retval;
}
示例10: porto_sub_preprocess_page
function porto_sub_preprocess_page(&$variables)
{
if ($variables['is_front']) {
//Add the search box on the frontpage
$form = drupal_get_form('search_block_form');
$variables['search'] = drupal_render($form);
}
}
示例11: update_selection_page
function update_selection_page()
{
$output = '<p>The version of Drupal you are updating from has been automatically detected. You can select a different version, but you should not need to.</p>';
$output .= '<p>Click Update to start the update process.</p>';
drupal_set_title('Drupal database update');
$output .= drupal_get_form('update_script_selection_form');
update_task_list('select');
return $output;
}
示例12: futurium_isa_theme_preprocess_page
function futurium_isa_theme_preprocess_page(&$variables) {
$item = menu_get_item();
if (isset($_GET['period'])) {
if ($_GET['q'] == 'analytics') {
$period = str_replace('1_', ' ', $_GET['period']);
$period = str_replace('_', ' ', $period);
$title = drupal_get_title();
$title .= ' - Last ' . $period;
drupal_set_title($title);
}
}
if (!user_is_logged_in()) {
unset($variables['tabs']);
}
unset($variables['navbar_classes_array'][1]);
$variables['navbar_classes_array'][] = 'container-fullwidth';
if (!empty($variables['page']['sidebar_first']) && !empty($variables['page']['sidebar_second'])) {
$variables['content_column_class'] = ' class="col-sm-6"';
}
elseif (!empty($variables['page']['sidebar_first']) || !empty($variables['page']['sidebar_second'])) {
$variables['content_column_class'] = ' class="col-sm-9"';
}
else {
$variables['content_column_class'] = ' class="container-fullwidth"';
}
$search_form = drupal_get_form('search_form');
$search_box = drupal_render($search_form);
$variables['search_box'] = $search_box;
$panels_callbacks = array(
'page_manager_page_execute',
'page_manager_node_view_page',
'page_manager_user_view_page',
'page_manager_user_edit_page',
'page_manager_node_add',
'page_manager_node_edit',
'page_manager_term_view_page',
'entity_translation_edit_page',
'user_pages_user_users',
'user_pages_user_user_login',
'user_pages_user_user_register',
'user_pages_user_user_password',
);
$variables['content_wrapper'] = !in_array($item['page_callback'], $panels_callbacks, TRUE);
$variables['show_title'] = $variables['content_wrapper'];
}
示例13: adaptivetheme_admin_preprocess_views_view
/**
* Implements template_preprocess_views_view().
* Change the "Change to Draft" link open in Popup mode.
* IM-13 : Action: Return the Publication
* @param $vars
*/
function adaptivetheme_admin_preprocess_views_view(&$vars)
{
$view = $vars['view'];
if ($view->name == "workbench_moderation") {
$output = !empty($vars['rows']) ? $vars['rows'] : $vars['empty'];
$form = drupal_get_form(views_form_id($view), $view, $output);
$vars['rows'] = $form;
}
}
示例14: postBuild
/**
* {@inheritdoc}
*/
public function postBuild(array &$build, ObjectInterface $context = NULL)
{
if ($context instanceof MapInterface) {
$olebs_blockswitcher_form = drupal_get_form('olebs_blockswitcher_form', $context);
// This can rely in the id of the map instead of the css class.
$olebs_blockswitcher_form['map']['#value'] = $context->getId();
$build['BlockLayerSwitcher'] = array('#type' => 'fieldset', '#title' => 'Layer Switcher', '#collapsible' => TRUE, '#collapsed' => TRUE, 'form' => $olebs_blockswitcher_form);
}
}
示例15: brukar_server_admin_applications_users
function brukar_server_admin_applications_users($app)
{
$res['add'] = drupal_get_form('brukar_server_admin_applications_users_add', $app);
$res['users'] = array('#theme' => 'table', '#header' => array(t('Name'), t('Level'), t('Status'), t('Operations')), '#rows' => array());
foreach (db_select('brukar_access', 'a')->fields('a')->execute() as $row) {
$res['users']['#rows'][] = array(array('data' => user_load($row->uid)->name), array('data' => '-'), array('data' => $row->active == 0 ? t('Inactive') : t('Active')), array('data' => array('#theme' => 'links', '#attributes' => array('class' => array('links', 'inline')), '#links' => array('change' => array('title' => t('change'), 'href' => 'admin/structure/brukar/application/' . $app->id . '/users/change/' . $row->id), 'remove' => array('title' => t('remove'), 'href' => 'admin/structure/brukar/application/' . $app->id . '/users/remove/' . $row->id)))));
}
return $res;
}