Render assets on asked page.

@param array $currentPage
@param array $fields
558484
public static function assets($currentPage, $fields)
    {
        global $pagenow;

        // Check current page
        if (empty($fields) || !in_array($pagenow, $currentPage)) {
            return;
        }

        $assets = [
            'scripts' => [],
            'styles' => [],
        ];

        /**
         * Add your custom assets to make them accessible.
         *
         * @param   array $paths
         * @return  array $paths
         */
        $paths = apply_filters('ol_zeus_render_assets', []);

        // Iterate on fields to render assets
        if (!empty($fields)) {
            foreach ($fields as $field) {
                if (!$field) {
                    continue;
                }

                $paths = array_merge($paths, $field->renderAssets());
            }
        }

        // Check paths
        if (empty($paths)) {
            return;
        }

        // Create temp accessible files and update assets
        foreach ($paths as $name => $path) {
            self::assetsInCache($path, $name);
            $type = 'js/' === substr($name, 0, 3) ? 'scripts' : 'styles';

            $assets[$type][] = [
                'name' => $name,
                'file' => OL_ZEUS_URI.$name,
            ];
        }

        // Add all in admin panel
        add_action('admin_enqueue_scripts', function ($hook) use ($assets) {
            // Scripts
            if (!empty($assets['scripts'])) {
                foreach ($assets['scripts'] as $script) {
                    wp_enqueue_script($script['name'], $script['file'], ['jquery']);
                }
            }

            // Styles
            if (!empty($assets['styles'])) {
                $handle = wp_style_is('olympus-core-css', 'registered') ? 'olympus-core-css' : false;

                foreach ($assets['styles'] as $style) {
                    wp_enqueue_style($style['name'], $style['file'], $handle);
                }
            }
        }, 9);
    }
671631
private function _loadPage($page, $variables = false)
	{
		// Start the output buffer captain
		ob_start();

		// Store the page
		$this->page = $page;

		// Load the page that was requested
		$this->_loadFile($this->page, 'page', $variables);

		// If a template was set we need to get the page content and pass it to the template
		if ($this->template !== null) {
			// Set the template content var
			$this->_template_content = ob_get_clean();

			// Restart the buffer
			ob_start();

			// Load the template with any template vars that were passed in earlier
			// from the page
			$this->_loadFile($this->template, 'template', $this->_template_vars);
		}

		// And finally output everything in the buffer
		ob_end_flush();
	}
672104
function render (currentTime) {
      // Store time scroll started, if not started already:
      if (!startTime) {
        startTime = currentTime;
      }

      // Determine time spent scrolling so far:
      elapsedTime = currentTime - startTime;

      // Calculate next scroll position:
      next = easing(elapsedTime, start, distance, duration, settings);

      // Scroll to it:
      window.scrollTo(0, next);

      // Check progress:
      elapsedTime < duration
        ? window.requestAnimationFrame(render)
        : done(start, startTime, distance, settings);
    }
95864
public function render() {
        $request     = Request::me();
        $namespace   = $this->module->getViewNamespace();
        $appUri      = $request->getApplicationBaseUri();
        $nestedTiles = $this->nestedTiles;
        foreach ($nestedTiles as $tile) {
            $tile->setParent($this);
        }
        $properties  = $this->getMergedProperties();

        if (!defined($namespace.'APP')) {
            define($namespace.'APP', strLeft($appUri, -1));
        }
        if (!defined($namespace.'MODULE')) {
            $moduleUri = $appUri.$this->module->getPrefix();
            define($namespace.'MODULE', strLeft($moduleUri, -1));
        }

        $properties['request' ] = $request;
        $properties['response'] = Response::me();
        $properties['session' ] = $request->isSession() ? $request->getSession() : null;
        $properties['form'    ] = $request->getAttribute(ACTION_FORM_KEY);
        $properties['page'    ] = Page::me();

        if ($this->isPushModelSupport()) {
            $pageValues = Page::me()->values();
            $properties = \array_merge($properties, $pageValues);
        }

        $tileHint = false;
        if (Application::isAdminIP()) {
            $rootDir  = $this->di('config')['app.dir.root'];
            $file     = $this->fileName;
            $file     = strRightFrom($file, $rootDir.DIRECTORY_SEPARATOR, 1, false, $file);
            $file     = 'file="'.str_replace('\\', '/', $file).'"';
            $tile     = $this->name==self::GENERIC_NAME ? '':'tile="'.$this->name.'" ';
            $tileHint = $tile.$file;
            echo ($this->parent ? NL:'').'<!-- #begin: '.$tileHint.' -->'.NL;
        }

        includeFile($this->fileName, $nestedTiles + $properties);

        if ($tileHint) {
            echo NL.'<!-- #end: '.$tileHint.' -->'.NL;
        }
        return $this;
    }
1179927
@Override
    public void render() {
        GdxUtilities.clearScreen();
        if (currentView != null) {
            currentView.render(Gdx.graphics.getDeltaTime());
        }
    }
1159371
def show
      respond_to do |format|
        format.html { render @page.template if @page.template.present? }
        format.json { render json: @page }
      end
    end
909139
public function render($model, array $fields = [], $element = self::DEFAULT_ELEMENT, array $data = [])
    {
        $data = Hash::merge([
            'clearUrl'   => [],
            'model'      => $model,
            'formFields' => $fields,
        ], $data);

        return $this->_View->element($element, $data);
    }
1236193
protected function _render_select($data, $current_value)
    {
        if (isset($data['options'])) {
            $options = $data['options'];
            unset($data['options']);
        } elseif (isset($data['values'])) {
            $options = $data['values'];
            unset($data['values']);
        } else {
            throw new MissingFieldException('values');
        }

        if (isset($data['all'])) {
            if ($data['all']) {
                $options = array_merge(['' => $data['all']], $options);
            }
            unset($data['all']);
        } else {
            $options = array_merge(['' => $this->_select_all_text], $options);
        }

        $r = PHP_EOL . '  <select';
        foreach (['id', 'name', 'class'] as $attr) {
            if (isset($data[$attr])) {
                $r .= " $attr=\"$data[$attr]\"";
                unset($data[$attr]);
            }
        }

        foreach ($data as $attr => $value) {
            $r .= " $attr=\"" . htmlspecialchars($data[$attr]) . '"';
        }

        $r .= '>' . PHP_EOL;

        foreach ((array)$options as $value => $label) {
            $r .= '    <option value="' . (is_numeric($value) ? $value : htmlspecialchars($value)) . '"';
            /** @noinspection TypeUnsafeComparisonInspection */

            $selected = false;
            if ($value === '') {
                if ($current_value === null || $current_value === '') {
                    $selected = true;
                }
            } elseif ($value === '0' || $value === 0) {
                if ($current_value === '0' || $current_value === 0) {
                    $selected = true;
                }
            } elseif ((string)$value === (string)$current_value) {
                $selected = true;
            }

            if ($selected) {
                $r .= ' selected';
            }
            $r .= '>' . htmlspecialchars($label) . '</option>' . PHP_EOL;
        }
        $r .= '  </select>' . PHP_EOL;

        return $r;
    }
1219381
public function set_currentpage($page) {
        global $DB;

        if ($this->check_page_access($page)) {
            $DB->set_field('quiz_attempts', 'currentpage', $page, array('id' => $this->get_attemptid()));
            return true;
        }
        return false;
    }
1156364
public function render($page, $settings=array())
    {
        $this->settings = array_merge($this->settings, $settings);

        if (!empty($page->currentUri)) {
            $this->htmlAHref = str_replace('?', '&', $this->htmlAHref);
            $this->currentUri = $page->currentUri;
        } else {
            $this->currentUri = $this->di->get('router')->getRewriteUri();
        }

        $html = '';
        if ($page->total_pages > 1) {
            $this->page = $page;

            $this->checkBoundary();

            $html .= '<ul class="pagination">';
            $html .= $this->renderPreviousButton();
            $html .= $this->renderPages();
            $html .= $this->renderNextButton();
            $html .= '</ul>';
        }

        return $html;
    }
979706
public void setCurrentPage(int currentPage) throws CmsIllegalArgumentException {

        if (getSize() != 0) {
            if ((currentPage < 1) || (currentPage > getNumberOfPages())) {
                throw new CmsIllegalArgumentException(
                    Messages.get().container(Messages.ERR_LIST_INVALID_PAGE_1, new Integer(currentPage)));
            }
        }
        m_currentPage = currentPage;
    }
215089
def render(self, ctx=None):
        '''
        
        '''
        if ctx is None:
            ctx = RenderContext()
        ctx.push(self)
        self._initialize()
        offset = self.offset if self.offset else 0
        self._fields[self._field_idx].set_offset(offset)
        rendered = self._fields[self._field_idx].render(ctx)
        self.set_current_value(rendered)
        ctx.pop()
        return self._current_rendered
965109
function renderiBooksField() {
		$this->renderField(
			[
				'id' => 'ibooks',
				'name' => $this->getSlug(),
				'option' => 'ibooks',
				'value' => ( isset( $this->options['ibooks'] ) ) ? $this->options['ibooks'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
360262
function renderPages($itemsCount, $itemsPerPage, $pageCount, $Descending = false, $sub_prefix='')
    {
        $prefix = empty($sub_prefix)?str_repeat('sub_', $this->sub):$sub_prefix;
        if ($itemsCount > $itemsPerPage)
        {
            $result = '<div class="admListPages">'.strPages;
            if ($Descending)
            {
                $forFrom = $pageCount;
                $forTo = 0;
                $forDelta = -1;
            }
            else
            {
                $forFrom = 1;
                $forTo = $pageCount+1;
                $forDelta = 1;
            }
            $pageIndex = arg($prefix.'pg') ? arg($prefix.'pg', 'int') : $forFrom;
            for ($i = $forFrom; $i != $forTo; $i += $forDelta)
            {
                if ($i == $pageIndex)
                {
                    $result .= '<span class="selected">&nbsp;'.$i.'&nbsp;</span>';
                }
                else
                {
                    $result .= '<a href="'.$this->url(array($prefix.'pg' => $i)).'">&nbsp;'.$i.'&nbsp;</a>';
                }
            }
            $result .= "</div>\n";
            return $result;
        }
        else
        {
            return '';
        }
    }
758279
final void render(long currentTime) {
        if (this.getStatus() != TweenAnimationStatus.RUNNING) {
            return;
        }

        if (currentTime >= endTime && this.getStatus() != TweenAnimationStatus.WAIT) {
            this.status = TweenAnimationStatus.WAIT;
            return;
        }

        value = equation.compute(currentTime - startTime, getStartValue(), getEndValue() - getStartValue(), getDuration());
    }
83093
public function addressNotEquals($page)
    {
        $expected = $this->cleanUrl($page);
        $actual = $this->getCurrentUrlPath();

        $this->assert($actual !== $expected, sprintf('Current page is "%s", but should not be.', $actual));
    }
1293829
public function Index($CurrentFormName = 'discussion') {
      $this->AddJsFile('jquery.autogrow.js');
      $this->AddJsFile('post.js');
      $this->AddJsFile('autosave.js');
		
		$this->SetData('CurrentFormName', $CurrentFormName);
		$Forms = array();
		$Forms[] = array('Name' => 'Discussion', 'Label' => Sprite('SpNewDiscussion').T('New Discussion'), 'Url' => 'vanilla/post/discussion');
		/*
		$Forms[] = array('Name' => 'Question', 'Label' => Sprite('SpAskQuestion').T('Ask Question'), 'Url' => 'vanilla/post/discussion');
		$Forms[] = array('Name' => 'Poll', 'Label' => Sprite('SpNewPoll').T('New Poll'), 'Url' => 'activity');
		*/
		$this->SetData('Forms', $Forms);
		$this->FireEvent('AfterForms');

		$this->SetData('Breadcrumbs', array(array('Name' => T('Post'), 'Url' => '/post')));
      $this->Render();
   }