/** * 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) { $_year = new MF_Widget_select('MF_' . $this->name . '_YEAR'); $_year->nullable = $this->nullable; $year_array = array(); for ($i = $this->highest_year; $i >= $this->lowest_year; $i--) { $year_array[$i] = $i; } $_year->setValues($year_array); $_year->data_value = $this->data_value_YEAR; $_month = new MF_Widget_select('MF_' . $this->name . '_MONTH'); $_month->nullable = $this->nullable; global $intl, $simple; if (is_object($intl)) { $_month->setValues(array('01' => $intl->get('January'), '02' => $intl->get('February'), '03' => $intl->get('March'), '04' => $intl->get('April'), '05' => $intl->get('May'), '06' => $intl->get('June'), '07' => $intl->get('July'), '08' => $intl->get('August'), '09' => $intl->get('September'), '10' => $intl->get('October'), '11' => $intl->get('November'), '12' => $intl->get('December'))); } else { $_month->setValues(array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December')); } $_month->data_value = $this->data_value_MONTH; $_day = new MF_Widget_select('MF_' . $this->name . '_DAY'); $_day->nullable = $this->nullable; $_day->setValues(array('01' => '1', '02' => '2', '03' => '3', '04' => '4', '05' => '5', '06' => '6', '07' => '7', '08' => '8', '09' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30', '31' => '31')); $_day->data_value = $this->data_value_DAY; if ($this->nullable || $this->addblank) { global $intl; if (is_object($intl)) { $_day->value[''] = $intl->get('Day'); $_month->value[''] = $intl->get('Month'); $_year->value[''] = $intl->get('Year'); } else { $_day->value[''] = 'Day'; $_month->value[''] = 'Month'; $_year->value[''] = 'Year'; } } $_year->extra = $this->extra; $_month->extra = $this->extra; $_day->extra = $this->extra; $_date = new MF_Widget_hidden($this->name); if ($generate_html) { $data = $_date->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\">" . $_month->display(0) . ' ' . $_day->display(0) . ' ' . $_year->display(0) . "</td>\n\t</tr>\n"; } else { $data = $_date->display(0); $data .= $_month->display(0) . ' ' . $_day->display(0) . ' ' . $_year->display(0); } return $data; }
/** * 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; }
/** * 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) { $_dl = new MF_Widget_select('MF_' . $this->name . '_DIRLIST'); $_dl->extra = $this->extra; $dir = new Dir($this->directory); if ($this->recursive == 0) { $list = $dir->read_all(); $goodlist = array(); $dir->close(); foreach ($list as $file) { if (!eregi('^\\.ht', $file) && (eregi('\\.(' . join('|', $this->extensions) . ')$', $file) || count($this->extensions) == 0) && $file != '.' && $file != '..') { $goodlist[$file] = $file; } } } else { $goodlist = array(); // recurse $list = $dir->find('*', $this->directory, 1); for ($i = 0; $i < count($list); $i++) { if (!@is_dir($list[$i]) && !eregi('^\\.ht', $list[$i]) && (eregi('\\.(' . join('|', $this->extensions) . ')$', $list[$i]) || count($this->extensions) == 0) && $list[$i] != '.' && $list[$i] != '..') { $list[$i] = preg_replace('/^' . preg_quote($this->directory . '/', '/') . '/', '', $list[$i]); $goodlist[$list[$i]] = $list[$i]; } } } $_dl->setValues($goodlist); $_dl->data_value = $this->data_value_DIRLIST; $_dirlist = new MF_Widget_hidden($this->name); $data = ''; if ($this->show_viewbutton) { global $intl; $data .= '<script language="JavaScript"> <!-- function ' . $this->name . '_preview (name, params, formname) { // get src from form widget path = "' . $this->web_path . '/' . '" + document.forms[formname].elements[name].options[document.forms[formname].elements[name].selectedIndex].value; pop = window.open (\'\', name, params); pop.document.open (); pop.document.write (\'<link rel="stylesheet" type="text/css" href="css/site.css" />\'); pop.document.write (\'<div align="center">\'); pop.document.write (\'<img src="\' + path + \'" alt="\' + name + \'" border="0" />\'); pop.document.write (\'<br /><br /><a href="#" onclick="window.close ()">' . $intl->get('Close Window') . '</a></div>\'); } // --> </script>'; $showbutton = ' <a href="#" onclick="' . $this->name . '_preview (\'MF_' . $this->name . '_DIRLIST\', \'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,dependent=no,fullscreen=no,width=300,height=300,top=50,left=160\', \'' . $this->formname . '\')">' . $intl->get('Preview') . '</a>'; } else { $showbutton = ''; } if ($generate_html) { $data .= $_dirlist->display(0) . "\n"; $data .= "\t<tr>\n\t\t<td>" . '<label for="' . $this->name . '"' . $this->invalid() . '>' . $this->display_value . "</label></td>\n\t\t<td>" . $_dl->display(0) . $showbutton . "</td>\n\t</tr>\n"; } else { $data .= $_dirlist->display(0); $data .= $_dl->display(0); $data .= $showbutton; } return $data; }
/** * 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) . ' : ' . $_minute->display(0) . ' : ' . $_second->display(0) . "</td>\n\t</tr>\n"; } else { $data = $_time->display(0); $data .= $_hour->display(0) . ' : ' . $_minute->display(0) . ' : ' . $_second->display(0); } return $data; }
/** * 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) . ' ' . $_select->display(0) . "</td>\n\t</tr>\n"; } else { $data = $_set->display(0); $data .= $_text->display(0) . ' ' . $_select->display(0); } return $data; }
/** * 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> </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} <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} <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} <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} <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; }
/** * 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_select('MF_' . $this->name . '_HOUR'); $_hour->nullable = $this->nullable; $_hour->setValues(array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12')); $_hour->data_value = $this->data_value_HOUR; $_minute = new MF_Widget_select('MF_' . $this->name . '_MINUTE'); $_minute->nullable = $this->nullable; $_minute->setValues(array(':00' => ':00', ':15' => ':15', ':30' => ':30', ':45' => ':45')); $_minute->data_value = $this->data_value_MINUTE; $_ampm = new MF_Widget_select('MF_' . $this->name . '_AMPM'); $_ampm->nullable = $this->nullable; $_ampm->setValues(array('am' => 'am', 'pm' => 'pm')); $_ampm->data_value = $this->data_value_AMPM; if ($this->nullable || $this->addblank) { global $intl; if (is_object($intl)) { $_ampm->value[''] = $intl->get('AM/PM'); $_minute->value[''] = $intl->get('Minute'); $_hour->value[''] = $intl->get('Hour'); } else { $_ampm->value[''] = 'AM/PM'; $_minute->value[''] = 'Minute'; $_hour->value[''] = 'Hour'; } } $_hour->extra = $this->extra; $_minute->extra = $this->extra; $_ampm->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) . ' ' . $_minute->display(0) . ' ' . $_ampm->display(0) . "</td>\n\t</tr>\n"; } else { $data = $_time->display(0); $data .= $_hour->display(0) . ' ' . $_minute->display(0) . ' ' . $_ampm->display(0); } return $data; }
/** * 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; $_date = new MF_Widget_date('MF_' . $this->name . '_DATE'); $_date->nullable = $this->nullable; $_date->addblank = $this->addblank; $_date->setValue($this->data_value_DATE_YEAR . '-' . $this->data_value_DATE_MONTH . '-' . $this->data_value_DATE_DAY); $_time = new MF_Widget_timeinterval('MF_' . $this->name . '_TIME'); $_time->nullable = $this->nullable; $_time->addblank = $this->addblank; $_time->setValue($_time->makeTime($this->data_value_TIME_HOUR, $this->data_value_TIME_MINUTE, $this->data_value_TIME_AMPM)); $_date->extra = $this->extra; $_time->extra = $this->extra; // echo '<pre>'; print_r ($this); print_r ($_date); echo "\n"; print_r ($_time); echo '</pre>'; $_datetime = new MF_Widget_hidden($this->name); if ($generate_html) { $data = $_datetime->display(0) . "\n"; $data .= "\t<tr>\n\t\t<td valign=\"top\" class=\"label\">" . '<label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . "</label></td>\n\t\t<td class=\"field\">" . $_date->display(0) . '<br />' . $_time->display(0) . "</td>\n\t</tr>\n"; } else { $data = $_datetime->display(0); $data .= $_date->display(0) . '<br />' . $_time->display(0); } return $data; }