Guest User

Untitled

a guest
Apr 4th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.22 KB | None | 0 0
  1. <?php
  2. /**
  3.  *
  4.  * Description
  5.  *
  6.  * @package VirtueMart
  7.  * @subpackage
  8.  * @author Max Milbers
  9.  * @link http://www.virtuemart.net
  10.  * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
  11.  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
  12.  * VirtueMart is free software. This version may have been modified pursuant
  13.  * to the GNU General Public License, and as distributed it includes or
  14.  * is derivative of works licensed under the GNU General Public License or
  15.  * other free or open source software licenses.
  16.  * @version $Id: media_edit.php 3049 2011-04-17 07:01:44Z Milbo $
  17.  */
  18. // Check to ensure this file is included in Joomla!
  19. defined('_JEXEC') or die('Restricted access');
  20. vmJsApi::JvalideForm();
  21. AdminUIHelper::startAdminArea();
  22. ?>
  23. <form name="adminForm" id="adminForm" method="post" action="">
  24.     <fieldset>
  25.     <legend><?php echo JText::_('COM_VIRTUEMART_PRODUCT_CUSTOM_FIELD'); ?></legend>
  26.     <?php
  27.     $this->customfields->addHidden('view', 'custom');
  28.     $this->customfields->addHidden('task', '');
  29.     $this->customfields->addHidden(JUtility::getToken(), 1);
  30. //if ($this->custom->custom_parent_id) $this->customfields->addHidden('custom_parent_id',$this->custom->custom_parent_id);
  31.     $attribute_id = JRequest::getVar('attribute_id', '');
  32.     if (!empty($attribute_id))
  33.         $this->customfields->addHidden('attribute_id', $attribute_id);
  34.     ?>
  35.     <table class="admintable">
  36.         <?php echo $this->customfields->displayCustomFields($this->custom); ?>
  37.  
  38.         <tr id="custom_plg">
  39.         <td valign="top"><?php echo JText::_('COM_VIRTUEMART_SELECT_CUSTOM_PLUGIN') ?></td>
  40.         <td>
  41.             <fieldset>
  42.             <?php echo $this->pluginList ?>
  43.             <div class="clear"></div>
  44.                 <div id="plugin-Container">
  45.             <?php
  46.             if (!empty($this->customPlugin)) {
  47.                 ?>
  48.  
  49.  
  50.                 <?php
  51.                 $parameters = new vmParameters($this->customPlugin, $this->customPlugin->custom_element, 'plugin', 'vmcustom');
  52.                 echo $rendered = $parameters->render();
  53.                 ?>
  54.  
  55.                 </div>
  56.                 </fieldset>
  57.             </td>
  58.             </tr>
  59.         <?php } ?>
  60.     </table>
  61.     </fieldset>
  62.     <?php if (!empty($this->customPlugin->custom_jplugin_id)) { ?>
  63.         <input type="hidden" name="id" value="<?php echo $this->customPlugin->virtuemart_custom_id ?>" >
  64.     <?php } ?>
  65. </form>
  66. <script type="text/javascript">
  67. function submitbutton(pressbutton) {
  68.     if (pressbutton=='cancel') submitform(pressbutton);
  69.     if (jQuery('#adminForm').validationEngine('validate')== true) submitform(pressbutton);
  70.     else return false ;
  71. }
  72. jQuery(function($) {
  73.  
  74. <?php if ($this->custom->field_type !== "E") { ?>$('#custom_plg').hide();<?php } ?>
  75.     $('#field_type').change(function () {
  76.     var $selected = $(this).val();
  77.     if ($selected == "E" ) $('#custom_plg').show();
  78.     else { $('#custom_plg').hide();
  79.         $('#custom_jplugin_id option:eq(0)').attr("selected", "selected");
  80.         $('#custom_jplugin_id').change();
  81.     }
  82.  
  83.     });
  84.     $('#custom_jplugin_id').change(function () {
  85.     var $id = $(this).val();
  86.     $('#plugin-Container').load( 'index.php?option=com_virtuemart&view=custom&task=viewJson&format=json&custom_jplugin_id='+$id , function() {
  87.     $(this).find("[title]").vm2admin('tips',tip_image) });
  88.  
  89.     });
  90. });
  91. </script>
  92. <?php AdminUIHelper::endAdminArea(); ?>
Advertisement
Add Comment
Please, Sign In to add comment