本文整理汇总了PHP中url_select::set_old_help_icon方法的典型用法代码示例。如果您正苦于以下问题:PHP url_select::set_old_help_icon方法的具体用法?PHP url_select::set_old_help_icon怎么用?PHP url_select::set_old_help_icon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类url_select
的用法示例。
在下文中一共展示了url_select::set_old_help_icon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: popup_form
/**
* Implements a complete little form with a dropdown menu.
*
* @deprecated since Moodle 2.0
*
* When JavaScript is on selecting an option from the dropdown automatically
* submits the form (while avoiding the usual acessibility problems with this appoach).
* With JavaScript off, a 'Go' button is printed.
*
* @global object
* @global object
* @param string $baseurl The target URL up to the point of the variable that changes
* @param array $options A list of value-label pairs for the popup list
* @param string $formid id for the control. Must be unique on the page. Used in the HTML.
* @param string $selected The option that is initially selected
* @param string $nothing The label for the "no choice" option
* @param string $help The name of a help page if help is required
* @param string $helptext The name of the label for the help button
* @param boolean $return Indicates whether the function should return the HTML
* as a string or echo it directly to the page being rendered
* @param string $targetwindow The name of the target page to open the linked page in.
* @param string $selectlabel Text to place in a [label] element - preferred for accessibility.
* @param array $optionsextra an array with the same keys as $options. The values are added within the corresponding <option ...> tag.
* @param string $submitvalue Optional label for the 'Go' button. Defaults to get_string('go').
* @param boolean $disabled If true, the menu will be displayed disabled.
* @param boolean $showbutton If true, the button will always be shown even if JavaScript is available
* @return string|void If $return=true returns string, else echo's and returns void
*/
function popup_form($baseurl, $options, $formid, $selected='', $nothing='choose', $help='', $helptext='', $return=false,
$targetwindow='self', $selectlabel='', $optionsextra=NULL, $submitvalue='', $disabled=false, $showbutton=false) {
global $OUTPUT, $CFG;
debugging('popup_form() has been deprecated. Please change your code to use $OUTPUT->single_select() or $OUTPUT->url_select().');
if (empty($options)) {
return '';
}
$urls = array();
foreach ($options as $value=>$label) {
$url = $baseurl.$value;
$url = str_replace($CFG->wwwroot, '', $url);
$url = str_replace('&', '&', $url);
$urls[$url] = $label;
if ($selected == $value) {
$active = $url;
}
}
$nothing = $nothing ? array(''=>$nothing) : null;
$select = new url_select($urls, $active, $nothing, $formid);
$select->disabled = $disabled;
$select->set_label($selectlabel);
$select->set_old_help_icon($help, $helptext);
$output = $OUTPUT->render($select);
if ($return) {
return $output;
} else {
echo $output;
}
}