This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$route = \Drupal::service('current_route_match'); | |
$job_id = $route->getRawParameters()->getInt('job'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$route = \Drupal::service('current_route_match'); | |
$route_name = $route->getRouteName(); | |
$invoice_id = $route->getRawParameter('invoice'); | |
$invoice_url = \Drupal\Core\Url::fromRoute($route_name, ['invoice' => $invoice_id], ['absolute' => TRUE])->toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\Drupal::configFactory()->getEditable('system.site')->set('page.front', '/job/1')->save(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_preprocess_block(&$variables). | |
*/ | |
function icareix_global_preprocess_block(&$variables) { | |
if ($variables['elements']['#plugin_id'] == 'system_branding_block') { | |
// Select front page by user role. | |
$current_user = \Drupal::currentUser(); | |
$current_uid = $current_user->id(); | |
$config = \Drupal::config('icareix_global.FrontPageByRole'); | |
$url = \Drupal::config('system.site')->get('page.front'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drupal.CTools.Modal.dismiss(); | |
$form['cancel'] = array( | |
'#type' => 'button', | |
'#value' => t('Cancel'), | |
'#attributes' => array('onClick' => 'Drupal.CTools.Modal.dismiss();'), | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set link = "/job/#{fields.id.content}" %} | |
{% set fll_name = "#{fields.field_first_name.content} #{fields.field_last_name.content}" %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function social_links_menu() { | |
$items['admin/config/system/social_links'] = array( | |
'title' => 'social_links', | |
'description' => 'Configure to fit clients needs', | |
'page callback' => 'drupal_get_form', | |
'page arguments' => array('social_links_settings'), | |
'access arguments' => array('administer site configuration'), | |
'file' => 'social_links.admin.inc', | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get information from module info file. | |
* | |
* @param string $path_to_module | |
* @param string $module_name | |
* | |
* @return array $module_info; | |
*/ | |
function bartik_get_module_info($path_to_module, $module_name) { | |
$path_to_info_file = "{$path_to_module}/{$module_name}.info"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$form['full_calendar_link'] = array( | |
'#type' => 'link', | |
'#title' => '<i class="fa fa-calendar fa-2x"></i>', | |
'#href' => 'fc/student-reports/calendar', | |
'#options' => array( | |
'html' => TRUE, | |
'query' => array('assignee' => 'All'), | |
'attributes' => array( | |
'title' => t('Full calendar'), | |
'class' => array('ctools-use-modal'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nids = db_select('node', 'n') | |
->fields('n', array('nid')) | |
->condition('type', 'quiz') | |
->execute() | |
->fetchCol(); | |
node_delete_multiple($nids); |