Ejemplo n.º 1
0
 function onSubmit($vals)
 {
     page_onload(false);
     page_onclick(false);
     page_onfocus(false);
     echo '<ul><li><a href="#rendered">Rendered HTML</a></li><li><a href="#source">HTML Source</a></li><li><a href="xed-example-form">Back</a></li></ul>';
     echo '<a name="rendered"></a><h2>Rendered HTML:</h2><div style="border: #369 1px dashed; padding: 10px; width: 600px">';
     echo $vals['xeditor'];
     echo '<br clear="all" /></div><p><a href="#top">[ top ]</a></p><a name="source"></a><h2>HTML Source:</h2><div style="border: #369 1px dashed">';
     echo '<pre>' . htmlentities($vals['xeditor']) . '</pre></div>';
 }
Ejemplo n.º 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)
 {
     global $simple;
     if ($this->setPath && $this->path) {
         session_set('filechooser_path', $this->path);
     }
     // initialize modal dialog event handlers
     static $included = false;
     if (!$included) {
         page_onclick('checkModal ()');
         page_onfocus('return checkModal ()');
         $included = true;
     }
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         return "\t" . '<tr>' . "\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"><input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value) . '" ' . $this->extra . ' />&nbsp;' . $this->_link() . '</td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="file" ' . $attrstr . ' value="" ' . $this->extra . ' />';
     }
 }
Ejemplo n.º 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)
    {
        global $simple;
        // initialize modal dialog event handlers
        static $included = false;
        if (!$included) {
            page_onclick('checkModal ()');
            page_onfocus('return checkModal ()');
            $included = true;
        }
        $attrstr = $this->getAttrs();
        if ($generate_html) {
            return '<tr>
				<td class="label"' . $this->invalid() . '>
					<label for="' . $this->name . '" id="' . $this->name . '-label">' . $simple->fill($this->label_template, $this, '', true) . '</label>
				</td>
				<td class="field">
					<input type="hidden" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value) . '" ' . $this->extra . ' />
					<table border="0" cellpadding="3" cellspacing="0" width="100%">
						<tr>
							<td width="60%">
								<span id="mf-pagechooser-' . pagebrowser_filter_name($this->name) . '-display" style="font-weight: bold">' . $this->displayValue($this->data_value) . '</span>
							</td>
							<td width="40%">
								' . $this->_link() . '
							</td>
						</tr>
					</table>
				</td>
			</tr>';
            //return "\t" . '<tr>' . "\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"><input type="hidden" ' . $attrstr . ' value="' . htmlentities_compat ($this->data_value) . '" ' . $this->extra . ' />&nbsp;' . $this->_link () . '</td>' . "\n\t" . '</tr>' . "\n";
        } else {
            return '<input type="hidden" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value) . '" ' . $this->extra . ' />
				<table border="0" cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td width="50%">
							<span id="mf-pagechooser-' . pagebrowser_filter_name($this->name) . '-display" style="font-weight: bold">' . $this->displayValue($this->data_value) . '</span>
						</td>
						<td width="50%" align="right">
							' . $this->_link() . '
						</td>
					</tr>
				</table>';
        }
    }
Ejemplo n.º 4
0
 function onSubmit($vals)
 {
     page_onload(false);
     page_onclick(false);
     page_onfocus(false);
 }
Ejemplo n.º 5
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>';
        }
    }