/** * Test the getInput method. * * @return void * * @since 12.1 */ public function testGetInput() { $form = new JFormInspector('form1'); $this->assertThat( $form->load('<form><field name="filelist" type="filelist" /></form>'), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.' ); $field = new JFormFieldFileList($form); $this->assertThat( $field->setup($form->getXml()->field, 'value'), $this->isTrue(), 'Line:' . __LINE__ . ' The setup method should return true.' ); $this->assertThat( strlen($field->input), $this->greaterThan(0), 'Line:' . __LINE__ . ' The getInput method should return something without error.' ); // TODO: Should check all the attributes have come in properly. }
/** * Method to get the list of images field options. * Use the filter attribute to specify allowable file extensions. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // Define the image file type filter. $this->filter = '\\.png$|\\.gif$|\\.jpg$|\\.bmp$|\\.ico$|\\.jpeg$|\\.psd$|\\.eps$'; // Get the field options. return parent::getOptions(); }
/** * Method to get the list of images field options. * Use the filter attribute to specify allowable file extensions. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // Define the image file type filter. $filter = '\\.png$|\\.gif$|\\.jpg$|\\.bmp$|\\.ico$|\\.jpeg$|\\.psd$|\\.eps$'; // Set the form field element attribute for file type filter. $this->element->addAttribute('filter', $filter); // Get the field options. return parent::getOptions(); }
/** * Method to get the list of files for the field options. * Specify the target directory with a directory attribute * Attributes allow an exclude mask and stripping of extensions from file name. * Default attribute may optionally be set to null (no file) or -1 (use a default). * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // update path to this template $path = (string) $this->element['directory']; if (!is_dir($path)) { $this->directory = $this->element['directory'] = CANVAS_TEMPLATE_PATH . DIRECTORY_SEPARATOR . $path; } return parent::getOptions(); }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ protected function getOptions() { //-- dossier $folder = $this->element['directory']; $folder = strtr($folder, "\\", DIRECTORY_SEPARATOR); //-- Controle existence folder bgmax if (!JFolder::exists(JPATH_ROOT . DIRECTORY_SEPARATOR . $folder)) { if (!JFolder::create(JPATH_ROOT . DIRECTORY_SEPARATOR . $folder, 0755)) { print_r('Error, fail to create folder: ' . $folder); $folder = 'images/stories'; // Pour �viter erreur } } // Get the field options. return parent::getOptions(); }
/** * Method to get the list of files for the field options. * Specify the target directory with a directory attribute * Attributes allow an exclude mask and stripping of extensions from file name. * Default attribute may optionally be set to null (no file) or -1 (use a default). * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // update path to this template $path = (string) $this->element['directory']; $this->directory = $this->element['directory'] = T3_TEMPLATE_PATH . DIRECTORY_SEPARATOR . $path; $options = parent::getOptions(); // get addon layouts $folders = JFolder::folders(T3_TEMPLATE_PATH . '/addons'); // Build the options list from the list of folders. if (is_array($folders)) { foreach ($folders as $folder) { $options[] = JHtml::_('select.option', 'addon.' . $folder, 'addon - ' . $folder); } } return $options; }
/** * Method to get the list of files for the field options. * Specify the target directory with a directory attribute * Attributes allow an exclude mask and stripping of extensions from file name. * Default attribute may optionally be set to null (no file) or -1 (use a default). * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // update path to this template $path = (string) $this->element['directory']; $options = array(); // get files in template path $this->directory = $this->element['directory'] = T3_TEMPLATE_PATH . DIRECTORY_SEPARATOR . $path; $options = parent::getOptions(); // get files in template local path if (!defined('T3_LOCAL_DISABLED') && is_dir(T3_LOCAL_PATH . DIRECTORY_SEPARATOR . $path)) { $this->directory = $this->element['directory'] = T3_LOCAL_PATH . DIRECTORY_SEPARATOR . $path; $options2 = parent::getOptions(); foreach ($options2 as $option) { $option->text .= ' (local)'; $options[] = $option; } } return $options; }
/** * Method to get the list of files for the field options. * Specify the target directory with a directory attribute * Attributes allow an exclude mask and stripping of extensions from file name. * Default attribute may optionally be set to null (no file) or -1 (use a default). * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // update path to this template $path = (string) $this->element['directory']; if (!is_dir($path)) { $this->element['directory'] = PLAZART_TEMPLATE_PATH . DIRECTORY_SEPARATOR . $path; } $this->filter = (string) $this->element['filter']; $this->exclude = (string) $this->element['exclude']; $hideNone = (string) $this->element['hide_none']; $this->hideNone = $hideNone == 'true' || $hideNone == 'hideNone' || $hideNone == '1'; $hideDefault = (string) $this->element['hide_default']; $this->hideDefault = $hideDefault == 'true' || $hideDefault == 'hideDefault' || $hideDefault == '1'; $stripExt = (string) $this->element['stripext']; $this->stripExt = $stripExt == 'true' || $stripExt == 'stripExt' || $stripExt == '1'; // Get the path in which to search for file options. $this->directory = (string) $this->element['directory']; return parent::getOptions(); }
protected function getOptions() { return parent::getOptions(); }
protected function getInput() { $fileList = parent::getInput(); return JbetoloSettingsElement::ui($this->fieldname, $fileList); }
/** * Method to get the list of files for the field options. * Specify the target directory with a directory attribute * Attributes allow an exclude mask and stripping of extensions from file name. * Default attribute may optionally be set to null (no file) or -1 (use a default). * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // update path to this template $path = (string) $this->element['directory']; if (!is_dir($path)) { $this->element['directory'] = PLAZART_TEMPLATE_PATH . DIRECTORY_SEPARATOR . $path; } if ($this->element['atzx']) { $colon = ''; ?> <script type="text/tzvascript"> //<![CDATA[ jQuery(window).on('load', function(){ TZDepend.addatzx('<?php echo $this->name; ?> ', { <?php if ($this->element['url']) { $colon = ','; ?> url: '<?php echo $this->element['url']; ?> ' <?php } ?> <?php if ($this->element['query']) { echo $colon; $colon = ','; ?> query: '<?php echo $this->element['query']; ?> ' <?php } ?> <?php if ($this->element['func']) { echo $colon; $colon = ','; ?> func: '<?php echo $this->element['func']; ?> ' <?php } ?> }); }); //]]> </script> <?php } return parent::getOptions(); }
/** * Method to get a list of options for a list input. * * @return array An array of JHtml options. */ protected function _getOptions() { $filter = '\\.png$|\\.gif$|\\.jpg$|\\.bmp$|\\.ico$'; $this->_element->addAttribute('filter', $filter); return parent::_getOptions(); }