ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/lib/form/dateselector.php000064400000031423152267661460023603 0ustar00. /** * Group of date input element * * Contains class for a group of elements used to input a date. * * @package core_form * @copyright 2007 Jamie Pratt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ global $CFG; require_once($CFG->libdir . '/form/group.php'); require_once($CFG->libdir . '/formslib.php'); /** * Class for a group of elements used to input a date. * * Emulates moodle print_date_selector function * * @package core_form * @category form * @copyright 2007 Jamie Pratt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class MoodleQuickForm_date_selector extends MoodleQuickForm_group { /** * Control the fieldnames for form elements. * * startyear => int start of range of years that can be selected * stopyear => int last year that can be selected * timezone => int|float|string (optional) timezone modifier used for edge case only. * If not specified, then date is caclulated based on current user timezone. * Note: dst will be calculated for string timezones only * {@link https://moodledev.io/docs/apis/subsystems/time#timezone} * optional => if true, show a checkbox beside the date to turn it on (or off) * @var array */ protected $_options = array(); /** * @var array These complement separators, they are appended to the resultant HTML. */ protected $_wrap = array('', ''); /** * @var null|bool Keeps track of whether the date selector was initialised using createElement * or addElement. If true, createElement was used signifying the element has been * added to a group - see MDL-39187. */ protected $_usedcreateelement = true; /** * constructor * * @param string $elementName Element's name * @param mixed $elementLabel Label(s) for an element * @param array $options Options to control the element's display * @param mixed $attributes Either a typical HTML attribute string or an associative array */ public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null) { // Get the calendar type used - see MDL-18375. $calendartype = \core_calendar\type_factory::get_calendar_instance(); $this->_options = array('startyear' => $calendartype->get_min_year(), 'stopyear' => $calendartype->get_max_year(), 'defaulttime' => 0, 'timezone' => 99, 'step' => 1, 'optional' => false); // TODO MDL-52313 Replace with the call to parent::__construct(). HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes); $this->_persistantFreeze = true; $this->_appendName = true; $this->_type = 'date_selector'; // set the options, do not bother setting bogus ones if (is_array($options)) { foreach ($options as $name => $value) { if (isset($this->_options[$name])) { if (is_array($value) && is_array($this->_options[$name])) { $this->_options[$name] = @array_merge($this->_options[$name], $value); } else { $this->_options[$name] = $value; } } } } } /** * Old syntax of class constructor. Deprecated in PHP7. * * @deprecated since Moodle 3.1 */ public function MoodleQuickForm_date_selector($elementName = null, $elementLabel = null, $options = array(), $attributes = null) { debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER); self::__construct($elementName, $elementLabel, $options, $attributes); } /** * This will create date group element constisting of day, month and year. * * @access private */ function _createElements() { global $OUTPUT; // Get the calendar type used - see MDL-18375. $calendartype = \core_calendar\type_factory::get_calendar_instance(); $this->_elements = array(); $dateformat = $calendartype->get_date_order($this->_options['startyear'], $this->_options['stopyear']); // Reverse date element (Day, Month, Year), in RTL mode. if (right_to_left()) { $dateformat = array_reverse($dateformat); } // If optional we add a checkbox which the user can use to turn if on. if ($this->_options['optional']) { $this->_elements[] = $this->createFormElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributesForFormElement(), true); } foreach ($dateformat as $key => $value) { $this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $value, $this->getAttributesForFormElement(), true); } // The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used. if ($calendartype->get_name() === 'gregorian') { $image = $OUTPUT->pix_icon('i/calendar', ''); $this->_elements[] = $this->createFormElement( 'button', 'calendar', $image, [ 'type' => 'button', 'title' => get_string('datepicker', 'calendar'), 'aria-label' => get_string('datepicker', 'calendar'), ], [ 'customclassoverride' => 'btn-link btn-sm icon-no-margin', ], ); } foreach ($this->_elements as $element){ if (method_exists($element, 'setHiddenLabel')){ $element->setHiddenLabel(true); } } } /** * Called by HTML_QuickForm whenever form event is made on this element * * @param string $event Name of event * @param mixed $arg event arguments * @param object $caller calling object * @return bool */ function onQuickFormEvent($event, $arg, &$caller) { $this->setMoodleForm($caller); switch ($event) { case 'updateValue': // Constant values override both default and submitted ones // default values are overriden by submitted. $value = $this->_findValue($caller->_constantValues); if (null === $value) { // If no boxes were checked, then there is no value in the array // yet we don't want to display default value in this case. if ($caller->isSubmitted() && !$caller->is_new_repeat($this->getName())) { $value = $this->_findValue($caller->_submitValues); } else { $value = $this->_findValue($caller->_defaultValues); } } $requestvalue=$value; if ($value == 0) { $value = time(); } if (!is_array($value)) { $calendartype = \core_calendar\type_factory::get_calendar_instance(); $currentdate = $calendartype->timestamp_to_date_array($value, $this->_options['timezone']); $value = array( 'day' => $currentdate['mday'], 'month' => $currentdate['mon'], 'year' => $currentdate['year']); // If optional, default to off, unless a date was provided. if ($this->_options['optional']) { $value['enabled'] = $requestvalue != 0; } } else { $value['enabled'] = isset($value['enabled']); } if (null !== $value) { $this->setValue($value); } break; case 'createElement': // Optional is an optional param, if its set we need to add a disabledIf rule. // If its empty or not specified then its not an optional dateselector. if (!empty($arg[2]['optional']) && !empty($arg[0])) { // When using the function addElement, rather than createElement, we still // enter this case, making this check necessary. if ($this->_usedcreateelement) { $caller->disabledIf($arg[0] . '[day]', $arg[0] . '[enabled]'); $caller->disabledIf($arg[0] . '[month]', $arg[0] . '[enabled]'); $caller->disabledIf($arg[0] . '[year]', $arg[0] . '[enabled]'); } else { $caller->disabledIf($arg[0], $arg[0] . '[enabled]'); } } return parent::onQuickFormEvent($event, $arg, $caller); break; case 'addElement': $this->_usedcreateelement = false; return parent::onQuickFormEvent($event, $arg, $caller); break; default: return parent::onQuickFormEvent($event, $arg, $caller); } } /** * Returns HTML for advchecbox form element. * * @return string */ function toHtml() { include_once('HTML/QuickForm/Renderer/Default.php'); $renderer = new HTML_QuickForm_Renderer_Default(); $renderer->setElementTemplate('{element}'); parent::accept($renderer); $html = $this->_wrap[0]; if ($this->_usedcreateelement) { $html .= html_writer::tag('span', $renderer->toHtml(), array('class' => 'fdate_selector')); } else { $html .= $renderer->toHtml(); } $html .= $this->_wrap[1]; return $html; } /** * Accepts a renderer * * @param HTML_QuickForm_Renderer $renderer An HTML_QuickForm_Renderer object * @param bool $required Whether a group is required * @param string $error An error message associated with a group */ function accept(&$renderer, $required = false, $error = null) { form_init_date_js(); $renderer->renderElement($this, $required, $error); } /** * Export for template * * @param renderer_base $output * @return array|stdClass */ public function export_for_template(renderer_base $output) { form_init_date_js(); return parent::export_for_template($output); } /** * Output a timestamp. Give it the name of the group. * * @param array $submitValues values submitted. * @param bool $assoc specifies if returned array is associative * @return array */ function exportValue(&$submitValues, $assoc = false) { $valuearray = array(); foreach ($this->_elements as $element){ $thisexport = $element->exportValue($submitValues[$this->getName()], true); if ($thisexport!=null){ $valuearray += $thisexport; } } if (count($valuearray) && isset($valuearray['year'])) { if($this->_options['optional']) { // If checkbox is on, the value is zero, so go no further if(empty($valuearray['enabled'])) { return $this->_prepareValue(0, $assoc); } } // Get the calendar type used - see MDL-18375. $calendartype = \core_calendar\type_factory::get_calendar_instance(); $gregoriandate = $calendartype->convert_to_gregorian($valuearray['year'], $valuearray['month'], $valuearray['day']); $value = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'], 0, 0, 0, $this->_options['timezone'], true); return $this->_prepareValue($value, $assoc); } else { return null; } } }