Back-End only Tab

18 years 2 months ago #5587 by spacebass5000
Back-End only Tab was created by spacebass5000
So I am doing my research into just whether or not I can do what I want to do wthin the confines of CB. I have read most of the API and the Subscriber Reference guide and still can't really tell if what I want to do is feasible or just a straight up kick in the nuts.

Is it possible make create a tab, and it's respective fields, only accessible via the back-end?

I really really want to use CB to handle this as I do not want to have to build this functionality into a custom component. I'd really like a way to flag a tab for back-end use only.

Please Log in to join the conversation.

18 years 2 months ago #5588 by spacebass5000
Replied by spacebass5000 on topic Re:Back-End only Tab
By overriding each of cbTabHandler's functions, I should be a ble to handle what gets displayed on the front-end and back-end via a switch statement and the $ui argument supplied to each of these functions right?

Please Log in to join the conversation.

18 years 2 months ago #5593 by spacebass5000
Replied by spacebass5000 on topic Re:Back-End only Tab
Ok, if I make getDisplayTab return an empty string, the tab will not be displayed to the user or anyone else browsing that user's tab for that matter.

The function getEditTab also needs to return an empty string in order for the user not to see the tab when he/she goes to edit their profile.

So in summation:
[code:1]function getEditTab($tab,$user,$ui)
{
if ($ui == 1)
{
return '';
}
elseif ($ui ==2)
{
$return = "<p>this is the back-end edit tab</p>";
return $return;
}
}

function getDisplayTab($tab,$user,$ui)
{
if ($ui == 1)
{
return '';
}
elseif ($ui ==2)
{
$return = "<p>this is the back-end display (not used i believe)</p>";
return $return;
}
}
[/code:1]
Please correct me if this is just straight up wrong.

Please Log in to join the conversation.

18 years 2 months ago #5599 by nant
Replied by nant on topic Re:Back-End only Tab
Yeah - looks like your on the right track!

Please Log in to join the conversation.

18 years 2 months ago #5624 by spacebass5000
Replied by spacebass5000 on topic Re:Back-End only Tab
Ok, so I've created a tab and added a single field to it. Unfortunately, it is showing up on all tab displays. I REALLY want the ease of use with regards to editing this field in the back-end yet I don't want it to show up on the front-end. I am very heisitant to utilize the fields="0" mechanism as this would make it such that I have to handle the database updating myself. I'd rather let CB do it.

Is there an easy way around this?

Please Log in to join the conversation.

18 years 2 months ago #6002 by xenfasa
Replied by xenfasa on topic Re:Back-End only Tab
I need this feature too.

I tried creating it in a previous version of CB but could never get it to work. If you or anyone has any more suggestion please share. I'll probably start hacking at it in the next couple of days.

Xen

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.620 seconds

Facebook Twitter LinkedIn