Generates license template content based
on the defined parameters

@return string
199687
protected function generateLicenseTemplateContent()
    {
        $contentArr = [];

        // Product Name
        $contentArr[] = ['Product-Name', $this->productName];
        // Registered to
        $contentArr[] = ['Registered-To', $this->registeredTo];
        // Hardware locked
        $contentArr[] = ['Hardware-Locked', ($this->hardwareLocked ? 'Yes' : 'No')];

        // Expires
        $contentArr[] = ['Expires', $this->expires];

        // IP-Range
        if (!empty($this->ipRange)) {
            $contentArr[] = ['IP-Range', $this->ipRange];
        }
        // Host-ID
        if (!empty($this->hostID)) {
            foreach (explode(';', $this->hostID) as $hostID) {
                $contentArr[] = ['Host-ID', $hostID];
            }
        } else {
            $contentArr[] = ['Host-ID', 'Not-Locked'];
        }

        // parse user defined fields
        if (!empty($this->userDefinedValues)) {
            $this->parseAndAddUserDefinedValues($this->userDefinedValues, $contentArr);
        }
        // parse user defined x-fields
        if (!empty($this->xUserDefinedValues)) {
            $this->parseAndAddUserDefinedValues($this->xUserDefinedValues, $contentArr, 'X-');
        }

        // merge all the values
        $content = '';
        foreach ($contentArr as $valuePair) {
            list($key, $value) = $valuePair;

            $content .= $key . " = " . $value . "\n";
        }

        return $content;
    }
1001858
protected function generateMsgHtml()
    {
        $templateIdent = $this->templateIdent();

        if (!$templateIdent) {
            $message = '';
        } else {
            $message = $this->renderTemplate($templateIdent);
        }

        return $message;
    }
411626
public function getContentPageTpl()
    {
        $aTemplate = [];
        $sContentId = $this->getContent()->oxcontents__oxloadid->value;
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        if ($sContentId == $myConfig->getConfigParam('sRDFaBusinessEntityLoc')) {
            $aTemplate[] = $this->_sBusinessTemplate;
        }
        if ($sContentId == $myConfig->getConfigParam('sRDFaDeliveryChargeSpecLoc')) {
            $aTemplate[] = $this->_sDeliveryTemplate;
        }
        if ($sContentId == $myConfig->getConfigParam('sRDFaPaymentChargeSpecLoc')) {
            $aTemplate[] = $this->_sPaymentTemplate;
        }

        return $aTemplate;
    }
116495
public function generate()
	{		
		// Get the content element object
		$this->objElement = \ElementsModel::findPublishedByAlias($this->type);

		if ($this->objElement === null)
		{
			return;
		}

		// Register the custom template
		if (!array_key_exists($this->objElement->template, TemplateLoader::getFiles()))
		{
			TemplateLoader::addFile($this->objElement->template, $this->objElement->getRelated('pid')->templates);
		}

		if (TL_MODE == 'BE' && $this->objElement->backendTpl)
		{
			$this->strTemplate = $this->objElement->backendTpl;
		}
		else
		{
			$this->strTemplate = $this->objElement->template;
		}
				
		if (TL_MODE == 'FE' && !BE_USER_LOGGED_IN && ($this->invisible || ($this->start != '' && $this->start > time()) || ($this->stop != '' && $this->stop < time())))
		{
			return '';
		}

		$this->Template = new Template($this->strTemplate);
	
		// Deliver some general element data
		$this->Template->setData(
			array (
				'id' => $this->id,
				'pid' => $this->pid,
				'ptable' => $this->ptable,
				'element' => $this->type,
				'tstamp' => $this->tstamp,
				'start' => $this->start,
				'stop' => $this->stop,
				'protected' => $this->protected,
				'inColumn' => $this->strColumn
			)
		);

		// compile pattern to prepare values
		$this->compile();
		
		return $this->Template->parse();
	}
550684
public static function getLicenseFile()

    {
        if (!isset(self::$file)) {
            $path = Grav::instance()['locator']->findResource('user-data://') . '/licenses.yaml';
            if (!file_exists($path)) {
                touch($path);
            }
            self::$file = CompiledYamlFile::instance($path);
        }

        return self::$file;
    }
981415
public function generateCode() {
        $content = "";
        foreach ($this->arrTemplates as $template) {
            if (!file_exists($template)) {
                //Template not found
                continue;
            }
            $content .= file_get_contents($template);
        }
        
        foreach ($this->attributes as $key => $val) {
            $content = str_replace($this->placeHolderStart.$key.$this->placeHolderEnd, $val, $content);
        }
        return $content;
    }
189548
public function license_view() {
		$status = $this->get_license_status();
		$value  = $this->license_key;

		$activate_string   = apply_filters( $this->product->get_key() . '_lc_activate_string', 'Activate' );
		$deactivate_string = apply_filters( $this->product->get_key() . '_lc_deactivate_string', 'Deactivate' );
		$valid_string      = apply_filters( $this->product->get_key() . '_lc_valid_string', 'Valid' );
		$invalid_string    = apply_filters( $this->product->get_key() . '_lc_invalid_string', 'Invalid' );
		$license_message   = apply_filters( $this->product->get_key() . '_lc_license_message', 'Enter your license from %s purchase history in order to get %s updates' );

		echo '<p ><input ' . ( ( 'valid' === $status ) ? ( 'style="border:1px solid #7ad03a; "' ) : '' ) . ' type="text" id="' . $this->product->get_key() . '_license" name="' . $this->product->get_key() . '_license" value="' . $value . '" /><a ' . ( ( 'valid' === $status ) ? ( 'style="color:#fff;background:  #7ad03a; display: inline-block;text-decoration: none;font-size: 13px;line-height: 26px;height: 26px; margin-left:5px; padding: 0 10px 1px;  -webkit-border-radius: 3px;border-radius: 3px; ">' . $valid_string ) : ( 'style="color:#fff;background:  #dd3d36; display: inline-block;text-decoration: none;font-size: 13px;line-height: 26px;height: 26px; margin-left:5px; padding: 0 10px 1px;  -webkit-border-radius: 3px;border-radius: 3px; ">' . $invalid_string ) ) . ' </a>&nbsp;&nbsp;&nbsp;<button name="' . $this->product->get_key() . '_btn_trigger" ' . ( ( 'valid' === $status ) ? ( ' class="button button-primary">' . $deactivate_string ) : ( ' class="button button-primary" value="yes" type="submit" >' . $activate_string ) ) . ' </button></p><p class="description">' . sprintf( $license_message, '<a  href="' . $this->get_api_url() . '">' . $this->get_distributor_name() . '</a> ', $this->product->get_type() ) . '</p>';

	}
1276757
public function generate()
    {
        $this->loadWebMasterTags();

        $title       = $this->getTitle();
        $description = $this->getDescription();
        $keywords    = $this->getKeywords();
        $metatags    = $this->metatags;

        $html   = [];

        if($title):
            $html[] = "<title>$title</title>";
        endif;

        if(!empty($description)):
            $html[] = "<meta name=\"description\" content=\"{$description}\" />";
        endif;

        if (!empty($keywords)):
            $keywords = implode(',', $keywords);
            $html[]   = "<meta name=\"keywords\" content=\"{$keywords}\" />";
        endif;

        foreach ($metatags as $key => $value):
            $name    = $value[0];
            $content = $value[1];
            $html[]  = "<meta {$name}=\"{$key}\" content=\"{$content}\" />";
        endforeach;

        return implode(PHP_EOL, $html);
    }
119364
public function GenerateCustomSources()
    {
        // Variables used by some template files.
        $authors = \Peg\Lib\Settings::GetAuthors();
        $contributors = \Peg\Lib\Settings::GetContributors();
        $extension = \Peg\Lib\Settings::GetExtensionName();
        $version = \Peg\Lib\Settings::GetVersion();

        // Variable to temporarily store a template file content.
        $content = "";

        // Generate custom sources list
        $custom_sources = $this->GetCustomSources();

        if(count($custom_sources) > 0)
        {
            foreach($custom_sources as $custom_source)
            {
                if($custom_source != "." && $custom_source != "..")
                {
                    ob_start();
                        include($this->GetGenericTemplate(
                            $custom_source, "custom_sources"
                        ));
                        $content = ob_get_contents();
                    ob_end_clean();

                    if(
                        (strpos($custom_source, ".c") !== false)
                        ||
                        (strpos($custom_source, ".cpp") !== false)
                    )
                    {
                        $this->AddGenericFile(
                            $custom_source,
                            $content,
                            "src"
                        );
                    }
                    elseif(
                        (strpos($custom_source, ".h") !== false)
                        ||
                        (strpos($custom_source, ".hpp") !== false)
                    )
                    {
                        $this->AddGenericFile(
                            $custom_source,
                            $content,
                            "includes"
                        );
                    }
                }
            }
        }
    }
260121
protected function generateFileContents()
    {
        $data = $this->classTemplate;

        $data = str_replace("{EXTENDS}", $this->extends, $data);
        $data = str_replace("{NAMESPACE}", $this->namespace, $data);
        $data = str_replace("{CLASSNAME}", $this->classname, $data);
        $data = str_replace("{CONTENTS}", $this->contents, $data);
        $data = str_replace("{USES}", $this->uses, $data);

        return $data;
    }
716702
private function generateResourceTemplate()
    {
        $params = array(
            'pagepart' => strtolower(
                    preg_replace('/([a-z])([A-Z])/', '$1-$2', str_ireplace('PagePart', '', $this->entity))
                ) . '-pp',
        );

        $this->renderSingleFile(
            $this->skeletonDir . '/Resources/views/PageParts/' . $this->entity . '/',
            $this->getTemplateDir($this->bundle) . '/PageParts/' . $this->entity . '/',
            'view.html.twig',
            $params,
            true
        );

        $this->renderSingleFile(
            $this->skeletonDir . '/Resources/views/PageParts/' . $this->entity . '/',
            $this->getTemplateDir($this->bundle) . '/PageParts/' . $this->entity . '/',
            'admin-view.html.twig',
            $params,
            true
        );

        $this->assistant->writeLine('Generating ' . $this->entity . ' template:     <info>OK</info>');
    }
178
protected function generateLicense()
    {
        $command = $this->prepareSignCommand() . ' 2>&1';

        $this->log('Creating license at ' . $this->outputFile);

        $this->log('Running: ' . $command, Project::MSG_VERBOSE);
        $tmp = exec($command, $output, $return_var);

        // Check for exit value 1. Zendenc_sign command for some reason
        // returns 0 in case of failure and 1 in case of success...
        if ($return_var !== 1) {
            throw new BuildException("Creating license failed. \n\nZendenc_sign msg:\n" . implode(
                "\n",
                $output
            ) . "\n\n");
        }
    }
1052723
public function generate()
  {
    if (TL_MODE == 'BE')
    {
      $objTemplate = new \BackendTemplate('be_wildcard');

      $objTemplate->wildcard = '### ModuleTrackEdit ###';
      $objTemplate->title = $this->headline;
      $objTemplate->id = $this->id;
      $objTemplate->link = $this->name;
      $objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;

      return $objTemplate->parse();
    }


    if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item']))
		{
			\Input::setGet('items', \Input::get('auto_item'));
		}

		if (!\Input::get('items'))
		{
			global $objPage;
			$objPage->noSearch = 1;
			$objPage->cache = 0;
			return '';
		}


		$strItem = \Input::get('items');

		if (strpos($strItem, "track")!==false)
		{
  		$this->strType = "track";
  		$this->intTrackId = str_replace("track_", "", $strItem);
		}
		if (strpos($strItem, "poi")!==false)
		{
  		$this->strType = "poi";
  		$this->intPoiId = str_replace("poi_", "", $strItem);
		}
		if (!$this->strType || $this->strType=="")
		{
			global $objPage;
			$objPage->noSearch = 1;
			$objPage->cache = 0;
			return '';
		}

    return parent::generate();
  }
175448
private function generatePagePartEntity()
    {
        $params = array(
            'bundle' => $this->bundle->getName(),
            'namespace' => $this->bundle->getNamespace(),
            'pagepart' => $this->entity,
            'pagepartname' => str_replace('PagePart', '', $this->entity),
            'adminType' => '\\' . $this->bundle->getNamespace(
                ) . '\\Form\\PageParts\\' . $this->entity . 'AdminType',
            'underscoreName' => strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $this->entity)),
            'prefix' => $this->prefix,
            'isV4' => $this->isSymfony4(),
        );

        $this->renderSingleFile(
            $this->skeletonDir . '/Entity/PageParts/' . $this->entity . '/',
            $this->bundle->getPath() . '/Entity/PageParts/',
            $this->entity . '.php',
            $params,
            true
        );

        $this->assistant->writeLine('Generating ' . $this->entity . ' Entity:       <info>OK</info>');
    }
913074
public function license()
    {
        $languageId = $this->getLanguageInstance()->getLanguage();
        $utils = $this->getUtilitiesInstance();

        $this->setViewOptions(
            'license.php',
            'STEP_2_TITLE',
            [
                "aLicenseText" => $utils->getLicenseContent($languageId)
            ]
        );
    }
327253
private function sync_site_license() {
            $api = $this->get_api_user_scope();

            $result = $api->get( "/licenses/{$this->_license->id}.json?license_key=" . urlencode( $this->_license->secret_key ), true );

            if ( ! $this->is_api_result_entity( $result ) ) {
                return $result;
            }

            $license = $this->_update_site_license( new FS_Plugin_License( $result ) );
            $this->_store_licenses();

            return $license;
        }
487389
public function getLicense()
    {
        if ($this->_license === null) {
            $this->_license = $this->take('package')->getLicense();
        }

        return $this->_license;
    }