Render-content action
164690
public function customCssAction()
    {
        /* @var $siteInfo \Zork\Db\SiteInfo */
        /* @var $model \Grid\Customize\Model\Extra\Model */
        /* @var $structure \Grid\Customize\Model\Extra\Structure */
        $params     = $this->params();
        $request    = $this->getRequest();
        $id         = $params->fromRoute( 'id' );
        $rootId     = is_numeric( $id ) ? (int) $id : null;
        $schema     = $params->fromRoute( 'schema' );
        $locator    = $this->getServiceLocator();
        $siteInfo   = $locator->get( 'Zork\Db\SiteInfo' );

        if ( $schema != $siteInfo->getSchema() )
        {
            $this->getResponse()
                 ->setResultCode( 403 );

            return;
        }

        $model      = $locator->get( 'Grid\Customize\Model\Extra\Model' );
        $structure  = $model->findByRoot( $rootId );

        if ( empty( $structure ) )
        {
            $this->getResponse()
                 ->setResultCode( 404 );

            return;
        }

        $id         = $rootId ?: 'global';
        $url        = $this->url();
        $hash       = $structure->updated->toHash();
        $cssPath    = $url->fromRoute( 'Grid\Customize\Render\CustomCss', array(
            'schema' => $schema,
            'id'     => $id,
            'hash'   => $hash,
        ) );

        $cssFile = static::PUBLIC_DIR . $cssPath;

        if ( ! is_file( $cssFile ) )
        {
            $dir = dirname( $cssFile );

            if ( ! is_dir( $dir ) )
            {
                mkdir( $dir, 0777, true );
            }

            $iterator = new RegexIterator(
                new FileSystemIterator(
                    $dir,
                    FileSystemIterator::SKIP_DOTS |
                    FileSystemIterator::KEY_AS_FILENAME |
                    FileSystemIterator::CURRENT_AS_PATHNAME
                ),
                '#.*[/\\\\]custom\.([^\\.]+|'
                    . preg_quote( $id, '#' )
                    . '\.[^\\.]+)\.css$#'
            );

            foreach ( $iterator as $unlinkPath )
            {
                @ unlink( $unlinkPath );
            }

            $this->getServiceLocator()
                 ->get( 'Grid\Customize\Model\Sheet\Model' )
                 ->findByExtra( $structure )
                 ->render( $cssFile );
        }

        $requestPath = $request->getUri()
                               ->getPath();

        if ( ltrim( $requestPath, '/' ) != ltrim( $cssPath, '/' ) )
        {
            return $this->redirect()
                        ->toUrl( $cssPath );
        }

        $response = Readfile::fromFile( $cssFile, 'text/css' );

        $this->getEvent()
             ->setResponse( $response );

        return $response;
    }
108295
function(panels, patternData, iframePassback, switchText) {

    // count how many panels have rendered content
    var panelContentCount = 0;
    for (var i = 0; i < panels.length; ++i) {
      if (panels[i].content !== undefined) {
        panelContentCount++;
      }
    }

    // see if the count of panels with content matches number of panels
    if (panelContentCount === Panels.count()) {
      panelsViewer.renderPanels(panels, patternData, iframePassback, switchText);
    }

  }
1130333
private function sendContent() {
        if ($this->content !== null) {
            if ($this->content instanceof View) {
                $this->content->render();
            }
            else if (($this->content instanceof stdClass) || is_array($this->content)) {
                echo "<pre>";
                print_r ($this->content);
                echo "</pre>";
            }
            else {
                echo $this->content;
            }
        }
    }
1021206
public function render() {
        global $controller;        
        
        if(!$this->ctrl) throw new \Exception('Controller not initialised');
        
		$controller = $this->ctrl;
        $this->ctrl->pageHeader();
        
        echo $this->renderContent();
    }
1152406
protected function renderContent() {
        
        if (Module::getModuleByName('ckeditor')) {
            CkeditorModule::enableEditor($this->ctrl);
        }
        
        /** @var AbstractModule $module  */
        $module = $this->data->get('module');        
        ?>        
        <ol class="breadcrumb small">
        	<li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li>
			<li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li>
			<li class="active"><?php echo $this->data->get('title'); ?></li>
		</ol>
		
		<h1><?php echo $this->data->get('title'); ?></h1>

		<form method="post" class="form-horizontal">
			<?php echo Filter::getCsrf(); ?>
			<input type="hidden" name="action" value="update">
			
			<h3><?php echo I18N::translate('Titles'); ?></h3>
			
			<!--  MAJ_TITLE_PREFIX -->        	
        	<div class="form-group">			
        		<label for="MAJ_TITLE_PREFIX" class="col-sm-3 control-label">
        			<?php echo I18N::translate('Title prefixes'); ?>
        		</label>
    			<div class="col-sm-9">
    				<input type="text" class="form-control" dir="auto" id="MAJ_TITLE_PREFIX" name="MAJ_TITLE_PREFIX" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_TITLE_PREFIX')); ?>" maxlength="255" placeholder="de |d'|du |of |von |vom |am |zur |van |del |della |t'|da |ten |ter |das |dos |af ">
        			<p class="small text-muted">
        				<?php echo I18N::translate('Set possible aristocratic particles to separate titles from the land they refer to (e.g. Earl <strong>of</strong> Essex). Variants must be separated by the character |.'); ?><br />
        				<?php echo I18N::translate('An example for this setting is : <strong>de |d\'|du |of |von |vom |am |zur |van |del |della |t\'|da |ten |ter |das |dos |af </strong> (covering some of French, English, German, Dutch, Italian, Spanish, Portuguese, Swedish common particles).'); ?>
        			</p>
        		</div>        		
        	</div>
        	
        	<h3><?php echo I18N::translate('Header'); ?></h3>
        	
        	<!-- MAJ_ADD_HTML_HEADER -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="MAJ_ADD_HTML_HEADER">
    				<?php echo I18N::translate('Include additional HTML in header'); ?>
    			</label>
    			<div class="col-sm-9">
    				<?php echo FunctionsEdit::editFieldYesNo('MAJ_ADD_HTML_HEADER', $module->getSetting('MAJ_ADD_HTML_HEADER', 0), 'class="radio-inline"'); ?>
				    <p class="small text-muted">
    					<?php echo I18N::translate('Enable this option to include raw additional HTML in the header of the page.'); ?>
    				</p>
    			</div>
    		</div>
        	
        	<!-- MAJ_SHOW_HTML_HEADER -->
        	<div class="form-group">
        		<label class="control-label col-sm-3" for="MAJ_SHOW_HTML_HEADER">
        			<?php echo I18N::translate('Hide additional header'); ?>
        		</label>
        		<div class="col-sm-9">
        			<?php echo FunctionsEdit::editFieldAccessLevel('MAJ_SHOW_HTML_HEADER', $module->getSetting('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE), 'class="form-control"'); ?>
        			<p class="small text-muted">
        				<?php echo I18N::translate('Select the access level until which the additional header should be displayed. The <em>Hide from everyone</em> should be used to show the header to everybody.'); ?>
        			</p>
        		</div>
        	</div>
        	
        	<!--  MAJ_HTML_HEADER -->        	
        	<div class="form-group">			
        		<label for="MAJ_HTML_HEADER" class="col-sm-3 control-label">
        			<?php echo I18N::translate('Additional HTML in header'); ?>
        		</label>
    			<div class="col-sm-9">
    				<textarea class="form-control html-edit" rows="10" dir="auto" id="MAJ_HTML_HEADER" name="MAJ_HTML_HEADER" ><?php echo Filter::escapeHtml($module->getSetting('MAJ_HTML_HEADER')); ?></textarea>
        			<p class="small text-muted">
        				<?php echo I18N::translate('If the option has been enabled, the saved HTML will be inserted in the header.'); ?><br>
        				<?php echo I18N::translate('In edit mode, the HTML characters might have been transformed to their HTML equivalents (for instance &amp;gt; for &gt;), it is however possible to insert HTML characters, they will be automatically converted to their equivalent values.'); ?>
        			</p>
        		</div>        		
        	</div>
        	
        	<h3><?php echo I18N::translate('Footer'); ?></h3>
        	
        	<!-- MAJ_DISPLAY_CNIL -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="MAJ_DISPLAY_CNIL">
    				<?php echo I18N::translate('Display French <em>CNIL</em> disclaimer'); ?>
    			</label>
    			<div class="col-sm-9">
    				<?php echo FunctionsEdit::editFieldYesNo('MAJ_DISPLAY_CNIL', $module->getSetting('MAJ_DISPLAY_CNIL', 0), 'class="radio-inline"'); ?>
				    <p class="small text-muted">
    					<?php echo I18N::translate('Enable this option to display an information disclaimer in the footer required by the French <em>CNIL</em> for detaining personal information on users.'); ?>
    				</p>
    			</div>
    		</div>
    		
    		<!--  MAJ_CNIL_REFERENCE -->        	
        	<div class="form-group">			
        		<label for="MAJ_CNIL_REFERENCE" class="col-sm-3 control-label">
        			<?php echo I18N::translate('<em>CNIL</em> reference'); ?>
        		</label>
    			<div class="col-sm-9">
    				<input type="text" class="form-control" dir="auto" id="MAJ_CNIL_REFERENCE" name="MAJ_CNIL_REFERENCE" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_CNIL_REFERENCE')); ?>" maxlength="255">
        			<p class="small text-muted">
        				<?php echo I18N::translate('If the website has been notified to the French <em>CNIL</em>, an authorisation number may have been delivered. Providing this reference will display a message in the footer visible to all users.'); ?>
        			</p>
        		</div>        		
        	</div>
        	
        	<!-- MAJ_ADD_HTML_FOOTER -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="MAJ_ADD_HTML_FOOTER">
    				<?php echo I18N::translate('Include additional HTML in footer'); ?>
    			</label>
    			<div class="col-sm-9">
    				<?php echo FunctionsEdit::editFieldYesNo('MAJ_ADD_HTML_FOOTER', $module->getSetting('MAJ_ADD_HTML_FOOTER', 0), 'class="radio-inline"'); ?>
				    <p class="small text-muted">
    					<?php echo I18N::translate('Enable this option to include raw additional HTML in the footer of the page.'); ?>
    				</p>
    			</div>
    		</div>
        	
        	<!-- MAJ_SHOW_HTML_FOOTER -->
        	<div class="form-group">
        		<label class="control-label col-sm-3" for="MAJ_SHOW_HTML_FOOTER">
        			<?php echo I18N::translate('Hide additional footer'); ?>
        		</label>
        		<div class="col-sm-9">
        			<?php echo FunctionsEdit::editFieldAccessLevel('MAJ_SHOW_HTML_FOOTER', $module->getSetting('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE), 'class="form-control"'); ?>
        			<p class="small text-muted">
        				<?php echo I18N::translate('Select the access level until which the additional footer should be displayed. The <em>Hide from everyone</em> should be used to show the footer to everybody.'); ?>
        			</p>
        		</div>
        	</div>
        	
        	<!--  MAJ_HTML_FOOTER -->        	
        	<div class="form-group">			
        		<label for="MAJ_HTML_FOOTER" class="col-sm-3 control-label">
        			<?php echo I18N::translate('Additional HTML in footer'); ?>
        		</label>
    			<div class="col-sm-9">
    				<textarea class="form-control html-edit" rows="10" dir="auto" id="MAJ_HTML_FOOTER" name="MAJ_HTML_FOOTER" ><?php echo Filter::escapeHtml($module->getSetting('MAJ_HTML_FOOTER')); ?></textarea>
        			<p class="small text-muted">
        				<?php echo I18N::translate('If the option has been enabled, the saved HTML will be inserted in the footer, before the logo.'); ?><br>
        				<?php echo I18N::translate('In edit mode, the HTML characters might have been transformed to their HTML equivalents (for instance &amp;gt; for &gt;), it is however possible to insert HTML characters, they will be automatically converted to their equivalent values.'); ?>
        			</p>
        		</div>        		
        	</div>
        	
        	<div class="form-group">
        		<div class="col-sm-offset-3 col-sm-9">
        			<button type="submit" class="btn btn-primary">
        				<i class="fa fa-check"></i>
        				<?php echo I18N::translate('save'); ?>
        			</button>
        		</div>
        	</div>
        	
        </form>
		
		<?php        
    }
570385
function render() {
  var content = $($.parseHTML(template));
  var compiler = Handlebars.compile(content.filter("#layout").html());

  Handlebars.registerPartial({
    leftPanel: content.filter("#left-panel").html(),
    rightPanel: content.filter("#right-panel").html(),
    transactionList: content.filter("#transaction-list").html(),
    transactionDetails: content.filter("#transaction-details").html(),
    transactionOther: content.filter("#transaction-other").html(),
  });

  // Adds selected class to selected transaction item.
  Handlebars.registerHelper('isSelected', function(options) {
    var resp =
      (this.business === dataView.selectedTransaction.business) ?
      "selected" : "";
    return options.fn(resp);
  });

  // Returns fake detail monthly total.
  Handlebars.registerHelper('monthlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 12);
    return options.fn(total);
  });

  // Returns fake detail yearly total.
  Handlebars.registerHelper('yearlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 40);
    return options.fn(total);
  });

  var html = compiler(dataView);
  $("#demo-app").html(html);

  addClickHandler();
}
840682
async function _renderContent(uriPath) {
  const pathAnalyzer = new services.UriPathAnalyzer(uriPath, this.paths.www);
  const [file, pathSection, pathRecordId] = pathAnalyzer.perform();
  const content = {};

  if (!file) {
    throw Boom.notFound('Template not found');
  }

  const partials = glob.sync(resolve(this.paths.www, '**/_*.html'));
  const template = Template.fromFile(file, this.paths.www, partials, { parseConditionals: true });
  const tree = template.parse();

  /* eslint-disable no-restricted-syntax */
  for (const [token, args] of Object.entries(tree)) {
    const recordId = pathSection === args.name ? pathRecordId : null;
    /* eslint-disable-next-line no-await-in-loop */
    let recordContent = await Section.contentFor(args, recordId);

    if (this.config.placeholders) {
      recordContent = _addPlaceholders(recordContent, args);
    }

    content[token] = recordContent;
  }
  /* eslint-enable no-restricted-syntax */

  return template.render(content);
}
711612
function Render()
    {
        if (!self::Guard()->Allow(Action::Read(), $this->content))
        {
            return '';
        }
        ContentTranslator::Singleton()->SetContent($this->content);
        $module = ClassFinder::CreateFrontendModule($this->content->GetType());
        $module->SetTreeItem($this->tree, $this->item);
        return $module->Render();
    }
1144064
protected function render_content() {
		?>
		<label>
			<?php if ( ! empty( $this->label ) ) : ?>
				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
			<?php endif; ?>
			<?php if ( ! empty( $this->description ) ) : ?>
				<span class="description customize-control-description"><?php echo wp_kses_post( $this->description ); ?></span>
			<?php endif; ?>
			<input type="hidden" {{{ data.inputAttrs }}} value="" <?php echo wp_kses_post( $this->get_link() ); ?> />
		</label>

		<ul class="repeater-fields"></ul>

		<?php if ( isset( $this->choices['limit'] ) ) : ?>
			<?php /* translators: %s represents the number of rows we're limiting the repeater to allow. */ ?>
			<p class="limit"><?php printf( esc_html__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices['limit'] ) ); ?></p>
		<?php endif; ?>
		<button class="button-secondary repeater-add"><?php echo esc_html( $this->button_label ); ?></button>

		<?php
		$this->repeater_js_template();
	}
1211222
def layout_render(content)
			return content unless @layout

			layout_files = find_layouts(@layout)
			return content if layout_files.empty?

			layout_files.each_with_object(content.dup) do |layout_file, result|
				layout = compile_file(layout_file)
				result.replace layout.render(@scope, @locals) { result }
			end
		end
766541
function renderElement(tag, attrs, content, indentStr, indentLevel) {
    let indent = indentStr.repeat(indentLevel);
    content = renderFalsey(content);
    content = isNested(content) ? ('\n' + jxh(content, indentStr, ++indentLevel) + indent) : content;
    return Tag.render(indent, tag, attrs, content);
}
474234
def render_content(text, user_content=False, context=None, username=None,
                   password=None, render_offline=False, api_url=None):
    
    renderer = (GitHubRenderer(user_content, context, api_url)
                if not render_offline else
                OfflineRenderer(user_content, context))
    auth = (username, password) if username or password else None
    return renderer.render(text, auth)
179518
function renderActionButtons() {
        $('.manage-resource-container .action-button').each(function (i, action) {
            action = $(action);
            var type = action.parent().hasClass(FOLDER_TYPE) ? FOLDER_TYPE : "";
            var id = action.attr("id"),
                dataId = action.parent('.resource-item').attr("id");

            var actions = [
                {
                    text: type ? "View" : "Download",
                    onClick: function (e) {
                        if (type) {
                            renderItemsByFolderId(dataId);

                        } else {
                            download(dataId);
                        }
                    },
                    permissionAction: "VIEW"
                },
                {
                    text: "Permission", data: {id: dataId},
                    onClick: function (e) {
                        openPermissions(dataId);
                    },
                    permissionAction: "PERMISSION"
                },
                {
                    text: "Rename", data: {id: dataId},
                    onClick: function (e) {
                        rename(dataId, true);
                    },
                    permissionAction: "UPDATE"
                },
                {
                    text: "Delete",
                    onClick: function (e) {
                        remove(dataId, type);
                    },
                    permissionAction: "DELETE"
                }
            ];
            var opts = {
                handlerId: id,
                buttonSize: "mini",
                actions: actions
            };

            var permissionConf = {
                modelId: dataId,
                modelName: modelName,
                permissionSchemaKey: permissionSchemaKey
            };

            new Rocket.ActionButton(opts, permissionConf)
        });
    }
945178
def render(self, context):
        """"""

        content = mark_safe(self.get_content_from_context(context))
        if not content:
            return ''
        if self.parsed:
            try:
                t = template.Template(content, name=self.name)
                content = mark_safe(t.render(context))
            except TemplateSyntaxError as error:
                if global_settings.DEBUG:
                    content = PLACEHOLDER_ERROR % {
                        'name': self.name,
                        'error': error,
                    }
                else:
                    content = ''
        if self.as_varname is None:
            return content
        context[self.as_varname] = content
        return ''
170787
def render_tag(self, context, caller, **kwargs):
        ''''''
        # load configuration from passed options
        self.load_configuration(**kwargs)

        # get request from context
        request = context['request']

        # get full path from request
        self.full_path = request.get_full_path()

        # render content of extension
        content = caller()

        # check content for "active" urls
        content = render_content(
            content,
            full_path=self.full_path,
            parent_tag=self.parent_tag,
            css_class=self.css_class,
            menu=self.menu,
            ignore_params=self.ignore_params,
        )

        return content
1230396
function Request__render(response) {

        if (this.isRendered) {
            return false;
        }



        if (Type.isString(response)) {
            this._checkContentType('text/html');
            this.response.writeHead(this.statusCode, this.headers);

            this.addHeader('Content-Length', response.length);
            this.response.end(response);
            this.isRendered = true;
            logger.info('Request.render:', {
                url: this.url,
                status: this.statusCode,
                id: this.id,
                isRendered: this.isRendered,
                content_type: this.getHeader('content-type')
            });
            return true;
        } else if (response instanceof Buffer) {
            this._checkContentType('text/html');
            this.response.writeHead(this.statusCode, this.headers);
            this.addHeader('Content-Length', response.length);
            this.response.end(response);
            this.isRendered = true;
            logger.info('Request.render:', {
                url: this.url,
                status: this.statusCode,
                id: this.id,
                isRendered: this.isRendered,
                content_type: this.getHeader('content-type')
            });
            return true;
        } else if (!response) {
            logger.error('Request.error:', {
                url: this.url,
                status: this.statusCode,
                id: this.id,
                response: response,
                isRendered: this.isRendered,
                content_type: this.getHeader('content-type'),
                message: 'No data to render'
            });
            throw new error.HttpError(500, {}, 'No data to render');
        } else {
            logger.error('Request.error:', {
                url: this.url,
                status: this.statusCode,
                id: this.id,
                response: response,
                isRendered: this.isRendered,
                content_type: this.getHeader('content-type'),
                message: 'Invalid response type'
            });
            throw new error.HttpError(500, {}, 'Invalid response type, string or buffer is required!');
        }
    }
815255
def render(filename, context=binding)
      contents=File.read(expand_filename(filename))
      template(contents, context)
    end