Create the default MEDIA tag

@return void
489114
protected function createMediaTag()
	{
		$tag = $this->configurator->tags->add($this->tagName);

		// This tag should not need to be closed and should not contain itself
		$tag->rules->autoClose();
		$tag->rules->denyChild($this->tagName);

		// Empty this tag's filter chain and add our tag filter
		$tag->filterChain->clear();
		$tag->filterChain
		    ->append(__NAMESPACE__ . '\\Parser::filterTag')
		    ->resetParameters()
		    ->addParameterByName('tag')
		    ->addParameterByName('parser')
		    ->addParameterByName('MediaEmbed.hosts')
		    ->addParameterByName('MediaEmbed.sites')
		    ->addParameterByName('cacheDir')
		    ->setJS(file_get_contents(__DIR__ . '/Parser/tagFilter.js'));
	}
731876
public function defaultContent()
    {
        $params = ['id' => null];
        $this->executor->execute(DriverCommand::SWITCH_TO_FRAME, $params);

        return $this->driver;
    }
289686
public function populateDefaultMetadata()
    {
        $oEmbed = Oembed::cache($this->path, ['lifetime' => 432000]);

        $this->type = $this->mediaType;
        $this->mimetype = mb_strtolower($oEmbed->providerName);
        $this->size = 0;

        $this->name = $oEmbed->title;
        $this->caption = $oEmbed->title;
        $this->description = $oEmbed->description;

        $this->setMetadata('media_type', $oEmbed->type);

        $this->setMetadata('provider_url', $oEmbed->providerUrl);
        $this->setMetadata('provider_icon', $oEmbed->providerIcon);

        if ( ! is_null($oEmbed->image))
        {
            $this->createEmbeddedPath();

            $destination = 'embedded/' . $this->mimetype . '_' . md5($oEmbed->image);
            copy($oEmbed->image, upload_path($destination));

            $this->setMetadata('thumbnail_original', $oEmbed->image);
            $this->setMetadata('thumbnail_url', $destination);
            $this->setMetadata('thumbnail_width', $oEmbed->imageWidth);
            $this->setMetadata('thumbnail_height', $oEmbed->imageHeight);
        }

        if ( ! is_null($oEmbed->authorName))
        {
            $this->setMetadata('author_name', $oEmbed->authorName);
            $this->setMetadata('author_url', $oEmbed->authorUrl);
        }
    }
479993
private function createDummyContent()
    {
        $this->info("Creating default roles...");
        UserGroup::createDefaultRoles();
        $this->advanceBar();

        $this->info("Creating admin user...");
        $this->createAdminUser();
        $this->advanceBar();

        // Create Default Language
        $this->info("Creating default language...");
        factory(\App\Models\Language::class)->create(
            [
            'name' => $this->PRIMARY_LANGUAGE->name,
            'nativeName' => $this->PRIMARY_LANGUAGE->nativeName,
            'slug' => $this->PRIMARY_LANGUAGE->slug,
            'isDefault' => true
            ]
        );
        $this->advanceBar();

        $this->info("Creating default post types...");
        (new \PostTypeSeeder())->createDefaultPostTypes();
        $this->advanceBar();

        // Create tags example
        $this->info("Creating example tags...");
        (new \TagSeeder())->run(20, null, true);
        $this->advanceBar();

        // Create a category
        $this->info("Creating an example category...");
        $categoryObj = new \CategorySeeder();
        $categoryObj->exampleTitles = true;
        $categoryObj->run(3, null);
        $this->advanceBar();

        $this->info("Creating example posts...");
        (new \PostSeeder())->run(0, 5, '', 0, 0, 0, false);
        $this->advanceBar();

        // Create default permalinks
        $this->info("Creating default permalinks...");
        (new \PermalinksTableSeeder())->run();
        $this->advanceBar();

        // Creating settings
        $this->info("Saving settings...");
        $this->setSettings();
        $this->advanceBar();

        // Create Primary Menu
        $this->info("Creating primary Menu...");
        $menuSeeder = new \MenuSeeder();
        $menu = $menuSeeder->createPrimaryMenu();
        $menuSeeder->addHomepageToPrimaryMenu($menu);
        $menuSeeder->addAboutToPrimaryMenu($menu);
        $menuSeeder->addCategoryToMenu($menu);
        $this->advanceBar();

        return $this;
    }
955360
private function setTag()
    {
        $Params = $this->getURLParams();
        $tag = Tag::get()
            ->filter(array('URLSegment' => Convert::raw2sql($Params['ID'])))->first();
        $this->current_tag = $tag;
    }
783434
protected function addDefaultClass()
    {
        $formDefaultClass = $this->formObject
            ->getConfiguration()
            ->getSettings()
            ->getDefaultClass();

        $class = $this->tag->getAttribute('class');

        if (false === empty($formDefaultClass)) {
            $class = (!empty($class) ? $class . ' ' : '') . $formDefaultClass;
            $this->tag->addAttribute('class', $class);
        }
    }
279020
public function setDefaultMediaType($defaultMediaType)
    {
        if (!\in_array($defaultMediaType, $this->defaultMediaTypes, true)) {
            return;
        }
        $this->defaultMediaTypes[] = $defaultMediaType;
    }
201945
public function createContent() {
    $productVariationType = ProductVariationType::load('default');
    if ($productVariationType !== NULL) {
      $productVariationType->delete();
    }

    $defaultProductType = ProductType::load('default');
    if ($defaultProductType !== NULL) {
      $defaultProductType->delete();
    }
  }
148994
protected function renderCss()
    {
        $html = "";

        foreach( $this->css as $item )
        {
            $html .= sprintf( MPageController::CSS_TEMPLATE, $item["rel"], $item["href"], $item["media"] ) . "\n";
        }

        $domQuery = $this->qp->find( "head" );
        if( $domQuery->count() <= 0 )
        {
            trigger_error( 'head tag not found in page', E_USER_WARNING );
        }
        else
        {
            $domQuery->append( $html );
        }
    }
589104
def default(self, request, tag):
        
        if self.parameter.default is not None:
            tag[self.parameter.default]
        return tag
867526
function(id, file, content, fm) {
				initImgTag.call(this, id, file, content, fm);
			}
835016
public function generate()
    {
        return sprintf(
            '<%s %s>%s</%s>%s',
            $this->tag,
            parent::generate(),
            $this->label,
            $this->tag,
            PHP_EOL
        );
    }
747958
public function editInstance()
    {
        $this->defaultData();

        $clazz = $this->getCurrentClass();
        $instance = $this->getCurrentInstance();
        $myFormContainer = new editInstanceForm($clazz, $instance);

        $myForm = $myFormContainer->getForm();
        if ($myForm->isSubmited()) {
            if ($myForm->isValid()) {

                $values = $myForm->getValues();
                // save properties
                $binder = new \tao_models_classes_dataBinding_GenerisFormDataBinder($instance);
                $instance = $binder->bind($values);
                $message = __('Instance saved');

                $this->setData('message', $message);
                $this->setData('reload', true);
            }
        }

        $this->setData('formTitle', __('Edit Instance'));
        $this->setData('myForm', $myForm->render());
        $uri = ($this->hasRequestParameter('id')) ? $this->getRequestParameter('id') : $this->getRequestParameter('uri');

        try {
            $mediaSource = new MediaSource(array());
            $fileInfo = $mediaSource->getFileInfo($uri);

            $mimeType = $fileInfo['mime'];
            $xml = in_array($mimeType, array('application/xml', 'text/xml'));
            $url = \tao_helpers_Uri::url(
                'getFile',
                'MediaManager',
                'taoMediaManager',
                array(
                    'uri' => $uri,
                )
            );
            $this->setData('xml', $xml);
            $this->setData('fileurl', $url);
            $this->setData('mimeType', $mimeType);

        } catch (\tao_models_classes_FileNotFoundException $e) {
            $this->setData('error', __('No file found for this media'));
        }
        $this->setView('form.tpl');

    }
133599
public function configDefaults($tag)
    {
        if (count(config('html.default.'.$tag, []))) {
            foreach (config('html.default.'.$tag) as $name => $value) {
                $this->attr($name, $value);
            }
        }
    }
487851
public function render()
    {
        $result = $this->arguments['result'];
        $this->conf = $this->arguments['conf'];

        $domImplementation = new \DOMImplementation();

        $this->doc = $domImplementation->createDocument();
        $li = $this->doc->createElement('li');
        $this->doc->appendChild($li);
        $li->setAttribute('class', 'pz2-detailsVisible');

        $iconElement = $this->doc->createElement('span');
        $li->appendChild($iconElement);
        $mediaClass = 'other';
        if (count($result['md-medium']) == 1) {
            $mediaClass = $result['md-medium'][0]['values'][0];
        } elseif (count($result['md-medium']) > 1) {
            $mediaClass = 'multiple';
        }

        $iconElement->setAttribute('class', 'pz2-mediaIcon ' . $mediaClass);
        $iconElement->setAttribute('title', LocalizationUtility::translate('media-type-' . $mediaClass, 'Pazpar2'));

        // basic title/author information
        $this->appendInfoToContainer($this->titleInfo($result), $li);
        $authors = $this->authorInfo($result);
        $this->appendInfoToContainer($authors, $li);

        // year or journal + year information
        $journal = $this->journalInfo($result);
        $this->appendInfoToContainer($journal, $li);

        if (!$journal) {
            $spaceBefore = ' ';
            if ($authors) {
                $spaceBefore = ', ';
            }
            $this->appendMarkupForFieldToContainer('date', $result, $li, $spaceBefore, '.');
        }

        if ($this->conf['provideCOinSExport'] == 1) {
            // Insert COinS information
            $this->appendCOinSSpansToContainer($result, $li);
        }

        // detailed information about the publication
        $this->appendInfoToContainer($this->renderDetails($result), $li);

        return $this->doc->saveHTML();
    }
469453
private function createMediaFolder()
    {
        $mediafolder = new \BackBee\NestedNode\MediaFolder(md5('media'));
        $mediafolder->setTitle('Mediacenter')->setUrl('/');
        $this->entyMgr->persist($mediafolder);
        $this->entyMgr->flush($mediafolder);
    }
655303
protected function setTagsContext()
    {
        $objectManager = Bootstrap::$staticObjectManager;
        $environment = $objectManager->get(Environment::class);

        $tags = [
            'php_version' => phpversion(),
            'flow_context' => (string)$environment->getContext(),
            'flow_version' => FLOW_VERSION_BRANCH
        ];

        $this->client->tags_context($tags);
    }