AAAA.htaccess000066600000000177151372162250006357 0ustar00 Order allow,deny Deny from all index.html000066600000000000151372162250006537 0ustar00view.html.php000066600000031643151372162250007211 0ustar00getCoreFields(); if ($layoutName == 'edit') { $editor = JFactory::getEditor(); $userField = $model->getUserfield(); $this->SetViewTitle('USERFIELD',$userField->name ); $this->assignRef('viewName',$viewName); $userFieldPlugin = ''; if ($userField->virtuemart_userfield_id < 1) { // Insert new userfield $this->assignRef('ordering', JText::_('COM_VIRTUEMART_NEW_ITEMS_PLACE')); $userFieldValues = array(); $attribs = ''; $lists['type'] = JHTML::_('select.genericlist', $this->_getTypes(), 'type', $attribs, 'type', 'text', $userField->type); } else { // Update existing userfield // Ordering dropdown $qry = 'SELECT ordering AS value, name AS text' . ' FROM #__virtuemart_userfields' . ' ORDER BY ordering'; $ordering = JHTML::_('list.specificordering', $userField, $userField->virtuemart_userfield_id, $qry); $this->assignRef('ordering', $ordering); $userFieldValues = $model->getUserfieldValues(); $lists['type'] = $this->_getTypes($userField->type) . ''; if (strpos($userField->type, 'plugin') !==false) $userFieldPlugin = self::renderUserfieldPlugin(substr($userField->type, 6),$userField); } $this->assignRef('userFieldPlugin', $userFieldPlugin); JToolBarHelper::divider(); JToolBarHelper::save(); JToolBarHelper::apply(); JToolBarHelper::cancel(); $notoggle = (in_array($userField->name, $lists['coreFields']) ? 'class="readonly"' : ''); // Vendor selection if(Vmconfig::get('multix','none')!=='none'){ $lists['vendors']= ShopFunctions::renderVendorList($userField->virtuemart_vendor_id); } // Shopper groups for EU VAT Id $shoppergroup_model = VmModel::getModel('shoppergroup'); $shoppergroup_list = $shoppergroup_model->getShopperGroups(true); array_unshift($shoppergroup_list,'0'); $lists['shoppergroups'] = JHTML::_('select.genericlist', $shoppergroup_list, 'virtuemart_shoppergroup_id', '', 'virtuemart_shoppergroup_id', 'shopper_group_name', $model->_params->get('virtuemart_shoppergroup_id')); // Minimum age select $ages = array(); for ($i = 13; $i <= 25; $i++) { $ages[] = array('key' => $i, 'value' => $i.' '.JText::_('COM_VIRTUEMART_YEAR_S')); } $lists['minimum_age'] = JHTML::_('select.genericlist', $ages, 'minimum_age', '', 'key', 'value', $model->_params->get('minimum_age', 18)); // Web address types $webaddress_types = array( array('key' => 0, 'value' => JText::_('COM_VIRTUEMART_USERFIELDS_URL_ONLY')) ,array('key' => 2, 'value' => JText::_('COM_VIRTUEMART_USERFIELDS_HYPERTEXT_URL')) ); $lists['webaddresstypes'] = JHTML::_('select.genericlist', $webaddress_types, 'webaddresstype', '', 'key', 'value', $model->_params->get('webaddresstype')); // Userfield values if (($n = count($userFieldValues)) < 1) { $lists['userfield_values'] = '' .'' .'' .''; $i = 1; } else { $lists['userfield_values'] = ''; $lang =JFactory::getLanguage(); for ($i = 0; $i < $n; $i++) { $translate= $lang->hasKey($userFieldValues[$i]->fieldtitle) ? " (".JText::_($userFieldValues[$i]->fieldtitle).")" : ""; $lists['userfield_values'] .= '' .'' .''.$translate.'' .''; } } $this->assignRef('valueCount', --$i); // Toggles $lists['required'] = VmHTML::row('booleanlist','COM_VIRTUEMART_FIELDMANAGER_REQUIRED','required',$userField->required,$notoggle); $lists['published'] = VmHTML::row('booleanlist','COM_VIRTUEMART_PUBLISHED','published',$userField->published,$notoggle); $lists['registration'] = VmHTML::row('booleanlist','COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_REGISTRATION','registration',$userField->registration,$notoggle); $lists['shipment'] = VmHTML::row('booleanlist','COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_SHIPPING','shipment',$userField->shipment,$notoggle); $lists['account'] = VmHTML::row('booleanlist','COM_VIRTUEMART_FIELDMANAGER_SHOW_ON_ACCOUNT','account',$userField->account,$notoggle); $lists['readonly'] = VmHTML::row('booleanlist','COM_VIRTUEMART_USERFIELDS_READONLY','readonly',$userField->readonly,$notoggle); $this->assignRef('lists', $lists); $this->assignRef('userField', $userField); $this->assignRef('userFieldValues', $userFieldValues); $this->assignRef('editor', $editor); } else { JToolBarHelper::title( JText::_('COM_VIRTUEMART_MANAGE_USER_FIELDS'),'vm_user_48 head'); JToolBarHelper::addNewX(); JToolBarHelper::editListX(); JToolBarHelper::divider(); JToolBarHelper::custom('toggle.required.1', 'publish','','COM_VIRTUEMART_FIELDMANAGER_REQUIRE'); JToolBarHelper::custom('toggle.required.0', 'unpublish','','COM_VIRTUEMART_FIELDMANAGER_UNREQUIRE'); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::divider(); $barText = JText::_('COM_VIRTUEMART_FIELDMANAGER_SHOW_HIDE'); $bar= JToolBar::getInstance( 'toolbar' ); $bar->appendButton( 'Separator', '">'.$barText.'
' .$retImgSrc. ''); } } /** * Create an array with userfield types and the visible text in the format expected by the Joomla select class * * @param string $value If not null, the type of which the text should be returned * @return mixed array or string */ function _getTypes ($value = null) { $types = array( array('type' => 'text' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_TEXTFIELD')) ,array('type' => 'checkbox' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_CHECKBOX_SINGLE')) ,array('type' => 'multicheckbox' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_CHECKBOX_MULTIPLE')) ,array('type' => 'date' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_DATE')) ,array('type' => 'age_verification' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_AGEVERIFICATION')) ,array('type' => 'select' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_DROPDOWN_SINGLE')) ,array('type' => 'multiselect' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_DROPDOWN_MULTIPLE')) ,array('type' => 'emailaddress' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_EMAIL')) // ,array('type' => 'euvatid' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_EUVATID')) ,array('type' => 'editorta' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_EDITORAREA')) ,array('type' => 'textarea' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_TEXTAREA')) ,array('type' => 'radio' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_RADIOBUTTON')) ,array('type' => 'webaddress' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_WEBADDRESS')) ,array('type' => 'delimiter' , 'text' => JText::_('COM_VIRTUEMART_FIELDS_DELIMITER')) ); $this->renderInstalledUserfieldPlugins($types); if ($value === null) { return $types; } else { foreach ($types as $type) { if ($type['type'] == $value) { return $type['text']; } return $value; } } } function renderUserfieldPlugin($element, $params){ $db = JFactory::getDBO(); if (JVM_VERSION===1) { $table = '#__plugins'; $jelement = 'element'; } else { $table = '#__extensions'; $jelement = 'element'; } $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $jelement . '` = "'.$element.'"'; $db ->setQuery($q); $this->plugin = $db ->loadObject(); if (!class_exists('vmParameters')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php'); $parameters = new vmParameters($params, $this->plugin->element , 'plugin' ,'vmuserfield'); $lang = JFactory::getLanguage(); $filename = 'plg_vmuserfield_' . $this->plugin->element; $lang->load($filename, JPATH_ADMINISTRATOR); return $parameters->render(); } function renderInstalledUserfieldPlugins(&$plugins){ if ( JVM_VERSION===1) { $table = '#__plugins'; $ext_id = 'id'; $enable = 'published'; } else { $table = '#__extensions'; $ext_id = 'extension_id'; $enable = 'enabled'; } $db = JFactory::getDBO(); $q = 'SELECT * FROM `'.$table.'` WHERE `folder` = "vmuserfield" AND `'.$enable.'`="1" '; $db->setQuery($q); $userfieldplugins = $db->loadAssocList($ext_id); if(empty($userfieldplugins)){ return; } foreach($userfieldplugins as $userfieldplugin){ $plugins[] = array('type' => 'plugin'.$userfieldplugin['element'], 'text' => $userfieldplugin['name']); } return; } } //No Closing Tag tmpl/edit.php000066600000023252151372162250007172 0ustar00userField',$this->userField); ?>
lists['type'] ); ?> userField->description,'100%','300', array('image','pagebreak', 'readmore') ); ?> userField->default,'class="inputbox"','',5); ?> lists['required']; ?> lists['registration']; ?> lists['account']; ?> lists['shipment']; ?> lists['readonly']; ?> lists['published']; ?> userField->size,'class="inputbox"','',5); ?> userField->ordering,'class="inputbox"','',5); ?> lists['vendors'] ); } ?>
userField->maxlength,'class="inputbox"','',5); ?>
userField->cols,'class="inputbox"','',5); ?> userField->rows,'class="inputbox"','',5); ?>
lists['minimum_age'] ); ?>
lists['webaddresstypes'] ); ?>
lists['userfield_values'];?>
userFieldPlugin; ?>
userField->sys ? 'readonly="readonly"' : ''); $readonly=$this->userField->sys ? 'readonly' : '' ?> class="validate[required,funcCall[checkName]] inputbox " />
hasKey($this->userField->title) ? JText::_($this->userField->title) : $this->userField->title; ?> ()
addStandardHiddenToForm(); ?>
setQuery("SHOW COLUMNS FROM `#__virtuemart_userfields`"); $existingFields = '"'.implode('","',$db->loadResultArray()).'"'; ?> tmpl/.htaccess000066600000000177151372162250007333 0ustar00 Order allow,deny Deny from all tmpl/index.html000066600000000000151372162250007513 0ustar00tmpl/default.php000066600000013736151372162250007677 0ustar00
userfieldsList); $i < $n; $i++) { $row = $this->userfieldsList[$i]; // vmdebug('my rows',$row); $coreField = (in_array($row->name, $this->lists['coreFields'])); $image = (JVM_VERSION===1) ? 'checked_out.png' : 'admin/checked_out.png'; $image = JHtml::_('image.administrator', $image, '/images/', null, null, JText::_('COM_VIRTUEMART_FIELDMANAGER_COREFIELD')); //$checked = '
'.JHTML::_('grid.id', $i, null,$row->virtuemart_userfield_id); $checked = JHTML::_('grid.id', $i ,$row->virtuemart_userfield_id,null,'virtuemart_userfield_id'); if ($coreField) $checked.=''. $image .''; $checked .= '
'; // There is no reason not to allow moving of the core fields. We only need to disable deletion of them // ($coreField) ? // ''. $image .'' : $editlink = JROUTE::_('index.php?option=com_virtuemart&view=userfields&task=edit&virtuemart_userfield_id=' . $row->virtuemart_userfield_id); $required = $this->toggle($row->required, $i, 'toggle.required', $coreField); // $published = JHTML::_('grid.published', $row, $i); $published = $this->toggle($row->published, $i, 'toggle.published', $coreField); $registration = $this->toggle($row->registration, $i, 'toggle.registration', $coreField); $shipment = $this->toggle($row->shipment, $i, 'toggle.shipment', $coreField); $account = $this->toggle($row->account, $i, 'toggle.account', $coreField); $ordering = ($this->lists['filter_order'] == 'ordering'); $disabled = ($ordering ? '' : 'disabled="disabled"'); ?>
sort('name','COM_VIRTUEMART_FIELDMANAGER_NAME') ?> sort('type','COM_VIRTUEMART_FIELDMANAGER_TYPE') ?> sort('ordering','COM_VIRTUEMART_FIELDMANAGER_REORDER') ?> userfieldsList ); ?> sort('virtuemart_userfield_id', 'COM_VIRTUEMART_ID') ?>
name); ?> title); ?> type); ?> pagination->orderUpIcon( $i, true, 'orderup', JText::_('COM_VIRTUEMART_MOVE_UP'), $ordering ); ?> pagination->orderDownIcon( $i, $n, true, 'orderdown', JText::_('COM_VIRTUEMART_MOVE_DOWN'), $ordering ); ?> class="text_area" style="text-align: center" /> virtuemart_userfield_id; ?>
pagination->getListFooter(); ?>
addStandardHiddenToForm(); ?>
view.json.php000066600000004350151372162250007211 0ustar00setQuery($q); $this->plugin = $db ->loadObject(); if (!class_exists('vmParameters')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php'); $parameters = new vmParameters($this->plugin , $this->plugin->element , 'plugin' ,'vmuserfield'); $lang = JFactory::getLanguage(); $filename = 'plg_vmuserfield_' . $this->plugin->element; if(VmConfig::get('enableEnglish', 1)){ $lang->load($filename, JPATH_ADMINISTRATOR, 'en-GB', true); } $lang->load($filename, JPATH_ADMINISTRATOR, $lang->getDefault(), true); $lang->load($filename, JPATH_ADMINISTRATOR, null, true); echo $parameters->render(); //echo ''; jExit(); } } jExit(); } } // pure php no closing tag