[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/lib/editor/htmlarea/popups/ -> dlg_ins_smile.php (source)

   1  <?php
   2  
   3  #################################################################################
   4  ##
   5  ## $Id: dlg_ins_smile.php,v 1.6 2007/01/27 23:23:45 skodak Exp $
   6  ##
   7  #################################################################################
   8  
   9      require("../../../../config.php");
  10  
  11      $id = optional_param('id', SITEID, PARAM_INT);
  12  
  13      require_course_login($id);
  14      @header('Content-Type: text/html; charset=utf-8');
  15  
  16      $pixpath = "$CFG->pixpath/s";
  17  
  18      $fullnames = get_list_of_pixnames();
  19  
  20      $emoticons = array ( 'smiley'     => ':-)',
  21                           'biggrin'    => ':-D',
  22                           'wink'       => ';-)',
  23                           'mixed'      => ':-/',
  24                           'thoughtful' => 'V-.',
  25                           'tongueout'  => ':-P',
  26                           'cool'       => 'B-)',
  27                           'approve'    => '^-)',
  28                           'wideeyes'   => '8-)',
  29                           'clown'      => ':o)',
  30                           'sad'        => ':-(',
  31                           'shy'        => '8-.',
  32                           'blush'      => ':-I',
  33                           'kiss'       => ':-X',
  34                           'surprise'   => '8-o',
  35                           'blackeye'   => 'P-|',
  36                           'angry'      => '8-[',
  37                           'dead'       => 'xx-P',
  38                           'sleepy'     => '|-.',
  39                           'evil'       => '}-]' );
  40  
  41  ?>
  42  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  43      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  44  <html>
  45  <head>
  46  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  47  <title><?php print_string('insertsmile', 'editor'); ?></title>
  48  <link rel="stylesheet" href="dialog.css" type="text/css" />
  49  <script type="text/javascript" src="popup.js"></script>
  50  <script type="text/javascript">
  51  //<![CDATA[
  52  function Init() {
  53    __dlg_init();
  54  }
  55  function attr(name, value) {
  56      if (!value || value == "") return "";
  57      return ' ' + name + '="' + value + '"';
  58  }
  59  function insert(img,text) {
  60      if (img) {
  61              var strImage = img;
  62              var strAlt = text;
  63              var imgString = "<img src=\"" + strImage +"\" alt=\"" + strAlt +"\" title=\"" + strAlt +"\" />";
  64      }
  65    // pass data back to the calling window
  66    __dlg_close(imgString);
  67    return false;
  68  };
  69  
  70  function cancel() {
  71    __dlg_close(null);
  72    return false;
  73  };
  74  //]]>
  75  </script>
  76  </head>
  77  <body onload="Init()">
  78  <table class="dlg" cellpadding="0" cellspacing="2" width="100%">
  79  <tr><td><table width="100%"><tr><td class="title" nowrap="nowrap"><?php print_string('chooseicon', 'editor'); ?></td></tr></table></td></tr>
  80  <tr>
  81  <td>
  82      <table border="0" align="center" cellpadding="5">
  83        <tr valign="top">
  84          <td>
  85          <table border="0">
  86  <?php
  87          $list = array('smiley', 'biggrin', 'wink', 'mixed', 'thoughtful',
  88                        'tongueout', 'cool', 'approve', 'wideeyes', 'surprise');
  89          foreach ($list as $image) {
  90              $name = $fullnames[$image];
  91              $icon = $emoticons[$image];
  92              echo '<tr>';
  93              echo "<td><img alt=\"$name\" class=\"icon\" src=\"$pixpath/$image.gif\" ".
  94                   " onclick=\"insert('$pixpath/$image.gif','$name')\" /></td>";
  95              echo "<td>$name</td>";
  96              echo "<td class=\"smile\">$icon</td>";
  97              echo "</tr>";
  98          }
  99  ?>
 100          </table>
 101          </td>
 102          <td>
 103          <table border="0" align="center">
 104  
 105  <?php
 106          $list = array('sad', 'shy', 'blush', 'kiss', 'clown', 'blackeye',
 107                        'angry', 'dead', 'sleepy', 'evil');
 108          foreach ($list as $image) {
 109              $name = $fullnames[$image];
 110              $icon = $emoticons[$image];
 111              echo '<tr>';
 112              echo "<td><img alt=\"$name\" class=\"icon\" src=\"$pixpath/$image.gif\" ".
 113                   " onclick=\"insert('$pixpath/$image.gif','$name')\" /></td>";
 114              echo "<td>$name</td>";
 115              echo "<td class=\"smile\">$icon</td>";
 116              echo "</tr>";
 117          }
 118  ?>
 119          </table>
 120          </td>
 121        </tr>
 122      </table>
 123  
 124      </td>
 125    </tr>
 126  <tr><td><table width="100%"><tr><td valign="middle" width="90%"><hr width="100%" /></td></tr></table></td></tr>
 127  <tr><td align="right">
 128      <button type="button" onclick="return cancel();"><?php print_string('close', 'editor'); ?></button></td></tr>
 129  </table>
 130  </body>
 131  </html>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7