[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/FCKeditorX/FCKeditor/editor/plugins/CMSContent/ -> fck_cmscontent.php (source)

   1  <?php
   2  $inclfilename = '../include.php';
   3  
   4  while(!@file_exists($inclfilename)){
   5              $inclfilename = "../".$inclfilename;
   6  }
   7  @require_once($inclfilename);
   8  ?>
   9  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  10  <html>
  11      <head>
  12          <title>CMS Link - Insert CMS Made Simple Link</title>
  13          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14          <meta content="noindex, nofollow" name="robots">
  15          <script type="text/javascript" src="fckcmscontent.js"></script>
  16          <script type="text/javascript">
  17          <!--
  18              var oEditor            = window.parent.InnerDialogLoaded(); 
  19              var FCK                = oEditor.FCK; 
  20              var FCKLang            = oEditor.FCKLang ;
  21              var FCKConfig        = oEditor.FCKConfig ;
  22              var FCKCMSContent    = oEditor.FCKCMSContent; 
  23               
  24              // oLink: The actual selected link in the editor.

  25              var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
  26              if ( oLink )
  27                  FCK.Selection.SelectNode( oLink ) ;
  28      
  29              window.onload = function ()    { 
  30                  // First of all, translates the dialog box texts.

  31                  oEditor.FCKLanguageManager.TranslatePage(document);
  32                  
  33                  LoadSelected();                            //See function below 

  34                  window.parent.SetOkButton( true );        //Show the "Ok" button. 

  35                  
  36              } 
  37               
  38              //If an anchor (A) object is currently selected, load the properties into the dialog 

  39  			function LoadSelected()    {
  40                  var sSelected;
  41                  
  42                  if ( oEditor.FCKBrowserInfo.IsGecko ) {
  43                      sSelected = FCK.EditorWindow.getSelection();
  44                  } else {
  45                      sSelected = FCK.EditorDocument.selection.createRange().text;
  46                  }
  47  
  48                  if ( sSelected == "" ) {
  49                      alert( 'Please select a text in order to create a (internal) link' );
  50                  }
  51  
  52              }
  53  
  54              //Code that runs after the OK button is clicked 

  55              function Ok() {
  56                  //Validate is option is selected

  57                  var oPageList = document.getElementById( 'cmbPages' ) ;
  58                  if(oPageList.selectedIndex == -1) {
  59                      alert('Please select a page in order to create a link');
  60                      return false;
  61                  }
  62                  
  63                  var oTagLink = document.getElementById( 'chkTaglink' );
  64                  
  65                  var txtTitle = document.getElementById( 'txtTitle' ).value;
  66                  
  67                  if (oTagLink.checked) {
  68                      //Create special CMS tag

  69                      var sSelected;
  70                      
  71                      if ( oEditor.FCKBrowserInfo.IsGecko ) {
  72                          sSelected = FCK.EditorWindow.getSelection();
  73                      } else {
  74                          sSelected = FCK.EditorDocument.selection.createRange().text;
  75                      }
  76                  
  77                      var sPageId = oPageList[oPageList.selectedIndex].value;
  78                      var sTagOutput = "";
  79                      
  80                      sTagOutput += "{cms_selflink page='" + sPageId + "'";
  81                      sTagOutput += " text='" + sSelected + "'";
  82                      if (txtTitle != "") {
  83                          sTagOutput += " title='" + txtTitle + "'";
  84                      }
  85                      //sTagOutput += " text='" + txtTitle + "'";

  86                      sTagOutput += "}";
  87                      
  88                      oEditor.FCK.InsertHtml( sTagOutput );
  89                                  
  90                  } else {
  91                      var sURL = document.getElementById( 'PageURL' ) ; 
  92                      var sPageId = oPageList[oPageList.selectedIndex].value;
  93                      oLink = oEditor.FCK.CreateLink( sURL.value + sPageId ) ;
  94                      SetAttribute( oLink, 'title'    , txtTitle ) ;
  95                      //SetAttribute( oLink, 'alt'    , txtAlt ) ;

  96                  }
  97                  return true;
  98              } 
  99              
 100          //-->

 101          </script>
 102      </head>
 103              
 104      <body scroll="no" >
 105      
 106           <input type="hidden" id="PageURL" value="<?php echo "index.php?".$config['query_var']."=" ?>" />
 107           <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> 
 108               <tr> 
 109                  <td>
 110                      <table width="100%">
 111                          <tr>
 112                              <td colspan="2"><span fckLang="DlgCMSCommentPageSelection">Select a CMS Page to link to:</span>&nbsp;</td>
 113                          </tr>
 114                          <tr>
 115                              <td colspan="2">
 116                                  <select id="cmbPages" style="WIDTH: 100%" size="8" name="cmbPages">
 117  <?php
 118                                  global $gCms;
 119                                  $contentops =& $gCms->GetContentOperations();
 120                                  $content_array = $contentops->GetAllContent(false);
 121                                  
 122                                  foreach ($content_array as $one) {
 123                                      if ($one->FriendlyName() == 'Separator') {
 124                                          continue;
 125                                      }
 126                                      echo "<option value=\"".$one->Alias()."\">".$one->Hierarchy()." ".$one->Name()."</option>";    
 127                                  }
 128  ?>
 129                                  </select>
 130                              </td>
 131                          </tr>
 132                          <tr>
 133                              <td nowrap><span fckLang="DlgCMSCommentTagLink">Generate Taglink?</span>&nbsp;</td>
 134                              <td><input id="chkTaglink" type="checkbox" name="chkTaglink" checked="checked" /></td>
 135                          </tr>
 136                          <tr>
 137                              <td nowrap align="right"><span fckLang="DlgCMSCommentTitle">Title:</span>&nbsp;</td>
 138                              <td width="100%" ><input id="txtTitle" style="WIDTH: 98%" type="text" name="txtTitle"></td>
 139                          </tr>
 140                      </table>
 141                  </td>
 142              </tr>
 143          </table>
 144          
 145      </body>
 146  </html> 


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7