Пример #1
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     $len = $this->length > 0 ? 'maxlength="' . $this->length . '" ' : '';
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><textarea rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $attrstr . ' ' . $len . $this->extra . '>' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea><br />' . '<a href="#" onclick="this.blur (); window.open (\'' . site_prefix() . '/index/cms-keywords-action?el=' . $this->name . '&sel=\' + document.forms[0].elements.' . $this->name . '.value, \'KeywordsWindow\', \'top=100,left=100,width=350,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,fullscreen=no\'); return false">' . intl_get('Global Keyword List') . '</a>' . '</td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Пример #2
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     $len = $this->length > 0 ? 'maxlength="' . $this->length . '" ' : '';
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $len . $this->extra . ' />' . ' &nbsp; <a href="#" onclick="window.open (\'' . site_prefix() . '/index/siteinvoice-currencies-action?sel=\' + document.forms[0].elements.' . $this->name . '.value, \'CurrencyWindow\', \'top=100,left=100,width=300,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,fullscreen=no\'); return false">Currency List</a>' . '</td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Пример #3
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     if (empty($this->data_value)) {
         if (empty($this->default_value)) {
             $this->data_value = session_username();
         } else {
             $this->data_value = $this->default_value;
         }
     }
     $adv = $this->advanced ? ' class="advanced"' : '';
     if ($generate_html) {
         return "\t" . '<tr' . $adv . '>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><strong>' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</strong><input type="hidden" name="' . $this->name . '" value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Пример #4
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     $len = $this->length > 0 ? 'maxlength="' . $this->length . '" ' : '';
     $adv = $this->advanced ? ' class="advanced"' : '';
     if ($this->reference !== false) {
         if (empty($this->reference)) {
             $this->reference = '&nbsp;';
         }
         $ref = '<td class="reference">' . $this->reference . '</td>';
     } else {
         $ref = '';
     }
     if ($generate_html) {
         return "\t" . '<tr' . $adv . '>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field">' . $this->prepend . '<input type="text" ' . $attrstr . ' value="' . str_replace('"', '&quot;', htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset)) . '" ' . $len . $this->extra . ' />' . $this->append . '</td>' . $ref . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Пример #5
0
    /**
     * Returns the display HTML for this widget.  The optional
     * parameter determines whether or not to automatically display the widget
     * nicely, or whether to simply return the widget (for use in a template).
     * 
     * @access	public
     * @param	boolean	$generate_html
     * @return	string
     * 
     */
    function display($generate_html = 0)
    {
        parent::display($generate_html);
        if ($this->cols == '') {
            $this->cols = 60;
        }
        if ($this->rows == '') {
            $this->rows = 16;
        }
        if ($this->isHtml) {
            page_add_script('/js/tiny_mce/tiny_mce.js');
            page_add_script(template_simple('
				tinyMCE.init ({
					mode : "textareas",
					theme : "advanced",
					editor_selector : "tinyarea",
					plugins : "{tinyPlugins}",
					relative_urls : false,
					theme_advanced_buttons1 : "{tinyButtons1}",
					theme_advanced_buttons2 : "{tinyButtons2}",
					theme_advanced_buttons3 : "{tinyButtons3}",
					theme_advanced_toolbar_location : "top",
					theme_advanced_toolbar_align : "left",
					theme_advanced_path_location : "bottom",
					extended_valid_elements : "{tinyValidElements}"
				});
			', $this));
        }
        $this->attrstr = $this->getAttrs();
        $this->label = template_simple($this->label_template, $this, '', true);
        if ($generate_html) {
            if ($this->labelPosition == 'left') {
                return template_simple($this->_template_left, $this);
            }
            return template_simple($this->_template_top, $this);
        }
        return template_simple($this->_template_no_table, $this);
    }
Пример #6
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     if ($this->cols == '') {
         $this->cols = 40;
     }
     if ($this->rows == '') {
         $this->rows = 8;
     }
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         if ($this->labelPosition == 'left') {
             return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
         } else {
             if (empty($this->alt)) {
                 return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
             } else {
                 return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
             }
         }
     } else {
         return '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
     }
 }
Пример #7
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     if ($this->filter) {
         if ($this->filter_import) {
             loader_import($this->filter_import);
         }
         $display = call_user_func($this->filter, $this->data_value);
     } else {
         $display = $this->data_value;
     }
     $disp = $display;
     if ($this->htmlentities) {
         $disp = htmlentities_compat($disp, ENT_COMPAT, $intl->charset);
     }
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field" valign="top"><strong>' . $disp . '</strong><input type="hidden" name="' . $this->name . '" value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Пример #8
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     if ($this->cols == '') {
         $this->cols = 40;
     }
     if ($this->rows == '') {
         $this->rows = 8;
     }
     $this->label_template = '{filter none}{display_value}{end filter}';
     $this->display_value = str_replace(array(' strong,', ' em,', ' a,', ' blockquote,', ' code)'), array(' <a href="#" onclick="return siteforum_insert_tag (\'strong\')">strong</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'em\')">em</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'a\')">a</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'blockquote\')">blockquote</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'code\')">code</a>)'), $this->display_value);
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         if ($this->labelPosition == 'left') {
             return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
         } else {
             return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
         }
     } else {
         return '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
     }
 }
Пример #9
0
    /**
     * Returns the display HTML for this widget.  The optional
     * parameter determines whether or not to automatically display the widget
     * nicely, or whether to simply return the widget (for use in a template).
     * 
     * @access	public
     * @param	boolean	$generate_html
     * @return	string
     * 
     */
    function display($generate_html = 0)
    {
        parent::display($generate_html);
        global $intl, $simple;
        if ($this->cols == '') {
            $this->cols = 40;
        }
        if ($this->rows == '') {
            $this->rows = 8;
        }
        $attrstr = $this->getAttrs();
        if ($generate_html) {
            static $script = false;
            if (!$script) {
                $out = '<script language="javascript" type="text/javascript">
					function xed_wysiwyg_popup (f, field_name) {
						form_name = "' . $this->form->name . '";
						window.open ("' . site_prefix() . '/index/xed-editor-action?template=' . $this->template . '&form_name=" + form_name + "&field_name=" + field_name + "&body=" + f.elements[field_name].value, "wysiwygEditor", "top=50,left=50,height=550,width=700,resizable=yes");
						return false;
					}
				</script>';
                $script = true;
            } else {
                $out = '';
            }
            if ($this->labelPosition == 'left') {
                return $out . "\n\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea><br />' . '<input type="submit" value="' . intl_get('WYSIWYG Editor') . '" onclick="return xed_wysiwyg_popup (this.form, \'' . $this->name . '\')" /></td>' . "\n\t" . '</tr>' . "\n";
            } else {
                return $out . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea><br />' . '<input type="submit" value="' . intl_get('WYSIWYG Editor') . '" onclick="return xed_wysiwyg_popup (this.form, \'' . $this->name . '\')" /></td>' . "\n\t" . '</tr>' . "\n";
            }
        } else {
            return '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
        }
    }
Пример #10
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl;
     $attrstr = $this->getAttrs();
     return '<input type="hidden" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
 }
Пример #11
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     if ($this->verify_method == 'turing') {
         loader_import('saf.Security.Turing');
         if (!TURING_TEST_GD_LOADED) {
             die('Your server does not have GD support, which is necessary to render the turing test for this form.');
         }
         $sec = new Security_Turing();
     } else {
         loader_import('saf.Security.Figlet');
         $sec = new Security_Figlet();
     }
     list($pre, $hash) = $sec->makeTest();
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label" colspan="2"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td></tr>' . "\n\t\t" . '<tr><td class="field" colspan="2">' . $pre . intl_get('Please type the letters and numbers you see above in the field below') . ':<br /><input type="hidden" name="' . $this->name . '_hash" value="' . $hash . '" /><input type="text" ' . $attrstr . '" maxlength="6" size="20" style="margin-top: 5px" ' . $this->extra . ' /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Пример #12
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     if ($this->cols == '') {
         $this->cols = 40;
     }
     if ($this->rows == '') {
         $this->rows = 8;
     }
     if ($this->reference !== false) {
         if (empty($this->reference)) {
             $this->reference = '&nbsp;';
         }
         $ref = '<td class="reference"><div style="overflow: auto; height: ' . 16 * $this->rows . '">' . $this->reference . '</div></td>';
         $refalt = '<td class="label">&nbsp;</td>';
     } else {
         $ref = '';
         $refalt = '';
     }
     if (!empty($this->prepend)) {
         $this->prepend = $this->prepend . '<br />';
     }
     if (!empty($this->append)) {
         $this->append = '<br />' . $this->append;
     }
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         if ($this->labelPosition == 'left') {
             return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field">' . $this->prepend . '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>' . $this->append . '</td>' . $ref . "\n\t" . '</tr>' . "\n";
         } else {
             if (empty($this->alt)) {
                 return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field">' . $this->prepend . '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>' . $this->append . '</td>' . $ref . "\n\t" . '</tr>' . "\n";
             } else {
                 return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . $refalt . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field">' . $this->prepend . '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>' . $this->append . '</td>' . $ref . "\n\t" . '</tr>' . "\n";
             }
         }
     } else {
         return '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
     }
 }
Пример #13
0
    function display($generate_html = 0)
    {
        parent::display($generate_html);
        global $intl, $simple, $cgi;
        // needs browser check to display textarea as alternative
        $this->initial_value = $this->formatValue($this->data_value);
        $this->scroller_data = $this->formatValue($this->scroller_data);
        if ($this->reference !== false) {
            if (empty($this->reference)) {
                $this->reference = '<br />';
            }
            $this->reference = $this->formatValue($this->reference);
        }
        loader_import('ext.phpsniff');
        $ua = new phpSniff();
        if ($ua->property('browser') == 'ie' && $ua->property('platform') == 'win' && $ua->property('version') >= '5.5' || $ua->property('browser') == 'mz' && $ua->property('version') >= '1.3' || $ua->property('browser') == 'ns' && $ua->property('version') >= '5.0' || $ua->property('browser') == 'fb' && $ua->property('version') >= '0.7' || $ua->property('browser') == 'ca' && $ua->property('version') >= '1.0' || $ua->property('browser') == 'sf' && $ua->property('version') >= '522' || strpos($ua->property('ua'), 'adobeair')) {
            // go xed
            if ($ua->property('browser') == 'ie') {
                $this->msie = true;
                if ($ua->property('version') >= '7.0') {
                    $this->msie7 = 'true';
                }
            }
            if ($ua->property('browser') == 'sf') {
                $this->safari = 'true';
            } elseif (strpos($ua->property('ua'), 'adobeair')) {
                $this->safari = 'true';
                $this->adobeair = 'true';
            }
            if (@file_exists('inc/html/' . conf('Server', 'default_template_set') . '/images.php')) {
                if ($cgi->_collection) {
                    $collection = $cgi->_collection;
                } elseif ($cgi->collection) {
                    $collection = $cgi->collection;
                } else {
                    $collection = false;
                }
                if ($collection) {
                    $images = ini_parse('inc/html/' . conf('Server', 'default_template_set') . '/images.php');
                    if (isset($images[$collection])) {
                        $this->max_height = $images[$collection]['max_height'];
                        $this->max_width = $images[$collection]['max_width'];
                        if ($images[$collection]['popup']) {
                            $this->img_popup = 'true';
                        } else {
                            $this->img_popup = 'false';
                        }
                    } else {
                        $this->max_height = 'false';
                        $this->max_width = 'false';
                        $this->img_popup = 'false';
                    }
                } else {
                    $this->max_height = 'false';
                    $this->max_width = 'false';
                    $this->img_popup = 'false';
                }
            } else {
                $this->max_height = 'false';
                $this->max_width = 'false';
                $this->img_popup = 'false';
            }
            // initialize modal dialog event handlers
            page_onload('xed_init (\'' . $this->name . '\')');
            page_onclick('checkModal ()');
            page_onfocus('return checkModal ()');
            template_bind('/html/body', '	<form style="display: inline" id="xed-' . $this->name . '-fsform" method="post" action="' . site_prefix() . '/index/xed-fullscreen-form" target="xedFullscreenWindow">
		<input type="hidden" name="ifname" value="' . $this->name . '" />
		<input type="hidden" name="xeditor" value="" />
	</form>');
            $this->templates = db_fetch_array('select * from xed_templates');
            foreach ($this->templates as $k => $t) {
                $this->templates[$k]->body = $this->formatValue($t->body);
            }
            $this->source_height = $this->height + 2;
            loader_import('saf.GUI.Prompt');
            $template = join('', file('inc/app/xed/html/xed.spt'));
            return template_simple($template, $this);
        } else {
            // return a textarea
            return '<tr><td class="field" colspan="2"><textarea name="' . $this->name . '" cols="50" rows="10">' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td></tr>';
        }
    }