ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ.. /** * Listing form element. * * Contains HTML class for a listing form element. * * @package core_form * @copyright 2012 Jerome Mouneyrac * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ if (!defined('MOODLE_INTERNAL')) { die('Direct access to this script is forbidden.'); } require_once("HTML/QuickForm/input.php"); /** * The listing element is a simple customizable "select" without the input type=select. * One main div contains the "large" html of an item. * A show/hide div shows a hidden div containing the list of all items. * This list is composed by the "small" html of each item. * * How to use it: * The options parameter is an array containing: * - items => array of object: the key is the value of the form input * $item->rowhtml => small html * $item->mainhtml => large html * - showall/hideall => string for the Show/Hide button * * WARNINGS: The form lets you display HTML. So it is subject to CROSS-SCRIPTING if you send it uncleaned HTML. * Don't forget to escape your HTML as soon as one string comes from an input/external source. * * How to customize it: * You can change the css in core.css. For example if you remove float:left; from .formlistingrow, * then the item list is not display as tabs but as rows. * * @package core_form * @copyright 2012 Jerome Mouneyrac * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class MoodleQuickForm_listing extends HTML_QuickForm_input { /** @var array items to display. */ protected $items = array(); /** @var string language string for Show All. */ protected $showall; /** @var string language string for Hide. */ protected $hideall; /** * Constructor. * * @param string $elementName (optional) name of the listing. * @param string $elementLabel (optional) listing label. * @param array $attributes (optional) Either a typical HTML attribute string or an associative array. * @param array $options set of options to initalize listing. */ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=array()) { $this->_type = 'listing'; if (!empty($options['items'])) { $this->items = $options['items']; } if (!empty($options['showall'])) { $this->showall = $options['showall']; } else { $this->showall = get_string('showall'); } if (!empty($options['hideall'])) { $this->hideall = $options['hideall']; } else { $this->hideall = get_string('hide'); } parent::__construct($elementName, $elementLabel, $attributes); } /** * Old syntax of class constructor. Deprecated in PHP7. * * @deprecated since Moodle 3.1 */ public function MoodleQuickForm_listing($elementName=null, $elementLabel=null, $attributes=null, $options=array()) { debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER); self::__construct($elementName, $elementLabel, $attributes, $options); } /** * Returns HTML for listing form element. * * @return string the HTML. */ function toHtml() { global $CFG, $PAGE; $this->_generateId(); $elementid = $this->getAttribute('id'); $mainhtml = html_writer::tag('div', $this->items[$this->getValue()]->mainhtml, array('id' => $elementid . '_items_main', 'class' => 'formlistingmain')); // Add the main div containing the selected item (+ the caption: "More items"). $html = html_writer::tag('div', $mainhtml . html_writer::tag('div', $this->showall, array('id' => $elementid . '_items_caption', 'class' => 'formlistingmore')), array('id' => $elementid . '_items', 'class' => 'formlisting hide')); // Add collapsible region: all the items. $itemrows = ''; $html .= html_writer::tag('div', $itemrows, array('id' => $elementid . '_items_all', 'class' => 'formlistingall')); // Add radio buttons for non javascript support. $radiobuttons = ''; foreach ($this->items as $itemid => $item) { $radioparams = array('name' => $this->getName(), 'value' => $itemid, 'id' => 'id_'.$itemid, 'class' => 'formlistinginputradio', 'type' => 'radio'); if ($itemid == $this->getValue()) { $radioparams['checked'] = 'checked'; } $radiobuttons .= html_writer::tag('div', html_writer::tag('input', html_writer::tag('div', $item->rowhtml, array('class' => 'formlistingradiocontent')), $radioparams), array('class' => 'formlistingradio')); } // Container for the hidden hidden input which will contain the selected item. $html .= html_writer::tag('div', $radiobuttons, array('id' => 'formlistinginputcontainer_' . $elementid, 'class' => 'formlistinginputcontainer')); $module = array('name'=>'form_listing', 'fullpath'=>'/lib/form/yui/listing/listing.js', 'requires'=>array('node', 'event', 'transition', 'escape')); $PAGE->requires->js_init_call('M.form_listing.init', array(array( 'elementid' => $elementid.'_items', 'hideall' => $this->hideall, 'showall' => $this->showall, 'hiddeninputid' => $this->getAttribute('id'), 'items' => $this->items, 'inputname' => $elementid, 'currentvalue' => $this->getValue())), true, $module); return $html; } }