Exemplo n.º 1
0
                   if (!$list) {
                       die('Invalid List');
                   }
                   $title = 'Edit Censor Word "' . $word['word'] . '"';
               } elseif ($request['listId']) {
                   // We are adding a word to a list.
                   $list = $database->getCensorList($request['listId']);
                   if (!$list) {
                       die('Invalid List');
                   }
                   $word = array('word' => '', 'wordId' => 0, 'severity' => 'replace', 'replacement' => '');
                   $title = 'Add Censor Word to "' . $list['listName'] . '"';
               } else {
                   die('Invalid params specified.');
               }
               $selectBlock = fimHtml_buildSelect('severity', array('replace' => 'replace', 'warn' => 'warn', 'confirm' => 'confirm', 'block' => 'block'), $word['severity']);
               echo container($title, '<form action="./moderate.php?do=censor&do2=editWord2" method="post">
 <table class="page ui-widget">
   <tr>
     <td>Text</td>
     <td>
       <input type="text" name="word" value="' . $word['word'] . '" /><br />
       <small>This is the word to be filtered or blocked out.</small>
     </td>
   </tr>
     <td>Severity:
     <td>
       ' . $selectBlock . '<br />
       <small>This is the type of filter to apply to the word. <tt>replace</tt> will replace the word above with the one below; <tt>warn</tt> warns the user upon sending the message, but sends the message without user intervention; <tt>confirm</tt> requires the user to confirm that they wish to send the message before it is sent; <tt>block</tt> outright blocks a user from sending the message - they will need to change the content of it first.</small>
     </td>
   </tr>
Exemplo n.º 2
0
                    case 'associative':
                        $valueBlock = '<textarea name="value">' . json_encode(json_decode($config2['value']), JSON_PRETTY_PRINT) . '</textarea>';
                        break;
                    default:
                        $valueBlock = '<input type="text" name="value" value="' . str_replace('"', '&quot;', $config2['value']) . '" />';
                }
                echo container($title, '<form action="./moderate.php?do=config&do2=edit2" method="post">
  <table class="ui-widget page">
    <tr>
      <td>Directive:</td>
      <td>' . ($config2['directive'] ? '<input type="hidden" name="newDirective" value="false" /><input type="hidden" name="directive" value="' . $config2['directive'] . '" />' . $config2['directive'] : '<input type="hidden" name="newDirective" value="true" /><input type="text" name="directive" value="' . $config2['directive'] . '" />') . '</td>
    </tr>
    <tr>
      <td>Type:</td>
      <td>
        ' . fimHtml_buildSelect('type', array('bool' => 'Boolean', 'integer' => 'Integer', 'float' => 'Float', 'string' => 'String', 'array' => 'Array', 'associative' => 'Associative Array'), $config2['type']) . '<br />
        <small>This is the type of the variable when interpreted. It should not normally be altered.</small>
      </td>
    </tr>
    <tr>
      <td>Value:</td>
      <td>
        ' . $valueBlock . '<br />
        <small>Note that for array types, values should be entered using comma-separated notation. You can escape commas in entries by prepending a "\\".</small>
      </td>
    </tr>
  </table>

  <button type="submit">Submit</button>
  <button type="reset">Reset</button>
</form>');