Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category Legend #131

Open
aabshagen opened this issue Mar 25, 2015 · 2 comments
Open

Category Legend #131

aabshagen opened this issue Mar 25, 2015 · 2 comments
Assignees
Milestone

Comments

@aabshagen
Copy link

Not sure if I am just missing something but it would be nice if there was a way to put a category legend at the bottom of the screen.

@sproctor sproctor added this to the Future milestone Mar 25, 2015
@sproctor sproctor self-assigned this Mar 25, 2015
@aabshagen
Copy link
Author

Just as a note not that this is the best way to do it but I added the below code to the footer section to accommodate what I wanted. This was added in calender.php just before the debug section.

$categories = $phpc_cal->get_categories();

foreach ($categories as $category) {
$name = empty($category['name']) ? __('No Name')
: $category['name'];
$catid = $category['catid'];
$textcolor = $category['text_color'];
$bgcolor = $category['bg_color'];
$group = empty($category['group_name']) ? __('None')
: $category['group_name'];
$style = "color: ". $textcolor ." !important; background: ". $bgcolor ." !important;";
$tag->add(tag('a',attributes('style="'.$style.'"'), $name));

}

@nemezis007
Copy link

The solution works, the only problem with it, which I find is that the categories are visible in public. The best solution for me would be only per user, which works well with this change to the above:

$categories = $phpc_cal->get_visible_categories($phpc_user->get_uid());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants