Compile table footer contents.

@return array
351595
protected function compileTableFooter()
    {
        $footer = [];
        foreach ($this->collection->all() as $row) {
            if (is_array($row->footer)) {
                $footerAttr = $this->html->attributes(array_only($row->footer,
                    ['class', 'id', 'title', 'width', 'style', 'data-class', 'data-hide']));
                $title = isset($row->footer['title']) ? $row->footer['title'] : '';
                $footer[] = '<th ' . $footerAttr . '>' . $title . '</th>';
            } else {
                $footer[] = '<th>' . $row->footer . '</th>';
            }
        }

        return $footer;
    }
1078443
public static function render() {
        self::newRow();
        ob_start();
        ?>

        <table <?php echo (!empty(self::$table_attributes)) ? self::parseAttributes(self::$table_attributes) : ""; ?>>
            <?php
            if (!empty(self::$headers)) {
                ?>

                <thead>
                    <tr>
                        <?php
                        foreach (self::$headers as $header) {
                            ?>

                            <th <?php echo self::parseAttributes($header[1]); ?>><?php echo $header[0] ?></th>
                            <?php
                        }
                        ?>

                    </tr>
                </thead>
                <?php
            }
            if (!empty(self::$rows)) {
                ?>

                <tbody>
                    <?php
                    foreach (self::$rows as $rowData) {
                        if (count($rowData) > 1) {
                            ?>

                            <tr <?php echo self::parseAttributes($rowData[0]); ?>>
                                <?php
                                foreach ($rowData[1] as $row) {
                                    ?>
                                    <td <?php echo self::parseAttributes($row[1]); ?>><?php echo $row[0] ?></td>
                                    <?php
                                }
                                ?>

                            </tr>
                            <?php
                        }
                    }
                    ?>

                </tbody>
                <?php
            }
            if (!empty(self::$footers)) {
                ?>

                <tfoot>
                    <tr>
                        <?php
                        foreach (self::$footers as $footer) {
                            ?>

                            <th <?php echo self::parseAttributes($footer[1]); ?>><?php echo $footer[0] ?></th>
                            <?php
                        }
                        ?>

                    </tr>
                </tfoot>
            <?php }
            ?>
        </table>
        <?php
        return ob_get_clean();
    }
581212
public function getCompiledBaseCss()
    {
        $mergedAsset = new InMemoryUIAsset();

        $assetMerger = new StylesheetUIAssetMerger($mergedAsset, $this->minimalStylesheetFetcher, $this->cacheBuster);

        $assetMerger->generateFile();

        return $mergedAsset;
    }
770693
function footer() {
        $footer = $this->footer_content;
        if ($footer) {
            if ($this->header_type == GESHI_HEADER_PRE) {
                $footer = str_replace("\n", '', $footer);;
            }
            $footer = $this->replace_keywords($footer);

            if ($this->use_classes) {
                $attr = ' class="foot"';
            } else {
                $attr = " style=\"{$this->footer_content_style}\"";
            }
            if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
                $footer = "<tfoot><tr><td colspan=\"2\">$footer</td></tr></tfoot>";
            } else {
                $footer = "<div$attr>$footer</div>";
            }
        }

        if (GESHI_HEADER_NONE == $this->header_type) {
            return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '</ol>' . $footer : $footer;
        }

        if ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) {
            if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
                return "</ol>$footer</div>";
            }
            return ($this->force_code_block ? '</div>' : '') .
                "$footer</div>";
        }
        elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
            if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
                return "</tr></tbody>$footer</table>";
            }
            return ($this->force_code_block ? '</div>' : '') .
                "$footer</div>";
        }
        else {
            if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
                return "</ol>$footer</pre>";
            }
            return ($this->force_code_block ? '</div>' : '') .
                "$footer</pre>";
        }
    }
120682
protected function tableHeaders() : string
    {
        $arrCells = [];
        foreach ($this->getHeaderColumns() as $key => $val) {
            $arrCells[] = $this->renderHeaderColumn($key, $val);
        }        
        $arrCells[] = "";
        
        $content = H::renderTableHeaderRow($arrCells);
        $full = H::thead($content)
                . H::tbody('');
        return $full;
    }
1271892
public function render_footer_template() {
		$output = null;
		if ( ! empty( $this->footer ) ) {
			$output .= '<script type="text/html" id="' . esc_attr( $this->id() ) . '-footer-tmpl">';
			$output .= $this->footer->render();
			$output .= '</script>';
		}

		return $output;
	}
1204375
private function footer()
    {
        $footer = $this->footer_content;
        if ($footer) {
            if ($this->header_type == self::OPT_HEADER_PRE) {
                $footer = str_replace("\n", '', $footer);;
            }
            $footer = $this->replace_keywords($footer);

            if ($this->use_classes) {
                $attr = ' class="foot"';
            }
            else {
                $attr = " style=\"{$this->footer_content_style}\"";
            }
            if ($this->header_type == self::OPT_HEADER_PRE_TABLE && $this->line_numbers != self::OPT_LINE_NUMBERS_NONE) {
                $footer = "<tfoot><tr><td colspan=\"2\">$footer</td></tr></tfoot>";
            }
            else {
                $footer = "<div$attr>$footer</div>";
            }
        }

        if (self::OPT_HEADER_NONE == $this->header_type) {
            return ($this->line_numbers != self::OPT_LINE_NUMBERS_NONE) ? '</ol>' . $footer : $footer;
        }

        if ($this->header_type == self::OPT_HEADER_DIV || $this->header_type == self::OPT_HEADER_PRE_VALID) {
            if ($this->line_numbers != self::OPT_LINE_NUMBERS_NONE) {
                return "</ol>$footer</div>";
            }

            return ($this->force_code_block ? '</div>' : '') .
                   "$footer</div>";
        }
        elseif ($this->header_type == self::OPT_HEADER_PRE_TABLE) {
            if ($this->line_numbers != self::OPT_LINE_NUMBERS_NONE) {
                return "</tr></tbody>$footer</table>";
            }

            return ($this->force_code_block ? '</div>' : '') .
                   "$footer</div>";
        }
        else {
            if ($this->line_numbers != self::OPT_LINE_NUMBERS_NONE) {
                return "</ol>$footer</pre>";
            }

            return ($this->force_code_block ? '</div>' : '') .
                   "$footer</pre>";
        }
    }
153383
public function footerAction()
    {
        // TODO: find the lightest way to get that information
        $version = $this->get('claroline.manager.version_manager')->getDistributionVersion();

        $roleUser = $this->roleManager->getRoleByName('ROLE_USER');
        $selfRegistration = $this->configHandler->getParameter('allow_self_registration') &&
            $this->roleManager->validateRoleInsert(new User(), $roleUser);

        return $this->render('ClarolineCoreBundle:layout:footer.html.twig', [
            'footerMessage' => $this->configHandler->getParameter('footer'),
            'footerLogin' => $this->configHandler->getParameter('footer_login'),
            'footerWorkspaces' => $this->configHandler->getParameter('footer_workspaces'),
            'headerLocale' => $this->configHandler->getParameter('header_locale'),
            'coreVersion' => $version,
            'selfRegistration' => $selfRegistration,
        ]);
    }
1288434
public function footer() {
        global $CFG, $DB, $PAGE;

        // Give plugins an opportunity to touch the page before JS is finalized.
        $pluginswithfunction = get_plugins_with_function('before_footer', 'lib.php');
        foreach ($pluginswithfunction as $plugins) {
            foreach ($plugins as $function) {
                $function();
            }
        }

        $output = $this->container_end_all(true);

        $footer = $this->opencontainers->pop('header/footer');

        if (debugging() and $DB and $DB->is_transaction_started()) {
            // TODO: MDL-20625 print warning - transaction will be rolled back
        }

        // Provide some performance info if required
        $performanceinfo = '';
        if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {
            $perf = get_performance_info();
            if (defined('MDL_PERFTOFOOT') || debugging() || $CFG->perfdebug > 7) {
                $performanceinfo = $perf['html'];
            }
        }

        // We always want performance data when running a performance test, even if the user is redirected to another page.
        if (MDL_PERF_TEST && strpos($footer, $this->unique_performance_info_token) === false) {
            $footer = $this->unique_performance_info_token . $footer;
        }
        $footer = str_replace($this->unique_performance_info_token, $performanceinfo, $footer);

        // Only show notifications when we have a $PAGE context id.
        if (!empty($PAGE->context->id)) {
            $this->page->requires->js_call_amd('core/notification', 'init', array(
                $PAGE->context->id,
                \core\notification::fetch_as_array($this)
            ));
        }
        $footer = str_replace($this->unique_end_html_token, $this->page->requires->get_end_code(), $footer);

        $this->page->set_state(moodle_page::STATE_DONE);

        return $output . $footer;
    }
943814
public function get_precompiled_css_content() {
        $configs = [$this] + $this->parent_configs;
        $css = '';

        foreach ($configs as $config) {
            if (isset($config->precompiledcsscallback)) {
                $function = $config->precompiledcsscallback;
                if (function_exists($function)) {
                    $css .= $function($this);
                }
            }
        }
        return $css;
    }
24276
protected function get_amd_footercode() {
        global $CFG;
        $output = '';

        // We will cache JS if cachejs is not set, or it is true.
        $cachejs = !isset($CFG->cachejs) || $CFG->cachejs;
        $jsrev = $this->get_jsrev();

        $jsloader = new moodle_url('/lib/javascript.php');
        $jsloader->set_slashargument('/' . $jsrev . '/');
        $requirejsloader = new moodle_url('/lib/requirejs.php');
        $requirejsloader->set_slashargument('/' . $jsrev . '/');

        $requirejsconfig = file_get_contents($CFG->dirroot . '/lib/requirejs/moodle-config.js');

        // No extension required unless slash args is disabled.
        $jsextension = '.js';
        if (!empty($CFG->slasharguments)) {
            $jsextension = '';
        }

        $minextension = '.min';
        if (!$cachejs) {
            $minextension = '';
        }

        $requirejsconfig = str_replace('[BASEURL]', $requirejsloader, $requirejsconfig);
        $requirejsconfig = str_replace('[JSURL]', $jsloader, $requirejsconfig);
        $requirejsconfig = str_replace('[JSMIN]', $minextension, $requirejsconfig);
        $requirejsconfig = str_replace('[JSEXT]', $jsextension, $requirejsconfig);

        $output .= html_writer::script($requirejsconfig);
        if ($cachejs) {
            $output .= html_writer::script('', $this->js_fix_url('/lib/requirejs/require.min.js'));
        } else {
            $output .= html_writer::script('', $this->js_fix_url('/lib/requirejs/require.js'));
        }

        // First include must be to a module with no dependencies, this prevents multiple requests.
        $prefix = "require(['core/first'], function() {\n";
        $suffix = "\n});";
        $output .= html_writer::script($prefix . implode(";\n", $this->amdjscode) . $suffix);
        return $output;
    }
1164210
public function map()
    {
        $this->bind('seo_footer_uri', function ($uri) {
            return Footer::query()
                ->where('uri', $uri)
                ->where('locale', config('app.locale'))
                ->firstOrFail();
        });

        $this->group(config('arcanesoft.seo.widgets.footers.route', []), function () {
            $this->get('{seo_footer_uri}.html', 'FootersController@show')->name('show');
        });
    }
1048583
public static function pages()
    {
        if (!getConfig('sitemap.pages')) {
            return [];
        }

        $table = TableRegistry::get('MeCms.PagesCategories');
        $url = Cache::read('sitemap', $table->getCacheName());

        if (!$url) {
            $alias = $table->Pages->getAlias();

            $categories = $table->find('active')
                ->select(['id', 'lft', 'slug'])
                ->contain($alias, function (Query $q) use ($alias) {
                    return $q->find('active')
                        ->select(['category_id', 'slug', 'modified'])
                        ->order([sprintf('%s.modified', $alias) => 'DESC']);
                })
                ->order(['lft' => 'ASC']);

            if ($categories->isEmpty()) {
                return [];
            }

            //Adds categories index
            $url[] = self::parse(['_name' => 'pagesCategories']);

            foreach ($categories as $category) {
                //Adds the category
                $url[] = self::parse(
                    ['_name' => 'pagesCategory', $category->slug],
                    ['lastmod' => array_value_first($category->pages)->modified]
                );

                //Adds each page
                foreach ($category->pages as $page) {
                    $url[] = self::parse(['_name' => 'page', $page->slug], ['lastmod' => $page->modified]);
                }
            }

            Cache::write('sitemap', $url, $table->getCacheName());
        }

        return $url;
    }
1029709
protected function get_amd_footercode() {
        global $CFG;
        $output = '';

        // First include must be to a module with no dependencies, this prevents multiple requests.
        $prefix = "require(['core/first'], function() {\n";
        $suffix = "\n});";
        $output .= html_writer::script($prefix . implode(";\n", $this->amdjscode) . $suffix);
        return $output;
    }
1298236
public function compile($content)
    {
        $phpCode = '';
        foreach (token_get_all($content) as $token) {
            $phpCode .= is_array($token) ? $this->parsePHPToken($token) : $token;
        }

        if (count($this->footer) > 0) {
            $phpCode = ltrim($phpCode, PHP_EOL) . PHP_EOL . implode(PHP_EOL, array_reverse($this->footer));
        }

        return $phpCode;
    }
667859
public function compile()
	{
		if ($this->multiArticle)
		{
			$objArticles = \ArticleModel::findMultipleByIds(\StringUtil::deserialize($this->data->multiArticle));

			// Return if there are no pages
			if ($objArticles === null)
			{
				return;
			}

			$arrArticles = array();

			// Sort the array keys according to the given order
			if ($this->data->orderArticle != '')
			{
				$tmp = \StringUtil::deserialize($this->data->orderArticle);

				if (!empty($tmp) && is_array($tmp))
				{
					$arrArticles = array_map(function () {}, array_flip($tmp));
				}
			}

			// Add the items to the pre-sorted array
			while ($objArticles->next())
			{
				$arrArticles[$objArticles->id] = $objArticles->row();
			}

			$arrArticles = array_values(array_filter($arrArticles));
			
			$this->writeToTemplate($arrArticles);

			}
		else
		{
			if (($objArticle = \ArticleModel::findById($this->data->singleArticle)) !== null)
			{
				$this->writeToTemplate($objArticle->row());
			}
		}
	}
109805
public function rules()
    {
        $footer = $this->route('seo_footer');

        return [
            // Footer Rules
            'name'            => ['required', 'string'],
            'localization'    => ['required', 'string'],
            'uri'             => ['required', 'string', $this->getUniqueUriRule()->ignore($footer->id)],
            'locale'          => $this->getLocaleRule(),
            'page'            => $this->getPageRule(),
            // SEO Rules
            'seo_title'       => ['required', 'string'],
            'seo_description' => ['required', 'string'],
            'seo_keywords'    => ['required', 'array', 'min:1'],
        ];
    }