示例#1
0
    require "../Connections/insetstuff.php";
    require "../Connections/dataactions.php";
    ob_end_flush();
}
if (isset($_GET['id'])) {
    $R__MMColParam = $_GET['id'];
} else {
    $R__MMColParam = "8000000";
}
$R = $dbcon->Execute("SELECT * FROM {$table} WHERE id = {$R__MMColParam}") or die($dbcon->ErrorMsg());
$rec_id =& new Input('hidden', 'MM_recordId', $_GET['id']);
//build form
$html = $buildform->start_table('name');
$html .= $buildform->add_header('Add/Edit ' . $listtitle, 'banner');
$html .= addfield('name', 'Template Name', 'text', $R->Fields("name"));
$html .= addfield('description', 'Template Description', 'textarea', $R->Fields("description"));
$html .= addfield('template', 'HTML Email Template<br>add [CONTENT] <br>where the content should appear', 'textarea', $R->Fields("template"));
$WYSIWYG = AMPFormElement_HTMLEditor::instance();
$WYSIWYG->addEditor('template');
$html .= $buildform->add_content($buildform->add_btn() . '&nbsp;' . $buildform->del_btn() . $rec_id->fetch());
$html .= $buildform->end_table();
$form =& new Form();
$form->set_contents($html);
include "header.php";
if ($_GET['action'] == "list") {
    listpage($listtitle, $listsql, $fieldsarray, $filename, $orderby, $sort, $extra);
} else {
    echo $form->fetch();
    echo $WYSIWYG->output();
}
include "footer.php";
示例#2
0
 function _awakenJS()
 {
     if (!AMP_USER_CONFIG_USE_WYSIWYG) {
         return;
     }
     if (array_search(getBrowser(), array('win/ie', 'mozilla')) === FALSE) {
         return;
     }
     $js_types = array('wysiwyg');
     foreach ($this->fields as $name => $field_def) {
         if (array_search($field_def['type'], $js_types) !== FALSE) {
             if (!isset($editor)) {
                 $editor =& AMPFormElement_HTMLEditor::instance();
             }
             $editor->addEditor($name);
         }
     }
 }
示例#3
0
 function HTMLEditorSetup($checkbox_fieldname = 'html')
 {
     require_once 'AMP/Form/ElementSwapScript.inc.php';
     $fieldswapper =& ElementSwapScript::instance();
     $fieldswapper->addSwapper($this->_editor_fieldswap_object_id);
     $fieldswapper->setForm($this->formname, $this->_editor_fieldswap_object_id);
     $fieldswapper->addSet('no_editor', array($checkbox_fieldname), $this->_editor_fieldswap_object_id);
     $fieldswapper->setInitialValue('no_editor', $this->_editor_fieldswap_object_id);
     $this->registerJavascript($fieldswapper->output());
     $editor =& AMPFormElement_HTMLEditor::instance();
     $editor->register_config_action('ActivateSwap( window.' . $this->_editor_fieldswap_object_id . ', "" );');
     $editor->register_config_action('document.forms["' . $this->formname . '"].elements["' . $checkbox_fieldname . '"].checked = true;');
     $this->_configHTMLEditor($editor);
 }
示例#4
0
?>
Content 
              Body</td>
          <tr> 
             <td colspan="2" valign="top" class="name">Full Text (not applicable 
              for offsite URLs)<br> 
                <textarea id="articlexin" name="article" rows="60" cols="80" WRAP="VIRTUAL" style = "width: 100%;"> 
                <?php 
print $type->Fields("test");
?>
</textarea><BR>
                <?php 
$current_browser = getBrowser();
if ($_COOKIE['AMPWYSIWYG'] != 'none' && ($current_browser == 'win/ie' or $current_browser == 'mozilla')) {
    print '<input name="html" type="hidden" value="1"><BR>';
    $editor =& AMPFormElement_HTMLEditor::instance();
    $editor->addEditor('articlexin');
    $editor->height = '800px';
    print $editor->output();
} else {
    print '<input name="html" type="checkbox" value="1"' . ($type->Fields("html") ? " CHECKED" : "") . ">HTML Override <br>";
}
?>
            </td>
          </tr>
          <tr class="intitle"> 
            <td colspan="2" valign="top"><?php 
echo helpme("image");
?>
Image (to 
              appear on front page and in first paragraph of article)</td>