GetAllTemplates() public static method

public static GetAllTemplates ( array $p_sqlOptions = null, boolean $p_update = true, boolean $p_useFilter = false, boolean $p_strict = false ) : array
$p_sqlOptions array
$p_update boolean
$p_useFilter boolean filter templates matching setting in SystemPreferences
$p_strict boolean if true, retrieves only template (tpl) files
return array
Example #1
0
require_once($GLOBALS['g_campsiteDir']."/include/phorum_load.php");
require_once($GLOBALS['g_campsiteDir'].'/classes/Phorum_forum.php');
require_once($GLOBALS['g_campsiteDir'].'/classes/Phorum_setting.php');
require_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/camp_html.php");
camp_load_translation_strings("api");

// Check permissions
if (!$g_user->hasPermission('ManagePub')) {
	camp_html_display_error(getGS("You do not have the right to add publications."));
	exit;
}

$languages = Language::GetLanguages(null, null, null, array(), array(), true);
$defaultLanguage = array_pop(Language::GetLanguages(null, camp_session_get('TOL_Language', 'en'), null, array(), array(), true));
$urlTypes = UrlType::GetUrlTypes();
$allTemplates = Template::GetAllTemplates(null, true, true, true);
$timeUnits = TimeUnit::GetTimeUnits(camp_session_get('TOL_Language', 'en'));
$shortNameUrlType = UrlType::GetByName('short names');
$aliases = array();

$crumbs = array();
$crumbs[] = array(getGS("Publications"), "/$ADMIN/pub/");
$crumbs[] = array(getGS("Add new publication"), "");
echo camp_html_breadcrumbs($crumbs);

include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");

?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;">
<TR>
	<TD><A HREF="/<?php echo $ADMIN; ?>/pub/"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD>
Example #2
0
    </tr>
    </table>
    <p>
    <?php
} else {
    if (empty($f_content)) {
        if (is_readable($filename)) {
            $contents = file_get_contents($filename);
        } else {
            $contents = getGS("File cannot be read.");
        }
    } else {
        $contents = $f_content;
    }

    $templates = Template::GetAllTemplates(array('ORDER BY' => array('Level' => 'ASC', 'Name' => 'ASC')));
    ?>
    <p></p>
    <table>
      <tr>
        <td>
        <script language="javascript">
        function openFile()
        {
           if (document.forms['template_load'].elements['f_path_name'].value == "") {
               return false;
           }

           if (editAreaLoader.getValue('cField') !== document.forms['template_edit'].elements['oldValue'].value) {
               if (!confirm('<?php putGS('Changes have not been saved. Load new template without saving the current one?') ?>')) {
                   return false;;