/** * Short description of method render * * @access public * @author Jerome Bogaerts, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; $widgetName = $this->buildWidgetName(); $widgetContainerId = $this->buildWidgetContainerId(); $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; $returnValue .= "<div id='{$widgetContainerId}' class='form-elt-container file-uploader'>"; if ($this->value instanceof tao_helpers_form_data_FileDescription && ($file = $this->value->getFile()) != null) { // A file is stored or has just been uploaded. $shownFileName = $this->value->getName(); $shownFileSize = $this->value->getSize(); $shownFileSize = number_format($shownFileSize / 1000, 2); // to kb. $shownFileTxt = sprintf(__('%s (%s kb)'), $shownFileName, $shownFileSize); $deleteButtonTitle = __("Delete"); $deleteButtonId = $this->buildDeleteButtonId(); $downloadButtonTitle = __("Download"); $downloadButtonId = $this->buildDownloadButtonId(); $iFrameId = $this->buildIframeId(); $returnValue .= "<span class=\"widget_AsyncFile_fileinfo\">{$shownFileTxt}</span>"; $returnValue .= "<button id=\"{$downloadButtonId}\" type=\"button\" class=\"download btn-neutral small icon-download\" title=\"{$downloadButtonTitle}\">"; $returnValue .= "<button id=\"{$deleteButtonId}\" type=\"button\" class=\"delete btn-error small icon-bin\" title=\"{$deleteButtonTitle}\"/>"; $returnValue .= "<iframe style=\"display:none\" id=\"{$iFrameId}\" frameborder=\"0\"/>"; // Inject behaviour of the Delete/Download buttons component in response. $returnValue .= self::embedBehaviour($this->buildDeleterBehaviour() . $this->buildDownloaderBehaviour()); } else { // No file stored yet. // Inject behaviour of the AsyncFileUpload component in response. $returnValue .= self::embedBehaviour($this->buildUploaderBehaviour()); } $returnValue .= "</div>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; // foreach($this->attributes as $key => $value){ // // if($key === 'class' && $value) { // // } // $returnValue .= " {$key}='{$value}' "; // } /*** * this attributes */ if (!empty($this->description)) { $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; } $content = _dh($this->value); if ($this->icon) { $content = $this->iconPosition === 'before' ? $this->icon . ' ' . $content : $content . ' ' . $this->icon; } $returnValue .= "<button type='button' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '">' . $content . '</button>'; return (string) $returnValue; }
/** * Display the list of all readiness checks performed on the given test center * It also allows launching new ones. */ public function index() { $testCenter = $this->getCurrentTestCenter(); $requestOptions = $this->getRequestOptions(); $this->setData('title', __('Readiness Check for test site %s', _dh($testCenter->getLabel()))); $this->composeView('diagnostic-index', array('testCenter' => $testCenter->getUri(), 'set' => TestCenterHelper::getDiagnostics($testCenter, $requestOptions), 'config' => TestCenterHelper::getDiagnosticConfig($testCenter), 'installedextension' => \common_ext_ExtensionsManager::singleton()->isInstalled('ltiDeliveryProvider')), array(BreadcrumbsHelper::testCenters(), BreadcrumbsHelper::testCenter($testCenter, TestCenterHelper::getTestCenters()), BreadcrumbsHelper::diagnostics($testCenter, array(BreadcrumbsHelper::deliveries($testCenter))))); }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (isset($this->attributes['class'])) { $classes = explode(' ', $this->attributes['class']); if (!isset($this->attributes['no-format'])) { if (!in_array('form-elt-info', $classes)) { $classes[] = 'form-elt-info'; } } if (!in_array('form-elt-container', $classes)) { $classes[] = 'form-elt-container'; } $this->attributes['class'] = implode(' ', $classes); } else { if (isset($this->attributes['no-format'])) { $this->attributes['class'] = 'form-elt-container'; } else { $this->attributes['class'] = 'form-elt-info form-elt-container'; } } unset($this->attributes['no-format']); $returnValue .= "<span class='form_desc'>"; if (!empty($this->description)) { $returnValue .= _dh($this->getDescription()); } $returnValue .= "</span>"; $returnValue .= "<span "; $returnValue .= $this->renderAttributes(); $returnValue .= " >"; $returnValue .= isset($this->attributes['htmlentities']) && !$this->attributes['htmlentities'] ? $this->value : _dh($this->value); $returnValue .= "</span>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = $this->renderLabel(); $returnValue .= "<input type='password' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = $this->renderLabel(); $returnValue .= "<textarea name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ">" . _dh($this->value) . "</textarea>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; $returnValue .= "<input type='hidden' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Somsack Sipasseuth, <*****@*****.**> * @return string */ public function render() { $returnValue = $this->renderLabel(); $returnValue .= "<input type='text' readonly='readonly' disabled='disabled' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (is_null($this->value) || empty($this->value)) { $this->value = __('Save'); } $returnValue = "<input type='submit' id='{$this->name}' name='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; return (string) $returnValue; }
/** * Returns html for property * @param $property * @return string */ protected function getGroupTitle($property) { if ($this->isParentProperty()) { foreach ($property->getDomain()->getIterator() as $domain) { $domainLabel[] = $domain->getLabel(); } $groupTitle = '<span class="property-heading-label">' . _dh($property->getLabel()) . '</span>' . '<span class="property-heading-toolbar">' . _dh(implode(' ', $domainLabel)) . ' <span class="icon-edit"></span>' . '</span>'; } else { $groupTitle = '<span class="property-heading-label">' . _dh($property->getLabel()) . '</span>' . '<span class="property-heading-toolbar">' . '<span class="icon-edit"></span>' . '<span class="icon-bin property-deleter" data-uri=\'' . tao_helpers_Display::encodeAttrValue($property->getUri()) . '\'></span>' . '</span>'; } return $groupTitle; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = $this->renderLabel(); $content = _dh($this->value); if ($this->icon) { $content = $this->iconPosition === 'before' ? $this->icon . ' ' . $content : $content . ' ' . $this->icon; } $returnValue .= "<button type='{$this->type}' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '">' . $content . '</button>'; return $returnValue; }
/** * @requiresRight id WRITE */ public function index() { $resource = new \core_kernel_classes_Resource($this->getRequestParameter('id')); $revisions = RepositoryProxy::getRevisions($resource->getUri()); $returnRevision = array(); foreach ($revisions as $revision) { $returnRevision[] = array('id' => $revision->getVersion(), 'modified' => \tao_helpers_Date::displayeDate($revision->getDateCreated()), 'author' => UserHelper::renderHtmlUser($revision->getAuthorId()), 'message' => _dh($revision->getMessage())); } $this->setData('resourceLabel', _dh($resource->getLabel())); $this->setData('id', $resource->getUri()); $this->setData('revisions', $returnRevision); $this->setView('History/index.tpl'); }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (!isset($this->attributes['noLabel'])) { $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; } else { unset($this->attributes['noLabel']); } $returnValue .= "<textarea name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ">" . _dh($this->value) . "</textarea>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (!isset($this->attributes['noLabel'])) { $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; } else { unset($this->attributes['noLabel']); } $returnValue .= "<input type='password' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Somsack Sipasseuth, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (!isset($this->attributes['noLabel'])) { $returnValue .= "<span class='form_desc'>" . _dh($this->getDescription()) . "</span>"; } else { unset($this->attributes['noLabel']); } $returnValue .= "<input type='text' readonly='readonly' disabled='disabled' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; return (string) $returnValue; }
public function renderLabel() { $renderedLabel = ''; if (!isset($this->attributes['noLabel']) && !empty($this->description)) { $renderedLabel .= "<label class='form_desc' for='" . $this->name . "'>" . _dh($this->getDescription()); if (isset($this->attributes['required'])) { $renderedLabel .= "<abbr title='" . __('This field is required') . "'>*</abbr>"; unset($this->attributes['required']); } $renderedLabel .= "</label>"; } else { unset($this->attributes['noLabel']); } return (string) $renderedLabel; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { if (array_key_exists('class', $this->attributes)) { if (strstr($this->attributes['class'], self::CSS_CLASS) !== false) { $this->attributes['class'] .= ' ' . self::CSS_CLASS; } } else { $this->attributes['class'] = self::CSS_CLASS; } $returnValue = $this->renderLabel(); $returnValue .= "<textarea name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ">" . _dh($this->value) . "</textarea>"; return (string) $returnValue; }
/** * (non-PHPdoc) * * @see tao_helpers_form_FormElement::render() */ public function render() { $returnValue = $this->renderLabel(); $hasUnit = !empty($this->unit); if ($hasUnit) { $this->addClass('has-unit'); } $returnValue .= "<input type='text' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; if ($hasUnit) { $returnValue .= '<label class="unit" for="' . $this->name . '">' . _dh($this->unit) . '</label>'; } return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (array_key_exists('class', $this->attributes)) { if (strstr($this->attributes['class'], self::CSS_CLASS) !== false) { $this->attributes['class'] .= ' ' . self::CSS_CLASS; } } else { $this->attributes['class'] = self::CSS_CLASS; } $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; $returnValue .= "<button name='{$this->name}' type='button'"; $returnValue .= $this->renderAttributes(); $returnValue .= " >" . __('Author Item') . "</button>"; return (string) $returnValue; }
/** * * @see tao_helpers_form_FormElement::render */ public function render() { $returnValue = $this->renderLabel(); $i = 0; $returnValue .= '<div class="form_radlst">'; foreach ($this->getOptions() as $optionId => $optionLabel) { $returnValue .= "<input type='radio' name='{$this->name}' id='{$this->name}_{$i}' value='{$optionId}' "; $returnValue .= $this->renderAttributes(); if ($this->value == $optionId) { $returnValue .= " checked='checked' "; } $returnValue .= " /><label class='elt_desc' for='{$this->name}_{$i}'>" . _dh($optionLabel) . "</label><br />"; $i++; } $returnValue .= "</div>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Somsack Sipasseuth, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (array_key_exists('class', $this->attributes)) { if (strstr($this->attributes['class'], self::CSS_CLASS) !== false) { $this->attributes['class'] .= ' ' . self::CSS_CLASS; } } else { $this->attributes['class'] = self::CSS_CLASS; } $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; $returnValue .= "<input type='button' for='{$this->name}' value='" . __('Manage Versioned File') . "' "; $returnValue .= $this->renderAttributes(); $returnValue .= " />"; $returnValue .= "<span for='{$this->name}' " . $this->renderAttributes() . "></span>"; return (string) $returnValue; }
/** * Render the Widget to allow Test Runner Features selection * * @return string */ public function render() { $serviceManager = ServiceManager::getServiceManager(); $testRunnerFeatureService = $serviceManager->get(TestRunnerFeatureService::SERVICE_ID); $allFeatures = $testRunnerFeatureService->getAll(); $activeFeatures = explode(',', $this->value); $choicesList = []; $i = 0; if (count($allFeatures) > 0) { foreach ($allFeatures as $feature) { $choicesList[] = ["title" => $feature->getDescription(), "value" => $feature->getId(), "id" => $this->name . "_" . $i, "checked" => in_array($feature->getId(), $activeFeatures) ? ' checked="checked" ' : '', "label" => _dh($feature->getLabel())]; $i++; } } $tpl = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoDeliveryRdf')->getDir() . self::WIDGET_TPL; $templateRenderer = new \taoItems_models_classes_TemplateRenderer($tpl, array('propLabel' => _dh($this->getDescription()), 'choicesList' => $choicesList)); return $templateRenderer->render(); }
/** * Short description of method render * * @access public * @author Joel Bout, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; // custom label rendering if (!isset($this->attributes['noLabel'])) { $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . (strlen($this->value) == 0 ? '' : ' (change)') . "</label>"; } else { unset($this->attributes['noLabel']); } $returnValue .= "<input type='password' name='{$this->name}[]' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="" /><br /><br />'; $returnValue .= "<label class='form_desc'></label>"; $returnValue .= "<input type='password' name='{$this->name}[]' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="" />'; return (string) $returnValue; }
/** * Rendering of the XHTML implementation of the Calendar Widget. * * @author Bertrand Chevrier, <*****@*****.**> * @return The XHTML stream of the Calendar Widget. */ public function render() { $returnValue = $this->renderLabel(); $uniqueId = uniqid('calendar_'); $elementId = tao_helpers_Display::TextCleaner($this->getDescription()) . '_' . $uniqueId; if (!isset($this->attributes['size'])) { $this->attributes['size'] = 20; } $returnValue .= "<input class='datepicker-input' type='text' name='{$this->name}' id='{$elementId}' "; $returnValue .= $this->renderAttributes(); if (!empty($this->value)) { $timeStamp = is_numeric($this->getRawValue()) ? $this->getRawValue() : $this->getEvaluatedValue(); $returnValue .= ' value="' . _dh(tao_helpers_Date::displayeDate($timeStamp, tao_helpers_Date::FORMAT_DATEPICKER)) . '"'; } $returnValue .= ' />'; $returnValue .= "<script type=\"text/javascript\">\n\t\t\trequire(['jquery','jqueryui','jquery.timePicker'], function(\$){\n\t\t\t\t\$(\"#{$elementId}\").datetimepicker({\n dateFormat: 'yy-mm-dd',\n beforeShow: function (textbox, instance) {\n \$(textbox).parent().append(instance.dpDiv);\n }\n\t\t\t\t});\n \n\t\t\t});</script>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Joel Bout, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; $i = 0; if (!isset($this->attributes['noLabel'])) { $returnValue .= "<span class='form_desc'>" . _dh($this->getDescription()) . "</span>"; } else { unset($this->attributes['noLabel']); } $checkAll = false; if (isset($this->attributes['checkAll'])) { $checkAll = (bool) $this->attributes['checkAll']; unset($this->attributes['checkAll']); } $checked = 0; $returnValue .= '<div class="form_radlst">'; foreach ($this->options as $optionId => $optionLabel) { $returnValue .= "<input type='checkbox' value='{$optionId}' name='{$this->name}_{$i}' id='{$this->name}_{$i}' "; $returnValue .= $this->renderAttributes(); $readOnly = in_array($optionId, $this->getReadOnly()); if ($readOnly) { $returnValue .= "disabled='disabled' readonly='readonly' "; } if (in_array($optionId, $this->values)) { $returnValue .= " checked='checked' "; $checked++; } $returnValue .= " /> <label class='elt_desc' for='{$this->name}_{$i}'>" . _dh($optionLabel) . "</label><br />"; if ($readOnly) { $returnValue .= "<input type='hidden' name='{$this->name}_{$i}' value='{$optionId}'>"; } $i++; } $returnValue .= "</div>"; //add a small link if ($checkAll) { if ($checked == count($this->options)) { $returnValue .= "<span class='checker-container'><a id='{$this->name}_checker' class='box-checker box-checker-uncheck' href='#'>" . __('Uncheck All') . "</a></span>"; } else { $returnValue .= "<span class='checker-container'><a id='{$this->name}_checker' class='box-checker' href='#'>" . __('Check All') . "</a></span>"; } } return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = $this->renderLabel(); $returnValue .= "<select name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ">"; if (!empty($this->emptyOption)) { $this->options = array_merge(array(' ' => $this->emptyOption), $this->options); } foreach ($this->options as $optionId => $optionLabel) { $returnValue .= "<option value='{$optionId}' "; if ($this->value === $optionId) { $returnValue .= " selected='selected' "; } $returnValue .= ">" . _dh($optionLabel) . "</option>"; } $returnValue .= "</select>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (array_key_exists('class', $this->attributes)) { if (strstr($this->attributes['class'], self::CSS_CLASS) !== false) { $this->attributes['class'] .= ' ' . self::CSS_CLASS; } } else { $this->attributes['class'] = self::CSS_CLASS; } if (!isset($this->attributes['noLabel'])) { $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; } else { unset($this->attributes['noLabel']); } $returnValue .= "<textarea name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ">" . _dh($this->value) . "</textarea>"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; $hasUnit = !empty($this->unit); if (!isset($this->attributes['noLabel'])) { $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; } else { unset($this->attributes['noLabel']); } if ($hasUnit) { $this->addClass('has-unit'); } $returnValue .= "<input type='text' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= ' value="' . _dh($this->value) . '" />'; if ($hasUnit) { $returnValue .= '<label class="unit" for="' . $this->name . '">' . _dh($this->unit) . '</label>'; } return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Joel Bout, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; if (!empty($this->value)) { if (common_Utils::isUri($this->value)) { $file = new core_kernel_file_File($this->value); if ($file->fileExists()) { $fileInfo = $file->getFileInfo(); $fileInfo->getFilename(); } else { $file->delete(); } } } $returnValue .= "<label class='form_desc' for='{$this->name}'>" . _dh($this->getDescription()) . "</label>"; $returnValue .= "<input type='hidden' name='MAX_FILE_SIZE' value='" . tao_helpers_form_elements_File::MAX_FILE_SIZE . "' />"; $returnValue .= "<input type='file' name='{$this->name}' id='{$this->name}' "; $returnValue .= $this->renderAttributes(); $returnValue .= " value='{$this->value}' />"; return (string) $returnValue; }
/** * Short description of method render * * @access public * @author Bertrand Chevrier, <*****@*****.**> * @return string */ public function render() { $returnValue = (string) ''; $i = 0; if (!isset($this->attributes['noLabel'])) { $returnValue .= "<span class='form_desc'>" . _dh($this->getDescription()) . "</span>"; } else { unset($this->attributes['noLabel']); } $returnValue .= '<div class="form_radlst">'; foreach ($this->options as $optionId => $optionLabel) { $returnValue .= "<input type='radio' name='{$this->name}' id='{$this->name}_{$i}' value='{$optionId}' "; $returnValue .= $this->renderAttributes(); if ($this->value == $optionId) { $returnValue .= " checked='checked' "; } $returnValue .= " /><label class='elt_desc' for='{$this->name}_{$i}'>" . _dh($optionLabel) . "</label><br />"; $i++; } $returnValue .= "</div>"; return (string) $returnValue; }