Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
DHTML_Calendar Class Reference

List of all members.

Public Member Functions

 DHTML_Calendar ($calendar_lib_path= '/calendar/', $lang= 'en', $theme= 'calendar-win2k-1', $stripped=true)
 set_option ($name, $value)
 load_files ()
 get_load_files_code ()
 _make_calendar ($other_options=array())
 make_input_field ($cal_options=array(), $field_attributes=array())
 _field_id ($id)
 PRIVATE SECTION.
 _trigger_id ($id)
 _gen_id ()
 _make_js_hash ($array)
 _make_html_attr ($array)

Public Attributes

 $calendar_lib_path
 $calendar_file
 $calendar_lang_file
 $calendar_setup_file
 $calendar_theme_file
 $calendar_options

Detailed Description

Definition at line 15 of file calendar.php.


Member Function Documentation

PRIVATE SECTION.

Definition at line 91 of file calendar.php.

{ return 'f-calendar-field-' . $id; }

Here is the caller graph for this function:

Definition at line 93 of file calendar.php.

{ static $id = 0; return ++$id; }

Here is the caller graph for this function:

DHTML_Calendar::_make_calendar ( other_options = array())

Definition at line 66 of file calendar.php.

                                                      {
        $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
        $code  = ( '<script type="text/javascript">Calendar.setup({' .
                   $js_options .
                   '});</script>' );
        return $code;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 109 of file calendar.php.

                                     {
        $attrstr = '';
        reset($array);
        while (list($key, $val) = each($array)) {
            $attrstr .= $key . '="' . $val . '" ';
        }
        return $attrstr;
    }

Here is the caller graph for this function:

Definition at line 95 of file calendar.php.

                                   {
        $jstr = '';
        reset($array);
        while (list($key, $val) = each($array)) {
            if (is_bool($val))
                $val = $val ? 'true' : 'false';
            else if (!is_numeric($val))
                $val = '"'.$val.'"';
            if ($jstr) $jstr .= ',';
            $jstr .= '"' . $key . '":' . $val;
        }
        return $jstr;
    }

Here is the caller graph for this function:

Definition at line 92 of file calendar.php.

{ return 'f-calendar-trigger-' . $id; }

Here is the caller graph for this function:

DHTML_Calendar::DHTML_Calendar ( calendar_lib_path = '/calendar/',
lang = 'en',
theme = 'calendar-win2k-1',
stripped = true 
)

Definition at line 24 of file calendar.php.

                                                       {
        if ($stripped) {
            $this->calendar_file = 'calendar_stripped.js';
            $this->calendar_setup_file = 'calendar-setup_stripped.js';
        } else {
            $this->calendar_file = 'calendar.js';
            $this->calendar_setup_file = 'calendar-setup.js';
        }
        $this->calendar_lang_file = 'lang/calendar-' . $lang . '.js';
        $this->calendar_theme_file = $theme.'.css';
        $this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path);
        $this->calendar_options = array('ifFormat' => '%Y/%m/%d',
                                        'daFormat' => '%Y/%m/%d');
    }

Definition at line 50 of file calendar.php.

                                   {
        $code  = ( '<link rel="stylesheet" type="text/css" media="all" href="' .
                   $this->calendar_lib_path . $this->calendar_theme_file .
                   '" />' . NEWLINE );
        $code .= ( '<script type="text/javascript" src="' .
                   $this->calendar_lib_path . $this->calendar_file .
                   '"></script>' . NEWLINE );
        $code .= ( '<script type="text/javascript" src="' .
                   $this->calendar_lib_path . $this->calendar_lang_file .
                   '"></script>' . NEWLINE );
        $code .= ( '<script type="text/javascript" src="' .
                   $this->calendar_lib_path . $this->calendar_setup_file .
                   '"></script>' );
        return $code;
    }

Here is the caller graph for this function:

Definition at line 46 of file calendar.php.

                          {
        echo $this->get_load_files_code();
    }

Here is the call graph for this function:

DHTML_Calendar::make_input_field ( cal_options = array(),
field_attributes = array() 
)

Definition at line 74 of file calendar.php.

                                                                                   {
        $id = $this->_gen_id();
        $attrstr = $this->_make_html_attr(array_merge($field_attributes,
                                                      array('id'   => $this->_field_id($id),
                                                            'type' => 'text')));
        echo '<input ' . $attrstr .'/>';
        echo '<a href="#" id="'. $this->_trigger_id($id) . '">' .
            '<img align="middle" border="0" src="' . $this->calendar_lib_path . 'img.gif" alt="" /></a>';

        $options = array_merge($cal_options,
                               array('inputField' => $this->_field_id($id),
                                     'button'     => $this->_trigger_id($id)));
        echo $this->_make_calendar($options);
    }

Here is the call graph for this function:

DHTML_Calendar::set_option ( name,
value 
)

Definition at line 42 of file calendar.php.

                                       {
        $this->calendar_options[$name] = $value;
    }

Member Data Documentation

Definition at line 18 of file calendar.php.

Definition at line 19 of file calendar.php.

Definition at line 16 of file calendar.php.

Definition at line 22 of file calendar.php.

Definition at line 20 of file calendar.php.

Definition at line 21 of file calendar.php.


The documentation for this class was generated from the following file: