Problem with dashboard

A place to discuss development of the Xataface core.

Problem with dashboard

Postby jbrnz » Sun Oct 17, 2010 1:12 pm

I have a dashboard for a site I am building. I used the tutorial page on the site to set it up.

I have creating dashboards for different apps before, but have never had this problem:

the dashboard.html template will not show I just get a blank main_column when the table is loaded after login.

Table delegate:
Code: Select all
class tables_dashboard {
        function getPermissions(&$record){
        if ( getUser() ){
            return Dataface_PermissionsTool::ALL();
        }
        return null;
    }


Application delegate:
Code: Select all
function beforeHandleRequest(){
        $app =& Dataface_Application::getInstance();
        $query =& $app->getQuery();
    if ( $query['-table'] == 'dashboard' and ($query['-action'] == 'browse' or $query['-action'] == 'list') ){
        $query['-action'] == 'dashboard';
        }
    }


Actions:
Code: Select all
class actions_dashboard {
    function handle(&$params){
        df_display(array('Contacts'=>$Contacts), 'dashboard.html');
    }


I have the default_action=find in my conf.ini and in my actions.ini

[dashboard]
permission=view

Any suggestions for what might be the problem

Thanks
jbrnz
 
Posts: 22
Joined: Mon Apr 20, 2009 11:20 am

Re: Problem with dashboard

Postby shannah » Thu Oct 21, 2010 9:31 am

You've posted everything except dashboard.html file. Most likely you have a type on the name of the fill_slot tag in there... but can't say for sure unless I saw it.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Problem with dashboard

Postby jbrnz » Fri Oct 22, 2010 9:14 pm

I new I forgot something

Code: Select all
{use_macro file="Dataface_Main_Template.html"}
    {fill_slot name="main_column"}
        <h1>ContactManager</h1>
       
        <p>
            <ul>
                <li><img src="{$ENV.DATAFACE_URL}/images/add_icon.gif"/>
                    <a href="{$ENV.DATAFACE_SITE_HREF}?-table=Contacts&-action=new">
                        Create New Contact</a>
                </li>
                <li><img src="{$ENV.DATAFACE_URL}/images/edit.gif"/>
                   Edit existing contacts:
                   <select onchange="window.location.href=this.options[this.selectedIndex].value">
                    <option value="">Select ...</option>
                    {foreach from=$Contacts item=Contact}
                        <option value="{$Contacts->getURL('-action=edit')}">
                            {$Contacts->getTitle()}
                        </option>
                   
                    {/foreach}
                </select>
                </li>               
            </ul>
    {/fill_slot}
{/use_macro}


I also forgot that before I uploaded the table delegate for the dashboard I added another function to the dashboard.php table delegate to output some html on the page. Would this have any impact on the template?

additional function in table delegate:
Code: Select all
function block__before_left_column(){
        echo '
      my html
      ';
    }


thank you
jbrnz
 
Posts: 22
Joined: Mon Apr 20, 2009 11:20 am

Re: Problem with dashboard

Postby jbrnz » Fri Oct 22, 2010 9:15 pm

I new I forgot something

Code: Select all
{use_macro file="Dataface_Main_Template.html"}
    {fill_slot name="main_column"}
        <h1>ContactManager</h1>
       
        <p>
            <ul>
                <li><img src="{$ENV.DATAFACE_URL}/images/add_icon.gif"/>
                    <a href="{$ENV.DATAFACE_SITE_HREF}?-table=Contacts&-action=new">
                        Create New Contact</a>
                </li>
                <li><img src="{$ENV.DATAFACE_URL}/images/edit.gif"/>
                   Edit existing contacts:
                   <select onchange="window.location.href=this.options[this.selectedIndex].value">
                    <option value="">Select ...</option>
                    {foreach from=$Contacts item=Contact}
                        <option value="{$Contacts->getURL('-action=edit')}">
                            {$Contacts->getTitle()}
                        </option>
                   
                    {/foreach}
                </select>
                </li>               
            </ul>
    {/fill_slot}
{/use_macro}


I also forgot that before I uploaded the table delegate for the dashboard I added another function to the dashboard.php table delegate to output some html on the page. Would this have any impact on the template?

additional function in table delegate:
Code: Select all
function block__before_left_column(){
        echo '
      my html
      ';
    }


thank you
jbrnz
 
Posts: 22
Joined: Mon Apr 20, 2009 11:20 am

Re: Problem with dashboard

Postby shannah » Fri Oct 22, 2010 9:55 pm

You may want to check your error log. It is possible that it is running into an error somewhere inside your template and is just crapping out. Do you see the footer? or just the header?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Problem with dashboard

Postby jbrnz » Fri Oct 22, 2010 10:28 pm

Everything shows up except the dashboard.html template for the main column. Everything except for the main column template.

I checked my error log and I did have some authentication tool errors all referring to the same line of code. I had to restart apache and remove the dashboard, so my log is empty currently, but I will try it again to see what shows up.

Just out of curiosity, and because I have users who are restricted to readonly access and I may not have logged in as admin as I think about it, should I change the:

Code: Select all
function getPermissions(&$record){
        if ( getUser() ){
            return Dataface_PermissionsTool::ALL();
        }
        return null;
    }


to something else in order to let admin and readonly users access the dashboard the same way? I have not had any trouble with permissions using a dashboard in the past, but I am curious. I will keep digging.

Thanks
jbrnz
 
Posts: 22
Joined: Mon Apr 20, 2009 11:20 am


Return to Xataface Developers

Who is online

Users browsing this forum: No registered users and 5 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved