Jump to content

Question

Posted

I have created a new module bellow my module structure

 

modules ->

              test ->

                        apis ->

                                   test_api.php

                        language ->

                                          en_us->

                                                      test.php

                        views ->

                                     default ->

                                                    images ->

                                                                    add_row.pdt

                                                                    admin_service_info.pdt

                                                                    client_service_info.pdt

                                                                    manage.pdt

                                                                    edit_row.pdt

                                                                    change_password.pdt

                        text.php

 

and i set link button on manage.pdt as follows

 

$link_buttons = array(
      array('name' => $this->_("Test.add_module_change_password", true), 'attributes' => array('href' => $this->base_uri .    "settings/company/modules/changepassword/" . $module->id))
);

 

i have a 404 error occure when i click change password link (button link specified on manage.pdt) and i attached the error image

post-4364-0-68418600-1383307481_thumb.pn

1 answer to this question

Recommended Posts

  • 0
Posted

Why do you need to change a password from the manage module section? Isn't that what the Module::manageAddRow() and Module::manageEditRow() methods are for?

 

Nonetheless, if you wanted to have custom tabs, you would need to use GET parameters, and handle them in your Module::manageModule() method.

 

 

So:

$link_buttons = array(

      array('name' => $this->_("Test.add_module_change_password", true), 'attributes' => array('href' => $this->base_uri .    "settings/company/modules/changepassword/" . $module->id))
);

 

may link to:

$link_buttons = array(
      array('name' => $this->_("Test.add_module_change_password", true), 'attributes' => array('href' => $this->base_uri .    "settings/company/modules/manage/" . $module->id . "/changepassword/"))
);

 

and then you would update your module:


	public function manageModule($module, array &$vars) {
		// Load the view into this object, so helpers can be automatically added to the view
                if (isset($_GET[1]) && $_GET[1] == "changepassword") {
                    $this->view = new View("change_password", "default");
                    #
                    # TODO: to whatever else you need to do
                    #
                }
                else {
		    $this->view = new View("manage", "default");
                }
		$this->view->base_uri = $this->base_uri;
		$this->view->setDefaultView("components" . DS . "modules" . DS . "test" . DS);
		
		// Load the helpers required for this view
		Loader::loadHelpers($this, array("Form", "Html", "Widget"));

		$this->view->set("module", $module);
		
		return $this->view->fetch();
	}

 

I haven't tested this, but that should be pretty close to getting it to work.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...