/** * Get the JavaScript command for the button * * @access private * @param object $definition Button definition * @return string JavaScript command string * @since 1.5 */ public function _getCommand($name, $url, $userOptions) { if (substr($url, 0, 4) !== 'http') { $url = JURI::base() . $url; } $commands = array(); // calculate the various parts of the ajax call params, encoded as JSon if (!empty($userOptions['update'])) { $commands['update'] = $userOptions['update']; } // make that a json object $params = Sh404sefHelperHtml::JGetJSObject($commands); // calculate the full command $command = 'javascript: onclick=shAjaxHandler(\'' . $name . '\',' . $params . ',' . $userOptions['closewindow'] . ')'; return $command; }