home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / CMS / xoops-2.0.18.1.exe / xoops-2.0.18.1 / htdocs / include / xoopscodes.php < prev   
Encoding:
PHP Script  |  2008-01-26  |  7.5 KB  |  91 lines

  1. <?php
  2. // $Id: xoopscodes.php 1276 2008-01-26 06:31:31Z phppp $
  3. //  ------------------------------------------------------------------------ //
  4. //                XOOPS - PHP Content Management System                      //
  5. //                    Copyright (c) 2000 XOOPS.org                           //
  6. //                       <http://www.xoops.org/>                             //
  7. //  ------------------------------------------------------------------------ //
  8. //  This program is free software; you can redistribute it and/or modify     //
  9. //  it under the terms of the GNU General Public License as published by     //
  10. //  the Free Software Foundation; either version 2 of the License, or        //
  11. //  (at your option) any later version.                                      //
  12. //                                                                           //
  13. //  You may not change or alter any portion of this comment or credits       //
  14. //  of supporting developers from this source code or any supporting         //
  15. //  source code which is considered copyrighted (c) material of the          //
  16. //  original comment or credit authors.                                      //
  17. //                                                                           //
  18. //  This program is distributed in the hope that it will be useful,          //
  19. //  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
  20. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
  21. //  GNU General Public License for more details.                             //
  22. //                                                                           //
  23. //  You should have received a copy of the GNU General Public License        //
  24. //  along with this program; if not, write to the Free Software              //
  25. //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
  26. //  ------------------------------------------------------------------------ //
  27. // Author: Kazumi Ono (AKA onokazu)                                          //
  28. // URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
  29. // Project: The XOOPS Project (http://www.xoops.org/)                        //
  30. // ------------------------------------------------------------------------- //
  31.  
  32. /*
  33. *  displayes xoopsCode buttons and target textarea to which xoopscodes are inserted
  34. *  $textarea_id is a unique id of the target textarea
  35. */
  36. function xoopsCodeTarea($textarea_id, $cols=60, $rows=15, $suffix=null)
  37. {
  38.     $hiddentext = isset($suffix) ? 'xoopsHiddenText'.trim($suffix) : 'xoopsHiddenText';
  39.     //Hack for url, email ...., the anchor is for having a link on [_More...]
  40.     echo "<a name='moresmiley'></a><img src='".XOOPS_URL."/images/url.gif' alt='url' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeUrl(\"$textarea_id\", \"".htmlspecialchars(_ENTERURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES)."\");'/> <img src='".XOOPS_URL."/images/email.gif' alt='email' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeEmail(\"$textarea_id\", \"".htmlspecialchars(_ENTEREMAIL, ENT_QUOTES)."\");' /> <img src='".XOOPS_URL."/images/imgsrc.gif' alt='imgsrc' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeImg(\"$textarea_id\", \"".htmlspecialchars(_ENTERIMGURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES)."\", \"".htmlspecialchars(_IMGPOSRORL, ENT_QUOTES)."\", \"".htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES)."\");' /> <img src='".XOOPS_URL."/images/image.gif' alt='image' onmouseover='style.cursor=\"hand\"' onclick='openWithSelfMain(\"".XOOPS_URL."/imagemanager.php?target=".$textarea_id."\",\"imgmanager\",400,430);' /> <img src='".XOOPS_URL."/images/code.gif' alt='code' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeCode(\"$textarea_id\", \"".htmlspecialchars(_ENTERCODE, ENT_QUOTES)."\");' /> <img src='".XOOPS_URL."/images/quote.gif' alt='quote' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeQuote(\"$textarea_id\");'/><br />\n";
  41.  
  42.     $sizearray = array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large");
  43.     echo "<select id='".$textarea_id."Size' onchange='setVisible(\"xoopsHiddenText\");setElementSize(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
  44.     echo "<option value='SIZE'>"._SIZE."</option>\n";
  45.     foreach ( $sizearray as $size ) {
  46.         echo "<option value='$size'>$size</option>\n";
  47.     }
  48.     echo "</select>\n";
  49.  
  50.     $fontarray = array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana");
  51.     echo "<select id='".$textarea_id."Font' onchange='setVisible(\"xoopsHiddenText\");setElementFont(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
  52.     echo "<option value='FONT'>"._FONT."</option>\n";
  53.     foreach ( $fontarray as $font ) {
  54.         echo "<option value='$font'>$font</option>\n";
  55.     }
  56.     echo "</select>\n";
  57.  
  58.     $colorarray = array("00", "33", "66", "99", "CC", "FF");
  59.     echo "<select id='".$textarea_id."Color' onchange='setVisible(\"xoopsHiddenText\");setElementColor(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
  60.     echo "<option value='COLOR'>"._COLOR."</option>\n";
  61.     foreach ( $colorarray as $color1 ) {
  62.         foreach ( $colorarray as $color2 ) {
  63.             foreach ( $colorarray as $color3 ) {
  64.                 echo "<option value='".$color1.$color2.$color3."' style='background-color:#".$color1.$color2.$color3.";color:#".$color1.$color2.$color3.";'>#".$color1.$color2.$color3."</option>\n";
  65.             }
  66.         }
  67.     }
  68.     echo "</select><span id='".$hiddentext."'>"._EXAMPLE."</span>\n";
  69.  
  70.     echo "<br />\n";
  71.     //Hack smilies move for bold, italic ...
  72.     $areacontent = isset( $GLOBALS[$textarea_id] ) ? $GLOBALS[$textarea_id] : '';
  73.     echo "<img src='".XOOPS_URL."/images/bold.gif' alt='bold' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeBold(\"".$hiddentext."\");' /> <img src='".XOOPS_URL."/images/italic.gif' alt='italic' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeItalic(\"".$hiddentext."\");' /> <img src='".XOOPS_URL."/images/underline.gif' alt='underline' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeUnderline(\"".$hiddentext."\");'/> <img src='".XOOPS_URL."/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeLineThrough(\"".$hiddentext."\");' /></a> <input type='text' id='".$textarea_id."Addtext' size='20' /> <input type='button' onclick='xoopsCodeText(\"$textarea_id\", \"".$hiddentext."\", \"".htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES)."\")' value='"._ADD."' /><br /><br /><textarea id='".$textarea_id."' name='".$textarea_id."' cols='$cols' rows='$rows'>".$areacontent."</textarea><br />\n";
  74.     //Fin du hack
  75. }
  76.  
  77. /*
  78. *  Displays smilie image buttons used to insert smilie codes to a target textarea in a form
  79. * $textarea_id is a unique of the target textarea
  80. */
  81. function xoopsSmilies($textarea_id)
  82. {
  83.     $myts =& MyTextSanitizer::getInstance();
  84.     $smiles = $myts->getSmileys( FALSE );
  85.     $count = count($smiles);
  86.     for ($i = 0; $i < $count; $i++) {
  87.         echo "<img src='".XOOPS_UPLOAD_URL."/".htmlspecialchars($smiles[$i]['smile_url'], ENT_QUOTES)."' border='0' alt='' onclick='xoopsCodeSmilie(\"".$textarea_id."\", \" ".$smiles[$i]['code']." \");' onmouseover='style.cursor=\"hand\"' />";
  88.     }
  89.     echo " [<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt='' onclick='openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&type=smilies&target=".$textarea_id."\",\"smilies\",300,475);'>"._MORE."</a>]";
  90. }
  91. ?>