[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/templates/admin/ -> newpost.template (source)

   1  {include file="$admintemplatepath/header.template"}
   2  {include file="$admintemplatepath/navigation.template" showOpt=newPost title=$locale->tr("newPost")}
   3  {assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
   4   <script type="text/javascript" src="js/ui/plogui.js"></script>
   5   <link rel="stylesheet" type="text/css" media="all" href="js/jscalendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
   6   <script type="text/javascript" src="js/jscalendar/calendar_stripped.js"></script>
   7   <script type="text/javascript" src="js/jscalendar/lang/calendar-en.js"></script>
   8   <script type="text/javascript" src="js/jscalendar/calendar-setup_stripped.js"></script>
   9   <script type="text/javascript" src="js/ui/autosave.js"></script>
  10   {if $htmlarea}
  11    <script type="text/javascript" src="js/tinymce/tiny_mce_gzip.php"></script>
  12    <script type="text/javascript" src="js/tinymce/tiny_mce-plog.js"></script>
  13   {else}
  14    <script type="text/javascript" src="js/editor/lifetypeeditor.js"></script>
  15   {/if}
  16   <script type="text/javascript">
  17    
  18    // some messages that we are going to need in the functions above
  19    var msgErrorMakingRequest = "{$locale->tr("error_sending_request")}";
  20    var msgErrorNoCategorySelected = "{$locale->tr("error_no_category_selected")}";
  21    var xmlHttpRequestSupportEnabled = '{$xmlHttpRequestSupportEnabled}';
  22    var htmlAreaEnabled = {if $htmlarea==0 || !$htmlarea}false{else}true{/if};
  23    var msgErrorPostTopic = "{$locale->tr("error_missing_post_topic")}";
  24    var msgErrorPostText = "{$locale->tr("error_missing_post_text")}";
  25    var msgSaving = "{$locale->tr("saving_message")}";
  26    var msgAutoSaveMessage = '{$locale->tr("warning_autosave_message")|escape:javascript}';
  27    
  28    var todayDay = '{$today->getDay()}';
  29    var todayMonth = '{$today->getMonth()}';
  30    var todayYear = '{$today->getYear()}'; 
  31    
  32    // this needs to be pre-initialized
  33    var preview = false; 
  34  
  35  {literal} 
  36  function selectOperation( t )
  37  {
  38      if( preview ) {    
  39          document.newPost.op.value="previewPost";
  40          window.open("", t, "scrollbars=yes,resizable=yes,toolbar=no" );
  41          return true;
  42      }
  43      else {
  44          document.newPost.op.value="addPost";
  45          document.newPost.target="";
  46          document.newPost.action="admin.php";
  47          return true;
  48      }
  49  }
  50  {/literal}
  51  </script>
  52   
  53    <form name="newPost" id="newPost" action="admin.php" method="post" onSubmit="return selectOperation(this.target);" target="admin">   
  54     <fieldset class="inputField">
  55     <legend>{$locale->tr("newPost")}</legend>
  56     <div id="mainPanel" style="float:left; width: 73%; border-right: 1px solid #DEDEDE;">
  57         <div id="autoSaveMessage" style="display: none;"></div>
  58         {include file="$admintemplatepath/formvalidate.template"}  
  59         <div class="field">
  60           <label for="postTopic">{$locale->tr("topic")}</label>
  61           <span class="required">*</span>
  62           <div class="formHelp">{$locale->tr("topic_help")}</div>
  63           <input type="text" name="postTopic" style="width:100%" id="postTopic" value="{$postTopic|escape:"html"}" />
  64           {include file="$admintemplatepath/validate.template" field=postTopic message=$locale->tr("error_missing_post_topic")}
  65         </div>
  66         
  67         <!-- text field custom fields -->
  68         {include file="$admintemplatepath/newpost_customfields.template" type=1 fields=$customfields}       
  69              
  70         <div class="field">
  71           <label for="postText">{$locale->tr("text")}</label>
  72           <span class="required">*</span>
  73           <div class="formHelp">{$locale->tr("text_help")}</div>
  74           {if !$htmlarea}<script type="text/javascript">var ed1 = new Lifetype.UI.Editor('postText','ed1');</script>{/if}
  75           <textarea {if $htmlarea==1}rows="20"{else}rows="15"{/if} id="postText" name="postText" style="width:100%">{$postText}</textarea>
  76           <a href="{if $htmlarea}javascript:tinyMCE.execInstanceCommand('mce_editor_0','mceinsertresource',true);{else}javascript:ed1.execute('postText','7_but_res',''){/if}">{$locale->tr("insert_media")}</a> |
  77               <a href="{if $htmlarea}javascript:tinyMCE.execInstanceCommand('mce_editor_0','mcemoremore');{else}javascript:ed1.execute('postText','8_but_more',''){/if}">{$locale->tr("insert_more")}</a>
  78           {include file="$admintemplatepath/validate.template" field=postText message=$locale->tr("error_missing_post_text")}   
  79         </div>
  80  
  81            <div class="field">
  82              <label for="trackbackUrls">{$locale->tr("trackback_urls")}</label>
  83                  <div class="formHelp">{$locale->tr("trackback_urls_help")}</div>
  84              <textarea rows="5" id="trackbackUrls" name="trackbackUrls" style="width:100%">{$trackbackUrls}</textarea>
  85            </div>
  86         
  87         <!-- text area custom fields -->
  88        {include file="$admintemplatepath/newpost_customfields.template" type=2 fields=$customfields}
  89     </div>
  90  
  91     <div id="optionPanel" style="float:left; width: 23%; margin-left: 8px;">
  92         <div class="field">
  93           <label for="postSlug">{$locale->tr("post_slug")}</label>
  94           <div class="formHelp">{$locale->tr("post_slug_help")}</div>
  95           <input type="text" name="postSlug" id="postSlug" style="width:100%" value="{$postSlug|escape:"html"}" />
  96         </div>
  97  
  98         <div class="field">
  99              <label for="postDateTime">{$locale->tr("date")}</label>
 100           <span class="required">*</span>
 101           <div class="formHelp">{$locale->tr("post_date_help")}</div>
 102           <input name="postDateTime" id="postDateTime" class="dateTime" readonly="true" type="text" size="16" value="{$postDateTime}" style="margin-bottom: 4px;" />
 103           <img src="imgs/admin/cal.jpg" id="postDateTimeSelector" alt="{$locale->tr("date")}" style="cursor: pointer; border: 0px; width: 16px; height: 14px; padding: 0;" />
 104         </div>
 105  
 106         <script type="text/javascript">
 107         var MondayFirstDay = ( {$locale->firstDayOfWeek()} == 1);
 108         {literal}
 109             Calendar.setup({
 110                 inputField  : "postDateTime",
 111                 ifFormat    : "%d/%m/%Y %H:%M",
 112                 button      : "postDateTimeSelector",
 113                 showsTime   : true,
 114                 timeFormat  : "24",
 115                 electric    : false,
 116                 align       : "Bl",
 117                 firstDay    : MondayFirstDay,
 118                 singleClick : true
 119             });
 120         {/literal}
 121         </script>
 122         
 123         <!-- date custom fields -->
 124         {include file="$admintemplatepath/newpost_customfields.template" type=4 fields=$customfields}
 125         
 126         <div class="field">
 127           <label for="postStatus">{$locale->tr("status")}</label>
 128           <span class="required">*</span>         
 129           <div class="formHelp">{$locale->tr("post_status_help")}</div>
 130           <select name="postStatus" id="postStatus">
 131             {foreach from=$poststatus key=name item=status}
 132               {if $name != "post_status_deleted"}
 133                 <option value="{$status}" {if $postStatus == $status}
 134                    selected="selected"{/if}>{$locale->tr($name)}</option>
 135               {/if}
 136             {/foreach}
 137           </select>       
 138         </div>
 139      
 140        <!-- user field -->
 141        {check_perms perm=update_all_user_articles}
 142         <div class="field">
 143          {if empty($postUser)}{assign var=postUser value=$user->getId()}{/if}
 144          <label for="postUser">{$locale->tr("posted_by")}</label>
 145           <span class="required">*</span>         
 146           <div class="formHelp">{$locale->tr("posted_by_help")}</div>
 147           <select name="postUser" id="postUser">
 148             {foreach from=$blog->getUsersInfo() item=bloguser}
 149              <option value="{$bloguser->getId()}" {if $postUser==$bloguser->getId()}selected="selected"{/if}>{$bloguser->getUserName()}</option>
 150             {/foreach}
 151          </select>       
 152         </div>
 153         {/check_perms}
 154         
 155         <div class="field">
 156           <label for="postCategories[]">{$locale->tr("categories")}</label>
 157           <span class="required">*</span>
 158           <div class="formHelp">{$locale->tr("post_categories_help")}</div>
 159           <select name="postCategories[]" id="postCategories" size="5" multiple="multiple" style="width:100%">
 160             {foreach name=categories from=$categories item=category}
 161             <option value="{$category->getId()}" {if $smarty.foreach.categories.first} selected="selected" {/if}>{$category->getName()}</option>
 162             {/foreach}
 163           </select>
 164           <input type="text" name="newArticleCategory" id="newArticleCategory" style="width:100px; margin-top:3px;" size="16" value="" />
 165           <input type="button" name="addArticleCategory" id="addArticleCategory" style="width:auto;margin-top:3px;" value="{$locale->tr("add")}" onclick="javascript:addArticleCategoryAjax()" />
 166          {include file="$admintemplatepath/validate.template" field=postCategories message=$locale->tr("error_no_category_selected")}       
 167         </div>
 168         
 169        <div class="field">
 170           <label for="globalArticleCategoryId">{$locale->tr("global_category")}</label>
 171           <span class="required">*</span>
 172           <div class="formHelp">{$locale->tr("global_article_category_help")}</div>
 173          <select name="globalArticleCategoryId" id="globalArticleCategoryId" size="1" style="width:100%">
 174             <option value="0">{$locale->tr("none")}</option>
 175             {if $globalArticleCategoryId}
 176                 {foreach from=$globalcategories item=globalcategory}
 177                 <option value="{$globalcategory->getId()}" {if $globalcategory->getId() == $globalArticleCategoryId} selected="selected" {/if}>{$globalcategory->getName()}</option>
 178                 {/foreach}
 179             {else}
 180                 {foreach name=globalcategories from=$globalcategories item=globalcategory}
 181                 <option value="{$globalcategory->getId()}">{$globalcategory->getName()}</option>
 182                 {/foreach}
 183             {/if}
 184           </select>
 185          {include file="$admintemplatepath/validate.template" field=globalArticleCategoryId message=$locale->tr("error_no_global_article_category_selected")}       
 186         </div>      
 187  
 188         <!-- list custom fields -->
 189         {include file="$admintemplatepath/newpost_customfields.template" type=5 fields=$customfields}
 190     
 191         <div class="field_checkbox">
 192           <input class="checkbox" type="checkbox" id="commentsEnabled" name="commentsEnabled" value="1" {if $commentsEnabled} checked="checked" {/if}/>
 193           <label for="commentsEnabled">{$locale->tr("post_comments_enabled_help")}</label>
 194         </div>
 195     
 196         <div class="field_checkbox">
 197           <input class="checkbox" type="checkbox" name="sendNotification" id="sendNotification" value="1" {if $sendNotification} checked="checked" {/if}/>
 198           <label for="sendNotification">{$locale->tr("send_notification_help")}</label>
 199         </div>
 200  
 201         <div class="field_checkbox">
 202           <input class="checkbox" type="checkbox" name="sendTrackbacks" id="sendTrackbacks" value="1" {if $sendTrackbacks} checked="checked" {/if}/>  
 203           <label for="sendTrackbacks">{$locale->tr("send_trackback_pings_help")}</label>
 204         </div>
 205          
 206         <div class="field_checkbox">    
 207           {if $xmlRpcPingEnabled}
 208           <input class="checkbox" type="checkbox" name="sendPings" id="sendPings" value="1" {if $sendPings} checked="checked" {/if}/>
 209           <label for="sendPings">{$locale->tr("send_xmlrpc_pings_help")}</label>
 210           {/if}
 211        </div>
 212  
 213        <!-- checkbox custom fields -->
 214         {include file="$admintemplatepath/newpost_customfields.template" type=3 fields=$customfields}
 215  
 216        <div class="field">
 217             <br /><label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
 218             <div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
 219          <a href="javascript:bm=document.selection?document.selection.createRange().text:document.getSelection();void(ltbm=window.open('{$url->getAdminUrl()}?op=newPost&amp;sendTrackbacks=1&amp;postText='+encodeURIComponent('&lt;p&gt;'+bm+' ... '+'&lt;a href=&quot;'+window.location.href+'&quot;&gt;'+'{$locale->tr("original_post")}'+'&lt;/a&gt;&lt;/p&gt;'),'ltbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'))" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("blogit_to_lifetype")}</a> 
 220        </div>
 221        
 222      </div>
 223      </fieldset>
 224      <div class="buttons">
 225          <input type="button" name="saveDraftAndContinue" value="{$locale->tr("save_draft_and_continue")}" onclick="javascript:saveDraftArticleAjax()" />
 226          <input type="submit" name="previewPost" value="{$locale->tr("preview")}" onClick="preview=true"/>
 227          <input type="submit" name="addPost" value="{$locale->tr("add_post")}" onClick="preview=false" />
 228          <input type="hidden" name="isDraft" value="" />
 229          <input type="hidden" name="op" value="addPost" />
 230          <input type="hidden" name="postId" id="postId" value="{$postId}" />
 231      </div>
 232    </form>
 233    <script type="text/javascript">
 234      initialAutoSave();
 235      startAutoSave();
 236    </script>
 237  {include file="$admintemplatepath/footernavigation.template"}
 238  {include file="$admintemplatepath/footer.template"}


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics