Detail button -> new site

Phoca Download - download manager
Mike77
Phoca Member
Phoca Member
Posts: 13
Joined: 09 Dec 2012, 20:01

Detail button -> new site

Post by Mike77 »

I don't want to spam but i think its better to ask this in several threads, since these are several tasks...

As i mentioned before i want to change the Link for the "detail" Button. I just want the same result, as i get if i click on a "file view" link, createt in the menu.
So the question is: how can i change the link, to get a new site instead of the overlib if i press the detail button?

After a little research i think i found the responsible code in: components/com_phocadownload/views/category/tmpl/default_files.php

Code: Select all

else if ($this->tmpl['display_detail'] == 2) {
				$buttonDOptions = $this->buttond->options;
				$detailLink 	= JRoute::_(PhocaDownloadHelperRoute::getFileRoute($v->id,$this->category[0]->id,$v->alias, $v->categoryalias, 0, 'detail').$this->tmpl['limitstarturl']);
				$pdButtonDetails = '<div class="pd-button-details">';
				$pdButtonDetails .= '<a class="pd-modal-button" href="'.$detailLink.'" rel="'. $buttonDOptions.'">'. JText::_('COM_PHOCADOWNLOAD_DETAILS').'</a>';
				$pdButtonDetails .= '</div>';
			}
There are two problems.
1: where it says that the link should be opened inside of the overlay?
EDIT: [solved] just renamed the class "pd-modal-button" into "-" or someting non existing. The Javascript won't work then on this button, so it opens on a new page.

Now if i click the button and open on a new site it is not inside the template but on a blank page. This is caused by the "?tmpl=component" part at the end of the link. So
2: how can i strip this part from the link? (?tmpl=component)

And finally:
What do i have to do, if i want to add this as a third option in addition of the two existing options, instead of changing one of them?
First thing is to copy the code above and change the "2" in the first line into "3" (else if ($this->tmpl['display_detail'] == 2))
But where do i have to add this number, so i can set it in the adminpanel to save it in the database?

Thank you for your help.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Detail button -> new site

Post by Jan »

Hi, in fact :-) you are asking for completely guide how to create components in Joomla!

just follow the variables:

$this->tmpl['display_detail'] ==>(components\com_phocadownload\views\category\view.html.php) $tmpl['display_detail'] = $params->get( 'display_detail', 1 );

it is taken from parameters, which are written in config.xml file in administration of the Phoca Download

For changing the link you need to customize the function PhocaDownloadHelperRoute::getFileRoute (to remove ?tmpl=component) ... etc. unfortunatelly because of time issues and so much questions in this forum I am not able to be more concrete :-( :-(

Jan
If you find Phoca extensions useful, please support the project
Post Reply