AAAAhome/academiac/www/plugins/vmpayment/paypal/paypal/elements/getcertificate.php000060400000004660151374053000023773 0ustar00load ('com_virtuemart', JPATH_ADMINISTRATOR); // path to images directory $folder = $node->attributes ('directory'); $safePath = VmConfig::get ('forSale_path', ''); $certificatePath=$safePath.$folder; $certificatePath = JPath::clean($certificatePath); $class = ($node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : ''); // Is the path a folder? if (!is_dir($certificatePath)){ return ''.JText::sprintf ('VMPAYMENT_PAYPAL_CERTIFICATE_FOLDER_NOT_EXIST', $certificatePath).''; } $path = str_replace ('/', DS, $certificatePath); $filter = $node->attributes ('filter'); $exclude = array($node->attributes ('exclude'), '.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html'); $pattern = implode ( "|", $exclude); $stripExt = $node->attributes ('stripext'); $files = JFolder::files ($path, $filter, FALSE, FALSE, $exclude); $options = array(); 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 .= ' 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); } }