Need to add new tab in dashboard

Permalink
How to add tabs to dashboard left, report header etc so that I can display my own reports.

sujiths
 
smartwebprojects replied on at Permalink Best Answer Reply
smartwebprojects
You need to create and install single page, for example:

Loader::model('single_page');
      $sp = SinglePage::add('dashboard/newpage');
      $sp->update(array('cName'=>t('Title goes here'), 'cDescription'=>t('Description goes here.')));


you should create php file before that:

single_pages/dashboard/newpage.php


The above example will add button to left side menu with title 'Title goes here' and description 'Description goes here', the url will be .../dashnoard/newpage

To add items to top menu, you'll have to create single pages of the third level:
single_pages/dashboard/newpage/newtab.php

I hope it helps.
sujiths replied on at Permalink Reply
sujiths
thank u very much for ur help
mobius2000 replied on at Permalink Reply
Hi guys,

This is similar to what I was wanting to achieve however I want the new tab to link to a second web app installed on my server, not link to a page inside the dashboard, firstly is this even possible, secondly could some one give me some pointers please? I am new to all this and didn't follow exactly how the above response works.

Richard
tbcrowe replied on at Permalink Reply
tbcrowe
All you need to do to get this to work is redirect from the single page smartwebprojects advised you to add. single_pages/dashboard/<newpage>.php is a essentially a view object, which contains a reference to its controller. Controllers have a 'redirect' method that makes it easy to redirect. So, to do what you want that new page add just needs to have the following php code: $this->controller->redirect('<url-of-your-web-app>');
mobius2000 replied on at Permalink Reply
Hi there,

Have a couple of problems here and I think it's because I'm not quite following.

1./ I have created a blank php file placed in root_dir/single_pages/dashboard/ and called it invoices.php and inside this php file I have placed:

<?php Loader::model('single_page');
$sp = SinglePage::add('dashboard/Invoices');
$sp->update(array('cName'=>t('Client Invoices'), 'cDescription'=>t('View client invoices.')));?>

This does add a new button to the dashboard titled Invoices however my first problem is that the title of the button is marked as "Client Invoices", it seems to only place the title of the php file and no description.

2./ on the same issue, where do I place the redirect code placed by "Tbvrowe"? Do I place:

<?php $this->controller->redirect('http://www.mysite.com.au');?>

inside the invoices.php file or do I need to create a controller.php as well?

I am sorry guys, I am very new to PHP and am trying to learn by throwing myself in the deep end "WITH MUCH APPRECIATED SUPPORT FROM THE C5 COMMUNITY".

Thank you sooo much to anyone that takes a glance at this.

Richard.
dihakz replied on at Permalink Reply
dihakz
Did u ever figure this out? I hate when I search and find someone with the SAME issues, and there are no responses that have come to that question!!
neils replied on at Permalink Reply
Hi! I'm totally new to this cms. Can you tell me where I should place the above code?
jfreak53 replied on at Permalink Reply
Very simple friend. Edit the file:
concrete/themes/core/dashboard.php

At line 85 you will find the links to the top menu bar. Here just copy an LI and add a new one to your link. I for instance use this to add an external link to expose flash gallery admin panel, since I can't find a good gallery for CC5.

Also if you scroll down to line 96 you will see the nav in the theme file. Just find the a href code and copy that before all the php to make your own link without the need for creating a whole new page. Good luck :)
johndorsay replied on at Permalink Reply
johndorsay
This is the simplest way to do this.
Create a page in folder single_pages/dashboard/somepagename.php

Now in the dashboard, in Pages and Themes add a new Single page. At the bottom of this page you will enter the URL
It needs to match the folder directory, so you will enter
'dashboard/somepagename'

That's it!

Now for controllers and models your options are endless :)
See this how to for more
http://www.concrete5.org/documentation/how-tos/shopping_cart_tutori...