本文整理汇总了PHP中vmPlugin::getVarsToPushByXML方法的典型用法代码示例。如果您正苦于以下问题:PHP vmPlugin::getVarsToPushByXML方法的具体用法?PHP vmPlugin::getVarsToPushByXML怎么用?PHP vmPlugin::getVarsToPushByXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmPlugin
的用法示例。
在下文中一共展示了vmPlugin::getVarsToPushByXML方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
if (!class_exists('vmCustomPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php';
}
$model = VmModel::getModel('custom');
// TODO Make an Icon for custom
$this->SetViewTitle('PRODUCT_CUSTOM_FIELD');
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
$this->addStandardEditViewCommands();
$customPlugin = '';
$this->custom = $model->getCustom();
$customfields = VmModel::getModel('customfields');
//vmdebug('VirtuemartViewCustom',$this->custom);
JPluginHelper::importPlugin('vmcustom');
$dispatcher = JDispatcher::getInstance();
$retValue = $dispatcher->trigger('plgVmOnDisplayEdit', array($this->custom->virtuemart_custom_id, &$customPlugin));
$this->SetViewTitle('PRODUCT_CUSTOM_FIELD', $this->custom->custom_title);
$selected = 0;
if (!empty($this->custom->custom_jplugin_id)) {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
$selected = $this->custom->custom_jplugin_id;
// Get the payment XML.
$formFile = JPath::clean(JPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->custom->custom_element . DS . $this->custom->custom_element . '.xml');
if (file_exists($formFile)) {
$this->custom->form = JForm::getInstance($this->custom->custom_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$this->custom->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
$this->custom->params->custom_params = $this->custom->custom_params;
VmTable::bindParameterable($this->custom->params, 'custom_params', $varsToPush);
$this->custom->form->bind($this->custom);
} else {
$this->custom->form = null;
}
}
$this->pluginList = self::renderInstalledCustomPlugins($selected);
$this->assignRef('customPlugin', $customPlugin);
$this->assignRef('customfields', $customfields);
} else {
JToolBarHelper::custom('createClone', 'copy', 'copy', vmText::_('COM_VIRTUEMART_CLONE'), true);
JToolBarHelper::custom('toggle.admin_only.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
JToolBarHelper::custom('toggle.admin_only.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
JToolBarHelper::custom('toggle.is_hidden.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
JToolBarHelper::custom('toggle.is_hidden.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$customs = $model->getCustoms(vRequest::getInt('custom_parent_id'), vRequest::getCmd('keyword'));
$this->assignRef('customs', $customs);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例2: display
function display($tpl = null) {
$db = JFactory::getDBO();
if ( $virtuemart_media_id = vRequest::getInt('virtuemart_media_id') ) {
//$db = JFactory::getDBO();
$query='SELECT `file_url`,`file_title` FROM `#__virtuemart_medias` where `virtuemart_media_id`='.$virtuemart_media_id;
$db->setQuery( $query );
$json = $db->loadObject();
if (isset($json->file_url)) {
$json->file_url = JURI::root().$json->file_url;
$json->msg = 'OK';
echo json_encode($json);
} else {
$json->msg = '<b>'.vmText::_('COM_VIRTUEMART_NO_IMAGE_SET').'</b>';
echo json_encode($json);
}
}
elseif ( $custom_jplugin_id = vRequest::getInt('custom_jplugin_id') ) {
$table = '#__extensions';
$ext_id = 'extension_id';
$q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "'.$custom_jplugin_id.'"';
$db ->setQuery($q);
$this->jCustom = $db ->loadObject();
$customModel = VmModel::getModel('custom');
$this->custom = $customModel -> getCustom();
// Get the payment XML.
$formFile = JPath::clean( VMPATH_ROOT .DS. 'plugins' .DS. 'vmcustom' .DS . $this->jCustom->element . DS . $this->jCustom->element . '.xml');
if (file_exists($formFile)){
VmConfig::loadJLang('plg_vmpsplugin', false);
if (!class_exists('vmPlugin')) require(VMPATH_PLUGINLIBS . DS . 'vmplugin.php');
$filename = 'plg_vmcustom_' . $this->jCustom->element;
vmPlugin::loadJLang($filename,'vmcustom',$this->jCustom->element);
$this->custom = VmModel::getModel('custom')->getCustom();
$varsToPush = vmPlugin::getVarsToPushByXML($formFile,'customForm');
$this->custom->form = JForm::getInstance($this->jCustom->element, $formFile, array(),false, '//vmconfig | //config[not(//vmconfig)]');
$this->custom->params = new stdClass();
foreach($varsToPush as $k => $field){
if(strpos($k,'_')!=0){
$this->custom->params->$k = $field[0];
}
}
$this->custom->form->bind($this->custom->getProperties());
$form = $this->custom->form;
include(VMPATH_ADMIN.DS.'fields'.DS.'formrenderer.php');
echo '<input type="hidden" value="'.$this->jCustom->element.'" name="custom_value">';
} else {
$this->custom->form = null;
VmConfig::$echoDebug = 1;
vmdebug ('File does not exist '.$formFile);
}
}
jExit();
}
示例3: display
function display($tpl = null)
{
$db = JFactory::getDBO();
if ($field = vRequest::getVar('field')) {
if (strpos($field, 'plugin') !== false) {
JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
$table = '#__extensions';
$field = substr($field, 6);
$q = 'SELECT `params`,`element`,`type` FROM `' . $table . '` WHERE `element` = "' . $field . '"';
$db->setQuery($q);
$this->userField = $db->loadObject();
//$this->userField->element = substr($this->userField->type, 6);
if (!class_exists('vmPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
}
vmPlugin::loadJLang('plg_vmuserfield_' . $this->userField->element, 'vmuserfield', $this->userField->element);
$path = JPATH_ROOT . DS . 'plugins' . DS . 'vmuserfield' . DS . $this->userField->element . DS . $this->userField->element . '.xml';
// Get the payment XML.
$formFile = JPath::clean($path);
if (file_exists($formFile)) {
if (!class_exists('VmConfig')) {
require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
}
if (!class_exists('VmTable')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmtable.php';
}
$this->userField->form = JForm::getInstance($this->userField->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$this->userField->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
/*
$this->userField->params->userfield_params = $this->userField->params;
VmTable::bindParameterable($this->userField->params,'userfield_params',$varsToPush);*/
if (empty($this->userField->userfield_params)) {
$this->userField->userfield_params = '';
}
$this->userField->params->userfield_params = $this->userField->userfield_params;
VmTable::bindParameterable($this->userField->params, 'userfield_params', $varsToPush);
$this->userField->form->bind($this->userField);
} else {
$this->userField->form = false;
vmdebug('renderUserfieldPlugin could not find xml for ' . $this->userField->type . ' at ' . $path);
}
//vmdebug('renderUserfieldPlugin ',$this->userField->form);
if ($this->userField->form) {
$form = $this->userField->form;
ob_start();
include JPATH_VM_ADMINISTRATOR . DS . 'fields' . DS . 'formrenderer.php';
$body = ob_get_contents();
ob_end_clean();
echo $body;
}
}
}
jExit();
}
示例4: renderUserfieldPlugin
function renderUserfieldPlugin()
{
if (!class_exists('vmUserfieldPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmuserfieldtypeplugin.php';
}
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
//$selected = $this->userField->userfield_jplugin_id;
//vmdebug('renderUserfieldPlugin $this->userField->element',$this->userField->type,$this->userField->element);
$this->userField->element = substr($this->userField->type, 6);
$path = JPATH_ROOT . DS . 'plugins' . DS . 'vmuserfield' . DS . $this->userField->element . DS . $this->userField->element . '.xml';
// Get the payment XML.
$formFile = JPath::clean($path);
if (file_exists($formFile)) {
$this->userField->form = JForm::getInstance($this->userField->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$this->userField->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
$this->userField->params->userfield_params = $this->userField->userfield_params;
VmTable::bindParameterable($this->userField->params, 'userfield_params', $varsToPush);
$this->userField->form->bind($this->userField);
} else {
$this->userField->form = false;
vmdebug('renderUserfieldPlugin could not find xml for ' . $this->userField->type . ' at ' . $path);
}
//vmdebug('renderUserfieldPlugin ',$this->userField->form);
if ($this->userField->form) {
$form = $this->userField->form;
ob_start();
include JPATH_VM_ADMINISTRATOR . DS . 'fields' . DS . 'formrenderer.php';
$body = ob_get_contents();
ob_end_clean();
return $body;
}
return;
}