2007-08-20 07:03:08 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2011-11-28 11:44:25 +00:00
|
|
|
* Callbacks for adding, editing, and deleting content and managing revisions.
|
|
|
|
*
|
|
|
|
* Also includes validation, submission and other helper functions.
|
|
|
|
*
|
|
|
|
* @see node_menu()
|
2007-08-20 07:03:08 +00:00
|
|
|
*/
|
|
|
|
|
2014-04-07 15:01:20 +00:00
|
|
|
use Drupal\Component\Utility\Xss;
|
2014-07-31 00:50:42 +00:00
|
|
|
use Drupal\Core\Form\FormStateInterface;
|
Issue #1668866 by ParisLiakos, aspilicious, tim.plunkett, pdrake, g.oechsler, dawehner, Berdir, corvus_ch, damiankloip, disasm, marcingy, neclimdul: Replace drupal_goto() with RedirectResponse.
2013-06-19 16:07:30 +00:00
|
|
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
2013-08-16 17:13:11 +00:00
|
|
|
use Drupal\node\NodeInterface;
|
2007-08-20 07:03:08 +00:00
|
|
|
|
2007-12-06 09:58:34 +00:00
|
|
|
/**
|
Issue #1987406 by jenlampton, Petr Illek, forbesgraham, herom, jerdavis, Jon Pugh, sanguis, idflood, ezeedub, shanethehat, joelpittet | Cottser: Node.module - Convert theme_ functions to Twig.
2014-02-13 16:54:28 +00:00
|
|
|
* Prepares variables for list of available node type templates.
|
2010-04-13 15:23:03 +00:00
|
|
|
*
|
Issue #1987406 by jenlampton, Petr Illek, forbesgraham, herom, jerdavis, Jon Pugh, sanguis, idflood, ezeedub, shanethehat, joelpittet | Cottser: Node.module - Convert theme_ functions to Twig.
2014-02-13 16:54:28 +00:00
|
|
|
* Default template: node-add-list.html.twig.
|
|
|
|
*
|
|
|
|
* @param array $variables
|
2010-04-13 15:23:03 +00:00
|
|
|
* An associative array containing:
|
|
|
|
* - content: An array of content types.
|
2007-12-06 09:58:34 +00:00
|
|
|
*
|
2011-11-28 11:44:25 +00:00
|
|
|
* @see node_add_page()
|
2007-12-06 09:58:34 +00:00
|
|
|
*/
|
Issue #1987406 by jenlampton, Petr Illek, forbesgraham, herom, jerdavis, Jon Pugh, sanguis, idflood, ezeedub, shanethehat, joelpittet | Cottser: Node.module - Convert theme_ functions to Twig.
2014-02-13 16:54:28 +00:00
|
|
|
function template_preprocess_node_add_list(&$variables) {
|
|
|
|
$variables['types'] = array();
|
|
|
|
if (!empty($variables['content'])) {
|
|
|
|
foreach ($variables['content'] as $type) {
|
|
|
|
$variables['types'][$type->type] = array(
|
|
|
|
'type' => $type->type,
|
|
|
|
'add_link' => l($type->name, 'node/add/' . $type->type),
|
2014-04-07 15:01:20 +00:00
|
|
|
'description' => Xss::filterAdmin($type->description),
|
Issue #1987406 by jenlampton, Petr Illek, forbesgraham, herom, jerdavis, Jon Pugh, sanguis, idflood, ezeedub, shanethehat, joelpittet | Cottser: Node.module - Convert theme_ functions to Twig.
2014-02-13 16:54:28 +00:00
|
|
|
);
|
2007-08-20 07:03:08 +00:00
|
|
|
}
|
2009-08-04 06:44:48 +00:00
|
|
|
}
|
2007-08-20 07:03:08 +00:00
|
|
|
}
|