本文整理汇总了PHP中drupal_goto函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_goto函数的具体用法?PHP drupal_goto怎么用?PHP drupal_goto使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drupal_goto函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter_init
function filter_init()
{
global $conf, $user;
// Inject values into the $conf array - will apply to all sites.
// This can be a useful place to apply generic development settings.
$conf_inject = unserialize(urldecode(runserver_env('RUNSERVER_CONF')));
// Merge in the injected conf, overriding existing items.
$conf = array_merge($conf, $conf_inject);
// Log in user if needed.
if (isset($_GET['login'])) {
$uid = runserver_env('RUNSERVER_USER');
if (!empty($uid) && $user->uid !== $uid) {
// If a user was provided, log in as this user.
$user = user_load($uid);
if (function_exists('drupal_session_regenerate')) {
// Drupal 7
drupal_session_regenerate();
} else {
// Drupal 6
sess_regenerate();
}
}
// Refresh the page (in case access denied has been called already).
drupal_goto($_GET['q']);
}
}
示例2: applyForTeamForm_submit
function applyForTeamForm_submit($form, $form_state)
{
global $user;
$name = $form_state['values']['personName'];
$email = $form_state['values']['email'];
$teamName = dbGetTeamName($form_state['TID']);
$note = $form_state['values']['message'];
// fill in the fields of the application
$application['UID'] = $user->uid;
$application['TID'] = $form_state['TID'];
$application['userEmail'] = stripTags($email, '');
// do not allow tags
$application['userMessage'] = stripTags($note);
// allow some tags
// add a notification for the team owner and admins
if (dbApplyForTeam($application)) {
// note that this does its own error checking
$notification['dateCreated'] = dbDatePHP2SQL(time());
$notification['dateTargeted'] = dbDatePHP2SQL(time());
$notification['TID'] = $form_state['TID'];
$notification['message'] = "{$name} has applied to join your team {$teamName}.";
$notification['bttnTitle'] = 'View';
$notification['bttnLink'] = '?q=viewUsersToBeApproved&TID=' . $form_state['TID'];
notifyUsersByRole($notification, 'teamOwner');
notifyUsersByRole($notification, 'teamAdmin');
drupal_set_message('Your application has been sent! You will receive an email when you have been approved for the team.');
drupal_goto('manageUserTeams');
}
}
示例3: deleteUserPage_submit
function deleteUserPage_submit($form, $form_state)
{
global $user;
$UID = $user->uid;
$teams = dbGetTeamsForUser($UID);
// getting teams that are associated with a user
foreach ($teams as $team) {
// looping through these teams
dbKickUserFromTeam($UID, $team['TID']);
// removing the user from these teams
dbRemoveAllUserRoles($UID, $team['TID']);
// ensuring the user doesn't have any role on the team
}
dbRemoveAllEmailsForUser($UID);
dbDisableUser($UID);
$params['feedback'] = stripTags($form_state['values']['misc'], '');
// stripping any "illegal" HTML tags
$params['userName'] = dbGetUserName($UID);
// getting the user name
drupal_mail('users', 'userdeleted', 'croma@chapresearch.com', variable_get('language_default'), $params, $from = null, $send = true);
// sending the user a confirmation mail
drupal_set_message("Your account has been deleted. We're sorry to see you go!");
// message displayed and redirected to front page
drupal_goto('<front>');
}
示例4: main_preprocess_node
function main_preprocess_node(&$variables)
{
// Redirect non delta project to first delta
if ($variables['type'] == "project") {
drupal_goto($variables['node_url'] . '/1');
}
}
示例5: postProcess
public function postProcess()
{
$params = $this->_submitValues;
$batchDetailsSql = " UPDATE civicrm_batch SET ";
$batchDetailsSql .= " title = %1 ";
$batchDetailsSql .= " , description = %2 ";
$batchDetailsSql .= " , banking_account = %3 ";
$batchDetailsSql .= " , banking_date = %4 ";
$batchDetailsSql .= " , exclude_from_posting = %5 ";
$batchDetailsSql .= " , contribution_type_id = %6 ";
$batchDetailsSql .= " , payment_instrument_id = %7 ";
$batchDetailsSql .= " WHERE id = %8 ";
$bankingDate = CRM_Utils_Date::processDate($params['banking_date']);
$sqlParams = array();
$sqlParams[1] = array((string) $params['batch_title'], 'String');
$sqlParams[2] = array((string) $params['description'], 'String');
$sqlParams[3] = array((string) $params['banking_account'], 'String');
$sqlParams[4] = array((string) $bankingDate, 'String');
$sqlParams[5] = array((string) $params['exclude_from_posting'], 'String');
$sqlParams[6] = array((string) $params['contribution_type_id'], 'String');
$sqlParams[7] = array((string) $params['payment_instrument_id'], 'String');
$sqlParams[8] = array((int) $params['id'], 'Integer');
CRM_Core_DAO::executeQuery($batchDetailsSql, $sqlParams);
drupal_goto('civicrm/batch/process', array('query' => array('bid' => $params['id'], 'reset' => '1')));
CRM_Utils_System::civiExit();
}
示例6: 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');
}
}
示例7: bluemod_init
function bluemod_init()
{
//theme ( 'bluemod_javascript' );
error_reporting(0);
// Redirecciona a la pantalla de ingreso
global $user;
//Redirecciona a home a los usuarios anónimos.
$curr = current_path();
$anon_main = 0;
$link_de_registro = substr_count($curr, 'user/reset/');
$link_de_invitacion = substr_count($curr, 'invite/accept/');
//echo $link_de_registro.','.$curr;
if ($user->roles[1] == 'anonymous user' && $curr != 'escritorio') {
//echo $curr;
//Lista de excepciones que un usuario anónimo puede ver
if ($curr != 'user/register' && $curr != 'user/password' && $curr != 'user/reset' && $curr != 'elegir-contactos' && $curr != 'node/374' && $curr != 'node/381' && $curr != 'node/228' && $curr != 'contact' && $curr != "system/ajax" && $link_de_registro == 0 && $link_de_invitacion == 0) {
//echo $link_de_registro.','.$curr;
//solo si no fuera el link de registro que tiene la forma user/reset/*
// header("Location: /");
//$mensaje = drupal_get_message(null,false);
//drupal_set_message($mensaje);
drupal_goto("<front>");
}
}
if (arg(0) == 'user' && arg(1) == 'password') {
drupal_set_title(t('Recupera tu Contraseña'));
}
if (arg(0) == 'user' && arg(1) == 'register') {
drupal_set_title(t('Solicitar Invitación'));
}
}
示例8: guifi_node_add
/** guifi_node_add(): creates a new node
*/
function guifi_node_add($id)
{
$zone = guifi_zone_load($id);
// Set the defaults for a node of this zone
// Callback to node/guifi-node/add
drupal_goto('node/add/guifi-node?edit[title]=' . $zone->id);
}
示例9: dexp_layerslider_clone
function dexp_layerslider_clone($slideid)
{
$slide = db_select('{dexp_layerslider}', 'd')->fields('d')->condition('id', $slideid, '=')->execute()->fetchAssoc();
db_insert("{dexp_layerslider}")->fields(array('name' => "Copy of " . $slide['name'], 'settings' => $slide['settings'], 'data' => $slide['data']))->execute();
drupal_set_message("Successfully cloned.");
drupal_goto('admin/dexp_layerslider');
}
示例10: submit
public function submit($form, &$form_state)
{
$paths = $form_state['storage']['paths'];
$content_type = $form_state['build_info']['args'][0];
publisher_purge_set_content_type_paths($content_type->type, $paths);
drupal_set_message(t('Content Type <strong>@content_type</strong> updated successfully.', array('@content_type' => $content_type->name)));
drupal_goto('admin/config/publisher/purge');
}
示例11: usersSearch_submit
function usersSearch_submit($form, $form_state)
{
$names = array('nameContains');
$row = getFields($names, $form_state['values']);
$row = stripTags($row, '');
drupal_goto('showUsersForTeam', array('query' => array('query' => $row['nameContains'])));
return;
}
示例12: acquia_prosper_preprocess
function acquia_prosper_preprocess(&$vars)
{
if (!function_exists('fusion_core_add_block')) {
drupal_set_message(t('Error! <a href="!link">Fusion Core</a> base theme not found. Please install and enable Fusion Core first.', array('!link' => 'http://drupal.org/project/fusion')), 'error', false);
variable_set('theme_default', 'garland');
$vars['is_admin'] ? drupal_goto('admin/build/themes') : drupal_goto('');
}
}
示例13: authorize
/**
* Implements OpenIDConnectClientInterface::authorize().
*/
public function authorize($scope = 'openid email')
{
$redirect_uri = OPENID_CONNECT_REDIRECT_PATH_BASE . '/' . $this->name;
$url_options = array('query' => array('client_id' => $this->getSetting('client_id'), 'response_type' => 'code', 'scope' => $scope, 'redirect_uri' => url($redirect_uri, array('absolute' => TRUE)), 'state' => openid_connect_create_state_token()));
$endpoints = $this->getEndpoints();
// Clear $_GET['destination'] because we need to override it.
unset($_GET['destination']);
drupal_goto($endpoints['authorization'], $url_options);
}
示例14: set_item_state
/**
* @todo
*/
function set_item_state($state, $js, $input, $item)
{
ctools_export_set_object_status($item, $state);
if (!$js) {
drupal_goto(ctools_export_ui_plugin_base_path($this->plugin));
} else {
return $this->list_page($js, $input);
}
}
示例15: approveHours
function approveHours($HID)
{
dbApproveHours($HID);
drupal_set_message('Hours have been approved!');
if (isset($_SERVER['HTTP_REFERER'])) {
drupal_goto($_SERVER['HTTP_REFERER']);
} else {
drupal_goto('viewHours');
}
}