News:

Looking for documentation? Take a look on our wiki

Main Menu

Passing cid to edit form in admin panel

Started by Stephen Roberts, November 08, 2011, 02:03:03 AM

Previous topic - Next topic

Stephen Roberts

I'm working on a custom admin panel (almost a copy of the Product Categories) and I'm trying to figure out how the 'cid' variable is passed from the list to the edit form. I see that cid[] is set in the URL, and it appears that it used to be processed and set in view.html.php by doing something like:

$cid = JRequest::getInt('cid[]');
$model->setId($cid);


but nothing like this is used in the category MVC.

It appears that, at least for Product Categories, the category id is being set in the model behind the scenes somewhere. I've already spent an hour looking for how this happens. Can anyone save me some time and point me in the right direction? Thanks!

Stephen
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

Milbo

Look in the helpers vmmodel to see our abstract model.

Then sometimes it got overriden. The cid is set most time by the constructor itself, but you can also use setId, except the usermodel is a bit different.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Stephen Roberts

Wow, ok. I see it now. Thanks for clarifying!

Next question: I'm building a custom control panel that's almost an exact replica of the categories. I've created a model, views, controller, and added an admin menu item in adminmenuentries. Is there a better way to extend core functionality of VM2? I was looking at the extendedplugin, but it looks like it doesn't offer enough functionality. Any thoughts are appreciated!
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

Milbo

It is even a lot easier than to create a standard view in joomla, due the provided stuff like publish and so.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/