getThemePath() ==> Fatal Error undefined method

Permalink
Hello

I have an element, which is loaded in to a jquery ui dialog with this code:
link:
<span onClick="javascript:loadForm('ordOpn',1200,500,<?php echo $u->getUserID() ?>);">Details</span>


javascript:
loadForm = function(formName, wdt, hgt, uID){
   jQuery.fn.dialog.open({
      title: 'This is my title',
      href: '<?php echo BASE_URL?>/ts-reporting/loadForm/' + formName,
      width: wdt,
      modal: false,
      height: hgt
   });


controller:
function loadForm($element){
      Loader::packageElement('forms/'.$element, 'steff_report', $_GET); 
      die();
   }


In the element, i have $this->getThemePath() which returns the error:
Fatal Error: Call to undefined method MypackageController::getThemePath() in /.....

Any Idea how to fix this?

==> This does not work:
$v = View::getInstance();
$themePath = $v->getThemePath();


Thanks a lot.

Steff
 
ScottC replied on at Permalink Reply
ScottC
I don't know i will almost always just use a tools file to do stuff like this. That is what they are designed for.
$urls = new ConcreteUrlsHelper();

get the path to a tool or your package tool and call it that way

-Scott
Mnkras replied on at Permalink Reply
Mnkras
also, never just pass $_GET or $_POST to something, what if someone were to pass something named c, that could cause all sorts of havok.
Steff replied on at Permalink Reply
Steff
Thank you Mnkras

This is just an internal project. So i do not think, there will be any one who trys to break this. But how could i do it better?

Thanks
Steff replied on at Permalink Reply
Steff
Thanks Scott

After trying several things. Do you have a code sample for me? Sorry. I just couldn't figure it out.

Thanks a lot.