Ignore:
Timestamp:
Jun 28, 2012, 12:11:22 PM (12 years ago)
Author:
mistic100
Message:

add a simple page template system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdditionalPages/trunk/admin/template/add_page.tpl

    r9660 r16118  
    77        auto_permalink = false;
    88      });
     9  });
     10 
     11  var content_changed = false;
     12  jQuery("#ap_content").change(function() {
     13    content_changed = true;
     14  });
     15 
     16  jQuery("#template").change(function() {
     17    if ($(this).val() != '-1') {
     18{/literal}
     19      if (content_changed == false || confirm("{'The content of the page changed, are your sure you wan\'t to quit without saving?'|@translate|escape:javascript}")) {ldelim}
     20        window.location.href = "admin.php?page=plugin-AdditionalPages-add_page&load_template="+ $(this).val();
     21      } else {ldelim}
     22        $(this).val('-1');
     23      }
     24{literal}
     25    }
    926  });
    1027});
     
    2845  <legend></legend>
    2946        <ul>
     47    {if $TEMPLATES}
     48    <li>
     49      <span class="property">
     50        <label for="template">{'Load a page model'|@translate}</label>
     51      </span>
     52      <select name="template" id="template">
     53        <option value="-1">---------</option>
     54        {foreach from=$TEMPLATES item=tpl}
     55        <option value="{$tpl.tpl_id}" {if $template_selected==$tpl.tpl_id}selected="selected"{/if}>{$tpl.name}</option>
     56        {/foreach}
     57      </select>
     58    </li>
     59    {/if}
     60   
    3061    <li>
    3162      <span class="property">
Note: See TracChangeset for help on using the changeset viewer.