AAAAhome/academiac/www/administrator/components/com_virtuemart/elements/vmfiles.php000060400000004770151373705300024316 0ustar00load ('com_virtuemart', JPATH_ADMINISTRATOR); // path to images directory $folder = $node->attributes ('directory'); $rel_path = str_replace ('/', DS, $folder); $path = JPATH_ROOT . DS . $rel_path; $filter = $node->attributes ('filter'); $exclude = array($node->attributes ('exclude'), '.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html'); $pattern = implode ( "|", $exclude); $stripExt = $node->attributes ('stripext'); if (!JFolder::exists ($path)) { return JText::sprintf ('COM_VIRTUEMART_FOLDER_NOT_EXIST', $node->attributes ('directory')); } $files = JFolder::files ($path, $filter, FALSE, FALSE, $exclude); $options = array(); if (!$node->attributes ('hide_none')) { $options[] = JHTML::_ ('select.option', '-1', '- ' . JText::_ ('Do not use') . ' -'); } if (!$node->attributes ('hide_default')) { $options[] = JHTML::_ ('select.option', '', '- ' . JText::_ ('Use default') . ' -'); } if (is_array ($files)) { foreach ($files as $file) { if ($exclude) { if (preg_match (chr (1) . $pattern . chr (1), $file)) { continue; } } if ($stripExt) { $file = JFile::stripExt ($file); } $options[] = JHTML::_ ('select.option', $file, $file); } } $class = ($node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : ''); $class .= ' multiple="true" size="5" data-placeholder="'.JText::_('COM_VIRTUEMART_DRDOWN_SELECT_SOME_OPTIONS').'"'; return JHTML::_ ('select.genericlist', $options, '' . $control_name . '[' . $name . '][]', $class, 'value', 'text', $value, $control_name . $name); } }