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


PHP drupal_get_query_parameters函数代码示例

本文整理汇总了PHP中drupal_get_query_parameters函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_get_query_parameters函数的具体用法?PHP drupal_get_query_parameters怎么用?PHP drupal_get_query_parameters使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了drupal_get_query_parameters函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: scsmetronic_subtheme_preprocess_page

/**
 * Processes variables for block.tpl.php.
 *
 * Prepares the values passed to the theme_block function to be passed
 * into a pluggable template engine. Uses block properties to generate a
 * series of template file suggestions. If none are found, the default
 * block.tpl.php is used.
 *
 * Most themes utilize their own copy of block.tpl.php. The default is located
 * inside "modules/block/block.tpl.php". Look in there for the full list of
 * variables.
 *
 * The $variables array contains the following arguments:
 * - $block
 *
 * @see block.tpl.php
 */
function scsmetronic_subtheme_preprocess_page(&$variables)
{
    global $user;
    if (variable_get('scsmetronic_redirect_to_login') && $user->uid == 0 && arg(0) != 'user') {
        //header('Location: ' . url('user/login', array( 'absolute' => TRUE)), TRUE, 302);
        // Handle redirection to the login form.
        // using drupal_goto() with destination set causes a recursive redirect loop
        $login_path = 'user/login';
        $code = 302;
        // The code in drupal_get_destination() doesn't preserve any query string
        // on 403 pages, so reproduce the part we want here.
        $path = isset($_GET['destination']) ? $_GET['destination'] : '<front>';
        $query = drupal_http_build_query(drupal_get_query_parameters(NULL, array('q', 'destination')));
        if ($query != '') {
            $path .= '?' . $query;
        }
        $destination = array('destination' => $path);
        header('Location: ' . url($login_path, array('query' => $destination, 'absolute' => TRUE)), TRUE, 302);
        drupal_exit();
    }
    $variables['navbar_top'] = 'navbar-static-top';
    $theme_header = theme_get_setting('theme_header', 'scsmetronic');
    if (!empty($theme_header) && $theme_header !== 'default') {
        $variables['navbar_top'] = 'navbar-fixed-top';
    }
    //Get the entire main menu tree
    $main_menu_name = theme_get_setting('theme_main_menu', 'scsmetronic');
    $main_menu_tree = menu_tree_all_data($main_menu_name);
    $user_menu_tree = menu_tree_all_data('user-menu');
    //Add the rendered output to the $main_menu_expanded variable
    $variables['main_menu_expanded'] = menu_tree_output($main_menu_tree);
    $variables['user_menu_expanded'] = menu_tree_output($user_menu_tree);
    if ($modal_form_paths = theme_get_setting('theme_modal')) {
        $modal_forms = explode("\r\n", $modal_form_paths);
        drupal_add_js(array('scsmetronic_forms_modal' => $modal_forms), 'setting');
    }
    if ($user->uid) {
        $name = theme('username', array('account' => $user, 'link_path' => NULL));
    } else {
        $name = variable_get('anonymous', t('Guest'));
    }
    $variables['loggedin_user_name'] = $name;
    $variables['image'] = scsmetronic_login_user_image($user);
}
开发者ID:Thomsonaj,项目名称:Ken,代码行数:61,代码来源:template.php

示例2: _myu_language_dropdown

function _myu_language_dropdown($type = 'language')
{
    if (drupal_multilingual()) {
        global $language_url;
        $path = drupal_is_front_page() ? '<front>' : $_GET['q'];
        //$type = 'language_url';
        $languages = language_negotiation_get_switch_links($type, $path);
        $items = array();
        foreach ($languages->links as $lang_code => $lang_options) {
            if ($lang_options['language']->language === $language_url->language) {
                // Icon for the selected language
                if (module_exists('languageicons')) {
                    $icon = theme('languageicons_icon', array('language' => (object) array('language' => $lang_code), 'title' => $language_url->native));
                }
                $active_language_text = $icon . '<span class="langname">' . strtoupper($language_url->language) . '</span><i class="fa fa-angle-down"></i>';
                $active_language_link = l($active_language_text, 'javascript:;', array('html' => TRUE, 'external' => TRUE, 'attributes' => array('class' => 'dropdown-toggle', 'data-close-others' => 'true', 'data-hover' => 'dropdown', 'data-toggle' => 'dropdown')));
            } else {
                if (!isset($lang_options['query'])) {
                    $lang_options['query'] = drupal_get_query_parameters();
                }
                $items[] = l($lang_options['title'], $lang_options['href'], $lang_options);
            }
        }
        $language_flag_list = theme('item_list', array('items' => $items, 'type' => 'ul', 'attributes' => array('class' => 'dropdown-menu dropdown-menu-default')));
        return '<ul class="menu nav navbar-nav language"><li class="dropdown dropdown-language">' . $active_language_link . $language_flag_list . '</li></ul>';
    }
}
开发者ID:verbruggenalex,项目名称:mediayoutubeupload,代码行数:27,代码来源:page.vars.php

示例3: viewUserStats

function viewUserStats()
{
    global $user;
    $params = drupal_get_query_parameters();
    if (isset($params["UID"])) {
        $UID = $params["UID"];
    } else {
        $UID = $user->uid;
    }
    $currentTeam = getCurrentTeam();
    $TID = $currentTeam['TID'];
    $teamNumber = $currentTeam['number'];
    $numOfOutreachesForUser = dbGetNumOutreachForUser($UID);
    $markup = "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.js\"></script>";
    $markup .= '<script src="numberCounting.js"></script>';
    $form['script'] = array('#markup' => $markup);
    // create page header and table
    $form['mainHeader'] = array('#markup' => '<h1>My Dashboard</h1>');
    $form['table'] = array('#markup' => '<table><tr><td>');
    // displays users total stats
    $markup = '<table id="myTotalStats"><tr><td colspan="2" style="text-align:center">';
    $markup .= '<div class="help tooltip2">';
    $markup .= '<h2><b>My Total Stats</b></h2>';
    $markup .= '<span id="helptext"; class="helptext tooltiptext2">';
    $markup .= 'These are your total numbers of hours and outreaches.';
    $markup .= '</span></div>';
    $markup .= '</td></tr>';
    $markup .= '<tr><td style="text-align:center"><a href="?q=viewHours&UID=' . $UID . '"><b>HOURS</b></a></td>';
    $markup .= '<td style="text-align:center"><a href="?q=outreach"><b>OUTREACHES</b></a></td></tr>';
    $markup .= '<tr style="font-size:48pt; font-family: "Open Sans", sans-serif;"><td style="text-align:center"><b class="countUp">' . dbGetUserHours($UID) . '</b></td>';
    $markup .= '<td style="text-align:center"><b class="countUp">' . $numOfOutreachesForUser;
    $markup .= '</b></td></tr></table></td>';
    $form['myStatsTable'] = array('#markup' => $markup);
    // if user has more than one team, displays stats for user on current team
    if (count(dbGetTeamsForUser($UID)) > 1) {
        // dropdown allows user to switch teams
        $form['TID'] = array('#prefix' => '<td><table id="myStatsOnTeamNumber"><tr><td id ="myStatsOnMultTeams1" style="text-align:right; padding:0px"><div class="help tooltip2"><h2><b>My Stats On</b></h2><span id="helptext"; class="helptext tooltiptext2">These are your total numbers of hours and outreaches for your currently active team.</span></div></td><td id="myStatsOnMultTeams2"> ', '#type' => 'select', '#attributes' => array('onChange' => 'document.getElementById("viewuserstats").submit();'), '#chosen' => true, '#options' => dbGetTeamsListForUser($UID), '#default_value' => $TID, '#suffix' => '</td></tr>');
        $markup = '<tr><td style="text-align:center"><a href="?q=userHoursForTeam&UID=' . $UID . '&TID=' . $TID . '"><b>HOURS</b></a></td>';
        $markup .= '<td style="text-align:center"><a href="?q=userEventsForTeam&UID=' . $UID . '&TID=' . $TID . '"><b>OUTREACHES</b></a></td></tr>';
        $markup .= '<tr style="font-size:48pt; font-family:"Open Sans", sans-serif;"><td style="text-align:center"><b class="countUp">' . dbGetUserHoursForTeam($UID, $TID) . '</b></td>';
        $markup .= '<td style="text-align:center"><b class="countUp">' . dbGetNumOutreachesForUserForTeam($UID, $TID) . '</b></td></tr></table></td></tr></table>';
        $form['teamStatsTable'] = array('#markup' => $markup);
        $form['submit'] = array('#type' => 'submit', '#value' => 'Update', '#attributes' => array('style' => array('display: none;')));
    } else {
        // if user does not have more than one team, displays what team the user is on
        $markup = '<td><table id="myStatsOnTeamNumber"><tr><td colspan="2" style="text-align:center">';
        $markup .= '<div class="help tooltip2">';
        $markup .= '<h2>My Team</h2>';
        $markup .= '<span id="helptext"; class="helptext tooltiptext2">';
        $markup .= 'This is the team number and CROMA permission for your user.';
        $markup .= '</span></div>';
        $markup .= '</td></tr>';
        $markup .= '<tr style="font-size:48pt; font-family:"Open Sans", sans-serif;"><td style="text-align:center"><b>' . $currentTeam['number'] . '</b></td></tr>';
        $role = dbGetRoleForTeam($UID, $TID) == '' ? 'Team Member' : dbGetRoleForTeam($UID, $TID);
        $markup .= '<tr><td style="text-align:center"><b>CROMA Role: </b>' . $role . '</td></tr>';
        $markup .= '</table></td></tr></table>';
        $form['TID'] = array('#markup' => $markup);
    }
    return $form;
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:60,代码来源:userStats.php

示例4: _soc_boxauth_get_code_from_box_handler

/**
 * This function is handles the callback from Box API.
 * @return string
 */
function _soc_boxauth_get_code_from_box_handler()
{
    // get query string parameters
    $qs = drupal_get_query_parameters();
    watchdog(SOC_BOXAUTH_MODULENAME, "Got code back from Box", $qs, WATCHDOG_INFO);
    // Stage post data and create http query
    $post_data = ['grant_type' => 'authorization_code', 'code' => $qs['code'], 'client_id' => variable_get(SOC_BOXAUTH_CLIENTID_VARIABLE), 'client_secret' => variable_get(SOC_BOXAUTH_CLIENTSECRET_VARIABLE)];
    $result = BoxFolderOperations::doPost('https://api.box.com/oauth2/token', $post_data, 'Content-type: application/x-www-form-urlencoded', 'QUERY');
    // save to session. Decoded json object into php array
    $_SESSION['box'] = drupal_json_decode($result);
    $_SESSION['box']['expires_time'] = time() + SOC_BOXAUTH_EXPIREOFFSET;
    // If successful, the ['box']['access_token'] will exists. Log and report
    // to user.
    if (isset($_SESSION['box']['access_token'])) {
        drupal_set_message(t(variable_get(SOC_BOXAUTH_SUCCESSMESSAGE_VARIABLE)));
        watchdog(SOC_BOXAUTH_MODULENAME, 'Successful box access_token');
        $next_steps = variable_get(SOC_BOXAUTH_NEXTSTEPS_VARIABLE, ['value' => t('Next steps...')]);
        return $next_steps['value'];
    } else {
        $message = t(variable_get(SOC_BOXAUTH_FAILUREMESSAGE_VARIABLE));
        drupal_set_message($message, 'error');
        watchdog(SOC_BOXAUTH_MODULENAME, 'Failed box access_token');
        return $message;
    }
}
开发者ID:rgoodie,项目名称:soc_boxauth,代码行数:29,代码来源:soc_boxauth_handler.inc.php

示例5: notificationForm_submit

function notificationForm_submit($form, $form_state)
{
    global $user;
    $params = drupal_get_query_parameters();
    $OID = $params['OID'];
    // generate the notification
    $notification = getFields(array('dateTargeted', 'message'), $form_state['values']);
    $notification = stripTags($notification);
    // allow some tags
    $notification['dateTargeted'] = dbDatePHP2SQL(strtotime($notification['dateTargeted']));
    $notification['bttnTitle'] = 'View Outreach';
    $notification['bttnLink'] = '?q=viewOutreach&OID=' . $OID;
    $notification['OID'] = $OID;
    $notification['TID'] = dbGetTeamForOutreach($OID);
    $notification['dateCreated'] = dbDatePHP2SQL(time());
    foreach ($form_state['values']['UID'] as $UID) {
        if ($UID != null) {
            $notification['UID'] = $UID;
            $result = dbAddNotification($notification);
        }
    }
    if ($result) {
        drupal_set_message('Notification added!');
        drupal_goto('manageNotifications', array('query' => array('OID' => $OID)));
    } else {
        drupal_set_message('There was an error.', 'error');
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:28,代码来源:notificationForm.php

示例6: transferTeamOwnershipForm

function transferTeamOwnershipForm($form, &$form_state)
{
    global $user;
    $params = drupal_get_query_parameters();
    if (isset($params['TID'])) {
        $form_state['TID'] = $TID = $params['TID'];
    } else {
        drupal_set_message('You need to choose a team.', 'error');
        drupal_goto('showUsersForTeam');
    }
    $team = dbGetTeam($TID);
    if ($user->uid != $team['UID']) {
        // if the user is not the team owner
        drupal_set_message("You are not the owner of team {$team['name']}", 'error');
        drupal_goto($_SERVER['HTTP_REFERER']);
    }
    $people = dbGetUsersListFromTeam($TID);
    unset($people[$user->uid]);
    // shouldn't be able to transfer to self
    $people[0] = '';
    // field needs a default value
    $form['header'] = array('#markup' => "<h1>Transfer Ownership of {$team['name']}</h1>");
    $form['fields'] = array('#type' => 'fieldset');
    $form['fields']['table'] = array('#prefix' => '<table><tr>', '#suffix' => '</tr></table>');
    $form['fields']['table']['info'] = array('#prefix' => '<td>', '#markup' => 'Transferring ownership of this team will make you into a team admin (at which point you may leave the team if you wish). The new owner you choose will be notified of their promotion via email, and will gain the <strong>ability to delete the team at will</strong>. His/her notification email will also include your email for contact purposes in case of an error. If you wish to become the team owner again, the new owner must transfer ownership.', '#suffix' => '</td>');
    $form['fields']['table']['newOwner'] = array('#prefix' => '<td>', '#type' => 'select', '#title' => t('New Team Owner:'), '#default_value' => 0, '#options' => $people, '#chosen' => true, '#suffix' => '</td>');
    $form['submit'] = array('#prefix' => '<div align="right">', '#attributes' => array('onclick' => 'return confirm("Are you sure you want to transfer ownership?");'), '#type' => 'submit', '#value' => 'Submit', '#suffix' => '</div>');
    return $form;
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:29,代码来源:manageUsersForTeam.php

示例7: _cignaglobal_preprocess_node_landing_page

function _cignaglobal_preprocess_node_landing_page(&$vars)
{
    // Convert title token to location from URL if used.
    $queries = drupal_get_query_parameters();
    $title =& $vars['content']['title'][0]['#markup'];
    if (strpos($title, '{location}') !== FALSE && isset($queries['location'])) {
        $title = str_replace('{location}', $queries['location'], $title);
        $title = ucwords($title);
    }
}
开发者ID:kymunr,项目名称:DrupalProject,代码行数:10,代码来源:node.php

示例8: usersSearchHeader

function usersSearchHeader()
{
    global $user;
    $params = drupal_get_query_parameters();
    if (isset($params["UID"])) {
        $UID = $params["UID"];
    } else {
        $UID = $user->uid;
    }
    // create table and header
    $markup = '<table><tr><div class="help tooltip2"><h2>Team Members</h2><span id="helptext"; class="helptext tooltiptext2">Click here to search for a team member or manage your teams permissions.</tr></span></div><th>Search For A Team Member</th></table>';
    return $markup;
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:13,代码来源:usersSearch.php

示例9: viewUserEventsForTeam

function viewUserEventsForTeam()
{
    global $user;
    $params = drupal_get_query_parameters();
    // if user does not have a team
    if (dbGetTeamsForUser($user->uid) == NULL) {
        drupal_set_message("You don't have a team assigned.", 'error');
        drupal_goto($_SERVER['HTTP_REFERER']);
    }
    if (isset($params['UID'])) {
        $UID = $params['UID'];
    } else {
        $UID = $user->uid;
    }
    if (isset($params['TID'])) {
        $TID = $params['TID'];
    } else {
        $currentTeam = getCurrentTeam();
        $TID = $currentTeam['TID'];
    }
    $outreaches = dbGetOutreachesForUserForTeam($UID, $TID);
    $teamName = dbGetTeamName($TID);
    // create page header and table
    $markup = "<table><h1>My Outreaches For {$teamName}</h1></table>";
    $markup .= '<table class="infoTable">';
    $markup .= '<tr>';
    $markup .= '<th colspan="3">Outreach Name</th>';
    $markup .= '<th colspan="3">Description</th>';
    $markup .= '<th colspan="2">Hours</th>';
    $markup .= "</tr>";
    // if user has outreaches for the current team
    if (!empty($outreaches)) {
        foreach ($outreaches as $outreach) {
            $markup .= "<tr>";
            $markup .= '<td colspan="3">' . '<a href="?q=viewOutreach&OID=' . $outreach['OID'] . '">' . chopString($outreach["name"], 30) . '</a>' . "</td>";
            $markup .= '<td colspan="3">' . chopString($outreach["description"], 30) . "</td>";
            $markup .= '<td colspan="2">' . dbGetHoursForUserFromOutreach($UID, $outreach['OID']) . "</tr>";
            $markup .= "</tr>";
        }
        $markup .= "</table>";
    } else {
        // if the user does not have any outreaches for the current team
        $markup .= '<tr><td style="text-align:center" colspan="10"><em>[None]</em></td>';
        $markup .= "</tr>";
    }
    $markup .= "</table>";
    $retArray = array();
    $retArray['#markup'] = $markup;
    return $retArray;
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:50,代码来源:userStatsForTeam.php

示例10: dismissNotification

function dismissNotification($NID)
{
    $params = drupal_get_query_parameters();
    dbDeleteNotification($NID);
    drupal_set_message('Notification has been dismissed.');
    // go back to the "View All Notifications" page
    if (isset($params["allnote"])) {
        drupal_goto('viewAllNotifications');
    } else {
        if (isset($_SERVER['HTTP_REFERER'])) {
            drupal_goto($_SERVER['HTTP_REFERER']);
        } else {
            drupal_goto('myDashboard');
        }
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:16,代码来源:viewNotifications.php

示例11: find_search

/**
 * Main search controller.
 * 
 * @param string $key
 */
function find_search($key)
{
    drupal_add_css(drupal_get_path('module', 'find') . '/css/find_search.css', array('group' => CSS_DEFAULT, 'every_page' => true));
    drupal_add_css(drupal_get_path('module', 'find') . '/css/find_print.css', array('group' => CSS_DEFAULT, 'every_page' => true, 'media' => 'print'));
    drupal_add_js('http://maps.google.com/maps/api/js?sensor=false&libraries=geometry,places', array('group' => JS_LIBRARY));
    drupal_add_library('system', 'ui.sortable');
    drupal_add_js(drupal_get_path('module', 'area') . '/css/overlay-style.js');
    drupal_add_js(drupal_get_path('module', 'area') . '/js/geometry.js');
    drupal_add_js(drupal_get_path('module', 'find') . '/js/find.js');
    drupal_add_css(drupal_get_path('module', 'gallery') . '/css/jquery.lightbox.css', array('group' => CSS_DEFAULT, 'every_page' => TRUE));
    drupal_add_js(drupal_get_path('module', 'gallery') . '/js/jquery.lightbox.js', array('weight' => 100));
    drupal_add_js(drupal_get_path('module', 'gallery') . '/js/gallery.lightbox.js');
    $variables = array('#theme' => 'find.search');
    // fetch $_GET parameters
    $params = find_query_params(array('search' => '', 'geo' => array(), 'date' => array(), 'class' => array(), 'user' => array(), 'family' => array(), 'genus' => array(), 'town' => array(), 'canton' => array(), 'redlist' => array(), 'habitat' => array(), 'image_type' => array(), 'columns' => array(), 'sort' => array()));
    $params['uid'] = $GLOBALS['user']->uid;
    try {
        $client = new Elastica_Client();
        $status = $client->getStatus();
        // ping to make sure elasticsearch is running
        $index = $client->getIndex('naturwerk');
        $parameters = new Parameters($params);
        $variables['#organisms'] = new Organisms($index, $parameters);
        $variables['#sightings'] = new Sightings($index, $parameters);
        $variables['#inventories'] = new Inventories($index, $parameters);
        $variables['#areas'] = new Areas($index, $parameters);
        $variables['#images'] = new Images($index, $parameters);
        // make parameters available to JavaScript
        $parameters = drupal_get_query_parameters();
        if (count($parameters) == 0) {
            $parameters = new stdClass();
            // force empty JSON object
        }
        drupal_add_js(array('find' => array('url' => url($_GET['q']), 'parameters' => $parameters, 'geo' => $params['geo'])), 'setting');
        $variables['#key'] = $key;
        $variables['#current'] = $variables['#' . $key];
        $output = array();
        $output['search'] = $variables;
        return $output;
    } catch (Elastica_Exception_Client $e) {
        watchdog('find', $e->getMessage(), array(), WATCHDOG_ERROR);
        drupal_set_message(t('Search error. Elasticsearch running?'), 'error');
        return array();
    }
}
开发者ID:rettichschnidi,项目名称:naturvielfalt,代码行数:50,代码来源:find.views.inc.php

示例12: osha_frontend_menu_link__menu_search

/**
 * Implements hook_menu_link__menu_search().
 *
 * Add classes to search menu to style like tabs.
 */
function osha_frontend_menu_link__menu_search($variables)
{
    $element = $variables['element'];
    $active = '';
    if (in_array('active-trail', $element['#attributes']['class'])) {
        $active = 'is-active active';
    }
    if (empty($element['#localized_options'])) {
        $element['#localized_options'] = array();
    }
    $query_parameters = drupal_get_query_parameters();
    if (!empty($query_parameters['search_block_form'])) {
        $element['#localized_options']['query']['search_block_form'] = $query_parameters['search_block_form'];
    }
    $element['#attributes']['class'] = array('tabs-primary__tab', $active);
    $element['#localized_options']['attributes']['class'] = array('tabs-primary__tab-link', $active);
    $output = l($element['#title'], $element['#href'], $element['#localized_options']);
    return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . "</li>\n";
}
开发者ID:ejcx,项目名称:osha-website,代码行数:24,代码来源:template.php

示例13: approveTeam

function approveTeam($TID)
{
    $params = drupal_get_query_parameters();
    dbApproveTeam($TID);
    $UID = dbGetOwnerForTeam($TID);
    $teamName = dbGetTeamName($TID);
    drupal_mail('adminFunctions', 'teamApproved', dbGetUserPrimaryEmail($UID), variable_get('language_default'), $params = array('teamName' => $teamName, 'fullName' => dbGetUserName($UID)), $from = NULL, $send = TRUE);
    drupal_set_message('The team has been approved and the team owner has been notified!');
    $notification = array('UID' => $UID, 'TID' => $TID, 'dateCreated' => dbDatePHP2SQL(time()), 'dateTargeted' => dbDatePHP2SQL(time()));
    $notification['message'] = "Your team, team \"{$teamName}\" has just been approved!";
    $notification['bttnTitle'] = 'View';
    $notification['bttnLink'] = "?q=viewTeam&TID={$TID}";
    dbAddNotification($notification);
    if (isset($params['show'])) {
        drupal_goto('adminPage', array('query' => array($params['show'])));
    } else {
        drupal_goto('adminPage');
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:19,代码来源:adminPage.php

示例14: addTeamMember

function addTeamMember($form, &$form_state)
{
    $params = drupal_get_query_parameters();
    if (isset($params['TID'])) {
        $form_state['TID'] = $params['TID'];
    }
    if (!isset($form_state['TID'])) {
        drupal_set_message('You need to specify a team.', 'error');
    }
    $teamName = dbGetTeamName($form_state['TID']);
    $form['fields'] = array('#type' => 'fieldset', '#title' => t("Add Team Member to {$teamName}"));
    $form['fields']['tableHeader'] = array('#markup' => '<table>');
    $form['fields']['primaryEmail'] = array('#prefix' => '<tr><td colspan="2" style="text-align:center">', '#type' => 'textfield', '#title' => t('Email'), '#suffix' => '</td></tr><tr><td>', '#ajax' => array('callback' => 'fillUserName', 'keypress' => true, 'wrapper' => 'div_user_name_wrapper'));
    $form['fields']['name']['firstName'] = array('#prefix' => '<div id="div_user_name_wrapper"><table><tr><td style="text-align:center">', '#type' => 'textfield', '#title' => t('First Name'), '#suffix' => '</td>');
    $form['fields']['name']['lastName'] = array('#prefix' => '<td style="text-align:center">', '#type' => 'textfield', '#title' => t('Last Name'), '#suffix' => '</td></tr></table></div></td></tr>');
    $form['fields']['submit'] = array('#prefix' => '<td colspan="2" style="text-align:right">', '#type' => 'submit', '#value' => t('Save'), '#suffix' => '</td>');
    $form['footer'] = array('#markup' => '</tr></table>');
    return $form;
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:19,代码来源:addTeamMember.php

示例15: manageNotifications

function manageNotifications()
{
    $params = drupal_get_query_parameters();
    if (isset($params['OID'])) {
        $OID = $params['OID'];
        $outreachName = dbGetOutreachName($OID);
        // create page header, table, and add notification button
        $markup = '';
        $markup .= '<table>';
        $markup .= "<tr><td><h1>Manage Notifications for \"{$outreachName}\" </h1>";
        $markup .= '</td><td style="text-align:right">';
        $markup .= '<a href="?q=notificationForm&OID=' . $OID . '"><button>Add Notification</button></a></td></tr></table>';
        $markup .= '<table class="infoTable"><tr><th colspan="3">Target Users</th><th colspan="3">Notification Message</th><th colspan="2">Date To Be Sent</th><th colspan="2"></th></tr>';
        $notifications = dbGetNotificationsForOutreach($OID);
        // if outreach already has notifications
        if (!empty($notifications)) {
            foreach ($notifications as $notification) {
                $markup .= '<tr>';
                $markup .= '<td colspan="3">' . dbGetUserName($notification['UID']) . '</td>';
                $markup .= '<td colspan="3">' . $notification['message'] . '</td>';
                $date = dbDateSQL2PHP($notification['dateTargeted']);
                $markup .= '<td colspan="2">' . date(TIME_FORMAT, $date) . '</td>';
                $markup .= '<td colspan="2"><a href="?q=deleteNotification/' . $notification['NID'];
                $markup .= "/{$OID}\"><button>Delete</button></a></td>";
                $markup .= '</td>';
            }
            $markup .= '</table>';
        } else {
            // if outreach does not have notifications
            $markup .= "<tr>";
            $markup .= '<td style="text-align:center" colspan="10"><em>[None]</em></td>';
            $markup .= "</tr>";
        }
        $markup .= "</table>";
        return array('#markup' => $markup);
    } else {
        // returns message if OID is not correct
        drupal_set_message('No outreach selected.', 'error');
        drupal_goto($_SERVER['HTTP_REFERER']);
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:41,代码来源:manageNotifications.php


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