Content-type selection screen.

User must select which content type wish to create.

@return void
481879
public function create()
    {
        $this->loadModel('Content.ContentTypes');
        $types = $this->ContentTypes->find()
            ->select(['id', 'slug', 'name', 'description'])
            ->all();

        $this->title(__d('content', 'Create New Content'));
        $this->set('types', $types);
        $this->Breadcrumb
            ->push('/admin/content/manage')
            ->push(__d('content', 'Create new content'), '');
    }
70062
protected function chooseView(){
        if($this->guestView){
            if(Yii::$app->user->isGuest){
                $this->controller->layout=$this->guestLayout;
                $this->view=$this->guestView;
            }
        }
        if($this->userView){
            if(!Yii::$app->user->isGuest){
                $this->controller->layout=$this->userLayout;
                $this->view=$this->userView;
            }
        }
    }
813207
public function init()
	{
		ob_start();
		ob_implicit_flush(false);

		if(isset($this->htmlOptions['id']))
			$this->id=$this->htmlOptions['id'];
		else
			$this->htmlOptions['id']=$this->id;
		echo CHtml::openTag($this->tagName,$this->htmlOptions)."\n";
		$this->renderDecoration();
		echo "<div class=\"{$this->contentCssClass}\">\n";

		$this->_openTag=ob_get_contents();
		ob_clean();
	}
816282
public function initialize()
    {
        $contentTypes = $this->contentTypeRepository->findAllNotDeletedInLastVersion();

        foreach ($contentTypes as $contentType) {
            $this->schemaGenerator->createMapping($contentType);
        }
    }
1334724
public function init()
    {
        if (isset($this->view)) {
            $controller = $this->getController();
            if (isset($controller) && $controller->getViewFile($this->view) !== false) {
                $this->content = $this->controller->renderPartial($this->view, $this->viewData, true);
            }
        }
        $this->htmlOptions['headingOptions'] = $this->headingOptions;
    }
538196
public function init() {
		
		parent::init();

		$classes = array('nav');

		$validTypes = array(self::TYPE_TABS, self::TYPE_PILLS, self::TYPE_LIST, self::TYPE_NAVBAR);

		if (isset($this->type) && in_array($this->type, $validTypes)) {
			$classes[] = $this->type === self::TYPE_NAVBAR ? 'navbar-nav' : 'nav-' . $this->type;
		}

		if ($this->stacked && $this->type !== self::TYPE_LIST) {
			$classes[] = 'nav-stacked';
		}
		
		if ($this->justified && $this->type !== self::TYPE_LIST) {
			$classes[] = 'nav-justified';
		}

		if ($this->dropup === true) {
			$classes[] = 'dropup';
		}

		if (isset($this->scrollspy)) {
			$scrollspy = is_string($this->scrollspy) ? array('target' => $this->scrollspy) : $this->scrollspy;
			$this->widget('booster.widgets.TbScrollSpy', $scrollspy);
		}

		if (!empty($classes)) {
			$classes = implode(' ', $classes);
			if (isset($this->htmlOptions['class'])) {
				$this->htmlOptions['class'] .= ' ' . $classes;
			} else {
				$this->htmlOptions['class'] = $classes;
			}
		}
	}
550133
public function init() {
		
		$this->addCssClass($this->htmlOptions, 'panel');
		
		if($this->isValidContext())
			self::addCssClass($this->htmlOptions, 'panel-'.$this->getContextClass());

		if ($this->padContent)
			self::addCssClass($this->contentHtmlOptions, 'panel-body');

		if (!isset($this->contentHtmlOptions['id'])) {
			$this->contentHtmlOptions['id'] = $this->getId();
		}

		if (isset($this->headerHtmlOptions['class'])) {
			$this->headerHtmlOptions['class'] = 'panel-heading ' . $this->headerHtmlOptions['class'];
		} else {
			$this->headerHtmlOptions['class'] = 'panel-heading';
		}

		echo CHtml::openTag('div', $this->htmlOptions);

		$this->renderHeader();
		$this->renderContentBegin();
	}
965797
protected function setDefaults() {
        if ($this->getAccept() === null) {
            $this->setDefaultAccept();
        }

        if ($this->getContentType() === null) {
            $this->setDefaultContentType();
        }
    }
72793
public function select_text() {
        // NodeElement.keyPress simply doesn't work.
        if (!$this->running_javascript()) {
            throw new coding_exception('Selecting text requires javascript.');
        }

        $editorid = $this->field->getAttribute('id');
        $js = ' (function() {
    var e = document.getElementById("'.$editorid.'editable"),
        r = rangy.createRange(),
        s = rangy.getSelection();

    while ((e.firstChild !== null) && (e.firstChild.nodeType != document.TEXT_NODE)) {
        e = e.firstChild;
    }
    e.focus();
    r.selectNodeContents(e);
    s.setSingleRange(r);
}()); ';
        $this->session->executeScript($js);
    }
699078
public function create()
	{
		// The highlight select field
		if ($this->canChangeHighlight)
		{
			$this->generateDCA('highlight', array
			(
				'inputType'			=> 'select',
				'label'				=> &$GLOBALS['TL_LANG']['tl_content']['highlight'],
				'options'			=> array('HTML', 'HTML5', 'XML', 'JavaScript', 'CSS', 'SCSS', 'PHP', 'JSON', 'Markdown'),
				'eval'				=> array
				(
					'includeBlankOption'	=> true,
					'submitOnChange'		=> true,
					'tl_class'				=> 'w50 clr'
				),
			));		
		}

		// The code text area
		$this->generateDCA('text', array
		(
			'inputType' 	=>	'textarea',
			'label'			=>	array($this->label, $this->description),
			'eval'			=>	array
			(
				'mandatory'		=>	($this->mandatory) ? true : false, 
				'tl_class'		=> 	'clr',
				'rte'			=>	'ace|' . (($this->highlight) ? strtolower($this->highlight) : 'text'),
				'preserveTags'	=>	true,
			),
			'load_callback'		=> (!$this->canChangeHighlight) ?: array
			(
				array('tl_content_elements', 'setAceCodeHighlighting'),
			),
		));
	}
1099030
protected function _addDefaultSelectTypes()
    {
        $typeMap = $this->getTypeMap()->getDefaults();
        $select = $this->clause('select');
        $types = [];

        foreach ($select as $alias => $value) {
            if (isset($typeMap[$alias])) {
                $types[$alias] = $typeMap[$alias];
                continue;
            }
            if (is_string($value) && isset($typeMap[$value])) {
                $types[$alias] = $typeMap[$value];
            }
            if ($value instanceof TypedResultInterface) {
                $types[$alias] = $value->getReturnType();
            }
        }
        $this->getSelectTypeMap()->addDefaults($types);
    }
86757
protected function selectionHandler()
    {
        $userCount = count($this->choices);
        if ($userCount > static::MAX_USER_CHOICES) {
            $this->autocomplete();
        } elseif ($userCount > 1) {
            $this->selector();
        } elseif (1 === $userCount) {
            $this->editor($this->choices[0]);
        }
    }
534450
private function setHeaderContentType()
    {
        $fileName = basename( $this->fileName );
        if ( $this->contentDisposition !== null && $this->contentDisposition->fileName !== null )
        {
            $fileName = $this->contentDisposition->fileName;
        }

        $this->setHeader( 'Content-Type',
                          $this->contentType . '/' . $this->mimeType . '; ' . 'name="' . $fileName . '"' );
    }
38140
def select_header_content_type(content_types)
      if content_types.empty?
        'application/json' # use application/json by default
      elsif content_types.any?{ |s| s.casecmp('application/json')==0 }
        'application/json' # use application/json if it's included
      else
        content_types[0] # otherwise, use the first one
      end
    end
1304391
public function _createElements() {
        if (!$this->has_customize_switch()) {
            $element = $this->createFormElement('hidden', 'customize', 1);
        } else {
            $element = $this->createFormElement('advcheckbox', 'customize', '', $this->_options['customlabel']);
        }
        $this->_elements[] = $element;

        if ($this->_options['type'] === 'text') {
            $element = $this->createFormElement($this->_options['type'], 'value',
                get_string('newvaluefor', 'form', $this->getLabel()), $this->getAttributes());
            $element->setHiddenLabel(true);
        } else if ($this->_options['type'] === 'date_selector') {
            $element = $this->createFormElement($this->_options['type'], 'value', '', $this->_options,
                $this->getAttributes());
        } else if ($this->_options['type'] === 'date_time_selector') {
            $element = $this->createFormElement($this->_options['type'], 'value', '', $this->_options,
                $this->getAttributes());
        }
        $this->_elements[] = $element;
    }
1144057
protected function createContent()
    {
        $this->setCliMessage('Creating content...');

        $this->initConfig();
        $this->createDbConfig();
        $this->createStore();
        $this->createSuperadmin();
        $this->createCountries();
        $this->createLanguages();
        $this->createPages();
    }
89696
protected function _loadContentType()
    {
        $this->_loadRawHeaders();

        if(key_exists('Content-Type', $this->_rawHeaders))
            $this->_requestContentType = $this->_rawHeaders['Content-Type'];
    }