[ 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/CMSModules/ -> fck_cmsmodules.php (source)

   1  <?php
   2  
   3  $inclfilename = '../include.php';
   4  
   5  while(!@file_exists($inclfilename)){
   6              $inclfilename = "../".$inclfilename;
   7  }
   8  @require_once($inclfilename);
   9  
  10  if (!isset($_POST["Module"]))
  11    $_POST["Module"] = "";
  12  
  13  $modules  = Array();
  14  $list_par = Array();
  15  $i = 0;
  16  $j = 0;
  17  $sel = 0;
  18  $prec = 0;
  19  $suc = 0;
  20  
  21  foreach ($gCms->modules as $key => $value) 
  22  {
  23      $modules[$i] = $key;
  24      $moduless[$key] = $key;
  25      
  26      if ($_POST['Module'] == '' || $_POST['Module'] == $key)
  27      {
  28          foreach ($value['object']->GetParameters() as $key3 => $value3) 
  29          {
  30              $_POST['Module'] = $key;
  31              $sel = $i;
  32              
  33              if ($value3['name'] == 'lang')
  34                  continue;
  35      
  36              $list_par[$j] = Array(); 
  37              
  38              $list_par[$j][0] = $value3['name'];
  39              $list_par[$j][1] = $value3['default'];
  40              $list_par[$j][2] = $value3['help'];
  41              
  42              $j++;
  43          }
  44      }
  45      $i++;
  46  }
  47  
  48  if ($sel == 0)
  49      $prec = $modules[count($modules)-1];
  50  else
  51      $prec = $modules[$sel-1];
  52      
  53  if ($sel == (count($modules)-1))
  54      $suc = $modules[0];
  55  else
  56      $suc = $modules[$sel+1];
  57  
  58  ?>
  59  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  60  <html>
  61      <head>
  62          <title>CMS Modules - Insert CAL to CMS Made Simple Modules</title>
  63          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  64          <meta content="noindex, nofollow" name="robots">
  65          <script type="text/javascript">
  66          <!--
  67              var oEditor            = window.parent.InnerDialogLoaded(); 
  68              var FCK                = oEditor.FCK; 
  69              var FCKLang            = oEditor.FCKLang ;
  70              var FCKConfig        = oEditor.FCKConfig ;
  71              var FCKCMSCCMSModules    = oEditor.FCKCMSModules; 
  72               
  73      
  74              window.onload = function ()    { 
  75                  // First of all, translates the dialog box texts.

  76                  oEditor.FCKLanguageManager.TranslatePage(document);
  77                  
  78                  window.parent.SetOkButton( true );        //Show the "Ok" button.                 

  79              } 
  80           
  81  			function set_mod(who){
  82              
  83                  obj = document.getElementById('Module');
  84                  
  85                  obj.value = who;
  86                  
  87                  
  88                  form = document.getElementById('CMSModules');
  89                  
  90                  form.submit();
  91              }
  92          
  93          
  94  			function ricarica(){
  95              
  96                  cmb = document.getElementById('cmbModules');
  97                  mod = document.getElementById('Module');
  98                  
  99                  mod.value = cmb.value;
 100                  
 101                  form = document.getElementById('CMSModules');
 102                  
 103                  form.submit();
 104              }
 105              
 106              //Code that runs after the OK button is clicked 

 107              function Ok() {
 108                  //Validate is option is selected

 109                  var sTagOutput = "";
 110                  
 111                  cmbModules = document.getElementById('cmbModules').value;
 112                          
 113                  sTagOutput += "{cms_module module='"+cmbModules+"' ";
 114                  
 115                  n = document.getElementById('num_par').value;
 116                  
 117                  var params = Array();
 118  <?php
 119  foreach ($list_par as $i => $arr)
 120  {
 121  ?>
 122                  params[<?php echo $i; ?>] = "<?php echo $arr[0]; ?>"
 123  <?php
 124  }    
 125  ?>
 126                  
 127                  for(i=0;i<n;i++){
 128                      par  = document.getElementById('par'+i);
 129                      
 130                      if (par.value != "")
 131                      sTagOutput += " "+ params[i] +"='"+par.value+"' ";
 132                  }
 133                  
 134                  sTagOutput += "}";
 135                          
 136                  oEditor.FCK.InsertHtml( sTagOutput );
 137                  
 138                  return true;
 139              }
 140          //-->

 141          </script>
 142      </head>
 143              
 144      <body scroll="no" >
 145          <table width="100%">
 146              <tr>
 147                  <td colspan="2"><span fckLang="DlgCMSCommentPageSelection">Select a CMSMS module:</span>&nbsp;</td>
 148              </tr>
 149              <tr>
 150                  <td colspan="2">
 151                      <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" name="CMSModules" id="CMSModules">
 152                          <table width="100%">
 153                              <tr>
 154                                  <td align="center" colspan="2" width="100%">
 155  <?php
 156  echo $gCms->modules[$modules[$sel]]["object"]->CreateInputHidden("", "Module", $modules[$sel], ' id="Module" ');
 157  echo $gCms->modules[$modules[$sel]]["object"]->CreateInputSubmit("", "prec", "<<", ' onclick="set_mod(\''.$prec.'\');" ');
 158  echo '&nbsp;';
 159  echo $gCms->modules[$modules[$sel]]["object"]->CreateInputDropdown("", "cmbModules", $moduless, $sel, $modules[$sel], ' id="cmbModules" onchange="ricarica();" ');
 160  echo $gCms->modules[$modules[$sel]]["object"]->CreateInputSubmit("", "suc", ">>", ' onclick="set_mod(\''.$suc.'\');" ');
 161  ?>
 162                                  </td>
 163                              </tr>
 164                              <tr>
 165                                  <td align="right" width="50%"></td>
 166                                  <td align="left" width="50%">
 167                                      <?php echo $gCms->modules[$modules[$sel]]["object"]->CreateInputHidden("", "num_par", count($list_par), ' id="num_par" '); ?>
 168                                    </td>
 169                              </tr>
 170  <?php
 171  
 172  for($i=0;$i<count($list_par);$i++) 
 173  {
 174  ?>
 175                              <tr>
 176                                  <td align="right">
 177                                      <?php echo $list_par[$i][0]; ?>
 178                                  </td>
 179                                  <td align="left">
 180                                      <?php echo $gCms->modules[$modules[$sel]]["object"]->CreateInputText("", 'par' . $i, $list_par[$i][1], '', '', ''); ?>
 181                                  </td>
 182                              </tr>
 183                              <tr>
 184                                  <td align="left" colspan="2">
 185                                      <i><?php echo $list_par[$i][2] ?></i><br/>
 186                                      <br/>
 187                                  </td>
 188                              </tr>
 189  <?php
 190  }
 191  ?>
 192                           </table>
 193                      </form>
 194                  </td>
 195              </tr>
 196          </table>
 197      </body>
 198  </html> 


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