Example #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)
    {
        $_inner = new MF_Widget_pagebrowser('MF_' . $this->name . '_INNER');
        //$_inner->nullable = $this->nullable;
        //$_inner->table = 'sitellite_page';
        //$_inner->primary_key = 'id';
        //$_inner->display_column = 'if(nav_title != "", nav_title, if(title != "", title, id))';
        //$_inner->ref_column = 'below_page';
        //$_inner->self_ref = true;
        //$_inner->addblank = true;
        $_inner->alt = intl_get('Internal');
        $_inner->data_value = $this->data_value_INNER;
        $_extern = new MF_Widget_text('MF_' . $this->name . '_EXTERN');
        $_extern->nullable = $this->nullable;
        $_extern->alt = intl_get('External');
        $_extern->data_value = $this->data_value_EXTERN;
        //$_inner->extra = $this->extra;
        $_extern->extra = $this->extra;
        $_page = new MF_Widget_hidden($this->name);
        if ($generate_html) {
            page_add_script(site_prefix() . '/js/dialog.js');
            page_add_script(loader_box('filechooser/js'));
            $data = $_page->display(0) . "\n";
            $data .= "\t<tr>\n\t\t<td class=\"label\" valign=\"top\"><label for=\"" . $this->name . '" id="' . $this->name . '-label" ' . $this->invalid() . '>' . template_simple($this->label_template, $this, '', true) . "</label></td>\n\t\t<td class=\"field\">" . '<table border="0" cellpadding="2" cellspacing="2"><tr><td>' . intl_get('Internal') . '</td><td>' . $_inner->display(0) . '</td></tr><td>' . intl_get('External') . '</td><td>' . $_extern->display(0);
            $data .= template_simple('
				<script language="javascript" type="text/javascript">

					function filechooser_handler () {
						if (typeof dialogWin.returnedValue == \'object\') {
							url = \'{site/prefix}\' + dialogWin.returnedValue[\'src\'];
						} else {
							url = \'{site/prefix}\' + dialogWin.returnedValue;
						}
						filechooser_form.elements[\'MF_\' + filechooser_element + \'_EXTERN\'].value = url;
					}

					var bookmark_form = false;
					var bookmark_element = false;
					dialogWin.scrollbars = \'yes\';
					dialogWin.resizable = \'yes\';
					function bookmark () {
						openDGDialog (
							\'{site/prefix}/index/xed-bookmarks-action\',
							400,
							300,
							bookmark_handler
						);
					}

					function bookmarks (f, e) {
						bookmark_form = f;
						bookmark_element = e;
						bookmark ();
						return false;
					}

					function bookmark_handler () {
						if (typeof dialogWin.returnedValue == \'object\') {
							url = dialogWin.returnedValue[\'src\'];
						} else {
							url = dialogWin.returnedValue;
						}
						bookmark_form.elements[\'MF_\' + bookmark_element + \'_EXTERN\'].value = url;
					}

				</script>

				<input type="submit" onclick="bookmarks (this.form, \'{name}\'); return false" value="{intl Bookmarks}" />
				<input type="submit" onclick="filechooser_get_file (this.form, \'{name}\'); return false" value="{intl Files}" />
			', $this);
            $data .= '</td></tr></table>' . "</td>\n\t</tr>\n";
        } else {
            $data = $_page->display(0);
            $data .= $_inner->display(0) . '<br />' . $_extern->display(0);
        }
        return $data;
    }
Example #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 $intl, $simple;
     $_text = new MF_Widget_text('MF_' . $this->name . '_TEXT');
     $_text->nullable = $this->nullable;
     $_text->data_value = $this->data_value_TEXT;
     $_select = new MF_Widget_select('MF_' . $this->name . '_SELECT');
     $_select->nullable = $this->nullable;
     $_select->setValues($this->value);
     $_select->data_value = $this->data_value_SELECT;
     $_text->extra = $this->extra;
     $_select->extra = $this->extra;
     $_set = new MF_Widget_hidden($this->name);
     if ($generate_html) {
         $data = $_set->display(0) . "\n";
         $data .= "\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\">" . $_text->display(0) . '&nbsp;' . $_select->display(0) . "</td>\n\t</tr>\n";
     } else {
         $data = $_set->display(0);
         $data .= $_text->display(0) . '&nbsp;' . $_select->display(0);
     }
     return $data;
 }
Example #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)
 {
     $_hour = new MF_Widget_text('MF_' . $this->name . '_HOUR');
     $_hour->nullable = $this->nullable;
     $_hour->data_value = $this->data_value_HOUR;
     $_hour->extra = 'size="2"';
     $_minute = new MF_Widget_text('MF_' . $this->name . '_MINUTE');
     $_minute->nullable = $this->nullable;
     $_minute->data_value = $this->data_value_MINUTE;
     $_minute->extra = 'size="2"';
     $_second = new MF_Widget_text('MF_' . $this->name . '_SECOND');
     $_second->nullable = $this->nullable;
     $_second->data_value = $this->data_value_SECOND;
     $_second->extra = 'size="2"';
     //$_hour->extra = $this->extra;
     //$_minute->extra = $this->extra;
     //$_second->extra = $this->extra;
     $_time = new MF_Widget_hidden($this->name);
     if ($generate_html) {
         $data = $_time->display(0) . "\n";
         $data .= "\t<tr>\n\t\t<td class=\"label\">" . '<label for="' . $this->name . '"' . $this->invalid() . '>' . $this->display_value . "</label></td>\n\t\t<td class=\"field\">" . $_hour->display(0) . '&nbsp;:&nbsp;' . $_minute->display(0) . '&nbsp;:&nbsp;' . $_second->display(0) . "</td>\n\t</tr>\n";
     } else {
         $data = $_time->display(0);
         $data .= $_hour->display(0) . '&nbsp;:&nbsp;' . $_minute->display(0) . '&nbsp;:&nbsp;' . $_second->display(0);
     }
     return $data;
 }
Example #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)
    {
        $_inner = new MF_Widget_pagebrowser('MF_' . $this->name . '_INNER');
        //$_inner->nullable = $this->nullable;
        //$_inner->table = 'sitellite_page';
        //$_inner->primary_key = 'id';
        //$_inner->display_column = 'if(nav_title != "", nav_title, if(title != "", title, id))';
        //$_inner->ref_column = 'below_page';
        //$_inner->self_ref = true;
        //$_inner->addblank = true;
        $_inner->alt = intl_get('Internal');
        $_inner->data_value = $this->data_value_INNER;
        $_extern = new MF_Widget_text('MF_' . $this->name . '_EXTERN');
        $_extern->nullable = $this->nullable;
        $_extern->alt = intl_get('External');
        $_extern->data_value = $this->data_value_EXTERN;
        $this->extra .= ' size="35"';
        //$_inner->extra = $this->extra;
        $_extern->extra = $this->extra;
        $_page = new MF_Widget_hidden($this->name);
        if ($generate_html) {
            page_add_script(site_prefix() . '/js/dialog.js');
            page_add_script(loader_box('filechooser/js'));
            $data = $_page->display(0) . "\n";
            $data .= "\t<tr>\n\t\t<td class=\"label\" valign=\"top\"><label for=\"" . $this->name . '" id="' . $this->name . '-label" ' . $this->invalid() . '>' . template_simple($this->label_template, $this, '', true) . "</label>&nbsp;&nbsp;</td>\n\t\t<td class=\"field\">" . '<table border="0" cellpadding="2" cellspacing="2"><tr><td valign="top">' . $_inner->display(0) . '</td></tr><td valign="top">' . $_extern->display(0);
            $data .= template_simple('
				<script language="javascript" type="text/javascript">

					function filechooser_handler () {
						if (typeof dialogWin.returnedValue == \'object\') {
							url = \'{site/prefix}\' + dialogWin.returnedValue[\'src\'];
						} else {
							url = \'{site/prefix}\' + dialogWin.returnedValue;
						}
						filechooser_form.elements[\'MF_\' + filechooser_element + \'_EXTERN\'].value = url;
					}

					var bookmark_form = false;
					var bookmark_element = false;
					dialogWin.scrollbars = \'yes\';
					dialogWin.resizable = \'yes\';
					function bookmark () {
						openDGDialog (
							\'{site/prefix}/index/xed-bookmarks-action\',
							400,
							300,
							bookmark_handler
						);
					}

					function bookmarks (f, e) {
						bookmark_form = f;
						bookmark_element = e;
						bookmark ();
						return false;
					}

					function mailto (f, e) {
						v = f.elements[\'MF_\' + e + \'_EXTERN\'].value;
						i = v.indexOf (\'mailto:\', 0);
						if (i >= 0) {
							return false;
						}
						f.elements[\'MF_\' + e + \'_EXTERN\'].value = \'mailto:\' + v;
						return false;
					}

					function bookmark_handler () {
						if (typeof dialogWin.returnedValue == \'object\') {
							url = dialogWin.returnedValue[\'src\'];
						} else {
							url = dialogWin.returnedValue;
						}
						bookmark_form.elements[\'MF_\' + bookmark_element + \'_EXTERN\'].value = url;
					}

					var anchor_form = false;
					var anchor_element = false;
					dialogWin.scrollbars = \'yes\';
					dialogWin.resizable = \'yes\';
					function anchor (anchor_list) {
						params = \'\';
						sep = \'?\';
						for (i = 0; i < anchor_list.length; i++) {
							params += sep + anchor_list[i].name + \'=\' + anchor_list[i].value;
							sep = \'&\';
						}
						openDGDialog (
							\'{site/prefix}/index/xed-anchors-action\' + params,
							400,
							300,
							anchor_handler
						);
					}

					function go_anchors (f, e) {
						anchor_form = f;
						anchor_element = e;
						anchor_list = opener.document.getElementById (f.elements[\'ifname\'].value).xed_get_anchors (f.elements[\'ifname\'].value);
						anchor (anchor_list);
						return false;
					}

					function anchor_handler () {
						if (typeof dialogWin.returnedValue == \'object\') {
							a = dialogWin.returnedValue[\'src\'];
						} else {
							a = dialogWin.returnedValue;
						}
						anchor_form.elements[\'MF_\' + anchor_element + \'_EXTERN\'].value = \'#\' + a;
					}

				</script>

				{if obj.files}&nbsp;<a href="#" onclick="filechooser_get_file (document.forms[0], \'{name}\'); return false"><img src="{site/prefix}/inc/app/cms/pix/icons/files.gif" alt="{intl Files}" title="{intl Files}" border="0" /></a>{end if}
				{if obj.email}&nbsp;<a href="#" onclick="mailto (document.forms[0], \'{name}\'); return false"><img src="{site/prefix}/inc/app/cms/pix/icons/email.gif" alt="{intl Email}" title="{intl Email}" border="0" /></a>{end if}
				{if obj.bookmarks}&nbsp;<a href="#" onclick="bookmarks (document.forms[0], \'{name}\'); return false"><img src="{site/prefix}/inc/app/cms/pix/icons/bookmark-darker.gif" alt="{intl Bookmarks}" title="{intl Bookmarks}" border="0" /></a>{end if}
				{if obj.anchors}&nbsp;<a href="#" onclick="go_anchors (document.forms[0], \'{name}\'); return false"><img src="{site/prefix}/inc/app/cms/pix/icons/anchor.gif" alt="{intl Anchors}" title="{intl Anchors}" border="0" /></a>{end if}
				<!-- input type="submit" onclick="bookmarks (this.form, \'{name}\'); return false" value="{intl Bookmarks}" />
				<input type="submit" onclick="filechooser_get_file (this.form, \'{name}\'); return false" value="{intl Files}" / -->
			', $this);
            $data .= '</td></tr></table>' . "</td>\n\t</tr>\n";
        } else {
            $data = $_page->display(0);
            $data .= $_inner->display(0) . '<br />' . $_extern->display(0);
        }
        return $data;
    }