当前位置: 首页>>代码示例>>PHP>>正文


PHP drupal_get_form函数代码示例

本文整理汇总了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');
    }
}
开发者ID:navster,项目名称:camp-adair,代码行数:26,代码来源:template.php

示例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>&raquo;&nbsp;' . l($text, "node/{$nid}") . '</p>';
        $return['subject'] = $parent_node->title;
        $return['content'] = $form . $link;
    }
    return $return;
}
开发者ID:rnao,项目名称:Connect,代码行数:32,代码来源:connect_blocks.php

示例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);
开发者ID:singhneeraj,项目名称:fr-store,代码行数:7,代码来源:filter-block-api.php

示例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;
}
开发者ID:nevetS,项目名称:flame,代码行数:14,代码来源:bootstrap_modal_forms.api.php

示例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;
}
开发者ID:freighthouse,项目名称:code,代码行数:31,代码来源:template.php

示例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;
}
开发者ID:berkes,项目名称:sympal,代码行数:7,代码来源:update.php

示例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;
}
开发者ID:freighthouse,项目名称:code,代码行数:8,代码来源:template.php

示例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']);
 }
开发者ID:enriquesanchezhernandez,项目名称:campaigns,代码行数:8,代码来源:WorkflowPublicationTest.php

示例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;
 }
开发者ID:rollinsb1010,项目名称:elearning,代码行数:11,代码来源:CqQuestionBalance.class.php

示例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);
    }
}
开发者ID:NISR,项目名称:web_d7,代码行数:8,代码来源:template.php

示例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;
}
开发者ID:nguyennamtien,项目名称:system_settings,代码行数:9,代码来源:recovery.php

示例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'];

}
开发者ID:ec-europa,项目名称:futurium-features,代码行数:57,代码来源:template.php

示例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;
    }
}
开发者ID:singhneeraj,项目名称:im-portal,代码行数:15,代码来源:template.php

示例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);
     }
 }
开发者ID:akapivo,项目名称:www.dmi.be,代码行数:12,代码来源:BlockLayerSwitcher.php

示例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;
}
开发者ID:evenos,项目名称:drupal7-module-brukar,代码行数:9,代码来源:brukar_server.admin.php


注:本文中的drupal_get_form函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。