@EXT\Route(
"/embed/{node}/{type}/{extension}/{openInNewTab}",
name="claro_resource_embed",
options={"expose"=true},
defaults={"openInNewTab"="0"}
)

Renders the HTML needed to embed a resource, based on its mime type.
324735
public function embedResourceAction(ResourceNode $node, $type, $extension, $openInNewTab)
    {
        $view = in_array($type, array('video', 'audio', 'image')) ? $type : 'default';

        return new Response(
            $this->templating->render(
                "ClarolineCoreBundle:Resource:embed/{$view}.html.twig",
                array(
                    'node' => $node,
                    'type' => $type,
                    'extension' => $extension,
                    'openInNewTab' => $openInNewTab !== '0'
                )
            )
        );
    }
1165855
protected function renderContent() {
        
        $table_id = $this->data->get('table_id');
        
        ?>        
        <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>
		
		<div align="center">
			<div id="tabs">
				<form method="post" action="#">
					<?php echo Filter::getCsrf(); ?>
					<input type="hidden" name="action" value="update">
					<table id="<?php echo $table_id; ?>" class="table table-bordered table-condensed table-hover table-site-changes" >
						<thead>
							<tr>
								<th><?php echo I18N::translate('Enabled'); ?></th>
								<th>ENABLED_SORT</th>
								<th><?php echo I18N::translate('Hook Function'); ?></th>
								<th><?php echo I18N::translate('Hook Context'); ?></th>
								<th><?php echo I18N::translate('Module Name'); ?></th>
								<th><?php echo I18N::translate('Priority (1 is high)'); ?></th>
								<th>PRIORITY_SORT</th>
							</tr>
						</thead>
						<tbody> 
							<?php  
							$hooks = $this->data->get('hook_list');
							foreach ($hooks as $hook) { 
							?>
							<tr>
								<td>
									<input type="hidden" name="hook-<?php echo $hook->id;?>" value="yes" >
									<?php echo FunctionsEdit::twoStateCheckbox('status-'.($hook->id), ($hook->status)=='enabled'); ?>
								</td>
								<td><?php echo (($hook->status)=='enabled'); ?></td>
								<td><?php echo $hook->hook; ?></td>
								<td><?php echo $hook->context; ?></td>
								<td><?php if($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td>
								<td><input type="text" class="center" size="2" value="<?php echo $hook->priority; ?>" name="moduleorder-<?php echo $hook->id; ?>" /></td>
								<td><?php echo $hook->priority; ?></td>
							</tr>
							<?php  } ?>
						</tbody>
					</table>
					<input type="submit" class="btn btn-primary save" value="<?php echo I18N::translate('save'); ?>">
				</form>
			</div>
		</div>	
		
		<?php        
    }
427826
public function discoverFromHtml($html)
    {
        $links = $this->findLinks($html);

        if ( ! $link = reset($links)) {
            return;
        }

        $type = null;

        switch($link['type']) {
        case 'application/json+oembed':
            $type = Provider::TYPE_JSON;
            break;
        case 'text/xml+oembed':
            $type = Provider::TYPE_XML;
            break;
        }

        $url = $link['href'];
        $endpoint = $this->getEndpointUrl($url);

        return new Provider($endpoint, $type);
    }
812518
private function embedResource(array $embeds, ResourceObject $ro, array $query)
    {
        foreach ($embeds as $embed) {
            /* @var $embed Embed */
            if (! $embed instanceof Embed) {
                continue;
            }
            try {
                $templateUri = $this->getFullUri($embed->src, $ro);
                $uri = uri_template($templateUri, $query);
                $ro->body[$embed->rel] = clone $this->resource->get->uri($uri);
            } catch (BadRequestException $e) {
                // wrap ResourceNotFound or Uri exception
                throw new EmbedException($embed->src, 500, $e);
            }
        }
    }
31889
public function renderView()
    {
        if ($this->path) {
            $this->js(true)->tab(
                ['cache' => false, 'auto' => true, 'path' => $this->path, 'apiSettings' => ['data' => ['__atk_tab' => 1]]]
            );
        } else {
            $this->js(true)->tab();
        }

        if ($this->owner->activeTabName == $this->name) {
            $this->js(true)->click();
        }

        parent::renderView();
    }
1065164
public function render( $field, $escaped_value, $object_id, $object_type, $field_type ) {
		self::setup_scripts();
		$this->field = $field;
		$this->do_type_label = false;

		if ( ! is_admin() ) {
			// Will need custom styling!
			// @todo add styles for front-end
			require_once( ABSPATH . 'wp-admin/includes/template.php' );
			do_action( 'cmb2_attached_posts_field_add_find_posts_div' );
		} else {
			// markup needed for modal
			add_action( 'admin_footer', 'find_posts_div' );
		}

		$query_args = (array) $this->field->options( 'query_args' );
		$query_users = $this->field->options( 'query_users' );

		if ( ! $query_users ) {

			// Setup our args
			$args = wp_parse_args( $query_args, array(
				'post_type'      => 'post',
				'posts_per_page' => 100,
			) );

			if ( isset( $_POST['post'] ) ) {
				$args['post__not_in'] = array( absint( $_POST['post'] ) );
			}

			// loop through post types to get labels for all
			$post_type_labels = array();
			foreach ( (array) $args['post_type'] as $post_type ) {
				// Get post type object for attached post type
				$post_type_obj = get_post_type_object( $post_type );

				// continue if we don't have a label for the post type
				if ( ! $post_type_obj || ! isset( $post_type_obj->labels->name ) ) {
					continue;
				}

				if ( is_post_type_hierarchical( $post_type_obj ) ) {
					$args['orderby'] = isset( $args['orderby'] ) ? $args['orderby'] : 'name';
					$args['order']   = isset( $args['order'] ) ? $args['order'] : 'ASC';
				}

				$post_type_labels[] = $post_type_obj->labels->name;
			}

			$this->do_type_label = count( $post_type_labels ) > 1;

			$post_type_labels = implode( '/', $post_type_labels );

		} else {
			// Setup our args
			$args = wp_parse_args( $query_args, array(
				'number' => 100,
			) );
			$post_type_labels = $field_type->_text( 'users_text', esc_html__( 'Users' ) );
		}

		$filter_boxes = '';
		// Check 'filter' setting
		if ( $this->field->options( 'filter_boxes' ) ) {
			$filter_boxes = '<div class="search-wrap"><input type="text" placeholder="' . sprintf( __( 'Filter %s', 'cmb' ), $post_type_labels ) . '" class="regular-text search" name="%s" /></div>';
		}

		// Check to see if we have any meta values saved yet
		$attached = (array) $escaped_value;

		$objects = $this->get_all_objects( $args, $attached );

		// If there are no posts found, just stop
		if ( empty( $objects ) ) {
			return;
		}

		// Wrap our lists
		echo '<div class="attached-posts-wrap widefat" data-fieldname="'. $field_type->_name() .'">';

		// Open our retrieved, or found posts, list
		echo '<div class="retrieved-wrap column-wrap">';
		echo '<h4 class="attached-posts-section">' . sprintf( __( 'Available %s', 'cmb' ), $post_type_labels ) . '</h4>';

		// Set .has_thumbnail
		$has_thumbnail = $this->field->options( 'show_thumbnails' ) ? ' has-thumbnails' : '';
		$hide_selected = $this->field->options( 'hide_selected' ) ? ' hide-selected' : '';

		if ( $filter_boxes ) {
			printf( $filter_boxes, 'available-search' );
		}

		echo '<ul class="retrieved connected' . $has_thumbnail . $hide_selected . '">';

		// Loop through our posts as list items
		$this->display_retrieved( $objects, $attached );

		// Close our retrieved, or found, posts
		echo '</ul><!-- .retrieved -->';

		// @todo make User search work.
		if ( ! $query_users ) {
			$findtxt = $field_type->_text( 'find_text', __( 'Search' ) );

			$js_data = json_encode( array(
				'queryUsers' => $query_users,
				'types'      => $query_users ? 'user' : (array) $args['post_type'],
				'cmbId'      => $this->field->cmb_id,
				'errortxt'   => esc_attr( $field_type->_text( 'error_text', __( 'An error has occurred. Please reload the page and try again.' ) ) ),
				'findtxt'    => esc_attr( $field_type->_text( 'find_text', __( 'Find Posts or Pages' ) ) ),
				'groupId'    => $this->field->group ? $this->field->group->id() : false,
				'fieldId'    => $this->field->_id(),
				'exclude'    => isset( $args['post__not_in'] ) ? $args['post__not_in'] : array(),
			) );

			echo '<p><button type="button" class="button cmb2-attached-posts-search-button" data-search=\''. $js_data .'\'>'. $findtxt .' <span title="'. esc_attr( $findtxt ) .'" class="dashicons dashicons-search"></span></button></p>';
		}

		echo '</div><!-- .retrieved-wrap -->';

		// Open our attached posts list
		echo '<div class="attached-wrap column-wrap">';
		echo '<h4 class="attached-posts-section">' . sprintf( __( 'Attached %s', 'cmb' ), $post_type_labels ) . '</h4>';

		if ( $filter_boxes ) {
			printf( $filter_boxes, 'attached-search' );
		}

		echo '<ul class="attached connected', $has_thumbnail ,'">';

		// If we have any ids saved already, display them
		$ids = $this->display_attached( $attached );

		// Close up shop
		echo '</ul><!-- #attached -->';
		echo '</div><!-- .attached-wrap -->';

		echo $field_type->input( array(
			'type'  => 'hidden',
			'class' => 'attached-posts-ids',
			'value' => ! empty( $ids ) ? implode( ',', $ids ) : '',
			'desc'  => '',
		) );

		echo '</div><!-- .attached-posts-wrap -->';

		// Display our description if one exists
		$field_type->_desc( true, true );
	}
87995
public static function oembed($html, $url, $attr, $postId, $wrapper = true)
    {
        $provider = false;

        if (strpos(strtolower($url), 'youtube') !== false || strpos(strtolower($url), 'youtu.be') !== false) {
            $provider = 'YouTube';
        } elseif (strpos(strtolower($url), 'vimeo') !== false) {
            $provider = 'Vimeo';
        }

        $shouldFilter = apply_filters('Municipio/oembed/should_filter_markup', true, $provider, $url, $postId);

        // Check if there's a oembed class for the provider
        if (!class_exists('\Municipio\Oembed\\' . $provider) || !$shouldFilter) {
            return $html;
        }

        $class = '\Municipio\Oembed\\' . $provider;
        $oembed = new $class($url, $html, $wrapper);

        return $oembed->output();
    }
1215443
public static function renderBlockAttrs(array $embed): string
    {
        // attributes to be rendered
        $classes = array();
        $styles = array();
        // shortcuts
        $d = &$embed['dimension'];
        // determine classes
        $classes[] = 'videoblock';
        if ($d->dynamic) {
            $classes[] = 'videoblock-dynamic';
        }
        // determine inline CSS style(s)
        // if scale model is no-scale, allow to "force dynamic"
        // by setting "dynamic" to TRUE
        if ($d->dynamic) {
            $styles[] = 'max-width:'.$d->width.'px';
        } else {
            $styles[] = 'width: '.$d->width.'px';
        }
        // render the attributes
        $class = implode(' ', $classes);
        $style = implode('; ', $styles) . (!empty($styles) ? ';' : '');
        return 'class="'.$class.'" style="'.$style.'"';
    }
1239368
public function embed($name, $options = null)
	{
		if ($this->options && !$options)
		{
			$options = $this->options;
		}

		switch (strtolower($name))
		{
			case 'maps':
				return new Embed\Maps($options);

			case 'analytics':
				return new Embed\Analytics($options);

			default:
				return null;
		}
	}
972120
function addBreadCrumb($route_name, $params = [], $replacements = []) {
        $url        = route($route_name, $params, false);
        $title                   = \LaraPage::pageTitle($route_name, $replacements);
        $h1                      = \LaraPage::pageH1($route_name, $replacements);
        $h1_ext                  = \LaraPage::pageH1Ext($route_name, $replacements);
        $description             = \LaraPage::pageH1Ext($route_name, $replacements);
        $icon                    = Route::routeIcons($route_name);
        $this->breadcrumbs[$url] = compact('title', 'icon');
        $this->setUrl($url);
        $_title = [];
        foreach($this->breadcrumbs as $url => $breadcrumb) {
            $_title[] = Arr::get($breadcrumb, 'title');
        }
        $_title = array_reverse($_title);
        $this->setTitle(implode(', ', $_title))->setDescription($description);

        return $this;
    }
25548
public function renderPagetabSeoAction()
	{
		$idPage = $this->params()->fromRoute('idPage', $this->params()->fromQuery('idPage', ''));
		$melisKey = $this->params()->fromRoute('melisKey', '');
		
		$seoForm = $this->getSeoPageForm($idPage);
		
		/**
		 * Get the data to fill the form
		 */
		if (!empty($idPage))
		{
			$melisTablePageSeo = $this->serviceLocator->get('MelisEngineTablePageSeo');
			$datasPageSeo = $melisTablePageSeo->getEntryById($idPage);
		}
		else
			$datasPageSeo = null;
		
		if (!empty($datasPageSeo))
		{
			$datasPageSeo = $datasPageSeo->current();
			if (!empty($datasPageSeo))
				$seoForm->bind($datasPageSeo);
		}
		
		/**
		 * Send back the view and add the form config inside
		*/
		$view = new ViewModel();
		$view->setVariable('meliscms_page_seo', $seoForm);
		$view->idPage = $idPage;
		$view->melisKey = $melisKey;
	
		return $view;
	}
281273
function Link(props) {

  // Handle clicks of the link
  const onClick = e => {
    e.preventDefault();
    routeTo(path);
  };

  // If link is for a new tab
  if(props.openIn === 'new') {
    return (
      <a href={props.to} target="_blank" rel="noopener noreferrer">
        {props.children}
      </a>
    );
  }

  return (
    <a href={props.to} onClick={onClick}>
      {props.children}
    </a>
  );
}
326007
public function renderTabs(\Tecnoready\Common\Model\Tab\Tab $tab,array $parameters = []) 
    {
        $parameters["tab"] = $tab;
        return $this->container->get('templating')->render($this->config["tabs"]["template"], 
            $parameters
        );
    }
472036
function renderPage(uri, req, res, hrStart) {
  const locals = res.locals,
    extension = getExtension(req),
    renderer = findRenderer(extension);

  // Add request route params, request query params
  // and the request extension to the locals object
  locals.params = req.params;
  locals.query = req.query;
  locals.extension = extension;

  // look up page alias' component instance
  return getDBObject(uri)
    .then(formDataFromLayout(locals, uri))
    .then(data => {
      logTime(hrStart, uri);
      return data;
    })
    .then(({ data, options }) => renderer.render(data, options, res))
    .catch(responses.handleError(res));
}
454313
function show (req, res, next) {
    var _embed = req.query._embed
    var _expand = req.query._expand
    var id = utils.toNative(req.params.id)
    var resource = db.get(name).getById(id).value()

    if (resource) {
      // Clone resource to avoid making changes to the underlying object
      resource = _.cloneDeep(resource)

      // Embed other resources based on resource id
      // /posts/1?_embed=comments
      embed(resource, _embed)

      // Expand inner resources based on id
      // /posts/1?_expand=user
      expand(resource, _expand)

      res.locals.data = resource
    }

    next()
  }
888550
function pong_map_DivHTML( divId, resourceURL, paramObj ) {
	log( "pong_map",  "divId="+divId+" resourceURL="+resourceURL );
	if ( moduleConfig[ divId ] != null ) {
		log( "pong_map", "moduleConfig= '"+JSON.stringify( moduleConfig[ divId ] )+"'");
		pong_map_RenderHTML( divId, resourceURL, paramObj, moduleConfig[ divId ]  );
	} else {
		log( "pong_map", "moduleConfig: getJSON( "+resourceURL+"/pong_map )" );
		$.getJSON( 
			resourceURL+"/pong_map", 
			function( pmd ) {
				pong_map_RenderHTML( divId, resourceURL, paramObj, pmd );
			}
		);					
	}	
}
631686
function publishHandlerLink( $element, &$params )
    {
        $ret = null;

        $href = $element->getAttribute( 'href' );

        if ( $href )
        {
            if ( preg_match( "@^ezobject://[0-9]+(#.*)?$@", $href ) )
            {
                $url = strtok( $href, '#' );
                $anchorName = strtok( '#' );
                $objectID = substr( strrchr( $url, "/" ), 1 );
                $element->setAttribute( 'object_id', $objectID );

                 if ( !in_array( $objectID, $this->linkedObjectIDArray ) )
                 {
                    $this->linkedObjectIDArray[] = $objectID;
                }
            }
            elseif ( preg_match( "@^eznode://.+(#.*)?$@" , $href ) )
            {
                $objectID = null;
                $url = strtok( $href, '#' );
                $anchorName = strtok( '#' );
                $nodePath = substr( strchr( $url, "/" ), 2 );
                if ( preg_match( "@^[0-9]+$@", $nodePath ) )
                {
                    $nodeID = $nodePath;
                    $node = eZContentObjectTreeNode::fetch( $nodeID, false, false );
                    if ( !$node )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Node '%1' does not exist.", '', array( $nodeID ) ) );
                    }
                    else
                    {
                        $objectID = $node['id'];
                    }
                }
                else
                {
                    $node = eZContentObjectTreeNode::fetchByURLPath( $nodePath, false );
                    if ( !$node )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Node '%1' does not exist.", '', array( $nodePath ) ) );
                    }
                    else
                    {
                        $nodeID = $node['node_id'];
                        $objectID = $node['id'];
                    }
                    $element->setAttribute( 'show_path', 'true' );
                }
                $element->setAttribute( 'node_id', $nodeID );

                if ( $objectID && !in_array( $objectID, $this->linkedObjectIDArray ) )
                {
                    $this->linkedObjectIDArray[] = $objectID;
                }
            }
            elseif ( preg_match( "@^#.*$@" , $href ) )
            {
                $anchorName = substr( $href, 1 );
            }
            else
            {
                //washing href. single and double quotes replaced with their urlencoded form
                $href = str_replace( array('\'','"'), array('%27','%22'), $href );

                $temp = explode( '#', $href );
                $url = $temp[0];
                if ( isset( $temp[1] ) )
                {
                    $anchorName = $temp[1];
                }

                if ( $url )
                {
                    // Protection from XSS attack
                    if ( preg_match( "/^(java|vb)script:.*/i" , $url ) )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Using scripts in links is not allowed, link '%1' has been removed", '', array( $url ) ) );

                        $element->removeAttribute( 'href' );
                        return $ret;

                    }
                    // Check mail address validity following RFC 5322 and RFC 5321
                    if ( preg_match( "/^mailto:([^.][a-z0-9!#\$%&'*+-\/=?`{|}~^]+@([a-z0-9.-]+))/i" , $url, $mailAddr ) &&
                         !eZMail::validate( $mailAddr[1] ) )
                    {
                        $this->handleError( eZXMLInputParser::ERROR_DATA,
                                            ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "Invalid e-mail address: '%1'", '' , array( $mailAddr[1] ) ) );

                        $element->removeAttribute( 'href' );
                        return $ret;
                    }
                    // Store urlID instead of href
                    $urlID = $this->convertHrefToID( $url );
                    if ( $urlID )
                    {
                        $urlIDAttributeName = 'url_id';

                        $element->setAttribute( $urlIDAttributeName, $urlID );
                    }
                }
            }

            if ( isset( $anchorName ) && $anchorName )
            {
                $element->setAttribute( 'anchor_name', $anchorName );
            }

            $element->removeAttribute( 'href' );
        }

        return $ret;
    }