GetTemplateFilterRegex() public static method

Return an regular expression to filter template lists
public static GetTemplateFilterRegex ( boolean $p_sql = false ) : string
$p_sql boolean indicates usage for sql query
return string
Example #1
0
        <TABLE BORDER="0" CELLSPACING="1" CELLPADDING="3" class="table_list">
        <TR class="table_list_header">
            <TD VALIGN="TOP"><B><?php  putGS('Folders'); ?> </B></TD>
            <?php
            if ($g_user->hasPermission("DeleteTempl")) {
                echo '<TD><B> '.getGS('Delete').' </B></TD>';
            }
            ?>
        </TR>
        <?php
        $currentFolder = $listbasedir;
        if (empty($currentFolder)) {
            $currentFolder = "/";
        }

        $filterRegex = Template::GetTemplateFilterRegex();

        if (isset($dirs)) {
            sort($dirs);
            $color = 0;
            foreach ($dirs as $dirname) {
                // filter folders
                if (strlen($filterRegex) && preg_match("/$filterRegex/", $dirname)) {
                     continue;
                }

                $tr_class = "";
                if ($color) {
                    $color = 0;
                    $tr_class = "class=\"list_row_even\"";
                } else {