Example #1
0
    function render($blockContent = NULL)
    {
        // get control
        $output = parent::render($blockContent);
        $jsFunc = '__phocoaWFJumpSelectGoto_' . $this->id;
        // add onSelect handler
        $selectJS = " onChange=\"{$jsFunc}(this);\" ";
        $libraryJS = '
            <script language="JavaScript">
            <!--
            function ' . $jsFunc . '(select)
            {
                var index;
                var initialSelection = \'' . $this->value . '\';

                for(index=0; index<select.options.length; index++)
                    if(select.options[index].selected)
                    {
                        if(select.options[index].value != initialSelection)
                        {
                            newURL = "' . $this->baseURL . '" + select.options[index].value; 
                            window.location.href = newURL;
                        }
                        break;
                    }
            }
            -->
            </script>
            ';
        $output = str_replace('<select ', $libraryJS . '<select ' . $selectJS, $output);
        return $output;
    }
Example #2
0
 public static function exposedProperties()
 {
     $items = parent::exposedProperties();
     return array_merge($items, array('incrementsPerHour' => array('1', '2', '4', '12', '60'), 'startTime', 'endTime', 'formatString'));
 }